29.08.2013, 21:25
Hello guys , today i just start to script new command /ban player i already got saving stats system
And my command
Now i just want help in when player connect it shows up dialog you are banned from this server , I already try to add
It just give me some errors ,
Thanks.
pawn Код:
enum pInfo
{
pAdminLevel,
pCash,
pScore,
pVip,
pBanned,
}]
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;
}
pawn Код:
if(PlayerInfo[playerid][pBanned] =1)return SendClientMessage(playerid,-1,"{FF0000}[ERROR]:{FAF5F5}banned from this server");
Код:
warning 211: possibly unintended assignment