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


Messages In This Thread
Ban command help. - by SilentSoul - 29.08.2013, 21:25
Re: Ban command help. - by MadafakaPro - 29.08.2013, 21:36
Re: Ban command help. - by SilentSoul - 29.08.2013, 21:39
Re: Ban command help. - by SilentSoul - 29.08.2013, 21:56
Re: Ban command help. - by DobbysGamertag - 30.08.2013, 04:29
Re: Ban command help. - by Giroud12 - 30.08.2013, 04:31
Re: Ban command help. - by SilentSoul - 30.08.2013, 05:46

Forum Jump:


Users browsing this thread: 1 Guest(s)