Ban command help.
#1

Hello guys , today i just start to script new command /ban player i already got saving stats system
pawn Код:
enum pInfo
{
    pAdminLevel,
    pCash,
    pScore,
    pVip,
    pBanned,
}]
And my command
pawn Код:
CMD:ban(playerid, params[])
{
    new id, reason[28];
    if(PlayerInfo[playerid][pAdminLevel] != 2)return SendClientMessage(playerid,-1,"{FF0000}[ERROR]:{FAF5F5}You are not{FF0000} Administrator {FAF5F5}level 2 to use this command");
    else if(sscanf(params, "us", id, reason))SendClientMessage(playerid,-1,"{FF0000}[System Usage]:{FAF5F5}/ban [playerid] [reason]");
    else if (id==INVALID_PLAYER_ID)SendClientMessage(playerid,-1,"{FF0000}[ERROR]:{FAF5F5}Player is not connected!");
    else {
          new Name[MAX_PLAYER_NAME], BanMessage[128];
          new Name2[MAX_PLAYER_NAME];
          GetPlayerName(playerid, Name, sizeof(Name));
          GetPlayerName(id, Name2, sizeof(Name2));
          format(BanMessage, sizeof(BanMessage),"{FF0000}[Ban]:{FAF5F5}Adminstrator %s banned %s from server | reason: {FF0000}%s",Name,Name2,reason);
          SendClientMessageToAll(-1,BanMessage);
          PlayerInfo[id][pBanned] = 1;
          Ban(id);
         }
    return 1;
}
Now i just want help in when player connect it shows up dialog you are banned from this server , I already try to add
pawn Код:
if(PlayerInfo[playerid][pBanned] =1)return SendClientMessage(playerid,-1,"{FF0000}[ERROR]:{FAF5F5}banned from this server");
It just give me some errors ,
Код:
warning 211: possibly unintended assignment
Thanks.
Reply
#2

pawn Код:
if(PlayerInfo[playerid][pBanned] = 1 ) return SendClientMessage(playerid,-1,"{FF0000}[ERROR]:{FAF5F5}banned from this server");
Try this
Reply
#3

Its the same one i got , look at my thread please.
pawn Код:
if(PlayerInfo[playerid][pBanned] =1) return SendClientMessage(playerid,-1,"{FF0000}[ERROR]:{FAF5F5}banned from this server");
Reply
#4

Any help please guys ?
Reply
#5

pawn Код:
if(PlayerInfo[playerid][pBanned] == 1)
== equal to
Reply
#6

Yeah, dobbys true
Reply
#7

Thank you guys , i notice this already but thank you for reply's
thanks -DobbysGamertag
thanks -Giroud12.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)