Ban cmd problem - 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 cmd problem (
/showthread.php?tid=482781)
Ban cmd problem -
Dolerath - 22.12.2013
Hello guys,
I've a problem with my ban command, it shows me the message that i'm banned but when I reconnect, I'm not banned I can connect correctly. Here is my code :
Код:
CMD:ban(playerid, params[])
{
new id, reason[150], message[150], nameAdmin[MAX_PLAYER_NAME], nameKicked[MAX_PLAYER_NAME];
GetPlayerName(playerid, nameAdmin, sizeof(nameAdmin));
if(User[playerid][USER_ADMIN] >= 3)
{
if(aDuty[playerid] == 1)
{
if(!sscanf(params, "is[150]", id, reason))
{
if(IsPlayerConnected(id))
{
GetPlayerName(id, nameKicked, sizeof(nameKicked));
format(message,sizeof(message), "%s a йtй banned par %s : %s", nameKicked, nameAdmin, reason);
SendClientMessageToAll(COLOR_RED, message);
SetTimerEx("BanPublic", 500, false, "i", id);
}
else
return SendClientMessage(playerid, COLOR_RED, "[ERREUR] : Joueur non trouvй");
}
else
return SendClientMessage(playerid, COLOR_RED, "[ERREUR] : /ban <id> <raison>");
}
else
return SendClientMessage(playerid, COLOR_RED, "[ERREUR] : Vous n'кtes pas en service -> /aduty");
}
else
return SendClientMessage(playerid, COLOR_RED, "[ERREUR] : Vous n'кtes pas admin");
return 1;
}
forward BanPublic(playerid);
public BanPublic(playerid) { Ban(playerid); }
Sorry for my bad English and have a nice english,
thx for future help.
Re: Ban cmd problem -
TheOriginal1337 - 22.12.2013
The ban system of sa-mp servers are pretty easy to avoid.
What we did in our system is:
SetPVarInt(playerid,"Banned",1);
It doesn't ban the player forever, but just on that name.
We also have a IP ban command, if we really do not want to let him come back.
Re : Ban cmd problem -
Dolerath - 22.12.2013
I still don't understand how to use "SetPVarInt" system
Re: Ban cmd problem -
J4mmyHD - 22.12.2013
pawn Код:
forward BanPublic(playerid);
public BanPublic(playerid)
{
Ban(playerid);
return 1;
}
You forgot to add return 1 to the public.
Re: Ban cmd problem -
HavingGood - 22.12.2013
Код:
forward BanPublic(playerid);
public BanPublic(playerid) { return Ban(playerid); }
Re : Ban cmd problem -
Dolerath - 23.12.2013
The both return solutions are not working