Gang Tag .
#1

Hi SA-MP Community! I'm working on a gang system and i want to add Name Tag For Gang Members.
Can Somone Help me Plzz !?
Reply
#2

Can you be more specific?
Reply
#3

Technically you're asking for a ready script, And here you can request codes : Click
Reply
#4

Like if the The player is member of Groove Street Families
His Name Become : [GS] Xxxxxxx
Reply
#5

Use streamer plugin which will let to create more tags, also thats really simple, you can use the search button and you can find the detail information about it, even there's good info in the wiki of samp.
Reply
#6

CAn You Help me !?
Reply
#7

Try something like this:
pawn Код:
new pName[MAX_PLAYERS][MAX_PLAYER_NAME+1];

public OnPlayerConnect(playerid)
{
    GetPlayerName(playerid, pName[playerid], MAX_PLAYER_NAME+1);
}

public OnPlayerClassSelection(playerid, classid)
{
    if(classid == 0) // Or whatever class grovestreet is..
    {
        new name[MAX_PLAYER_NAME+1];
        format(name, sizeof(name), "[GS]%s", pName[playerid]);
        SetPlayerName(playerid, name);
    }
}
Reply
#8

Here's my code:

First, we define the Grove Street team:
pawn Код:
#define TEAM_GROVE 0 //We define Grove Street team
Second, we create a function like "pTeam" so we can use it later to set the teams:
pawn Код:
new pTeam[MAX_PLAYERS];
Third, we use pTeam in some callback to set the player as Grove member. (For example: OnPlayerSpawn)
pawn Код:
public OnPlayerSpawn(playerid)
{
    pTeam[playerid] =TEAM_GROVE;
    return 1;
}
Then, we use OnPlayerText to detect if the player who types a Grove Street member:
pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[256];
    if(pTeam[playerid] == TEAM_GROVE)
    {
        format(string,sizeof(string),"[GS] %s(%d): %s",PlayerName(playerid),playerid,text);
        SendClientMessageToAll(-1,string);
        /*NOTE:
        1. %s - The player's name
        2. (%d) - The player's ID
        3. %s - The player's text (What the player types)*/

        //If the player's a Grove Street member then it will send a message to all players with the tag [GS]
        return 0;
    }
    return 1;
}
Use this stock for PlayerName: (In the bottom of your script)
pawn Код:
stock PlayerName(playerid)
{
  new name[255];
  GetPlayerName(playerid, name, 255);
  return name;
}
Reply
#9

255 cells for a playername? Are you serious?
Reply
#10

Quote:
Originally Posted by RedFusion
Посмотреть сообщение
255 cells for a playername? Are you serious?
For now he seems to be...
Using like 255 for PlayerName is a huge waste. The size of MAX_PLAYER_NAME is 24. You're wasting 231 x 4 bytes. You use a player's name in your script very often, so creating a name string witha size of 255 is a super huge waste.
And now I know someone wastes more in string sizes than me.
If you're happy and you know it, clap your hands. Sorry, I get carried away sometimes
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)