SA-MP Forums Archive
CheckATC Code Issue - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: CheckATC Code Issue (/showthread.php?tid=191997)



CheckATC Code Issue - [UG]Scripter - 21.11.2010

Hmm....

So I have this ATC system Im making and It seems to not want to work. The only part that I don't have working is the vid part.

I defined vid as:
pawn Код:
vid = GetPlayerVehicleID(playerid);
Heres My Code Obviously with the forward:

pawn Код:
public CheckATC(playerid,newstate)
{
new vid = GetPlayerVehicleID(playerid);
if(ATCAllow[playerid] == 0 || newstate == PLAYER_STATE_DRIVER)
{
TogglePlayerControllable(playerid,0);
}
if(ATCAllow[playerid] == 1 && newstate == PLAYER_STATE_DRIVER)
{
TogglePlayerControllable(playerid,1);
}
}



Re: CheckATC Code Issue - The_Gangstas - 21.11.2010

use onplayerstatechange


Re: CheckATC Code Issue - Grim_ - 21.11.2010

I do not know what ATC means, so if you could explain what you are trying to do, that would be great.

And since you are checking the state of the player, it would be smarter to use OnPlayerStateChange, as suggested by The_Gangstas. (Only one person :P)


Re: CheckATC Code Issue - Haydz - 21.11.2010

Quote:
Originally Posted by Grim_
Посмотреть сообщение
I do not know what ATC means, so if you could explain what you are trying to do, that would be great.

And since you are checking the state of the player, it would be smarter to use OnPlayerStateChange, as suggested by The_Gangstas. (Only one person :P)
ATC = air traffic control


Re: CheckATC Code Issue - [UG]Scripter - 21.11.2010

Basiclly. This peice of code checks if the player has ATC clearence. Under OnPlayerStateChange it checks if the player has clearence and sends a message this codes checks to see if they have clearence then freezes them of unfreezes them.