need a better way to do this
#1

pawn Код:
forward RegenerateZombieHealth(playerid);
public RegenerateZombieHealth(playerid)
{
    if(pInfo[playerid][Team] == 2)
    {
        new Float:hp;
        GetPlayerHealth(playerid, hp);
        if(hp < 200) SetPlayerHealth(playerid, hp+5);
        CheckPlayerHealth(playerid, 200);
    }
    return 1;
}
This works, but sometimes health pass 200 and my anti hack bans the player, how can I do this but dont let life pass 200 (even if it stops realing if health is like 198 or something :P)
Reply
#2

pawn Код:
if (hp > 200) { hp = 200; }
Reply
#3

Quote:
Originally Posted by admantis
Посмотреть сообщение
pawn Код:
if (hp > 200) { hp = 200; }
Can u also explain why (so I will learn :P)
Reply
#4

if(hp < 195) SetPlayerHealth(playerid, hp+5);
Reply
#5

Quote:
Originally Posted by Retardedwolf
Посмотреть сообщение
if(hp < 195) SetPlayerHealth(playerid, hp+5);
Uhhhmmm didnt think of that, that will probrably work
Reply
#6

Quote:
Originally Posted by marinov
Посмотреть сообщение
Can u also explain why (so I will learn :P)
If player health is over 200 it will automatically turn to 200 so your anticheat won't do anything too bad, but Retardedwolf's solution is reliable as well
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)