11.02.2012, 16:37
Hi all!
I got a question: I wanna make different /ban commands: I want, that one bans a player's IP, one bans a player for a few hours (maximum 24), and another one for days...
I don't know how to do this, I also created my own one! Will this one ban the IP or what?
Also, do I have to create the file samp.ban somewhere?
Thank you!
I got a question: I wanna make different /ban commands: I want, that one bans a player's IP, one bans a player for a few hours (maximum 24), and another one for days...
I don't know how to do this, I also created my own one! Will this one ban the IP or what?
PHP код:
CMD:ban(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >=5) {
new PID;
new reason[64];
new str[128];
new PName[MAX_PLAYER_NAME], AName[MAX_PLAYER_NAME];
GetPlayerName(playerid, AName, sizeof(AName));
GetPlayerName(PID, PName, sizeof(PName));
if(sscanf(params, "us[64]", PID, reason)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /ban [playerid] [reason]");
if(!IsPlayerConnected(PID))
return SendClientMessage(playerid, COLOR_YELLOW, "Player is not connected!");
format(str, sizeof(str), "'%s' has been banned by administrator '%s'. Reason: %s ", PName, AName, reason);
SendClientMessageToAll(COLOR_RED, str);
Ban(PID);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You have to be level 5 to use that command!");
}
return 1;
}
Thank you!