Server side problem
#1

I did a server side for SetPlayerHealth and look:
PHP Code:
PUBLIC: SetPlayerHealthEx(playeridFloat:health)
{
    new 
Float:tmp_health health,Float:newhp;
    if (
tmp_health 0.0tmp_health 0.0;
    else if (
tmp_health 100.0tmp_health 100.0;
    
AntiCheatInfo[playerid][acHealth] = tmp_health;
    
SetPlayerHealth(playeridtmp_health);
    
GetPlayerHealth(playeridnewhp);
    
printf("GetPlayerHealth: %.01f\nAntiCheatHealth: %.01f\nHealth: %.01f"newhpAntiCheatInfo[playerid][acHealth], tmp_health);
    return 
1;

This is debug
PHP Code:
GetPlayerHealth99.0
AntiCheatHealth
98.0
Health
98.0 
Where is the problem i don`t understand, i don`t found any bugs ....

PHP Code:
PUBLIC: PlayerHealthLoss()
{
    new 
Float:oldhealthFloat:amount;
    foreach(
Playerx)
    {
        if(
PlayerInfo[x][pStatus] == 1)
        {
            
GetPlayerHealth(xoldhealth);
            
amount floatsub(oldhealth1.0);
            
SetPlayerHealthEx(xamount);
        }
    }
    return 
1;

This function is called per every minute
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)