SA-MP Forums Archive
Stun! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Stun! (/showthread.php?tid=207700)



Stun! - 06leachr - 06.01.2011

OK, So as part of my GM I have a /stun script. However, when you get /stun'ned you do nothing, just stand there, lol.
This is the code:


pawn Код:
if(!IsPlayerInAnyVehicle(NearestPlayer) )
                {
                    TogglePlayerControllable(NearestPlayer, false);
                    Player[NearestPlayer][Tazed] = 1;
                    format( string, sizeof( string ), "* %s has stunned %s, with their taser.", UnderscoreToSpaceName( playerid ), UnderscoreToSpaceName(NearestPlayer) );
                    NearByMessage( playerid, NICESKY, string);
                    SendClientMessage(NearestPlayer, WHITE, "You have been tased. The effect will last for 12 seconds." );
                    SetTimerEx( "UntazePlayer", 12000, false, "d", NearestPlayer);
                }
                else
So I added:

pawn Код:
ApplyAnimationEx( playerid, "PED", "FLOOR_hit_f", 3.1, 0, 1, 1, 1, 1);// Taze Animation
And then the person who does the stunning falls over. LOL.

So I changed 'playerid' to 'NearestPlayer' thinking at that is the variable which defines the bitch that gets tazed. But when doing this, is just makes them stand there, just link before.


Any advice? I want the person who gets tazed to
pawn Код:
ApplyAnimationEx( ???, "PED", "FLOOR_hit_f", 3.1, 0, 1, 1, 1, 1)
Cheers.


Re: Stun! - bartje01 - 06.01.2011

ApplyAnimationEx( NearestPlayer, "PED", "FLOOR_hit_f", 3.1, 0, 1, 1, 1, 1);


Re: Stun! - 06leachr - 06.01.2011

If you read my OP it says I tried that...


Re: Stun! - bartje01 - 06.01.2011

Where did you add the anim?