Problem anti lag-shot.
#1

I added an anti lagshot, works perfectly but I have a little problem:
An admin when using / aduty life and armor are full and do not falls but when I added this system when shooting in an admin / aduty ii decreases armor and do not want that.
Код:
new Float:Damage;
    if(AdminDuty[playerid]==0)
    GetPlayerArmour(damagedid, Damage);
    if(Damage > 0)
    {
        if(amount > Damage)
        {
            SetPlayerArmour(damagedid, 0);
        }
        else
        {
            SetPlayerArmour(damagedid, Damage-amount);
        }
    }
    else
    {
        GetPlayerHealth(damagedid, Damage);
        SetPlayerHealth(damagedid, Damage-amount);
    }
and Command /aduty:
Код:
if(strcmp(cmd, "/aduty", true) == 0)
 {
		if(IsPlayerConnected(playerid))
		{
			GetPlayerName(playerid, sendername, sizeof(sendername));
			if(PlayerInfo[playerid][pAdmin] >= 1)
			{
				if(AdminDuty[playerid]==0)
				{
					format(string, sizeof(string), "* Admin %s este acum disponibil sa va ajute. Folositi /report pentru ajutor TEHNIC.", sendername);
					SendClientMessageToAll(0xa9c4e4FF, string);
					AdminDuty[playerid] = 1;
					SetPlayerColor(playerid, 0x389CD1FF);
					SetPlayerHealth(playerid,99999);
					SetPlayerArmour(playerid,99999);
					GivePlayerWeapon(playerid, 38,99999);
				}
				else if(AdminDuty[playerid]==1)
				{
					format(string, sizeof(string), "* Admin %s este acum off-aduty.", sendername);
					SendClientMessageToAll(0xa9c4e4FF, string);
					AdminDuty[playerid] = 0;
					SetPlayerHealth(playerid,100);
					SetPlayerArmour(playerid,0);
					SetPlayerToTeamColor(playerid);
					ResetPlayerWeaponsEx(playerid);
				}
			}
		}
	}
Reply
#2

PHP код:
    new FloatDamage;
    if (
AdminDuty [damagedit] == 0)
    {  
            
GetPlayerArmour (damagedidDamage);
        if (
Damage0)
        {
            if (
amountDamage)
            {
                
SetPlayerArmour (damagedid0);
            }
            else
            {
                
SetPlayerArmour (damagedidDamage-amount);
            }
        }
        else
        {
            
GetPlayerHealth (damagedidDamage);
            
SetPlayerHealth (damagedidDamage-amount);
        }
    } else return 
0
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)