Damage System - 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: Damage System (
/showthread.php?tid=636496)
Damage System -
valelele - 28.06.2017
My damage system it's ok but at deagle, shotgun and sawn off damage it's changed but i don't know, i have a injured system under 50hp but deagle is 13 damage and player goes to 47 HP. If I shoot one more time with deagle when player is 47HP he die instantly and not go to injury system
Re: Damage System -
MrCesar - 28.06.2017
use GetPlayerHealth to save the targeted players health into a variable.
Re: Damage System -
Abagail - 28.06.2017
You could try using teams to nullify the damage, it should work if done right.
Re: Damage System -
aoky - 28.06.2017
Create a new float, getting the players health. If the amount > playerhealth, setplayerhealth to 50.
Re: Damage System -
Gammix - 28.06.2017
https://sampforum.blast.hk/showthread.php?pid=3872869#pid3872869
https://sampforum.blast.hk/showthread.php?tid=563387
Re: Damage System -
valelele - 28.06.2017
It doesn't work, if i put the match on OnPlayerUpdate() if i connect on server it's says that i am dead but i am not because health is 0 and probably doesn't recognize why
Re: Damage System -
valelele - 28.06.2017
deagle damage is bugged, i set to 13 and it's damage it's 50 cuz gta single i think
Re: Damage System -
MrCesar - 28.06.2017
Quote:
Originally Posted by valelele
deagle damage is bugged, i set to 13 and it's damage it's 50 cuz gta single i think
|
Can you please show us the code you written?
Re: Damage System -
valelele - 28.06.2017
Код:
public OnPlayerUpdate(playerid)
{
new Float:health, Float:x, Float:y, Float:z;
GetPlayerHealth(playerid, health), GetPlayerPos(playerid, x, y, z);
if(IsPlayerInAnyVehicle(playerid))
{
if(health <= 35 && GetPVarInt(playerid, "Dead") == 0)
{
RemovePlayerFromVehicle(playerid);
SetPlayerPosEx(playerid,x,y,z+2);
SetPlayerHealth(playerid, 35);
CallRemoteFunction("Wounded","i", playerid);
}
}
else
{
if(health <= 35 && GetPVarInt(playerid, "Dead") == 0)
{
SetPlayerHealth(playerid, 35);
CallRemoteFunction("Wounded","i", playerid);
}
}
}
And if i am login on the server this is the problem it's callremotefunction the wounded header