Limit of healing and timer???
#1

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..
Reply
#2

8 views and no reply? please help!
Reply
#3

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

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.
Reply
#5

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

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;
}
Reply
#7

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..
Reply
#8

Noone knows? :/
Reply
#9

Not possible.
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)