29.10.2010, 15:57
Hello everybody, my problem is OnPlayerStateChange isn't being called properly. Please look in my script
No errors nor warnings when compiled but In Game it doesnt work
please give me a hand
pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if (newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
{
new veh = GetPlayerVehicleID(playerid);
if (veh == 425 || veh == 520)
{
if (PlayerInfo[playerid][pPermissons] == 0)
{
SendClientMessage(playerid,COLOR_WHITE,"You don't have got permissons to use this vehicle!");
RemovePlayerFromVehicle(playerid);
}
else if (PlayerInfo[playerid][pPermissons] > 0)
{
SendClientMessage(playerid,COLOR_WHITE,"You have used 1 permisson for using this vehicle !");
PlayerInfo[playerid][pPermissons]--;
new string[64], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s has used a permisson!", pname);
print(string);
}
}
}
return 1;
}
please give me a hand