Help with a car comand? - 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 with a car comand? (
/showthread.php?tid=204048)
Help with a car comand? -
ifly4life - 28.12.2010
Ok well i am making a RP server but i made a "sky island",so i wanted to put cars on there only I could get in and drive.Maybe 1 or 2 more people also, so how can i do this?
Re: Help with a car comand? -
_rAped - 28.12.2010
Something like this?
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if (newstate == PLAYER_STATE_DRIVER)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new vid = GetPlayerVehicleID(playerid);
if(vid == 1) // VehicleID of the restricted vehicle
{
if(strcmp(name, "YourCharName", true) != 0)
{
RemovePlayerFromVehicle(playerid);
}
}
}
return 1;
}
Re: Help with a car comand? -
ifly4life - 28.12.2010
But wouldnt i have to define PLAYER_STATE_DRIVER ?
Re: Help with a car comand? -
Joe Staff - 28.12.2010
No, PLAYER_STATE_DRIVER is already defined