Help here a bit with my injured 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: Help here a bit with my injured system (
/showthread.php?tid=342370)
Help here a bit with my injured system -
N0FeaR - 13.05.2012
I makeing a injured system but he wont fall down under 10hp
pawn Код:
}
public DoDeath(playerid)
{
new Float:VBLife;
GetPlayerHealth(playerid,VBLife);
if(VBLife < 10)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You were brutally wounded, you can either wait for help or accept your death (/accept death)");
Wounded[playerid] = 1;
TogglePlayerControllable(playerid, 0);
SetPlayerPos(playerid, DeathDest[playerid][0],DeathDest[playerid][1],DeathDest[playerid][2]);
SetPlayerVirtualWorld(playerid,DeathWorld[playerid]);
SetPlayerInterior(playerid,GetPlayerInterior(playerid));
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
//SetPlayerHealth(playerid, 1);
}
return 1;
Re: Help here a bit with my injured system -
ViniBorn - 13.05.2012
Are you using DoDeath with a timer?
Re: Help here a bit with my injured system -
N0FeaR - 13.05.2012
Quote:
Originally Posted by Viniborn
Are you using DoDeath with a timer?
|
Nope.
Re: Help here a bit with my injured system -
ViniBorn - 13.05.2012
Where DoDeath is called?
Re: Help here a bit with my injured system -
N0FeaR - 13.05.2012
On OnPlayerDeath.
Re: Help here a bit with my injured system -
ViniBorn - 13.05.2012
Don't use this function after the player is already dead.
Try OnPlayerGiveDamage or OnPlayerTakeDamage
Re: Help here a bit with my injured system -
N0FeaR - 13.05.2012
Quote:
Originally Posted by Viniborn
Don't use this function after the player is already dead.
Try OnPlayerGiveDamage or OnPlayerTakeDamage
|
Yeah but when i use this i got tp to red county when i got under 10hp
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
new Float:VBLife;
GetPlayerHealth(playerid,VBLife);
if(VBLife < 10)
Wounded[playerid] = 1;
DoDeath(playerid);
return true;
}