Help in Admin chat command
#8

if(strcmp(cmd, "/admin", true) == 0 || strcmp(cmd, "/a", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Usage: (/a)dmin [admin chat]");
return 1;
}

new arank[64];
if(PlayerInfo[playerid][pAdmin] == 1) { arank = "Moderator"; }
else if(PlayerInfo[playerid][pAdmin] == 2) { arank = "Level 2 Admin"; }
else if(PlayerInfo[playerid][pAdmin] == 3) { arank = "Level 3 Admin"; }
else if(PlayerInfo[playerid][pAdmin] == 4) { arank = "Level 4 Admin"; }
else if(PlayerInfo[playerid][pAdmin] == 1337) { arank = "Head Admin"; }
else if(PlayerInfo[playerid][pAdmin] == 133 { arank = "Scripter"; }
else if(PlayerInfo[playerid][pAdmin] == 1339) { arank = "Co-Owner"; }
else if(PlayerInfo[playerid][pAdmin] == 1340) { arank = "Owner"; }
else { arank = "Moderator"; }

format(string, sizeof(string), "*** %s %s *** %s", arank, sendername, result);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
SendAdminMessage(COLOR_YELLOW, string);
}
printf("Admin %s: %s", sendername, result);
}
return 1;
}
Reply


Messages In This Thread
Help in Admin chat command - by BASITJALIL - 12.03.2011, 12:16
Re: Help in Admin chat command - by JamesC - 12.03.2011, 12:39
Re: Help in Admin chat command - by Montis123 - 12.03.2011, 12:41
Re: Help in Admin chat command - by JamesC - 12.03.2011, 12:44
Re: Help in Admin chat command - by BASITJALIL - 12.03.2011, 12:48
Re: Help in Admin chat command - by JamesC - 12.03.2011, 12:50
Re: Help in Admin chat command - by BASITJALIL - 12.03.2011, 12:56
Re: Help in Admin chat command - by Gagi_Corleone - 12.03.2011, 13:03
Re: Help in Admin chat command - by Stigg - 12.03.2011, 13:05

Forum Jump:


Users browsing this thread: 2 Guest(s)