09.11.2010, 01:22
pawn Код:
dcmd_unban(playerid,params[]) {
{
if(AccInfo[playerid][Level] >= 2)
{
new tmp[256], Index; tmp = strtok(params,Index);
if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /unban [name]");
new adminname[MAX_PLAYER_NAME], string[128], unbanname[256];
unbanname = tmp;
if(udb_Exists(unbanname)) {
dUserSetINT(unbanname).("banned", 0);
GetPlayerName(playerid, adminname, sizeof(adminname));
AdministratorMessage(COLOR_YELLOW, %s,1);
format(string,sizeof(string),"Server: %s (ID: %d) has unbanned the name: \"%s\" .",adminname,playerid,unbanname);
SendClientMessageToAll(green,string);
dini_IntSet(file,"", 0); // Edit This, I replaced your "SaveToFile"
print(string);
return 1;
} else return SendClientMessage(playerid, red, "ERROR: No player with this name.");
} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
Forgot to mention, Stick both of these into your script to get the "AdministratorMessage" Working or just edit it to something else
pawn Код:
forward AdministratorMessage(color,const string[],level);
pawn Код:
public AdministratorMessage(color,const string[],level)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if (AccInfo[i][Level] >= level)
{
}
}
}
return 1;
}