Gang Tag . -
GeekSiMo - 26.06.2014
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 !?
Re: Gang Tag . -
Dziugsas - 26.06.2014
Can you be more specific?
Re: Gang Tag . -
Clad - 26.06.2014
Technically you're asking for a ready script, And here you can request codes :
Click
Re: Gang Tag . -
GeekSiMo - 26.06.2014
Like if the The player is member of Groove Street Families
His Name Become : [GS] Xxxxxxx
Re: Gang Tag . -
Laurey - 26.06.2014
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.
Re: Gang Tag . -
GeekSiMo - 26.06.2014
CAn You Help me !?
Re: Gang Tag . -
RedFusion - 26.06.2014
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);
}
}
Re: Gang Tag . -
iFiras - 26.06.2014
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:
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;
}
Re: Gang Tag . -
RedFusion - 26.06.2014
255 cells for a playername? Are you serious?
Re: Gang Tag . -
NaClchemistryK - 26.06.2014
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