VIP Feature help
#1

Hello, I'm trying to change the player Text Like this : [VIP]PlayerName[ID]: Smth
But I don't know what I'm doing wrong, any help? Thanks.

Код:
public OnPlayerText(playerid, text[])
{
        if(pInfo[playerid][VIPlevel] == 1)
	{
	     new pName[MAX_PLAYER_NAME], msg[200], string[128];
	     GetPlayerName(playerid, pName, sizeof(pName));
	     SetPlayerColor(playerid, 0x009900);
             format(string, sizeof(string), "{000099}[VIP]| %s [%d]:{7F7F7F} %s", pName, playerid, msg);
	     SendPlayerMessageToAll(playerid, string);
	     return 0;
	}
        return 1;
}
Reply
#2

PHP код:
public OnPlayerText(playeridtext[])
{
    if (
pInfo[playerid][VIPlevel] == 1)
    {
         new
             
pName[MAX_PLAYER_NAME],
             
string[128];
             
        
GetPlayerName(playeridpNamesizeof(pName));
        
format(stringsizeof(string), "[VIP]| %s [%d]:{7F7F7F} %s"pNameplayeridtext);
        
SendClientMessageToAll(GetPlayerColor(playerid), string);
        return 
0;
    }
     return 
0;

Try that
Reply
#3

Your first code quote already does that? Or what am I missing? Can you clarify your question?
Reply
#4

It does but when I type smth it not displaying my text when I typed

EDIT:

Sjn, thanks for helping but On the end of the Callback You need to return 1;
if not none VIP players will unable to type.
Reply
#5

Quote:
Originally Posted by BladeFire
Посмотреть сообщение
It does but when I type smth it not displaying my text when I typed
Show a screenshot? If possible.

EDIT: Alright glad the issue is solved.
Reply
#6

Oh, now I see.

With SendPlayerMessageToAll your output will become

Код:
username:{000099}[VIP]| username [player id]:{7F7F7F} message
With SendClientMessageToAll your output should become

Код:
{000099}[VIP]| username [player id]:{7F7F7F} message
Try Sjn's solution.
Reply
#7

Quote:
Originally Posted by SKAzini
Посмотреть сообщение
Try Sjn's solution.
I did m8.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)