SA-MP Forums Archive
Tag Problem - 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: Tag Problem (/showthread.php?tid=400279)



Tag Problem - Blackazur - 17.12.2012

Код:
new name[MAX_PLAYER_NAME], string[55];
    GetPlayerName(playerid, name,sizeof(name));
    format(string,sizeof(string), "[V.I.P]%s",name);
    SetPlayerName(playerid, string);
How can i make that it is only a [V.I.P] Tag because when i restart the Server the User reconnect with the VIP Tag but i will that it is only a VIP Tag, and that the User can connect with his normal Username, so that the V.I.P Tag is only a Tag. Can everyone help me?


Re: Tag Problem - park4bmx - 17.12.2012

don't do that just use the "string" with the name to display / check what ever you want with it.

Example
pawn Код:
public OnPlayerText(playerid, text[])
{
    new name[MAX_PLAYER_NAME], string[55];
    GetPlayerName(playerid, name,sizeof(name));
    format(string,sizeof(string), "[V.I.P]%s: %s",name,text);
    SendPlayerMessageToAll(playerid, string);
    return 0;
}



AW: Tag Problem - Blackazur - 17.12.2012

Can you make me that not? I understand that not so right..


Re: Tag Problem - park4bmx - 17.12.2012

you can make an extra GetPlayerNameEx so you can retrieve the players name with the tag.

pawn Код:
stock GetPlayerNameEx(playerid)
{
     new Name[MAX_PLAYER_NAME];
     new GetPlayerName(playerid,Name,sizeof(Name));
     if(IsPlayerVIP[playerid]==1)//change to your VIP variable
     {
          format(Name,sizeof(Name), "[V.I.P]%s",Name);
          return Name;
     }else return Name;  
}



AW: Tag Problem - Blackazur - 17.12.2012

But for the Stock i must use this or?

Quote:

new name[MAX_PLAYER_NAME], string[55];
GetPlayerName(playerid, name,sizeof(name));
format(string,sizeof(string), "[V.I.P]%s",name);
SetPlayerName(playerid, string);




Re: Tag Problem - maramizo - 17.12.2012

Quote:
Originally Posted by park4bmx
Посмотреть сообщение
you can make an extra GetPlayerNameEx so you can retrieve the players name with the tag.

pawn Код:
stock GetPlayerNameEx(playerid)
{
     new Name[MAX_PLAYER_NAME];
     new GetPlayerName(playerid,Name,sizeof(Name));
     if(IsPlayerVIP[playerid]==1)//change to your VIP variable
     {
          format(Name,sizeof(Name), "[V.I.P]%s",Name);
          return Name;
     }else return Name;  
}
And then use notepad to replace all of your GetPlayerName, by using the following expression:
Find:
(GetPlayerName\()([^,]+)(.*)
Replace with:
GetPlayerNameEx\(\2\)


AW: Tag Problem - Blackazur - 17.12.2012

That work not, can everyone help me with that?