Issues with strings
#3

Can't you just:
pawn Код:
if(StrangerID[playerid])
    {
        new Float:arm, Float:hps, healthstring[64], string[128];
        GetPlayerHealth(playerid, hps);
        GetPlayerArmour(playerid, arm);
        new var = floatround(hps), var2 = floatround(arm);
        format(healthstring, sizeof(healthstring), (var2) ? ("\nHP: %d | Armour: %d") : ("\nHealth: %d"), (var2) ? (var, var2) : (var));
        PlayerInfo[playerid][HealthString] = healthstring;
        format(string, sizeof(string), "%s%s", PlayerInfo[playerid][StrangerMask], healthstring);
        Update3DTextLabelText(StrangerTag[playerid], WHITE, string);
    }
I don't know how big your 'StrangerMask' is, so I just used 128. (I'm assuming it's not 256 cells long...)

EDIT: This way, your 'PlayerInfo[playerid][StrangerMask]' never changes, and you won't need to delete anything from it.
Reply


Messages In This Thread
Issues with strings - by nmader - 21.06.2014, 01:35
Re: Issues with strings - by Ciandlah - 21.06.2014, 03:02
Re: Issues with strings - by Threshold - 21.06.2014, 21:45

Forum Jump:


Users browsing this thread: 1 Guest(s)