GetPlayerAnimationIndex help
#3

Quote:
Originally Posted by Cjgogo
Посмотреть сообщение
Hmm, try this:

Also search for ' SetTimerEx("CheckHealth" ' and tell me how fast the timer executes..?
It makes the "SetPVarFloat(playerid, "faPlayerHealth", fHealth);" line unreachable and keeps spamming the detection. The timer is 500 ms.

EDIT: I think I found a solution: if(GetPlayerAnimationIndex(playerid) == 1666) return SetPVarFloat(playerid, "faPlayerHealth", 100.0);
EDIT2: No, shit wont work, lol
EDIT3: I removed "SetPVarFloat" line that's supposed to set it from my health and made this CMD for debugging:
Код:
CMD:getvar(playerid, params[])
{
    new string[256];
    format(string, sizeof(string), "var is %f", GetPVarFloat(playerid, "faPlayerHealth"));
    SendClientMessage(playerid, -1, string);
    return 1;
}
And it doesn't get set with "if(GetPlayerAnimationIndex(playerid) == 1666) return SetPVarFloat(playerid, "faPlayerHealth", 100.0);" while it works fine with:
Код:
CMD:setvar(playerid, params[])
{
    new Float:crap;
    crap = 100.0;
    SetPVarFloat(playerid, "faPlayerHealth", crap);
    SendClientMessage(playerid, -1, "var set to 100.0");
    return 1;
}
EDIT4: And THIS worked:
Код:
if(GetPlayerAnimationIndex(playerid))
    {
    	new animlib[32];
        new animname[32];
        new msg[128];
        GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
        if(!strcmp(animname, "VEND_USE", true)) {SetPVarFloat(playerid, "faPlayerHealth", 100.0);}
    }
Reply


Messages In This Thread
GetPlayerAnimationIndex help - by exclide1 - 05.07.2013, 08:54
Re: GetPlayerAnimationIndex help - by Cjgogo - 05.07.2013, 09:01
Re: GetPlayerAnimationIndex help - by exclide1 - 05.07.2013, 09:07

Forum Jump:


Users browsing this thread: 1 Guest(s)