02.08.2017, 18:38
First of all GetPlayerArmour returns value to a float. To use float in pawn, you have to indicate that with a tag:
Also, use MAX_PLAYERS constant to create array for all players for future proofing:
You can't concat strings like that in PAWN, unfortunately.
If you want to concat string and anything else than a string, use format:
If you want to join two strings, use strcat:
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)
pawn Код:
new Float:PlayerHealth[100];
new Float:PlayerArmour[100];
pawn Код:
new Float:PlayerHealth[MAX_PLAYERS];
new Float:PlayerArmour[MAX_PLAYERS];
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);
pawn Код:
new first[32] = "Hello ";
static const second[] = "there";
strcat(first, second); //Now "first" is "Hello there".