SA-MP Forums Archive
Object won't work - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Object won't work (/showthread.php?tid=457640)



Object won't work - FiReAlEx - 12.08.2013

Hi everyone. I've encountered an issue with this script:
pawn Код:
GetPlayerHealth(playerid, pHealth);
    GetPlayerArmour(playerid, pArmour);
    if(Giocatore[playerid][Health] > floatround(pHealth))
    {
        Giocatore[playerid][Health] = floatround(pHealth);
        new cuore;
        cuore = CreateObject(1240, 0, 0, 0, 0, 0, 0);
        AttachObjectToPlayer(cuore, playerid, 0, 0, 1.35, 0, 0, 0);
        SetTimerEx("HealthArmour", 500, false, "i", cuore);
    }
    if(Giocatore[playerid][Armour] > floatround(pArmour))
    {
        Giocatore[playerid][Armour] = floatround(pArmour);
        new giubbotto;
        giubbotto = CreateObject(1242, 0, 0, 0, 0, 0, 0);
        AttachObjectToPlayer(giubbotto, playerid, 0, 0, 1.50, 0, 0,0);
        SetTimerEx("HealthArmour", 500, false, "i", giubbotto);
    }
The health or armour won't appear (only some times they will).
But if I change the ">" in "!=" I won't have this problem.
By the way, the object will display even when a player gets healed and I don't want that to happen. How can I solve this problem? Thanks


Re: Object won't work - FiReAlEx - 12.09.2013

Bump!


Re: Object won't work - Scrillex - 12.09.2013

0, 0, 0, 0, 0, 0

This is the thing.. you need to randomize.. You set the cords under ground in nowhere...