hmm weird
#1

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
Reply
#2

add another bracket.
return 1;
}
}

maybe. dunno.



EDIT: Fail didnt look over the whole code xD
Reply
#3

Код:
{
 ` 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
Reply
#4

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
Reply
#5

Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)