Small help
#1

Hello,so i'm scripting a cops and robbers gamemode and i maked this code:

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(GetPlayerWantedLevel(playerid) >= 1) && gTeam[playerid] == TEAM_COP
    {
    GameTextForPlayer(playerid, "~b~~h~You can't choose cops team because you're wanted.Choose civilians", 5000, 6);
    return 0;
    }
    else return 1;
}
I've 2 teams,cops and civilians.Civilians has wanted level saved on the player file.The thing i wanna make,it's when a player reconnects and he gets back their wanted level,he cant choose COP as team but he can only choose CIVILIANS.So i made in that way and dont work.

I get this errors:

error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
warning 225: unreachable code
error 029: invalid expression, assumed zero
warning 215: expression has no effect
error 001: expected token: ";", but found "return"
Reply
#2

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(GetPlayerWantedLevel(playerid) >= 1) && gTeam[playerid] == TEAM_COP
    {
        GameTextForPlayer(playerid, "~b~~h~You can't choose cops team because you're wanted.Choose civilians", 5000, 6);
    }
    else
    {
        bla bla
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by doreto
Посмотреть сообщение
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(GetPlayerWantedLevel(playerid) >= 1) && gTeam[playerid] == TEAM_COP
    {
        GameTextForPlayer(playerid, "~b~~h~You can't choose cops team because you're wanted.Choose civilians", 5000, 6);
    }
    else
    {
        bla bla
    }
    return 1;
}
It will still give errors.

Try:

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(GetPlayerWantedLevel(playerid) >= 1 && gTeam[playerid] == TEAM_COP)//error was on this line
    {
        GameTextForPlayer(playerid, "~b~~h~You can't choose cops team because you're wanted.Choose civilians", 5000, 6);
    }
    else
    {
        //bla bla
    }
    return 1;
}
Reply
#4

Stigg,u forgot a return 0 after GameText,i fixed.

Thanks to both.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)