3d label
#1

hi can someone help me on putting a 3d label on top of the player when loggin

like on my gamemode is about gangwarz and i want to put a label in top of every player with the color and name of the gang like this


pawn Код:
public OnPlayerSpawn(playerid)
{
  new rand = random( 5 );
  SetPlayerInterior( playerid, 0 );
  SetPlayerToTeamColor( playerid );



with this example



pawn Код:
new Text3D:label[MAX_PLAYERS];
 
public OnPlayerConnect(playerid)
{
  label[playerid] = Create3DTextLabel("vagos gangmember!",0x008080FF,30.0,40.0,50.0,40.0,0);
  Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
  return 1;
}
 
public OnPlayerDisconnect(playerid, reason)
{
  Delete3DTextLabel(label[playerid]);
  return 1;
}
if someone can help me on makin this for me so every player will login with the gang that he is in on top of his head i will apreciate it cuz ma pano skillz suck
Reply
#2

Wrong Section, script request thread.

Second, what exactly do you need done?

Just add the new Text3D:label[MAX_PLAYERS]; to the top of your script.
And add the other functions in.
But change it so it recognizes your gang system.

(we don't see that so can't exactly help)
Reply
#3

ok what i need is like every playes shows in top of the head the gangcolor that he is from and the gang name that he is in like for vagos gang everytime they spawn it shows yellow color and vagos gang as the name of the gang but what i dont know is how to set it up so i will show everytime palyer spawn
Reply
#4

Once you attach a label to a player it stays, even when they die.
If you want to change it when they respawn then https://sampwiki.blast.hk/wiki/Update3DTextLabelText
Reply
#5

yea iknow but thats not what i want i just want to add the name of the gang with the color of the gang they are from but i dont know how to post it and were to put them in ma gamemode if someone can give me an example
Reply
#6

anyone
Reply
#7

You already gave a good example:
Just modify that.
Instead of putting "vagos" ... just check which gang they are in.

Oh and don't bump. Posting Rules

new Text3D:label[MAX_PLAYERS];
Код:
 
public OnPlayerConnect(playerid)
{
  label[playerid] = Create3DTextLabel("vagos gangmember!",0x008080FF,30.0,40.0,50.0,40.0,0);
  Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
  return 1;
}
 
public OnPlayerDisconnect(playerid, reason)
{
  Delete3DTextLabel(label[playerid]);
  return 1;
}
If you want an example using your gang system, you need to post your gang system.
Reply
#8

ok here


#define AZTECA_COLOR 0x33FFFF80
#define VAGOS_COLOR 0xF5BE1880
#define BALLA_COLOR 0x9245AB80
#define GROVE_COLOR 0x007D0080
#define HOODLUM_COLOR 0x6D363680
#define RIFA_COLOR 0x99FFFF80
#define TRIAD_COLOR 0xFF009980
#define NANG_COLOR 0x99000080
#define WORKER_COLOR 0x1D584A80
#define COP_COLOR 0x0080FF80
#define GUARD_COLOR 0x44444480
#define BIKER_COLOR 0xFF464680
#define MAFIA_COLOR 0x8888FF80
#define FANCLUB_COLOR 0xFFFF6680
#define MECHANIC_COLOR 0x99FF0080



those were the gang colors




pawn Код:
public OnPlayerSpawn(playerid)
{
  new rand = random( 5 );
  SetPlayerInterior( playerid, 0 );
  SetPlayerToTeamColor( playerid );
  SetPlayerHealth( playerid, 100 );
  SetPlayerArmour( playerid, 100 );
and thats what i have on my onplayerspawn selection

now...how to i set it up with the 3d label code so players with the color have their own gangname and colorand i dint bump kkk sorry if it sounded liek that
Reply
#9

Where do you set the players gang?
Here i only see gang definitions.

What is SetPlayerToTeamColor?

You obviously need some sort of gang id for each gang, instead of just definitions.
So if you have

enum{
AZTECA,
VAGOS,
BALLA,
...
}

Then you can use either an array.
new GangColours[] =
{
0x33FFFF80, 0xF5BE1880,...
}

then set their colour using, ex GangColours[AZTECA];
Reply
#10

pawn Код:
public OnPlayerSpawn(playerid)
{
  new rand = random( 5 );
  SetPlayerInterior( playerid, 0 );
  SetPlayerToTeamColor( playerid );
  SetPlayerHealth( playerid, 100 );
  SetPlayerArmour( playerid, 100 );
there
setplayer to team color is what the player selected and is gonna appear on player spawn depending on the gang he is
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)