Tag Problem
#1

Код:
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?
Reply
#2

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;
}
Reply
#3

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

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;  
}
Reply
#5

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);

Reply
#6

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\)
Reply
#7

That work not, can everyone help me with that?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)