question about streamer dinamic CP - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: question about streamer dinamic CP (
/showthread.php?tid=529624)
question about streamer dinamic CP -
DoflamingoValentin - 03.08.2014
Код:
native CreateDynamicCP(Float:x, Float:y, Float:z, Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0);
native DestroyDynamicCP(checkpointid);
native IsValidDynamicCP(checkpointid);
native TogglePlayerDynamicCP(playerid, checkpointid, toggle);
native TogglePlayerAllDynamicCPs(playerid, toggle);
native IsPlayerInDynamicCP(playerid, checkpointid);
native GetPlayerVisibleDynamicCP(playerid);
The question : how i get the checkpoint id ?
i mean for example
When i create a new player CP , how i get the CP ID ? i want to do a farmer job , but i'm scarry what if the player go to work as farmer , and type /gps choose a location , the location is changing and him go there and bug the job ...
Re: question about streamer dinamic CP -
IceBilizard - 03.08.2014
example
pawn Код:
new PlayerCP;//at top of script
then
pawn Код:
public OnGameModeInit()
{
PlayerCP = CreateDynamicCP(Float:x, Float:y, Float:z, Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0);
return 1;
}
then
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == PlayerCP)
{
//here code
}
return 1;
}
Re: question about streamer dinamic CP -
Raza2013 - 03.08.2014
did you update your current streamer version?
Re: question about streamer dinamic CP -
ViniBorn - 03.08.2014
Normally, when used, the functions which create Cars, objects, CP, etc, return their IDs.
Then, you can store this ID in a variable