SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 22/11/2012, 09:37 AM   #1
changeME
Big Clucker
 
changeME's Avatar
 
Join Date: Oct 2012
Posts: 103
Reputation: 28
Default Speed Boost+Car Fly[God For Stunt Server]

Speed Boost+Car Fly
Hello This Is My New FilterScript Created For Stunt Servers.
Hope You WIll Like It.
Code:
//SpeedBoost With Car Fly Nitros by max_pain
//Don't Romove the Credits Please
//You can Add it with the credits thanks Enjoy my script


#include a_samp
#define FILTERSCRIPT
#define red 0xF60000AA
#define GREEN 				0x21DD00FF
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define COLOR_MESSAGE_YELLOW            0xFFDD00AA
//------------------------------------------------------------------------------
new Float:SpeedBoostMultiplier[MAX_PLAYERS];

// -----------------------------------------------------------------------------

public OnFilterScriptInit()
{
	print("\n-------------------------------------------------");
	print(" Speed Boost With Car Fly Has been loaded by max_pain");
	print("-------------------------------------------------\n");

	for (new i = 0; i < MAX_PLAYERS; i++)
	{
	    if (IsPlayerConnected(i) && !IsPlayerNPC(i))
	    {
	        SpeedBoostMultiplier[i] = 3.0;
	    }
	}

	return 1;
}

// -----------------------------------------------------------------------------

public OnFilterScriptExit()
{
	print("\n------------------------------------------------");
	print(" Unloaded SpeedBoost with CarFly By Boom Successfully");
	print("------------------------------------------------\n");
	return 1;
}

// -----------------------------------------------------------------------------

public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256];
	new idx;

	cmd = strtok(cmdtext, idx);
	if (strcmp(cmd, "/SpeedBoostSetup", true) == 0 || strcmp(cmd, "/ssb", true) == 0)
	{
	    new strBoostMultiplier[256];
	    new strTempString[256];
      	strBoostMultiplier = strtok(cmdtext, idx);

      	if (!strlen(strBoostMultiplier))
      	{
        	return 1;
      	}

      	if (!IsNumeric2(strBoostMultiplier))
      	{
        	return 1;
      	}

        new Float:BoostMultiplier = floatstr(strBoostMultiplier);

		if (BoostMultiplier < 1.0 || BoostMultiplier > 3.0)
        {
        	SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "*** Error: You can just change it for 0.1 to 3.0");
        	return 1;
      	}

      	SpeedBoostMultiplier[playerid] = BoostMultiplier;

		format(strTempString,sizeof(strTempString), "*** You set your speed boost multiplier to %0.2f", SpeedBoostMultiplier[playerid]);
        SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, strTempString);

      	return 1;
    }
	return 0;
}

// -----------------------------------------------------------------------------

public OnPlayerConnect(playerid)
{
	SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "to use the speedboost press LMB, to use the carfly press + or 2");
    // (the previous player may of changed it)
	SpeedBoostMultiplier[playerid] = 2.0; //Its 2.0 you can also doing 3.0 and change it
	return 1;
}

// -----------------------------------------------------------------------------

stock strtok(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	}

	new offset = index;
	new result[20];
	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}

// -----------------------------------------------------------------------------

IsNumeric2(const string[])
{
	new length=strlen(string);
	if (length==0) return false;
	for (new i = 0; i < length; i++)
	{
	  if((string[i] > '9' || string[i] < '0' && string[i]!='-' && string[i]!='+' && string[i]!='.') // Not a number,'+' or '-' or '.'
	         || (string[i]=='-' && i!=0)                                             // A '-' but not first char.
	         || (string[i]=='+' && i!=0)                                             // A '+' but not first char.
	     ) return false;
	}
	if (length==1 && (string[0]=='-' || string[0]=='+' || string[0]=='.')) return false;
	return true;
}

