SA-MP Forums Archive
Death System like LS:RP - 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: Death System like LS:RP (/showthread.php?tid=636072)



Death System like LS:RP - valelele - 19.06.2017

hello boyz, i want to make a copy of death system from LS:RP like this:

One player have a weapon(like AK-47) and he shoots after somebody, that player who is attacked if he has health under 35( health < 35) he goes to Injury System like he fell at the ground with ApplyAnimationEx(playerid, "WUZI", "CS_Dead_Guy", 4.0, 0, 1, 1, 1, 0);
And one 3dtext label is created above his head like this :
Code:
format(stringdamage, sizeof(stringdamage), "(( Has been injured %d times, /damages %d for more information. ))", CountDamages(playerid), playerid);
strcat(stringdamage, stringdamage2);
PlayerInfo[playerid][pInjuriesText] = CreateDynamic3DTextLabel(stringdamage, COLOR_ERROR, x, y, z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), -1, 20.0);
Now it's okay, but if i want to shoot again in him, i don't want to take damage from the player is on the ground, like if i shoot with AK-47 10-20 bullets, he doesn't take damage and he goes to Death System and a 3DTextLabel is now "(( THE PLAYER IS DEAD )) ".


How could I make the player is on the ground to not taking damage in the injury system?
Thank you a lot boys, i make on OnThePlayerTakeDamage this:

Code:
if(GetPVarInt(playerid, "Dead") == 6)
{
     SetPlayerHealth(playerid, health+25);
     DestroyDynamic3DTextLabel(PlayerInfo[playerid][pInjuriesText]);
     GetPlayerPos(playerid, x, y, z);
     PlayerInfo[playerid][pInjuriesText] = CreateDynamic3DTextLabel("(( THIS PLAYER IS DEAD ))", COLOR_ERROR, x, y, z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), -1, 20.0);
}
BUT THE PLAYER IS TAKING DAMAGE, WHY?



Re: Death System like LS:RP - Fairuz - 19.06.2017

I think you should use: https://sampforum.blast.hk/showthread.php?tid=563387
And simply return 0 at OnPlayerDamage


Re: Death System like LS:RP - valelele - 19.06.2017

it doesn't work, i want just on my gamemode, not to include. I have more if-s in OnPlayerTakeDamage


Re: Death System like LS:RP - Puppy - 19.06.2017

I did something exactly like this without using weapon-config as well, without desyncing bullets or using laggy functions (best part is damage is still added to damage list even in death mode accurately). Excuse the poor video quality:

https://www.youtube.com/watch?v=3PXt-YRMVvg

What's the key to doing this? I'm not going to completely give it away but you can use teams (https://sampwiki.blast.hk/wiki/SetPlayerTeam) to your advantage, you just have to find a good way to use them.


Re: Death System like LS:RP - valelele - 19.06.2017

Yea but where i can put this? And then how can i escape from this SetPlayerTeam?


Re: Death System like LS:RP - DRIFT_HUNTER - 19.06.2017

https://sampwiki.blast.hk/wiki/OnPlayerWeaponShot
return 0 there if you want to stop player giving damage. Returning 0/1 in OnPlayer Give/Take Damage does not have any effect other then breaking/continuing callback chain.

But keep in mind OnPlayerWeaponShot only works for weapons with bullets.


If you are hiding player tags then i guess you can set players health to 1000 and make some kind of custom damage system.


Re: Death System like LS:RP - JasonRiggs - 19.06.2017

Maybe set his hp for a very high count, Btw, It's not good to come in here and just say "I want to make this" and take ideas from other server.. This ain't cool, Start a system, then come if there are a bug or an error..


Re: Death System like LS:RP - valelele - 19.06.2017

I want just to not taking damage if someone is in Injury System(under 30 hp)


Re: Death System like LS:RP - JasonRiggs - 19.06.2017

Okay, Set the anim, and set his controllable to 0, and set his HP after that to 9999 or smth, ez


Re: Death System like LS:RP - GoldenLion - 19.06.2017

I don't understand why does everyone want to make a replica of it. Be original. This will help you: https://sampforum.blast.hk/showthread.php?tid=558839


Re: Death System like LS:RP - valelele - 19.06.2017

On OnPlayerWeaponShot
Code:
{
     if(GetPVarInt(playerid, "Dead") == 6)
     {
	SetPlayerTeam(playerid, hitid);
     }
}
It\'s that ok?