14.07.2011, 15:32
Hey, I basically need an unban command for this ban command...
I know it's got to read the account folder but I don't know how to do it. Thanks.
pawn Код:
command(ban, playerid, params[])
{
if( PlayerInfo[playerid][Admin] >= 2)
{
new admin[25];
new pid;
new player[25];
new reason[128];
new string[128];
if(sscanf(params, "us[128]", pid, reason)) return SendClientMessage(playerid, COLOUR_WHITE, "Hint: /ban [Playerid/Name] [Reason]");
if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOUR_WHITE, "That player ID is not connected.");
GetPlayerName(playerid, admin, 25);
GetPlayerName(pid, player, 25);
format(string, sizeof(string),"**Server Admin %s has {F81414}banned {00BFFF}%s. Reason: %s.**",admin, player, reason);
SendClientMessageToAll(COLOUR_ALERT,string);
SendClientMessage(pid, COLOUR_WHITE, "You have been {F81414}banned!" );
PlayerInfo[pid][Banned] = 1;
SaveUser(pid);
Kick(pid);
}
return 1;
}
I know it's got to read the account folder but I don't know how to do it. Thanks.