10.04.2017, 10:22
So, I want to make a system where it detects your health and if its 10hp, it forces you into a animation and displays a text above your head saying (( THIS PLAYER IS INJURED )).
Now, I found a code after searching around SAMP forums, but not exactly sure where to insert it. Remember, this code doesn't have the animation or the text.
If the player gets shot again, the text will change to (( THIS PLAYER IS DEAD )), and thus, they'll be taken to a hospital.
Now, I understand the code and all, BUT. I'm not sure whether to insert it into OnPlayerTakeDamage or OnPlayerGiveDamage. I would think that it goes into GiveDamage, but anyway. I still need the text displaying above and the animation. Also, you won't be able to get out of this animation until your health is 0.
Talking about a medic reviving you, here's the stock that I have for it.
Maybe add it to a strcmp command. The script that I use uses strcmp although I'd much prefer it ZCMD, anyways.
Now, I found a code after searching around SAMP forums, but not exactly sure where to insert it. Remember, this code doesn't have the animation or the text.
If the player gets shot again, the text will change to (( THIS PLAYER IS DEAD )), and thus, they'll be taken to a hospital.
Код:
new Float: playersHealth; GetPlayerHealth(playerid, playersHealth); if(playersHealth = 10) { SendClientMessage(playerid, -1, "You are critically injured. You may /acceptdeath or wait for a medic to revive you."); LoopingAnim(playerid,"SWEET","Sweet_injuredloop", 4.0, 1, 0, 0, 0, 0); }
Talking about a medic reviving you, here's the stock that I have for it.
Код:
if(!(PlayerInfo[playerid][pMember] >= 7 && PlayerInfo[playerid][pMember] <= 8))