12.10.2013, 04:59
(
Последний раз редактировалось Uberanwar; 22.11.2014 в 07:05.
)
Hi guys, I'm trying to make my own built-in admin system, there are some errors that I need help..
This is the command I've done so far..
7 Errors.
Can anyone help me please? I will be very grateful
This is the command I've done so far..
pawn Код:
dcmd_promote(playerid, params[])
{
new id, level;
if(IsPlayerAdmin(playerid))
{
if(sscanf(params,"ud",id,level) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /promote <ID/Name> <Level>");
}
else
{
if(level > 3) return SendClientMessage(playerid, COLOR_ERROR, "ERROR: Invalid level. Max level is 3.");
}
else
{
new INI:File = INI_Open(UserPath(id));
INI_WriteInt(File,"Admin",level);
INI_Close(File);
}
}
}
else
{
SendClientMessage(playerid, COLOR_ERROR, "ERROR: You're not authorized to use this command.");
}
}
dcmd_kick(playerid, params[])
{
new id, reason[128],name[MAX_PLAYER_NAME];
new string1[128];
if(PlayerInfo[playerid][pAdmin] > 1)
{
if(sscanf(params,"us[128]",id,reason); return SendClientMessage(playerid, COLOR_ERROR, "Error!");
else
{
format(string1,sizeof(string1),"%s has been kicked from the server! - %s", GetPlayerName(id,name,sizeof(name)),reason);
SendClientMessageToAll(0xFFFFFF,string1);
Kick(id);
}
}
else
{
SendClientMessage(playerid, COLOR_ERROR, "ERROR: You're not authorized to use this command!");
}
}
7 Errors.
Can anyone help me please? I will be very grateful