Hello Friends
Can Anyone Can Tell Me How to Use Function CheckPoint and Spheres?
Create Checkpoint
CreateCheckpoint(player, world, pos, ARGB, radius);
Example:
[spoiler]function onPlayerCommand( player, cmd, text )
{
if ( cmd == "createcp" )
{
CreateCheckpoint( null, 1, Vector( player.Pos.x, player.Pos.y, player.Pos.z ), ARGB( 255, 255, 0, 0), 10 );
}
}[/spoiler]
Create Sphere
Click Here (http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions/CreateSphere)
And For Sphere it will be this?
if ( cmd == "createsp" )
{
CreateSphere( null, 1, Vector( player.Pos.x, player.Pos.y, player.Pos.z ), ARGB( 255, 255, 0, 0), 10 );
}
Friends i am facing problem when i do /createcp its say index CreateCheckPoint Does Not Exist
Why?
Quote from: [VSS]Shawn on Jun 21, 2015, 08:33 AMFriends i am facing problem when i do /createcp its say index CreateCheckPoint Does Not Exist
Why?
Update your plugins.
Also, CreateCheckpoint, not CreateCheckPoint.
From WHere i Update my plugins?
Quote from: [VSS]Shawn on Jun 21, 2015, 09:02 AMFrom WHere i Update my plugins?
Here. (http://forum.vc-mp.org/?board=4.0)
when i update window X86 there is server.exe i replace that when i open my server its come
Close the Program
Quote from: [VSS]Shawn on Jun 21, 2015, 05:58 PMwhen i update window X86 there is server.exe i replace that when i open my server its come
Close the Program
You updated the squirrel plugin too?
yep then they give some error on console i cant see them
THen it come CLose Program
Did you update ALL your plugins?
Are you sure everything is the same as in here:
http://forum.vc-mp.org/?topic=870.0
Thanks Plugins Problem Solve But When i Add onScriptLoad()
this
CreateSphere( null, 1, -918.2058, -341.6375, 13.3802, RGB(215, 0, 225), 2);
it give error on another line and when i remove this server work properly
Your coordinates need to be a Vector.
Thank You
I add one sphere in bank i want that if someone go in sphere he get frozen and after 10 sec he gets 1000 then sphere remove and respawn after 60 sec
How Can i Do That
incorrect its must be
CreateCheckpoint(player, ID, Showing(true or false), Vector(PosX, PosY, PosZ), ARGB(Alpha, Red, Green, Blue), Size);
The result is:
CreateCheckpoint(null, 0, true, Vector(-902.341,-345.601,13.3802), ARGB(355, 255, 0, 0), 2);
Quote from: gamingpro on Jun 18, 2023, 02:27 PMincorrect its must be
CreateCheckpoint(player, ID, Showing(true or false), Vector(PosX, PosY, PosZ), ARGB(Alpha, Red, Green, Blue), Size);
The result is:
CreateCheckpoint(null, 0, true, Vector(-902.341,-345.601,13.3802), ARGB(355, 255, 0, 0), 2);
You need to create a slot first, which is a checkpoint.
function onScriptLoad()
{
bankcp<-CreateCheckpoint(。。。。);
}
When a player enters a checkpoint, if the checkpoint ID is the same as the slot ID
function onCheckpointEntered(player,checkpoint)
{
if(checkpoint.ID==bankcp.ID)
{
player.Frozen=true;
MessagePlayer("In 10 seconds, you'll have $1,000 in cash",player);
NewTimer("UnFrozen",10000,1,player.ID);
}
}
//Add this unfrozen function anywhere,Unfreeze the player and get 1000 cash
function UnFrozen(i)
{
local plr=FindPlayer(I);
if(plr)
{
plr.Frozen=false;
plr.Cash+=1000;
//Delete this bank checkpoint
bankcp.Remove();
bankcp=null;
NewTimer("BacnkCpCreate",60000,1); //Set timer and re-create in 60 seconds
}
}
function BacnkCpCreate()
{
bankcp=CreateCheckpoint(。。。。);
}
Hope this was helpful, sorry I didn't test this code.