get array text
#2

First of all GetPlayerArmour returns value to a float. To use float in pawn, you have to indicate that with a tag:
pawn Код:
new Float:PlayerHealth[100];
new Float:PlayerArmour[100];
Also, use MAX_PLAYERS constant to create array for all players for future proofing:
pawn Код:
new Float:PlayerHealth[MAX_PLAYERS];
new Float:PlayerArmour[MAX_PLAYERS];
You can't concat strings like that in PAWN, unfortunately.
If you want to concat string and anything else than a string, use format:
pawn Код:
new message[64];
format(message, sizeof message, "%s %.2f", "Your health in array", PlayerHealth[playerid]);
MessagePlayer(message);
If you want to join two strings, use strcat:
pawn Код:
new first[32] = "Hello ";
static const second[] = "there";
strcat(first, second); //Now "first" is "Hello there".
pawn is full of surprises and limitations, so watch out and ask in this forum any other questions (I'd also recommend googling for "Your problem site:forum.sa-mp.com" as forum search sucks)
Reply


Messages In This Thread
get array text - by Kewun - 02.08.2017, 18:26
Re: get array text - by Misiur - 02.08.2017, 18:38
Re: get array text - by ISmokezU - 02.08.2017, 18:54

Forum Jump:


Users browsing this thread: 1 Guest(s)