SA-MP Forums Archive
Why isn't this code working? - 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: Why isn't this code working? (/showthread.php?tid=581335)



Why isn't this code working? - Pawnify - 12.07.2015

<What coding at 2am does to you (removed)>


Re: Why isn't this code working? - ]Rafaellos[ - 12.07.2015

Why not?

PHP код:
new
    
healTimer
;
public 
OnGameModeInit()
{
    
healTimer SetTimer("healHealers"5000true);
    return 
1;
}
forward healHealers();
public 
healHealers()
{
    foreach (new 
Player)
    {
        if(
PlayerSkill[i] == Healer)
        {
            new
                
Float:playerHealth
            
;
            
GetPlayerHealth(iplayerHealth);
            if((
playerHealth 5) < 100)
            {
                
SetPlayerHealth(iplayerHealth 5);
            }
        }
    }
    return 
1;




Re: Why isn't this code working? - Pawnify - 17.07.2015

Quote:
Originally Posted by ]Rafaellos[
Посмотреть сообщение
Why not?

PHP код:
new
    
healTimer
;
public 
OnGameModeInit()
{
    
healTimer SetTimer("healHealers"5000true);
    return 
1;
}
forward healHealers();
public 
healHealers()
{
    foreach (new 
Player)
    {
        if(
PlayerSkill[i] == Healer)
        {
            new
                
Float:playerHealth
            
;
            
GetPlayerHealth(iplayerHealth);
            if((
playerHealth 5) < 100)
            {
                
SetPlayerHealth(iplayerHealth 5);
            }
        }
    }
    return 
1;

That seems way more efficient thank you.