SA-MP Forums Archive
Limit of healing and timer??? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Limit of healing and timer??? (/showthread.php?tid=84016)



Limit of healing and timer??? - Moustafa - 28.06.2009

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_SECONDARY_ATTACK)
    {
        if (PlayerToPoint(0.5, playerid, 1778.5148,-1575.8615,17.4416))
        {
            #define newhealth 25
            new Float:oldhealth;
            GetPlayerHealth(playerid,oldhealth);
            SetPlayerHealth(playerid,oldhealth + newhealth);
            }
            else
            {
            GetPlayerHealth(playerid, 100); // line 23
            SendClientMessage(playerid, 0xFF0000FF, " Your health is full");
        }
    }
    return 1;
}
SCROLL DOWN AND SEE THE SCRIPT OVERALL!!

Iam getting error on line (23) : error 035: argument type mismatch (argument 2)

I want that line as when the Player's health is 100 then it tells him that his health is full, and i need to set timer so after 5 seconds he can press F again so he can heal again until he reach 100 health, after that, he cannot use it again unless he loses health..

If you can help me, then please do..


Re: Limit of healing and timer??? - Moustafa - 28.06.2009

8 views and no reply? please help!


Re: Limit of healing and timer??? - woot - 28.06.2009

pawn Код:
new Float:pHealth;
GetPlayerHealth(playerid, phealth);
if(pHealth > 99.0) return SendClientMessage(playerid, 0xFF0000FF, " Your health is full");



Re: Limit of healing and timer??? - Moustafa - 28.06.2009

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_SECONDARY_ATTACK)
    {
        if (PlayerToPoint(0.5, playerid, 1778.5148,-1575.8615,17.4416))
        {
            #define newhealth 50
            new Float:oldhealth;
            GetPlayerHealth(playerid,oldhealth);
            SetPlayerHealth(playerid,oldhealth + newhealth);
            new Float:pHealth;
            GetPlayerHealth(playerid, phealth);
            if(pHealth > 99.0) return SendClientMessage(playerid, 0xFF0000FF, " Your health is full");
        }
    }
    return 1;
}
Код:
C:\Documents and Settings\Moustafa & Ahmed\Desktop\Desktop\server\filterscripts\prisonhealth.pwn(21) : error 017: undefined symbol "phealth"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: Limit of healing and timer??? - dice7 - 28.06.2009

GetPlayerHealth(playerid, pHealth); since the declaration is new FloatHealth;


Re: Limit of healing and timer??? - woot - 28.06.2009

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    new Float:pHealth;
    GetPlayerHealth(playerid,pHealth);
    if(newkeys & KEY_SECONDARY_ATTACK)
    {
        if (PlayerToPoint(0.5, playerid, 1778.5148,-1575.8615,17.4416))
        {
            if (pHealth > 99.0) return SendClientMessage(playerid, 0xFF0000FF, " Your health is full");
            else
            {
                #define newhealth 25
                SetPlayerHealth(playerid,pHealth + newhealth);
            }
        }
    }
    return 1;
}



Re: Limit of healing and timer??? - Moustafa - 28.06.2009

Okay good, now i need to set timer so each time he Presses F to heal, he needs to wait 5 seconds for each heal..


Re: Limit of healing and timer??? - Moustafa - 28.06.2009

Noone knows? :/


Re: Limit of healing and timer??? - yom - 28.06.2009

Not possible.


Re: Limit of healing and timer??? - Moustafa - 28.06.2009

Impossible to set timer between each heal and heal? duh.. but i see it on other servers!