Quote:
Originally Posted by Abagail
pawn Код:
new PlayerClass[MAX_PLAYERS] = CLASS_NONE; public OnPlayerRequestClass(playerid,classid) { if(classid == CLASS_HUNTER) { PlayerClass[playerid] = CLASS_HUNTER; }
return 1; }
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(vehicleid == 426 && PlayerClass[playerid] != CLASS_HUNTER) return ClearAnimations(playerid);
return true; }
public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_DRIVER && GetVehicleModel(GetPlayerVehicleID(playerid)) == 426 && PlayerClass[playerid] != CLASS_HUNTER) { RemovePlayerFromVehicle(playerid); }
return true; }
Adjust this to your script, this is just an example.
|
Thank you but this is not working. I got this error:
PHP код:
array index out of bounds (variable "gPlayerClass")
My line:
PHP код:
if(vehicleid == 426 && gPlayerClass[MAX_PLAYERS] != PILOT)
What can i do to fix this?