A question (+REP) - 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: A question (+REP) (
/showthread.php?tid=612805)
A question (+REP) -
MarkNelson - 21.07.2016
Hello all, I tried to set the player do an animation with ApplyPlayerAnimation when the player take damage.
I tried many times but i failed. So how to do that? Can someone help me ?
Re: A question (+REP) -
Mister0 - 21.07.2016
try to put 2 times the animmation,
or make a timer with 0.5 seconds settimer("Animation",500,false,"i",playerid);
public animation(playerid)
applyplayeranimation(playerid)
Re: A question (+REP) -
MarkNelson - 21.07.2016
Not works. Guys can you help me?
Re: A question (+REP) -
oMa37 - 22.07.2016
Quote:
Originally Posted by TopShooter
This one should work.
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 || weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
{
ApplyAnimation(playerid,"PED","KO_skid_front",4.1,0,0,0,0,0); // << Animation Example.
// Your animation code here, applyanimation and etc.
}
return 1;
}
|
Why not switch?
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
switch(weaponid)
{
case 22 .. 34:
{
ApplyAnimation(playerid,"PED","KO_skid_front",4.1,0,0,0,0,0); // << Animation Example.
// Your animation code here, applyanimation and etc.
}
}
return 1;
}