#1

pawn Код:
timerid = SetTimer("Health", 1000, true); // this is in /god command
 KillTimer(timerid); // in /godoff


forward Health(playerid);
public Health(playerid)
{
    SetPlayerHealth(playerid, 100);
}
this only makes id 0 invulnerable and m confused
Reply
#2

post the god cmd
Reply
#3

Try
pawn Код:
timerid = SetTimer("Health", 1000, true); // this is in /god command
 KillTimer("timerid"); // in /godoff


forward Health(playerid);
public Health(playerid)
{
    SetPlayerHealth(playerid, 100);
}
Reply
#4

edit: deleted
Reply
#5

EDIT:
pawn Код:
timerid = SetTimer("Health", 1000, true); // this is in /god command
 KillTimer(timerid); // in /godoff


forward Health(playerid);
public Health(playerid)
{
    SetPlayerHealth(playerid, 100);
}
Reply
#6

oh yeah sorry it is like this
Reply
#7

pawn Код:
// Change timerid variable into array
// Find the new timerid; and change it into this:
new timerid[MAX_PLAYERS];

// Its SetTimerEx not SetTimer!
timerid[playerid] = SetTimerEx("Health", 1000, true, "d", playerid);

// In /godoff
KillTimer(timerid[playerid]);

// This'll be called each second
forward Health(playerid);
public Health(playerid)
{
    // Checking if player's connected
    if(!IsPlayerConnected(playerid))
        KillTimer(timerid[playerid]);
    else
        SetPlayerHealth(playerid, 100.0);
    return 1;
}
Reply
#8

you know you wont be invulnerable to explosives that kill you at once
Reply
#9

yup i will be changed the setplayerhealth to something greater

thnx a lot!
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)