SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 08/05/2016, 02:16 PM   #1
!Pumpkin
Big Clucker
 
!Pumpkin's Avatar
 
Join Date: Jul 2010
Location: Estonia
Posts: 82
Reputation: 6
Default Simple Dodge system by !Pumpkin

So this is a simple dodge system.
Just press RMB+Crouch to dodge.

https://youtu.be/6bGMybk8iT4
http://pastebin.com/mFF3W8u3

Code:
#include <a_samp>

#define KEY_AIM			(128)
#define PRESSED(%0) \
	(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

PreloadAnimLib(playerid, animlib[])
{
	ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
}

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Simple dodge system by !Pumpkin reloaded");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	print("\n--------------------------------------");
	print(" Simple dodge system by !Pumpkin unloaded");
	print("--------------------------------------\n");
	return 1;
}

	public OnPlayerSpawn(playerid)
{
	PreloadAnimLib(playerid,"PED");
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    new playerState = GetPlayerState(playerid); // Get the killer's state
    if(playerState == PLAYER_STATE_ONFOOT) // If the killer was in a vehicle
    {
	if (PRESSED( KEY_CROUCH | KEY_AIM ))
	{
	ApplyAnimation(playerid, "PED", "EV_dive", 4.1, 0, 1, 1, 1, 5, 1);
	}
	}
	return 1;
}
!Pumpkin is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pumpkin Object? Never Forgive Scripting Help 3 01/11/2014 11:11 AM
[FilterScript] Simple lumberjack job by Pumpkin !Pumpkin Filterscripts 16 25/04/2014 08:46 AM
[FilterScript] Simple Briefcase System + A Simple Whisper System by kosa451 kosa451 Filterscripts 4 16/09/2013 09:20 PM
Dodge Charger R/T 69 (IV video) Den Everything and Nothing 14 25/10/2009 02:46 AM


All times are GMT. The time now is 11:04 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.