Posts: 220
Threads: 74
Joined: Dec 2011
Reputation:
0
Hello , I want to know if there's a function that allows me to know if the player has already a checkpoint, so If he has one he will need to /deletecheckpoint to have another! I just need to know if there's a function that may help,
Posts: 220
Threads: 74
Joined: Dec 2011
Reputation:
0
that's not What I meant
I mean, like If he uses /checkpoint (a checkpoint appears) then he uses /checkpoint again (a message will appear, U already have 1 active checkpoint, use /deletecheckpoint to delete it)
All I want is the "1 active checkpoint " message, but can't find if there's a function that indicates if the player has a checkpoint already or not
Posts: 182
Threads: 85
Joined: Jan 2014
Reputation:
0
Sorry, bad English..it?
new uKikepzes[256];
public OnPlayerEnterCheckpoint(playerid)
{
if(uKikepzes[playerid] == 1){ // <1check
uKikepzes[playerid] = 2;
SetPlayerCheckpoint(playerid,1524.1716,1254.2545,1 3.8625,3); //<< agreed to
return 1;
}
if(uKikepzes[playerid] == 2){
uKikepzes[playerid] = 0; // stop
DisablePlayerCheckpoint(playerid); <<<disable
return 1;
}
return 1;
}
CMD:teszt1(playerid)
{
uKikepzes[playerid] = 1;
SetPlayerCheckpoint(playerid,1524.1716,1254.2545,1 3.8625,3);
}
Posts: 220
Threads: 74
Joined: Dec 2011
Reputation:
0
I'll make it simple: If someone who already has an active checkpoint uses another checkpoint command a message will appear saying "You already have an active checkpoint, please delete it before having another one"
Just that
Posts: 11,827
Threads: 33
Joined: Dec 2011
Reputation:
0
It resets the checkpoint's position so there wouldn't be any problem. If you still want to display that message, create an array for the players and set it to 0 on connect. Then to 1 in the command to active the checkpoint and in the command to disable it, set it back to 0. All you have to do then is check if the value of the variable is 1 and return the error.