Problem
#1

Hi all,i create this functions only for VIP players,to get every minute +5 hp to their health:

pawn Код:
forward VIPHP();
public VIPHP()
{
    for (new i=0;i<MAX_PLAYERS; i++)
    {
    if(PlayerVip[playerid] == 1)
    {
    new Float:health;
    GetPlayerHealth(i, health);
    SetPlayerHealth(i, health +5);
    }
    return 1;
}
I created timer,but what's wrong?

I get tons of errors.
Reply
#2

Well post your errors.
EDIT: you forgot to close your function..

pawn Код:
forward VIPHP(playerid);
public VIPHP(playerid)
{
    for (new i=0;i<MAX_PLAYERS; i++)
    {
        if(PlayerVip[playerid] == 1)
        {
            new Float:health;
            GetPlayerHealth(i, health);
            SetPlayerHealth(i, health +5);
        }
    }
    return 1;
}
Also, there is no "playerid" in your function. Look what I did, and retype your function calling playerid aswell.
Reply
#3

Ok fixed,i use the "i" cuz i made a loop:

for (new i=0;i<MAX_PLAYERS; i++)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)