[CODE] /ban command
#1

I have this so far -

dcmd_ban(playerid, params[])
{
if(!IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, red, "You do not have permission to use this command");
return 1;
}
else
{
static ID, reason, theBan[128], name[MAX_PLAYER_NAME], banername[MAX_PLAYER_NAME], IP[16];
if (sscanf(params, "is", ID, reason)) return SendClientMessage(playerid, red, "Usage: /ban [playerid/name] [reason]");
GetPlayerIp(ID, IP, sizeof(IP));
GetPlayerName(ID, name, sizeof(name));
GetPlayerName(playerid, banername, sizeof(banername));
format(theBan, sizeof(theBan), "%s was kicked by %s. - REASON: %s", name, banername, reason);
Ban(name);
SendClientMessageToAll(red, theBan);
return 1;
}
}

but how would I ban the IP? because I dont wont to ban the actual name.
Reply
#2

First of all, you need to ban the ID, instead of name; Also, ban function does it automatically.
Reply
#3

oh really cool thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)