How the hell can I make that running animation? [ REP + ]
#1

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

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
Reply
#3

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?
Reply
#4

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

??
Reply
#5

What?...
Reply
#6

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

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

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

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

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


Forum Jump:


Users browsing this thread: 2 Guest(s)