Race checkpoint doesn't get disabled - 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: Race checkpoint doesn't get disabled (
/showthread.php?tid=396145)
Race checkpoint doesn't get disabled -
Mr.Anonymous - 29.11.2012
Hi,
So I made a very simple command which enables a race checkpoint and disables when a player enters it. But when a player enters it, it doesn't get disabled. Here it is:
pawn Код:
CMD:approchls(playerid,params[])
{
new Name[24], Msg[200];
GetPlayerName(playerid, Name, sizeof(Name));
SetPlayerRaceCheckpoint(playerid, 2, 1455.1359,-2593.3552,13.5469, 0, 0, 0, 12);
SendClientMessage(playerid, red, "Bla bla shit");
if(IsPlayerInRaceCheckpoint(playerid))
DisablePlayerRaceCheckpoint(playerid);
return 1;
}
I'm sure that I'm doing something wrong there. Can someone help me out?
Re: Race checkpoint doesn't get disabled -
Hugoca - 29.11.2012
Try with that
pawn Код:
CMD:approchls(playerid,params[])
{
new Name[24], Msg[200];
GetPlayerName(playerid, Name, sizeof(Name));
SetPlayerRaceCheckpoint(playerid, 2, 1455.1359,-2593.3552,13.5469, 0, 0, 0, 12);
SendClientMessage(playerid, red, "Bla bla shit");
if(IsPlayerInRaceCheckpoint(playerid))
{
DisablePlayerRaceCheckpoint(playerid);
}
return 1;
}
Re: Race checkpoint doesn't get disabled -
Vince - 29.11.2012
Duh, this only works if the player types the command when he's in the checkpoint already. There is something called OnPlayerEnterRaceCheckpoint.
Re: Race checkpoint doesn't get disabled -
Mr.Anonymous - 29.11.2012
Quote:
Originally Posted by Vince
Duh, this only works if the player types the command when he's in the checkpoint already. There is something called OnPlayerEnterRaceCheckpoint.
|
Oh GOD. How stupid I was! Never thought of that. And thanks.