OnPlayerStateChange
#4

Quote:
Originally Posted by Vince
Посмотреть сообщение
Ah, and again someone who can't differentiate between vehicleids and modelids. Funny.
https://sampwiki.blast.hk/wiki/GetVehicleModel
Now, i got 4 errors:
Код:
C:\Users\Keegan\Desktop\gamemodes\MWFFA.pwn(401) : error 029: invalid expression, assumed zero
C:\Users\Keegan\Desktop\gamemodes\MWFFA.pwn(401) : warning 215: expression has no effect
C:\Users\Keegan\Desktop\gamemodes\MWFFA.pwn(401) : error 001: expected token: ";", but found ")"
C:\Users\Keegan\Desktop\gamemodes\MWFFA.pwn(401) : error 029: invalid expression, assumed zero
C:\Users\Keegan\Desktop\gamemodes\MWFFA.pwn(401) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
With code:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        if(GetVehicleModel(vehicleid) == 432 && IsEngineer[playerid] != 1 && IsVIP[playerid] != && IsOwner[playerid] != 1)
        {
            SendClientMessage(playerid, COLOR_RED, "ERROR: You must be an engineer or owner to drive this.");
            RemovePlayerFromVehicle(playerid);
        }

        if(GetVehicleModel(vehicleid) == 425 && IsPilot[playerid] != 1 && IsVIP[playerid] != 1 && IsOwner[playerid] != 1)
        {
            SendClientMessage(playerid, COLOR_RED, "ERROR: You must be a pilot or owner to pilot this.");
            RemovePlayerFromVehicle(playerid);
        }
       
        if(GetVehicleModel(vehicleid) == 447 && IsPilot[playerid] != 1 && IsOwner[playerid] != 1)
        {
            SendClientMessage(playerid, COLOR_RED, "ERROR: You must be a pilot or owner to pilot this.");
            RemovePlayerFromVehicle(playerid);
        }
       
        if(GetVehicleModel(vehicleid) == 520 && IsPilot[playerid] != 1 && IsOwner[playerid] != 1)
        {
            SendClientMessage(playerid, COLOR_RED, "ERROR: You must be a pilot or owner to pilot this.");
            RemovePlayerFromVehicle(playerid);
        }
    }
    return 1;
}
[B]EDIT: I got it working (I forgot an extra letter). Thanks
Reply


Messages In This Thread
OnPlayerStateChange - by stormchaser206 - 13.07.2012, 17:57
Re: OnPlayerStateChange - by marcoj - 13.07.2012, 17:59
Re: OnPlayerStateChange - by Vince - 13.07.2012, 18:01
Re: OnPlayerStateChange - by stormchaser206 - 13.07.2012, 18:07

Forum Jump:


Users browsing this thread: 2 Guest(s)