SA-MP Forums Archive
/ban and /unban - 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 and /unban (/showthread.php?tid=392520)



/ban and /unban - Elysian` - 14.11.2012

Hello,

Is it possible to use Rcon command ban and unban without logging into Rcon to ban someone? If yes, Can someone make a /ban and I'll make the unban xD

Like:
/ban [id] [reason]
/unban [id]


Thanks.


Re: /ban and /unban - Glad2BeHere - 14.11.2012

https://sampwiki.blast.hk/wiki/SendRconCommand


Re: /ban and /unban - Faisal_khan - 14.11.2012

No that is not possible i think.


Re: /ban and /unban - Elysian` - 14.11.2012

So can you make me a /ban command to ban someone using Y_INI? thanks.


Re: /ban and /unban - Glad2BeHere - 14.11.2012

pawn Код:
CMD:reconnect(playerid, params[])
{
        new targetid;
        if(sscanf(params,"u", targetid)) return SendClientMessage(playerid, COLOR_WHITE,"Usage:/Reconnect [playerid]");
        new string[16 + 6],destid = targetid,ipstring[16];
        if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, " Error:Player Is Not Connected!");
        GetPlayerIp(destid, ipstring, 16), SetPVarString(destid, "pIp", ipstring);
        format(string, sizeof(string), "banip %s",ipstring);
        SendRconCommand(string);
        PlayerReconnecting[destid]=1;
        new string1[8+16];
        GetPVarString(playerid, "pIp", string, 16);
        format(string1, sizeof(string1), "unbanip %s", string1);
        SendRconCommand(string1);
        return SendClientMessage(destid, COLOR_WHITE, "Reconnecting...");
}
see how to ban and unban a player


Re: /ban and /unban - Elysian` - 14.11.2012

LOL, Reconnect?


Re: /ban and /unban - Glad2BeHere - 14.11.2012

From that u didnt understand a thing for u as u above they just formatted a string to ban or unban a player but since u not intellectually stable to look above the matter ill show u


Re: /ban and /unban - Glad2BeHere - 14.11.2012

pawn Код:
CMD:ban(playerid, params[])
{
        new targetid;
        if(sscanf(params,"u", targetid)) return SendClientMessage(playerid, COLOR_WHITE,"Usage:/Reconnect [playerid]");
        new string[16 + 6],destid = targetid,ipstring[16];
        if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, " Error:Player Is Not Connected!");
        GetPlayerIp(destid, ipstring, 16), SetPVarString(destid, "pIp", ipstring);
        format(string, sizeof(string), "banip %s",ipstring);
        SendRconCommand(string);
        return SendClientMessage(destid, COLOR_WHITE, "banned...");
}

CMD:reconnect(playerid, params[])
{
        new targetid;
        if(sscanf(params,"u", targetid)) return SendClientMessage(playerid, COLOR_WHITE,"Usage:/Reconnect [playerid]");
        new string[16 + 6],destid = targetid,ipstring[16];
        if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, " Error:Player Is Not Connected!");
        GetPlayerIp(destid, ipstring, 16), SetPVarString(destid, "pIp", ipstring);
        format(string1, sizeof(string1), "unbanip %s", string1);
        SendRconCommand(string1);
        return SendClientMessage(destid, COLOR_WHITE, "unbanning...");
}
Using rcon


Re: /ban and /unban - Elysian` - 14.11.2012

I get what you mean don't worry.
I'll make it now, thanks anyway