VIP Feature help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: VIP Feature help (
/showthread.php?tid=586480)
VIP Feature help -
BladeFire - 22.08.2015
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;
}
Re: VIP Feature help -
Sjn - 22.08.2015
PHP код:
public OnPlayerText(playerid, text[])
{
if (pInfo[playerid][VIPlevel] == 1)
{
new
pName[MAX_PLAYER_NAME],
string[128];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "[VIP]| %s [%d]:{7F7F7F} %s", pName, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
return 0;
}
Try that
Re: VIP Feature help -
SKAzini - 22.08.2015
Your first code quote already does that? Or what am I missing? Can you clarify your question?
Re: VIP Feature help -
BladeFire - 22.08.2015
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.
Re: VIP Feature help -
Bingo - 22.08.2015
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.
Re: VIP Feature help -
SKAzini - 22.08.2015
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.
Re: VIP Feature help -
BladeFire - 22.08.2015
Quote:
Originally Posted by SKAzini
Try Sjn's solution.
|
I did m8.