Prefixes.
#1

I think i made everything right, but there is something NOT right.

I made so when i rcon log it will show:

[Rcon Admin] name[ID:0]: text

and when you are default

name[ID:0]: text

But it doesnt work.. It shows (name[ID:0] text) even if im Rcon logged.


Photo: Click Here


Code:

Код:
public OnPlayerText(playerid, text[])
{
	if(PlayerInfo[playerid][pAdmin] >= 0)
	{
		new string[250];
		new pName[MAX_PLAYER_NAME];
		GetPlayerName(playerid, pName, sizeof(pName));
		format(string, sizeof(string), "{05FF00}%s{FFFFFF}[ID: %d]: %s", pName, playerid, text);
		SendClientMessageToAll(0xFEFEFEFF, string);
		return 0;
	}
	if(IsPlayerAdmin(playerid))
	{
        new string[250];
		new pName[MAX_PLAYER_NAME];
		GetPlayerName(playerid, pName, sizeof(pName));
		format(string, sizeof(string), "{00FF0A}[{FFFFFF}RCON Admin{00FF0A}]{FF0A00}%s{FFFFFF}[ID: %d]: %s", pName, playerid, text);
		SendClientMessageToAll(0xFEFEFEFF, string);
		return 0;
	}
	return 1;
}
Thanks.
Reply
#2

Because you are still pAdmin >= 0 and you return the message there.
Put the RCON admin code before that.

Also please just use 144 for the string size, ClientMessage output max is 144 characters and player text input max is 128 characters...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)