Ban command help. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Ban command help. (
/showthread.php?tid=460777)
Ban command help. -
SilentSoul - 29.08.2013
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.
Re: Ban command help. -
MadafakaPro - 29.08.2013
pawn Код:
if(PlayerInfo[playerid][pBanned] = 1 ) return SendClientMessage(playerid,-1,"{FF0000}[ERROR]:{FAF5F5}banned from this server");
Try this
Re: Ban command help. -
SilentSoul - 29.08.2013
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");
Re: Ban command help. -
SilentSoul - 29.08.2013
Any help please guys ?
Re: Ban command help. -
DobbysGamertag - 30.08.2013
pawn Код:
if(PlayerInfo[playerid][pBanned] == 1)
== equal to
Re: Ban command help. -
Giroud12 - 30.08.2013
Yeah, dobbys true
Re: Ban command help. -
SilentSoul - 30.08.2013
Thank you guys , i notice this already but thank you for reply's
thanks -DobbysGamertag
thanks -Giroud12.