08.09.2012, 08:46
i need help on OnPlayerStateChange
i made it like this :
pawno is also not giving error or warning but when i go in game to test it doesnt works
i made it like this :
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vehicleid;
if(newstate == PLAYER_STATE_DRIVER)
{
SetPlayerArmedWeapon(playerid, 0);
}
if(GetVehicleModel(vehicleid) == 425 && gClass[playerid] != PILOT_CLASS && gClass[playerid] != DONOR_CLASS)
{
SendClientMessage(playerid, RED,"ERROR: You need to be Pilot/Donor to drive Hunter");
RemovePlayerFromVehicle(playerid);
}
if(GetVehicleModel(vehicleid) == 520 && gClass[playerid] != PILOT_CLASS && gClass[playerid] != DONOR_CLASS)
{
SendClientMessage(playerid, RED,"ERROR: You need to be Pilot/Donor to drive Hydra");
RemovePlayerFromVehicle(playerid);
}
if(GetVehicleModel(vehicleid) == 432 && gClass[playerid] != ENGINEER_CLASS && gClass[playerid] != DONOR_CLASS)
{
SendClientMessage(playerid, RED,"ERROR: You need to be Engineer/Donor to drive Rhino");
RemovePlayerFromVehicle(playerid);
}
if(GetVehicleModel(vehicleid) == 447 && gClass[playerid] != PILOT_CLASS && gClass[playerid] != DONOR_CLASS)
{
SendClientMessage(playerid, RED,"ERROR: You need to be Pilot/Donor to drive Sea-Sparrow");
RemovePlayerFromVehicle(playerid);
}
return 1;
}