Parole Command
#1

I get this message (Only Law Enforcement can use this command) when im COP and trying /parole

pawn Код:
else if(gTeam[playerid] != TEAM_COP || gTeam[playerid] != TEAM_AIRCOP || gTeam[playerid] != TEAM_MARINECOP || gTeam[playerid] != TEAM_SWAT || gTeam[playerid] != TEAM_ARMY) return SendClientMessage(playerid, COLOR_ERROR, "Only Law Enforcement can use this command");
Reply
#2

are you sure you have wrote TEAM_COP earlier
Reply
#3

Can we see the WHOLE Command?
Reply
#4

Quote:
Originally Posted by Porsche911
Посмотреть сообщение
Can we see the WHOLE Command?
Sure :]

pawn Код:
dcmd_parole(playerid, params[])
{
    new targetid, string[128];
   
    new playername[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername));
    GetPlayerName(targetid, targetname, sizeof(targetname));

    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_USAGE, "USAGE: /parole (id)");
    else if(gTeam[playerid] != TEAM_COP || gTeam[playerid] != TEAM_AIRCOP || gTeam[playerid] != TEAM_MARINECOP || gTeam[playerid] != TEAM_SWAT || gTeam[playerid] != TEAM_ARMY) return SendClientMessage(playerid, COLOR_ERROR, "Only Law Enforcement can use this command");
    else if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ERROR, "Invalid ID");
    else if(IsSpawned[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You are dead. You cannot use this command");
    else if(Jailed[playerid] == 1) return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command in jail");
    else if(Alcatraz[targetid] == 1)
    {
        format(string, sizeof(string), "%s(%d) is on alcatraz. You cannot parole that player", targetname, targetid);
        SendClientMessage(playerid, COLOR_ERROR, string);
    }
    else if(Jailed[targetid] == 0)
    {
        format(string, sizeof(string), "%s(%d) is not in jail",targetname, targetid);
        SendClientMessage(playerid, COLOR_ERROR, string);
        return 1;
    }
    else
    {
        //sends the shit
        //info
        //ect
        return 1;
    }
    return 1;
}
Reply
#5

NVM, Sorry
Reply
#6

use && instead of ||
Reply
#7

Thanks
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)