SA-MP Forums Archive
Ban - 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 (/showthread.php?tid=554696)



Ban - nezo2001 - 04.01.2015

is this right ??
PHP код:
CMD:unban(playerid, params[])
{
new 
ip[128];
if(
PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_RED, "You can't use this command");
if(
sscanf(params, "s[128]", ip)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /unban [ip]");
SendRconCommand("unbanip");
return 
1;
} 
It didn;t do anything .
Please help !


Re: Ban - Lawbringer - 04.01.2015

You need to pass a command line argument to the unbanip RCON command.


Re: Ban - nezo2001 - 04.01.2015

I made it know like that
PHP код:
CMD:unban(playerid, params[])
{
new 
ip[128];
new 
string[128];
if(
PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_RED, "You can't use this command");
if(
sscanf(params, "s[128]", ip)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /unban [ip]");
format(string,sizeof(string),"unbanip %s",ip);
SendRconCommand("string");
return 
1;
} 
But also nothing happen


Re: Ban - Boot - 04.01.2015

Almost right.

Take a read: https://sampforum.blast.hk/showthread.php?tid=299352


Re: Ban - Mexanizm93 - 04.01.2015

PHP код:
CMD:unban(playerid, params[]) 
{ 
new 
ip[20]; 
if(
PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_RED, "You can't use this command"); 
if(
sscanf(params, "s[20]", ip)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /unban [ip]"); 
new 
string[40];
format(string,sizeof(string),"unbanip %s",ip);
SendRconCommand(string);
SendRconCommand("reloadbans");
return 
1; 
} 



Re: Ban - Fungi - 04.01.2015

Replace SendRconCommand("unbanip");*
with
pawn Код:
new str[30];
format(str,sizeof(str),"unbanip %s",ip);
SendRconcommand(str);
+ You dont need string size of 128, 20 would be fine
//Edit: sorry didnt notice that someone already replied


Re: Ban - Boot - 04.01.2015

I see what you did wrong.

Just replace "SendRconCommand("string");" with "SendRconCommand(string);"


Re: Ban - Evocator - 04.01.2015

Do NOT use sscanf with one string parameter only. Oh god, just use params instead.


Re: Ban - nezo2001 - 04.01.2015

Thank you all it worked