SA-MP Forums Archive
I need crates animation. - 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: I need crates animation. (/showthread.php?tid=614245)



I need crates animation. - jimdo - 06.08.2016

Can someone shows me how can I make carrying crates animation?

For the example, Button Y is to carry crates (animation started) and button N is to drop the crates (animation stopped).


Re: I need crates animation. - Lucky13 - 06.08.2016

On top of script:
Код:
#define PRESSED(%0) \
	(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
Now:

Код:
public OnPlayerConnect(playerid)
{
	SetPVarInt(playerid,"Carrying",0);
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	if(GetPVarInt(playerid,"Carrying")==1) { SetPVarInt(playerid,"Carrying",0); }
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if(PRESSED(KEY_YES)) // ' Y ' Key
	{
	    if(GetPVarInt(playerid,"Carrying")==0) { SetPlayerSpecialAction(playerid, 25); SetPVarInt(playerid,"Carrying",1); }
	}
	else if(PRESSED(KEY_NO)) // ' N ' Key
	{
	    if(GetPVarInt(playerid,"Carrying")==1) { SetPlayerSpecialAction(playerid, 0); SetPVarInt(playerid,"Carrying",0); }
	}
	return 1;
}
Hope you understand.


Re: I need crates animation. - jimdo - 06.08.2016

thanks.


Re: I need crates animation. - jimdo - 06.08.2016

Edit: How can you add crates object or box when they're doing carry anims?


Re: I need crates animation. - Sew_Sumi - 06.08.2016

Create an object, then attachobjecttoplayer.