11.02.2010, 05:34
Ok, so i have regular admin chat which is for all admins to chat it, Now i'm trying to make one where higher rank admins can talk about low ranked admins without the low rank admins knowing
How would i make this command so like level 6 admins and up can use it and see it and level 5 and down can't see it or use it
pawn Код:
if(strcmp(cmd, "/leadadmin", true) == 0 || strcmp(cmd, "/la", true) == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_PURPLE, "USAGE: (/la)eadadmin [Leadadmin chat]");
return 1;
}
format(string, sizeof(string), "*Lead Admin %s: %s", sendername, result);
if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 5)
{
SendAdminMessage(COLOR_YELLOW, string);
}
printf("Lead Admin %s: %s", sendername, result);
return 1;
}
else
{
SendClientMessage(playerid,COLOR_RED, "You're Not Autorized to use the command");
}


you have to rewrite the code and make that chat only for ADMINS