SA-MP Forums Archive
Tazer problem. - 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: Tazer problem. (/showthread.php?tid=595962)



Tazer problem. - YoDawg - 10.12.2015

Hello again. I was wondering how can I add an animation for the player when getting tazed? Perhaps just a /crack animation or some shit here's the code:

Код:
forward TazeTimer(playerid);
public TazeTimer(playerid)
{
    if(IsPlayerLoggedIn(playerid))
	{
	    new string[128];
		if (TazeTimeout[playerid] > 0)
	   	{
	   		format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~~r~Tazer effect fading in ~w~%d ~r~seconds", TazeTimeout[playerid]);
			GameTextForPlayer(playerid, string,1500, 3);
			TazeTimeout[playerid] -= 1;
	   	}
	   	if(TazeTimeout[playerid] <= 0)
	   	{
	   	    KillTimer(TazeCountDown[playerid]);
	   	    TogglePlayerControllable(playerid, 1);
			ClearAnimations(playerid);
	   	    TogglePlayerTazed(playerid, 0);
	   	}
   	}
	return 1;
}



Re: Tazer problem. - Alpay0098 - 10.12.2015

Here's ma Idea [From one of GMs]
PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponid)
{
    new 
suspect playerid;
    
playerid issuerid;
    if(
PlayerHasTaser[playerid] == 1)
    {
        new 
Float:xFloat:yFloat:z;
        
GetPlayerPos(playeridx,y,z);
        if(
IsPlayerConnected(suspect))
        {
            if(
IsPlayerInRangeOfPoint(suspect10.0xyz) && weaponid == 23)
            {
                
ClearAnimations(suspect);
                  
ApplyAnimation(suspect"PED","FLOOR_hit_f"4.010000);
            }
        }
    }
    return 
1;




Re: Tazer problem. - YoDawg - 10.12.2015

Alright fixed, found another solution.


Re: Tazer problem. - Sellize - 10.12.2015

Quote:
Originally Posted by YoDawg
Посмотреть сообщение
Alright fixed, found another solution.
You should post your solution in case others might face the same problem.


Re: Tazer problem. - YoDawg - 10.12.2015

Quote:
Originally Posted by Sellize
Посмотреть сообщение
You should post your solution in case others might face the same problem.
Just changed the animation that's it, worked after that.