SA-MP Forums Archive
How the hell can I make that running animation? [ 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: How the hell can I make that running animation? [ REP + ] (/showthread.php?tid=571297)



How the hell can I make that running animation? [ REP + ] - _GHT_MarK445 - 17.04.2015

Hey guys,

how i am enable to make that thing, that running animation on that object? Like you know in singleplayer that gym, you entered that little.. i dont know how is it called right now but you was like running on it.

I need an idea or example how to create it, thanks.


Re: How the hell can I make that running animation? [ REP + ] - Chausar - 18.04.2015

Here's the animation of it:
Код:
ApplyAnimation(playerid, "GYMNASIUM", "gym_tread_sprint", 4.1, 0, 1, 1, 0, 0, 1);
Код:
if(!strcmp(cmdtext, "/run", true))
        {
		ApplyAnimation(playerid, "GYMNASIUM", "gym_tread_sprint", 4.1, 0, 1, 1, 0, 0, 1);     
	}
	return 1;

}
-Chausar


Re: How the hell can I make that running animation? [ REP + ] - _GHT_MarK445 - 18.04.2015

Yes, but how can i do, if the player will stay near that object and PRESS enter, it will do it, like in singleplayer? Move player on that object and start that anim? Like connect these?


Re: How the hell can I make that running animation? [ REP + ] - Azula - 18.04.2015

by removing
PHP код:
DisableInteriorEnterExits() 
PHP код:
public OnGameModeInit()
{
    
DisableInteriorEnterExits();
    return 
1;

??


Re: How the hell can I make that running animation? [ REP + ] - _GHT_MarK445 - 19.04.2015

What?...


Re: How the hell can I make that running animation? [ REP + ] - ChuckyBabe - 19.04.2015

Aah, the walking animation when entering a interior, like in single player right ?


Re: How the hell can I make that running animation? [ REP + ] - Chausar - 19.04.2015

Quote:
Originally Posted by ChuckyBabe
Посмотреть сообщение
Aah, the walking animation when entering a interior, like in single player right ?
No, He meaned that if player press 'Enter' at the Gym running machine (forgot what it called) it will make player exercise on it (running) like in singleplayer.


Re: How the hell can I make that running animation? [ REP + ] - Razor483 - 19.04.2015

1.You should place the object where you want the treadmill to be.
2.use IsPlayerInRangeOfPoint function to define the location of the treadmill
3.Set "KEY_SECONDARY_ATTACK" (Enter) to trigger the script in the desired range
4. TogglePlayerControllable 0 and ApplyAnimation for the player.

It looks like as the person is using the treadmill.


Re: How the hell can I make that running animation? [ REP + ] - Chausar - 19.04.2015

Idk, What his motive to do that. haha But here's the code:

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if(newkeys == KEY_WALK) // Alt key, change it.
	{
		if(IsPlayerInRangeOfPoint(playerid, 7.0, 2348.4985, -1373.0328, 24.3984)) //Change the coords to the threadmill machine
		{
			ApplyAnimation(playerid, "GYMNASIUM", "gym_tread_sprint", 4.1, 0, 1, 1, 1, 0, 1); //Running animation
		}
		return 1;
	}
	return 1;
}



Re: How the hell can I make that running animation? [ REP + ] - _GHT_MarK445 - 19.04.2015

Thanks guys! Anyways Chausar, what is wrong with doing it? I am not the first person on the world using it.