Problem...
#1

Okay i made this code with no errors..
Код:
public CheckHealth(playerid)
{
   new Float:Health;
    GetPlayerHealth(playerid,Health);
    if(Health < 20)
    {
        hptimer = SetTimer("losehp",1000,true);
    }
    return 1;
}

forward hptimer(playerid);
public hptimer(playerid)
{
   new Float:Health;
   GetPlayerHealth(playerid, Health);
   SetPlayerHealth(playerid, Health -5); 
   return 1;
}
For some reason the health wont drop down by 5 minutes if the hp is lower than 20 -_-
Reply
#2

Quote:
Originally Posted by viddo
Посмотреть сообщение
Okay i made this code with no errors..
Код:
public CheckHealth(playerid)
{
   new Float:Health;
    GetPlayerHealth(playerid,Health);
    if(Health < 20)
    {
        hptimer = SetTimer("losehp",1000,true);
    }
    return 1;
}

forward hptimer(playerid);
public hptimer(playerid)
{
   new Float:Health;
   GetPlayerHealth(playerid, Health);
   SetPlayerHealth(playerid, Health -5); 
   return 1;
}
For some reason the health wont drop down by 5 minutes if the hp is lower than 20 -_-
You want every 5 Minutes Fall From Player to HP 20?
Reply
#3

No every 1 minute the player loses 5 hp but it wont work
Reply
#4

Just set the timer to the correct value. The timer should be like 300k ms or so
Reply
#5

Quote:
Originally Posted by Allu
Посмотреть сообщение
Just set the timer to the correct value. The timer should be like 300k ms or so
Didnt work -_-

Код:
forward CheckHealth(playerid);
public CheckHealth(playerid)
{
   new Float:Health;
    GetPlayerHealth(playerid,Health);
    if(Health < 20)
    {
    	SetTimerEx("losehp",300000,true);
    }
    return 1;
}

forward losehp(playerid);
public losehp(playerid)
{
   new Float:Health;
   GetPlayerHealth(playerid, Health);
   SetPlayerHealth(playerid, Health -5);
   return 1;
}
Reply
#6

pawn Код:
SetTimerEx("losehp",60000,true);
Reply
#7

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
pawn Код:
SetTimerEx("losehp",60000,true);
Код:
forward CheckHealth(playerid);
public CheckHealth(playerid)
{
   new Float:Health;
    GetPlayerHealth(playerid,Health);
    if(Health < 20)
    {
    	SetTimerEx("losehp",60000,true);
    }
    return 1;
}

forward losehp(playerid);
public losehp(playerid)
{
   new Float:Health;
   GetPlayerHealth(playerid, Health);
   SetPlayerHealth(playerid, Health-5);
   return 1;
}
Still didn't work....
is there something wrong that i made that prevents the hp to lose ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)