My admin chat not working for Trial Admins
#1

Hello guys.

Well I have a problem here..

Recently I tried to change so the lowest admin could too access /a(dmin), the admin chat. But well.. He can write in the chat but not see it.

Before I changed the code

Код:
CMD:admin(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 2) {
		if(!isnull(params)) {

			new szMessage[128];

			if(PlayerInfo[playerid][pAdmin] == 1) format(szMessage, sizeof(szMessage), "[Admin Chat]Server Moderator %s: %s", GetPlayerNameEx(playerid), params);
			else if(PlayerInfo[playerid][pAdmin] == 2) format(szMessage, sizeof(szMessage), "[Admin Chat]{808000}[Junior Admin]{FFFFFF} %s: %s", GetPlayerNameEx(playerid), params);
			else if(PlayerInfo[playerid][pAdmin] == 3) format(szMessage, sizeof(szMessage), "[Admin Chat]{008080}[General Admin]{FFFFFF} %s: %s", GetPlayerNameEx(playerid), params);
			else if(PlayerInfo[playerid][pAdmin] == 4) format(szMessage, sizeof(szMessage), "[Admin Chat]{FFFF00}[Senior Admin]{FFFFFF} %s: %s", GetPlayerNameEx(playerid), params);
			else if(PlayerInfo[playerid][pAdmin] == 1337) format(szMessage, sizeof(szMessage), "[Admin Chat]{FF00FF}[Head Admin]{FFFFFF} %s: %s", GetPlayerNameEx(playerid), params);
			else if(PlayerInfo[playerid][pAdmin] == 1338) format(szMessage, sizeof(szMessage), "[Admin Chat]{FF0000}[Admin Director]{FFFFFF} %s: %s", GetPlayerNameEx(playerid), params);
			else if(PlayerInfo[playerid][pAdmin] == 99998) format(szMessage, sizeof(szMessage), "[Admin Chat]{00FFFF}[Community Manager]{FFFFFF} %s: %s", GetPlayerNameEx(playerid), params);
			else if(PlayerInfo[playerid][pAdmin] == 99999) format(szMessage, sizeof(szMessage), "[Admin Chat]{00FF00}[Community Owner]{FFFFFF} %s: %s", GetPlayerNameEx(playerid), params);
			else format(szMessage, sizeof(szMessage), "* Undefined Admin (%i) %s: %s", PlayerInfo[playerid][pAdmin], GetPlayerNameEx(playerid), params);

			SendAdminMessage(COLOR_GREEN, szMessage);
			Log("logs/adminchat.log", szMessage);
		}
		else SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: (/a)dmin [admin chat]");
	}
	return 1;
}
And when I changed it...

Код:
CMD:admin(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 1) {
		if(!isnull(params)) {

			new szMessage[128];

			if(PlayerInfo[playerid][pAdmin] == 1) format(szMessage, sizeof(szMessage), "[Admin Chat]{FFFFAA}Trial Admin{FFFFFF} %s: %s", GetPlayerNameEx(playerid), params);
			else if(PlayerInfo[playerid][pAdmin] == 2) format(szMessage, sizeof(szMessage), "[Admin Chat]{008080} Junior Admin{FFFFFF} %s: %s", GetPlayerNameEx(playerid), params);
			else if(PlayerInfo[playerid][pAdmin] == 3) format(szMessage, sizeof(szMessage), "[Admin Chat]{008080} General Admin{FFFFFF} %s: %s", GetPlayerNameEx(playerid), params);
			else if(PlayerInfo[playerid][pAdmin] == 4) format(szMessage, sizeof(szMessage), "[Admin Chat]{FFFF00} Senior Admin{FFFFFF} %s: %s", GetPlayerNameEx(playerid), params);
			else if(PlayerInfo[playerid][pAdmin] == 1337) format(szMessage, sizeof(szMessage), "[Admin Chat]{FF0000} Head Admin{FFFFFF} %s: %s", GetPlayerNameEx(playerid), params);
			else if(PlayerInfo[playerid][pAdmin] == 1338) format(szMessage, sizeof(szMessage), "[Admin Chat]{FF0000} Developer{FFFFFF} %s: %s", GetPlayerNameEx(playerid), params);
			else if(PlayerInfo[playerid][pAdmin] == 99998) format(szMessage, sizeof(szMessage), "[Admin Chat]{00FFFF} Community Manager{FFFFFF} %s: %s", GetPlayerNameEx(playerid), params);
			else if(PlayerInfo[playerid][pAdmin] == 99999) format(szMessage, sizeof(szMessage), "[Admin Chat]{00FFFF} Community Owner{FFFFFF} %s: %s", GetPlayerNameEx(playerid), params);
			else format(szMessage, sizeof(szMessage), "* Undefined Admin (%i) %s: %s", PlayerInfo[playerid][pAdmin], GetPlayerNameEx(playerid), params);

			SendAdminMessage(COLOR_GREEN, szMessage);
			Log("logs/adminchat.log", szMessage);
		}
		else SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: (/a)dmin [admin chat]");
	}
	return 1;
}
So my question is if you can see the problem?

Thanks for all help I can get.
Reply
#2

your stock/function "SendAdminMessage" doesn't allow the trial admins to see it. it doesn't send a SendClientMessage to the the trial admins.
Reply
#3

Why don't you use sscanf? Show us your stock code for the trial admins
Reply
#4

Quote:
Originally Posted by ThaCrypte
Посмотреть сообщение
your stock/function "SendAdminMessage" doesn't allow the trial admins to see it. it doesn't send a SendClientMessage to the the trial admins.
Thanks so much!

+rep
Reply
#5

Quote:
Originally Posted by Josh_Main
Посмотреть сообщение
Why don't you use sscanf?
There is no use for sscanf here.
He is only using 1 parameter and that's the string the player entered.
He isn't using 2+ parameters so he doesn't have to split the string.
Reply
#6

Quote:
Originally Posted by DavidSparks
Посмотреть сообщение
Thanks so much!

+rep
Np, if you ever need help again, feel free to PM.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)