Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: [VSS]Shawn on Jun 20, 2015, 11:18 PM

Title: CheckPoint and Sphere
Post by: [VSS]Shawn on Jun 20, 2015, 11:18 PM
Hello Friends
Can Anyone Can Tell Me How to Use Function CheckPoint and Spheres?
Title: Re: CheckPoint and Sphere
Post by: Diego^ on Jun 20, 2015, 11:54 PM
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)
Title: Re: CheckPoint and Sphere
Post by: [VSS]Shawn on Jun 21, 2015, 07:17 AM
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 );
       }

Title: Re: CheckPoint and Sphere
Post by: [VSS]Shawn on Jun 21, 2015, 08:33 AM
Friends i am facing problem when i do /createcp its say index CreateCheckPoint Does Not Exist
Why?
Title: Re: CheckPoint and Sphere
Post by: MatheuS on Jun 21, 2015, 08:37 AM
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.
Title: Re: CheckPoint and Sphere
Post by: Stormeus on Jun 21, 2015, 08:50 AM
Also, CreateCheckpoint, not CreateCheckPoint.
Title: Re: CheckPoint and Sphere
Post by: [VSS]Shawn on Jun 21, 2015, 09:02 AM
From WHere i Update my plugins?
Title: Re: CheckPoint and Sphere
Post by: MatheuS on Jun 21, 2015, 04:15 PM
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)
Title: Re: CheckPoint and Sphere
Post by: [VSS]Shawn on Jun 21, 2015, 05:58 PM
when i update window X86 there is server.exe i replace that when i open my server its come
Close the Program
Title: Re: CheckPoint and Sphere
Post by: Diego^ on Jun 21, 2015, 06:21 PM
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?
Title: Re: CheckPoint and Sphere
Post by: [VSS]Shawn on Jun 21, 2015, 06:49 PM
yep then they give some error on console i cant see them
THen it come CLose Program
Title: Re: CheckPoint and Sphere
Post by: Stormeus on Jun 21, 2015, 07:31 PM
Did you update ALL your plugins?

Are you sure everything is the same as in here:
http://forum.vc-mp.org/?topic=870.0
Title: Re: CheckPoint and Sphere
Post by: [VSS]Shawn on Jun 23, 2015, 06:40 AM
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
Title: Re: CheckPoint and Sphere
Post by: Stormeus on Jun 23, 2015, 06:48 AM
Your coordinates need to be a Vector.
Title: Re: CheckPoint and Sphere
Post by: [VSS]Shawn on Jun 23, 2015, 07:04 AM
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
Title: Re: CheckPoint and Sphere
Post by: gamingpro on Jun 18, 2023, 02:27 PM
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);
Title: Re: CheckPoint and Sphere
Post by: gamingpro on Jun 18, 2023, 02:30 PM
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);
Title: Re: CheckPoint and Sphere
Post by: PSL on Jun 20, 2023, 08:40 AM
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.