admin chat cmd help
#1

hello,i got problem,i want to make my admin chat be like that:

*[level]* Trial Admin [name] : [result]
it would be when admin level 1-2 says it

*[level]* Admin [name] : [result]
if admin level 3-9 says it

*[level]* Head Admin [name] : [result]
if admin level 10-14 says it

*[level]* Owner [name] : [result]
if admin level 15 says it

PLEASE now i got this:


Quote:

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;
}
format(string, sizeof(string), "*%d Admin %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
SendAdminMessage(COLOR_GREEN, string);
}
printf("Admin %s: %s", sendername, result);
}
return 1;
}

Reply


Messages In This Thread
admin chat cmd help - by WardenCS - 02.08.2009, 16:58
Re: admin chat cmd help - by member - 02.08.2009, 17:08
Re: admin chat cmd help - by Agent Smith - 02.08.2009, 17:10

Forum Jump:


Users browsing this thread: 1 Guest(s)