SA-MP Forums Archive
hmm weird - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: hmm weird (/showthread.php?tid=137221)



hmm weird - [WF]Demon - 28.03.2010

Hi, im making it so if a player has ispolice == 0 it would remove them from the car, but for some reason i get some errors on the last line of this code and not on the others above it, here is the errors and the code
Код:
C:\Users\Windows Vista\Desktop\sa-mpr6\gamemodes\Cranked.pwn(1491) : error 029: invalid expression, assumed zero
C:\Users\Windows Vista\Desktop\sa-mpr6\gamemodes\Cranked.pwn(1491) : warning 215: expression has no effect
C:\Users\Windows Vista\Desktop\sa-mpr6\gamemodes\Cranked.pwn(1491) : error 001: expected token: ";", but found "if"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
    if(newstate == PLAYER_STATE_DRIVER && (pveh == 596))
    {
    if(ispolice[playerid] == 0) return RemovePlayerFromVehicle(playerid) || SendClientMessage(playerid, COLOR_RED, "This Car Is Reserved For Police Only Type /jobpolice To Join!");
    }
    else if(newstate == PLAYER_STATE_DRIVER && (pveh == 523))
    {
    if(ispolice[playerid] == 0) return RemovePlayerFromVehicle(playerid) || SendClientMessage(playerid, COLOR_RED, "This Car Is Reserved For Police Only Type /jobpolice To Join!");
    }
    else if(newstate == PLAYER_STATE_DRIVER && (pveh == 601))
    {
    if(ispolice[playerid] == 0) return RemovePlayerFromVehicle(playerid) || SendClientMessage(playerid, COLOR_RED, "This Car Is Reserved For Police Only Type /jobpolice To Join!");
    }
    else if(newstate == PLAYER_STATE_DRIVER && (pveh == 427))
    {
    if(ispolice[playerid] == 0) return RemovePlayerFromVehicle(playerid) || SendClientMessage(playerid, COLOR_RED, "This Car Is Reserved For Police Only Type /jobpolice To Join!");
    }
    else if(newstate == PLAYER_STATE_DRIVER && (pveh == 490))
    {
    if(ispolice[playerid] == 0) return RemovePlayerFromVehicle(playerid) || SendClientMessage(playerid, COLOR_RED, "This Car Is Reserved For Police Only Type /jobpolice To Join!");
    }
    else if(newstate == PLAYER_STATE_DRIVER && (pveh == 599))
    {
 `  if(ispolice[playerid] == 0) return RemovePlayerFromVehicle(playerid) || SendClientMessage(playerid, COLOR_RED, "This Car Is Reserved For Police Only Type /jobpolice To Join!");
    }
    return 1;
}
Thanks, [DJ][SF]Зурэ Яииr ∞™ AKA Cody Beer


Re: hmm weird - iLcke - 28.03.2010

add another bracket.
return 1;
}
}

maybe. dunno.



EDIT: Fail didnt look over the whole code xD


Re: hmm weird - jamesbond007 - 28.03.2010

Код:
{
 ` if(ispolice[playerid] == 0) return RemovePlayerFromVehicle(playerid) || SendClientMessage(playerid, COLOR_RED, "This Car Is Reserved For Police Only Type /jobpolice To Join!");
}
your mistake you added `

in

` if(

yw


Re: hmm weird - iLcke - 28.03.2010

Quote:
Originally Posted by jamesbond007
Код:
{
 ` if(ispolice[playerid] == 0) return RemovePlayerFromVehicle(playerid) || SendClientMessage(playerid, COLOR_RED, "This Car Is Reserved For Police Only Type /jobpolice To Join!");
}
your mistake you added `

in

` if(

yw
oh shit, i over looked the code also xD


Re: hmm weird - jamesbond007 - 28.03.2010




Re: hmm weird - [WF]Demon - 28.03.2010

LOL ROFL thanks james, its hard to see on my screen!
Thanks in advance, Cody Beer