Problem anti lag-shot. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem anti lag-shot. (
/showthread.php?tid=442739)
Problem anti lag-shot. -
myria - 08.06.2013
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);
}
}
}
}
Re: Problem anti lag-shot. -
random123 - 08.06.2013
PHP код:
new Float: Damage;
if (AdminDuty [damagedit] == 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);
}
} else return 0;