Brief help please!
#1

I'd basically like someone to finish this code completely, I know I am not doing it completely right, so please help me finishing it, thanks.



Код:
#include <a_samp>
#define func


public OnPlayerSpawn(playerid)
func()
{
        if(team != 2) return 1;
        SetTimerEx("RegHP", 2000, true, "%i", playerid); //Should be at OnPlayerSpawn
    return 1;
}

forward RegHP(playerid);
public RegHP(playerid)
{
    new Float:Health;
    GetPlayerHealth(playerid, Health);
    if(Health < 100) //To stop regernating if the player has 100 health or more


    {
        SetPlayerHealth(playerid, Health+1);
 	}
Reply
#2

What do you want to do? Where? When? How?
Any info?
Reply
#3

Well I basically want to finish it, but I want somebody else to do it as I don't know how, so that I'll know in the future. I get errors when compiling that, I strongly suspect I've screwed up big-time but I'm not certain, that's why I want somebody to help me finish it, thanks.
Reply
#4

Bump
Reply
#5

pawn Код:
#include <a_samp>

public OnPlayerSpawn(playerid)
{
    func(playerid);
    return 1;
}

forward func(playerid);
public func(playerid)
{
    if(GetPlayerTeam(playerid) != 2) return 1;
    SetTimerEx("RegHP", 2000, true, "i", playerid); //Should be at OnPlayerSpawn
    return 1;
}

forward RegHP(playerid);
public RegHP(playerid)
{
    new Float:Health;
    GetPlayerHealth(playerid, Health);
    if(Health < 100) //To stop regernating if the player has 100 health or more
    {
        SetPlayerHealth(playerid, Health+1);
    }
    return 1;
}
Reply
#6

Thanks, it works and all, albeit, is there anyway to change it that when I do /setrace I start gaining HP instantly? As this merely gives HP on player spawn basically.


Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)