question about streamer dinamic CP
#1

Код:
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 ...
Reply
#2

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;
}
Reply
#3

did you update your current streamer version?
Reply
#4

Normally, when used, the functions which create Cars, objects, CP, etc, return their IDs.
Then, you can store this ID in a variable
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)