28.12.2010, 17:16
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?
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;
}