lil help with admin chat
#1

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

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");
}
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
Reply
#2

something like this add this line to your code before the function so only admins lvl 1337 and higher can use it ?
Код:
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
 then ur function goes here
}
Reply
#3

Quote:
Originally Posted by [GM
LeGenDy ]
something like this add this line to your code before the function so only admins lvl 1337 and higher can use it ?
Код:
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
 then ur function goes here
}
I've tried that, All it does it make there name disapear.
Reply
#4

then your doing it wrong you have to rewrite the code and make that chat only for ADMINS
lvl 1337 or w.e lvl and higher

so only they can type in and read what comes in the chat
Reply
#5

thats why i'm asking for help.
Reply
#6

anything?
Reply
#7

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)