Tazer problem.
#1

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;
}
Reply
#2

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;

Reply
#3

Alright fixed, found another solution.
Reply
#4

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)