28.04.2010, 18:19
pawn Код:
if(strcmp(cmd, "/makeadmin", true) == 0)
{
if(adminlevel[playerid] == 7)
{
if(logged[playerid] == 1)
{
new tmp[256], tmp2[256], idx; tmp = strtok(cmdtext,idx), tmp2 = strtok(cmdtext,idx);
tmp = strtok(cmdtext, idx);
new player1, level, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
player1 = strval(tmp);
level = strval(tmp2);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /makeadmin [playerid] [level]");
}
else
{
if(adminlevel[playerid] == 7)
{
if(logged[playerid] == 1)
{
GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
format(string,sizeof(string),"You have promoted %s to adminlevel %d ", playername, level);
SendClientMessage(playerid, COLOR_GREEN, string);
format(string,sizeof(string),"Administrator %s has promoted %s to adminlevel %d",adminname, playername, level);
SendClientMessageToAll(playerid, COLOR_GREEN, string);
adminlevel[playerid] = level;
return 1;
}
pawn Код:
}
}
}
}
return 1;
}