I need a bit of help here! [easy I guess]
#1

how can I put a piece of text as a string?

I've got this, but I get an error....

Quote:

weaponp = M4A1;

also I have a:

Quote:

new weaponp;

at the top...

and I have:
Код:
new primary[128];
new secondairy[128];
new extra[128];
format(primary, sizeof(primary), "%s", weaponp);
TextDrawSetString(shop4,primary);
shop4 = TextDrawCreate(259.000000, 360.000000, "AK74");
TextDrawBackgroundColor(shop4, 255);
TextDrawFont(shop4, 1);
TextDrawLetterSize(shop4, 0.500000, 1.000000);
TextDrawColor(shop4, -1);
TextDrawSetOutline(shop4, 0);
TextDrawSetProportional(shop4, 1);
TextDrawSetShadow(shop4, 1);
how can I give the string a piece of text?
Reply
#2

pawn Код:
new string[51];

format(string, sizeof(string), "M4A1");
Reply
#3

may I ask why you used 51 and where do I have to put this format? thanks.
Reply
#4

51 is the length, the shorter, the less waste of memory.

Use this code:

pawn Код:
new primary[128];
new secondairy[128];
new extra[128];
format(primary, sizeof(primary), "M4A1"); // Modified this line.
TextDrawSetString(shop4,primary);
shop4 = TextDrawCreate(259.000000, 360.000000, "AK74");
TextDrawBackgroundColor(shop4, 255);
TextDrawFont(shop4, 1);
TextDrawLetterSize(shop4, 0.500000, 1.000000);
TextDrawColor(shop4, -1);
TextDrawSetOutline(shop4, 0);
TextDrawSetProportional(shop4, 1);
TextDrawSetShadow(shop4, 1);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)