[help] im not sure why this wont work - 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: [help] im not sure why this wont work (
/showthread.php?tid=205046)
[help] im not sure why this wont work -
fangoth1 - 31.12.2010
this is a teamcheck for the cops to see if they are on the right team
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new vehid = GetPlayerVehicleID(playerid);
new teamid = GetPlayerTeam(playerid);
if(vehid == 596)
{
if(teamid == 3)
SendClientMessage(playerid, COLOR_RED, "You Are Not In The {6600FF}LSPD, {CC0000}You Cannont Drive This");
RemovePlayerFromVehicle(playerid);
return 1;
}
else if(teamid == 3)
{
SendClientMessage(playerid, COLOR_ROYALBLUE, "You Are In The {6600FF}LSPD, {99FF00}You Can Drive This");
return 1;
}
return 1;
}
Re: [help] im not sure why this wont work -
MadeMan - 31.12.2010
Use OnPlayerStateChange callback.
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new vehid = GetPlayerVehicleID(playerid);
new teamid = GetPlayerTeam(playerid);
if(GetVehicleModel(vehid) == 596)
{
if(teamid == 3)
{
SendClientMessage(playerid, COLOR_ROYALBLUE, "You Are In The {6600FF}LSPD, {99FF00}You Can Drive This");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You Are Not In The {6600FF}LSPD, {CC0000}You Cannont Drive This");
RemovePlayerFromVehicle(playerid);
}
}
}
return 1;
}
Re: [help] im not sure why this wont work -
fangoth1 - 31.12.2010
Thanks man, it works