29.10.2010, 16:12
You forgot to return the codes before the closing braces. Therefore, the script is only reading the braces, here, try now. If it doesn't work, I'll still help you, but I gotta look into it more.
Not tested because I don't have your PlayerInfo enum. Try it out, see how it is.
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);
return 1;
}
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;
}
}
}
return 1;
}