// -----------------------------------------------------------------------------

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if(newkeys == KEY_CROUCH)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			{
    			RepairVehicle(GetPlayerVehicleID(playerid));
			}
		}
	}
	if (PRESSED(KEY_FIRE))
	{
		new
			vehicleid = GetPlayerVehicleID(playerid);
		if (vehicleid)
		{
			AddVehicleComponent(vehicleid, 1010);
		}
	}
	if(newkeys & KEY_FIRE && IsPlayerInAnyVehicle(playerid))
	{
		if(!IsNosVehicle(GetPlayerVehicleID(playerid))) return
		AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
		PlayerPlaySound(playerid, 1133 ,0, 0, 0);
	}
	if(newkeys & KEY_SUBMISSION && IsPlayerInAnyVehicle(playerid))
    {
  		if(IsPlayerInAnyVehicle(playerid))
		{
  			new Float:x, Float:y, Float:z;
			GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
			SetVehicleVelocity(GetPlayerVehicleID(playerid) ,x ,y ,z+0.3);
		}
    }
	if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
		if (newkeys & KEY_FIRE)
		{
		    new Float:vx, Float:vy, Float:vz;
		    GetVehicleVelocity(GetPlayerVehicleID(playerid), vx, vy, vz);

		    if (floatabs(vx) < 3 && floatabs(vy) < 3 && floatabs(vz) < 3)
		    {
		    	SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * SpeedBoostMultiplier[playerid], vy * SpeedBoostMultiplier[playerid], vz * SpeedBoostMultiplier[playerid]);
		    }
		    return 1;
		}
	}
	return 1;
}
IsNosVehicle(vehicleid)
{
	#define NO_NOS_VEHICLES 52

	new InvalidNosVehicles[NO_NOS_VEHICLES] =
	{
		581,523,462,521,463,522,461,448,468,586,417,425,469,487,512,520,563,593,
		509,481,510,472,473,493,520,595,484,430,453,432,476,497,513,533,577,
		452,446,447,454,590,569,537,538,570,449,519,460,488,511,519,548,592
	};

	for(new i = 0; i < NO_NOS_VEHICLES; i++)
	{
		if(GetVehicleModel(vehicleid) == InvalidNosVehicles[i])
		{
			return false;
		}
	}
	return true;
}
No Screen ATM.
Try it.
Simple to use.
Controls
Press LMB,Alt For Speed boost.
Press "2" for Car Fly.
Enjoy !
__________________
Scripting For +Rep On samp fourms
Pm Me If You want Any GFX I just need +Rep
Skype:-Vasumax24
Facebook:-www.facebook.com/vasumax
changeME is offline   Reply With Quote
Old 22/11/2012, 09:50 AM   #2
x96664
Gangsta
 
x96664's Avatar
 
Join Date: Jun 2009
Posts: 616
Reputation: 3
Default Re: Speed Boost+Car Fly[God For Stunt Server]

1st
Good job!
x96664 is offline   Reply With Quote
Old 22/11/2012, 11:24 AM   #3
ashwinsekhari
Huge Clucker
 
ashwinsekhari's Avatar
 
Join Date: May 2012
Location: india>>> Delhi NCR
Posts: 217
Reputation: 32
Default Re: Speed Boost+Car Fly[God For Stunt Server]

Good
__________________
ashwinsekhari is offline   Reply With Quote
Old 22/11/2012, 01:40 PM   #4
changeME
Big Clucker
 
changeME's Avatar
 
Join Date: Oct 2012
Posts: 103
Reputation: 28
Default Re: Speed Boost+Car Fly[God For Stunt Server]

Quote:
Originally Posted by x96664 View Post
1st
Good job!
Quote:
Originally Posted by ashwinsekhari View Post
Good
thanks
__________________
Scripting For +Rep On samp fourms
Pm Me If You want Any GFX I just need +Rep
Skype:-Vasumax24
Facebook:-www.facebook.com/vasumax
changeME is offline   Reply With Quote
Old 22/11/2012, 08:49 PM   #5
Mr.Valdez
Big Clucker
 
Mr.Valdez's Avatar
 
Join Date: Oct 2012
Location: The Depths
Posts: 75
Reputation: 23
Default Re: Speed Boost+Car Fly[God For Stunt Server]

i like it
__________________
Mr.Valdez is offline   Reply With Quote
Old 23/11/2012, 02:51 AM   #6
changeME
Big Clucker
 
changeME's Avatar
 
Join Date: Oct 2012
Posts: 103
Reputation: 28
Default Re: Speed Boost+Car Fly[God For Stunt Server]

Quote:
Originally Posted by Mr.Valdez View Post
i like it
nice
__________________
Scripting For +Rep On samp fourms
Pm Me If You want Any GFX I just need +Rep
Skype:-Vasumax24
Facebook:-www.facebook.com/vasumax
changeME 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
Speed Boost BlackBlood's Scripting Help 7 07/12/2011 07:54 AM
Speed Boost? stieben Help Archive 9 08/12/2010 06:58 PM


All times are GMT. The time now is 06:45 AM.


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