PDA

View Full Version : Names


CannonBolt
28/09/2016, 12:40 PM
Well i made a team system and i would like to give them names,well specific names for example

#define TEAM_DRIVERS 1

TextDrawSetString(Text,"TEAM_DRIVERS");

So "DRIVERS" would show in the textdraw as Taxi Drivers,how would i do that?

Logic_
28/09/2016, 12:43 PM
Very bad idea to use the old team system, move towards Array based functions.

JaKe Elite
28/09/2016, 12:43 PM
#define TEAM_DRIVERS "Drivers"

TextDrawSetString(Text,TEAM_DRIVERS);


Try that.

ThatFag
28/09/2016, 12:45 PM
If(howugetplayersteam == TEAM_DRIVERS)
{
new string[50];
format(string,sizeof(string),"Team Taxi Drivers");
TextDrawSetString(string,TextDrawName);
}

this should work maybe idk what u meant tho

CannonBolt
28/09/2016, 12:47 PM
Very bad idea to use the old team system, move towards Array based functions.

Hey if it gets the job done,so be it.


#define TEAM_DRIVERS "Drivers"

TextDrawSetString(Text,TEAM_DRIVERS);


Try that.

Errors,it seems as though i need the integers there.

If(howugetplayersteam == TEAM_DRIVERS)
{
new string[50];
format(string,sizeof(string),"Team Taxi Drivers");
TextDrawSetString(string,TextDrawName);
}

this should work maybe idk what u meant tho


?

CannonBolt
28/09/2016, 07:12 PM
I'm not really a fan of bumping topics before 24 Hour but i really need this,anyone?

iLearner
28/09/2016, 07:27 PM
Are you trying to create a textdraw for each team? explain your problem a bit more please and show us the textdraw whom you're trying to use "TextDrawSetString" for.

CannonBolt
28/09/2016, 07:32 PM
Are you trying to create a textdraw for each team? explain your problem a bit more please and show us the textdraw whom you're trying to use "TextDrawSetString" for.

You've got to be kidding me I'm sure i clearly stated what i'm trying to do

iLearner
28/09/2016, 07:33 PM
In that case, stay stuck mate.

CannonBolt
28/09/2016, 08:42 PM
In that case, stay stuck mate.

K,thanks for shitposting. Jack/Ali/Thatfag understand its right there do i need to write it 1000 times

All i'm trying to do is change the integer "1" to a string (class string.)

Threshold
28/09/2016, 08:45 PM
And you already have a correct answer.
#define TEAM_DRIVERS "Drivers"

TextDrawSetString(Text,TEAM_DRIVERS);

What errors are you getting...?

CannonBolt
28/09/2016, 08:51 PM
And you already have a correct answer.
#define TEAM_DRIVERS "Drivers"

TextDrawSetString(Text,TEAM_DRIVERS);

What errors are you getting...?

error 017: undefined symbol

gTeam{playerid} = TEAM_DRIVERS;//Here

When i change the text back to an integer no errors

Its in the array.

Sew_Sumi
28/09/2016, 10:05 PM
All i'm trying to do is change the integer "1" to a string (class string.)

You don't need to, you're wanting to simply because you are trying to read it... The compiler/server will be able to understand this.

error 017: undefined symbol

gTeam{playerid} = TEAM_DRIVERS;//Here

When i change the text back to an integer no errors

Its in the array.

It's your usage of the array.

gTeam is fine, there is no issue with it. However when you do use the DRIVERS, you'd be using something akin to if(gTeam[playerid]=DRIVERS)

The usage of the define is simply to make something you can read, later on.

So you don't have to remember "Now which team did I set to XXX".