[FilterScript] Speed Boost + Jump Car
#1

Speed Boost
Jump Car





im make this script because im dont see in forum any speed boost + jump only i see speed boost but this script it is the best without any bug have fun
If you Press LMB or Alt will get Speed Boost
If you Press H or CAPS will get jump
And You Can Disable And Enable Boost by Type /Boost


here Jump Car


here Speed Boost


Download Link:


Pastebin
If You Like My Work Rep me
Reply
#2

Here is the reason why i hate people who ask rep

- They made a FS/INC/GM then in the last line of the topic

If it help rep me please

- They ask rep in Scripting Disucssion

Please rep me

- They ask rep in Signature

if i ever help you please click REP++

Rep will not make your life better, Rep will just increase your Rep in your details and you can post server advertisement (7 rep) thats it thats all rep can do

OT: Nice Job would be better if you add a flip one too
Reply
#3

Quote:
Originally Posted by RollTi
View Post
Here is the reason why i hate people who ask rep

- They made a FS/INC/GM then in the last line of the topic

If it help rep me please

- They ask rep in Scripting Disucssion

Please rep me

- They ask rep in Signature

if i ever help you please click REP++

Rep will not make your life better, Rep will just increase your Rep in your details and you can post server advertisement (7 rep) thats it thats all rep can do

OT: Nice Job would be better if you add a flip one too
post your idea in every thing and nothing not in my Fs here you can post ,nice, good job, any thing,


ok but i will keep my idea about rep
Reply
#4

pawn Code:
if(EnableBoast[playerid] == 0) return 0;
with that in OnPlayerKeyStateChange, you block the KEY_FIRE in Filterscripts, that loads after yours.. you can delete this line - it's useles..
Reply
#5

Quote:
Originally Posted by Pablo Borsellino
View Post
pawn Code:
if(EnableBoast[playerid] == 0) return 0;
with that in OnPlayerKeyStateChange, you block the KEY_FIRE in Filterscripts, that loads after yours.. you can delete this line - it's useles..
good idea thanks
Reply
#6

I like simple things nice work bro ; )
Reply
#7

can you upload a amx. and pawn file pl0x?
Reply
#8

you can just copy the code from the past-bin abd past it into a FS or place it in your GM then press edit every code to its place

Example:

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
Ban(playerid);
}
return 1;
}
You can change it to


Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    Ban(playerid);
    return 1;
}
Reply
#9

Quote:
Originally Posted by Youice
View Post
I like simple things nice work bro ; )
thanks


Quote:
Originally Posted by Waw
View Post
can you upload a amx. and pawn file pl0x?
you can programer to .emx by use pawno code
Reply
#10

how can i set the boost on as default? (when player join)?

and i have searched for a good script, and finally! +REP
Reply
#11

Guys, seriously, I don't want to be impolite, but this filterscript is just a merely use of GetVehicleVelocity/SetVehicleVelocity, which actually makes cars jump and adds boost. However, the speed boost is not even directional - which is much more useful! My Cruise Control/Flying Car filterscript works by applying multiple directional speed boost, while you are pressing CTRL, to simulate that car is flying. By commenting the line "SetTimerEx("ccf", UPDATE_RATE, false, "i", playerid);" in my script, it can do exactly the same and is directional! Or, you san still take a look at Matite's speed boost, where you can define how much boost you want: https://sampforum.blast.hk/showthread.php?tid=95064

I don't want to offend the creator, but why do not create a directional and configurable speed boost? I think there's no FS with such settings. There's just a tutorial about that: https://sampforum.blast.hk/showthread.php?tid=199628 - I also used it to create my FS.
Reply
#12

Quote:
Originally Posted by richardcor91
Посмотреть сообщение
Guys, seriously, I don't want to be impolite, but this filterscript is just a merely use of GetVehicleVelocity/SetVehicleVelocity, which actually makes cars jump and adds boost. However, the speed boost is not even directional - which is much more useful! My Cruise Control/Flying Car filterscript works by applying multiple directional speed boost, while you are pressing CTRL, to simulate that car is flying. By commenting the line "SetTimerEx("ccf", UPDATE_RATE, false, "i", playerid);" in my script, it can do exactly the same and is directional! Or, you san still take a look at Matite's speed boost, where you can define how much boost you want: https://sampforum.blast.hk/showthread.php?tid=95064

I don't want to offend the creator, but why do not create a directional and configurable speed boost? I think there's no FS with such settings. There's just a tutorial about that: https://sampforum.blast.hk/showthread.php?tid=199628 - I also used it to create my FS.
ok you talk so much only you can type good fs
Reply
#13

Yes, maybe I've more experience than you, but about this FS, it's not necessary to have much knowlegde, since the tutorial I said above explains everything.
Anyway, it's not necessary to keep discussing about it, there are much worse releases I've seen here, and yours at least is useful for new scripters.
Reply
#14

Quote:
Originally Posted by richardcor91
Посмотреть сообщение
Yes, maybe I've more experience than you, but about this FS, it's not necessary to have much knowlegde, since the tutorial I said above explains everything.
Anyway, it's not necessary to keep discussing about it, there are much worse releases I've seen here, and yours at least is useful for new scripters.
i don't care with your talking you said
PHP код:
I've more experience than you 
ok but this is my FS im Release it because i need good comment not for text and what about you every one like my FS and 2 people rep me if you dont love my fs do not comment
Reply
#15

So, what you want to listen is "thanks", "great fs", "nice work" and get reputation. Ok man, I've nothing to do here, since you can't hear constructive criticism about your scripts.
And a correction: I said: "maybe I've more experience than you", not "Ive more experience than you". Respect, man.

Just to finalize, even if you care or not, and because probably others care, here there's a simple FS to Speed Boost and Car Jump:

Код:
#include <a_samp>
#include <sscanf2> 
#include <zcmd> //I'm using these includes to avoid old functions and make it simple

new Float: SpeedBoostMultiplier[MAX_PLAYERS];
new Float: JumpSize[MAX_PLAYERS]; //variable to configure, activate or deactivate car jump

public OnPlayerConnect(playerid)
{
	SpeedBoostMultiplier[playerid] = 1.5;
	JumpSize[playerid] = 0.2;
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if(newkeys & KEY_ACTION) //CTRL to speed boost
	{
	    if(SpeedBoostMultiplier[playerid] == 0) return 1;
            if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return 1;
	    new Float:currspeed[3], Float:direction[3], Float:total;
	    GetVehicleVelocity(GetPlayerVehicleID(playerid), currspeed[0], currspeed[1], currspeed[2]);
	    total = floatsqroot((currspeed[0] * currspeed[0]) + (currspeed[1] * currspeed[1]) + (currspeed[2] * currspeed[2]));
	    total += 0.7;
	    new Float:invector[3] = {0.0, -1.0, 0.0};
	    RotatePointVehicleRotation(GetPlayerVehicleID(playerid), invector, direction[0], direction[1], direction[2]);
	    SetVehicleVelocity(GetPlayerVehicleID(playerid),
		direction[0] * total * SpeedBoostMultiplier[playerid],
		direction[1] * total * SpeedBoostMultiplier[playerid],
		direction[2] * total * SpeedBoostMultiplier[playerid]); //I added here a boost factor to increase or decrese boost power.

             //Note: Like Matite, you could still use this code to avoid abuses:
	   //if (floatabs(currspeed[ 0 ]) < 3 && floatabs(currspeed[ 1 ]) < 3 && floatabs(currspeed[ 2 ]) < 3)
        }

	if(newkeys & KEY_CROUCH) //H to make car jump
	{
	        if(JumpSize[playerid] == 0) return 1;
		if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return 1;
		new Float: x, Float: y, Float: z;
		GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
                SetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z + JumpSize[playerid]); //The same here.
	}
        return 1;
}

//Command to activate or deactivate boost, with an extra function: configure boost factor. With "factor" I mean "power"
CMD:boost(playerid, params[])
{
	new Float: value;
	if(!sscanf(params, "f", value)) //if player type some parameter, we configure the boost factor and automatically active it.
	{
		if(value < 1.0 || value > 3.0) return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /boost <1.0-3.0>");
		SpeedBoostMultiplier[playerid] = value;
		new msg[64];
		format(msg, 64, "You have a new speed boost factor: %.2f! Press CTRL to use it!", value);
		SendClientMessage(playerid, 0xFFFFFFFF, msg);
	}
	else //otherwise, we activate or deactivate the boost.
 	{
	 	if(SpeedBoostMultiplier[playerid] == 0)
	 	{
                        SpeedBoostMultiplier[playerid] = 1.5;
                        SendClientMessage(playerid, 0xFFFFFFFF, "You turned on the speed boost multiplier. Press CTRL to use it. Type /boost <1.0-3.0> to configure it!");
		}
		else
		{
			SpeedBoostMultiplier[playerid] = 0;
			SendClientMessage(playerid, 0xFFFFFFFF, "You turned off the speed boost multiplier. Type /boost to activate it again!");
		}
 	}
	return 1;
}

//Extra command I added to the configure jump size - note that this command is very similar to the /boost one.
CMD:jump(playerid, params[])
{
	new Float: value;
	if(!sscanf(params, "f", value))
	{
		if(value < 0.1 || value > 10.0) return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /jump <0.1-10.0>"); //Use reasonable values
		JumpSize[playerid] = value;
		new msg[64];
		format(msg, 64, "You have a new jump size: %.2f! Press H to use it!", value);
		SendClientMessage(playerid, 0xFFFFFFFF, msg);
	}
	else
 	{
	 	if(JumpSize[playerid] == 0)
	 	{
                        JumpSize[playerid] = 0.2; //reasonable car jump
                        SendClientMessage(playerid, 0xFFFFFFFF, "You turned on the jump car mode. Press H to use it. Type /jump <0.1-1.0> to configure it!");
		}
		else
		{
			JumpSize[playerid] = 0;
			SendClientMessage(playerid, 0xFFFFFFFF, "You turned off the jump car mode. Type /jump to activate it again!");
		}
 	}
	return 1;
}

//From the tutorial by The_Gangstas I told you:
stock MatrixTransformVector(Float:vector[3], Float:m[4][4], &Float:resx, &Float:resy, &Float:resz) {
        resz = vector[2] * m[0][0] + vector[1] * m[0][1] + vector[0] * m[0][2] + m[0][3];
        resy = vector[2] * m[1][0] + vector[1] * m[1][1] + vector[0] * m[1][2] + m[1][3];
        resx = -(vector[2] * m[2][0] + vector[1] * m[2][1] + vector[0] * m[2][2] + m[2][3]); // don't ask why -x was needed, i don't know either.
}

stock RotatePointVehicleRotation(vehid, Float:Invector[3], &Float:resx, &Float:resy, &Float:resz, worldspace=0)
{
    new Float:Quaternion[4];
    new Float:transformationmatrix[4][4];

    GetVehicleRotationQuat(vehid, Quaternion[0], Quaternion[1], Quaternion[2], Quaternion[3]);

    // build a transformation matrix out of the quaternion
    new Float:xx = Quaternion[0] * Quaternion[0];
    new Float:xy = Quaternion[0] * Quaternion[1];
    new Float:xz = Quaternion[0] * Quaternion[2];
    new Float:xw = Quaternion[0] * Quaternion[3];
    new Float:yy = Quaternion[1] * Quaternion[1];
    new Float:yz = Quaternion[1] * Quaternion[2];
    new Float:yw = Quaternion[1] * Quaternion[3];
    new Float:zz = Quaternion[2] * Quaternion[2];
    new Float:zw = Quaternion[2] * Quaternion[3];

    transformationmatrix[0][0] = 1 - 2 * ( yy + zz );
    transformationmatrix[0][1] =     2 * ( xy - zw );
    transformationmatrix[0][2] =     2 * ( xz + yw );
    transformationmatrix[0][3] = 0.0;

    transformationmatrix[1][0] =     2 * ( xy + zw );
    transformationmatrix[1][1] = 1 - 2 * ( xx + zz );
    transformationmatrix[1][2] =     2 * ( yz - xw );
    transformationmatrix[1][3] = 0.0;

    transformationmatrix[2][0] =     2 * ( xz - yw );
    transformationmatrix[2][1] =     2 * ( yz + xw );
    transformationmatrix[2][2] = 1 - 2 * ( xx + yy );
    transformationmatrix[2][3] = 0;

    transformationmatrix[3][0] = 0;
    transformationmatrix[3][1] = 0;
    transformationmatrix[3][2] = 0;
    transformationmatrix[3][3] = 1;
    // transform the point thru car's rotation
    MatrixTransformVector(Invector, transformationmatrix, resx, resy, resz);
    // if worldspace is set it'll return the coords in global space - useful to check tire coords against tire spike proximity directly, etc..
    if (worldspace == 1) {
        new Float:fX, Float:fY, Float:fZ;
        GetVehiclePos(vehid, fX, fY, fZ);
        resx += fX;
        resy += fY;
        resz += fZ;
    }
}
Reply
#16

Cool Nice work
Reply
#17

Quote:
Originally Posted by richardcor91
Посмотреть сообщение
So, what you want to listen is "thanks", "great fs", "nice work" and get reputation. Ok man, I've nothing to do here, since you can't hear constructive criticism about your scripts.
And a correction: I said: "maybe I've more experience than you", not "Ive more experience than you". Respect, man.

Just to finalize, even if you care or not, and because probably others care, here there's a simple FS to Speed Boost and Car Jump:

Код:
#include <a_samp>
#include <sscanf2> 
#include <zcmd> //I'm using these includes to avoid old functions and make it simple

new Float: SpeedBoostMultiplier[MAX_PLAYERS];
new Float: JumpSize[MAX_PLAYERS]; //variable to configure, activate or deactivate car jump

public OnPlayerConnect(playerid)
{
	SpeedBoostMultiplier[playerid] = 1.5;
	JumpSize[playerid] = 0.2;
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if(newkeys & KEY_ACTION) //CTRL to speed boost
	{
	    if(SpeedBoostMultiplier[playerid] == 0) return 1;
            if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return 1;
	    new Float:currspeed[3], Float:direction[3], Float:total;
	    GetVehicleVelocity(GetPlayerVehicleID(playerid), currspeed[0], currspeed[1], currspeed[2]);
	    total = floatsqroot((currspeed[0] * currspeed[0]) + (currspeed[1] * currspeed[1]) + (currspeed[2] * currspeed[2]));
	    total += 0.7;
	    new Float:invector[3] = {0.0, -1.0, 0.0};
	    RotatePointVehicleRotation(GetPlayerVehicleID(playerid), invector, direction[0], direction[1], direction[2]);
	    SetVehicleVelocity(GetPlayerVehicleID(playerid),
		direction[0] * total * SpeedBoostMultiplier[playerid],
		direction[1] * total * SpeedBoostMultiplier[playerid],
		direction[2] * total * SpeedBoostMultiplier[playerid]); //I added here a boost factor to increase or decrese boost power.

             //Note: Like Matite, you could still use this code to avoid abuses:
	   //if (floatabs(currspeed[ 0 ]) < 3 && floatabs(currspeed[ 1 ]) < 3 && floatabs(currspeed[ 2 ]) < 3)
        }

	if(newkeys & KEY_CROUCH) //H to make car jump
	{
	        if(JumpSize[playerid] == 0) return 1;
		if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return 1;
		new Float: x, Float: y, Float: z;
		GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
                SetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z + JumpSize[playerid]); //The same here.
	}
        return 1;
}

//Command to activate or deactivate boost, with an extra function: configure boost factor. With "factor" I mean "power"
CMD:boost(playerid, params[])
{
	new Float: value;
	if(!sscanf(params, "f", value)) //if player type some parameter, we configure the boost factor and automatically active it.
	{
		if(value < 1.0 || value > 3.0) return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /boost <1.0-3.0>");
		SpeedBoostMultiplier[playerid] = value;
		new msg[64];
		format(msg, 64, "You have a new speed boost factor: %.2f! Press CTRL to use it!", value);
		SendClientMessage(playerid, 0xFFFFFFFF, msg);
	}
	else //otherwise, we activate or deactivate the boost.
 	{
	 	if(SpeedBoostMultiplier[playerid] == 0)
	 	{
                        SpeedBoostMultiplier[playerid] = 1.5;
                        SendClientMessage(playerid, 0xFFFFFFFF, "You turned on the speed boost multiplier. Press CTRL to use it. Type /boost <1.0-3.0> to configure it!");
		}
		else
		{
			SpeedBoostMultiplier[playerid] = 0;
			SendClientMessage(playerid, 0xFFFFFFFF, "You turned off the speed boost multiplier. Type /boost to activate it again!");
		}
 	}
	return 1;
}

//Extra command I added to the configure jump size - note that this command is very similar to the /boost one.
CMD:jump(playerid, params[])
{
	new Float: value;
	if(!sscanf(params, "f", value))
	{
		if(value < 0.1 || value > 10.0) return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /jump <0.1-10.0>"); //Use reasonable values
		JumpSize[playerid] = value;
		new msg[64];
		format(msg, 64, "You have a new jump size: %.2f! Press H to use it!", value);
		SendClientMessage(playerid, 0xFFFFFFFF, msg);
	}
	else
 	{
	 	if(JumpSize[playerid] == 0)
	 	{
                        JumpSize[playerid] = 0.2; //reasonable car jump
                        SendClientMessage(playerid, 0xFFFFFFFF, "You turned on the jump car mode. Press H to use it. Type /jump <0.1-1.0> to configure it!");
		}
		else
		{
			JumpSize[playerid] = 0;
			SendClientMessage(playerid, 0xFFFFFFFF, "You turned off the jump car mode. Type /jump to activate it again!");
		}
 	}
	return 1;
}

//From the tutorial by The_Gangstas I told you:
stock MatrixTransformVector(Float:vector[3], Float:m[4][4], &Float:resx, &Float:resy, &Float:resz) {
        resz = vector[2] * m[0][0] + vector[1] * m[0][1] + vector[0] * m[0][2] + m[0][3];
        resy = vector[2] * m[1][0] + vector[1] * m[1][1] + vector[0] * m[1][2] + m[1][3];
        resx = -(vector[2] * m[2][0] + vector[1] * m[2][1] + vector[0] * m[2][2] + m[2][3]); // don't ask why -x was needed, i don't know either.
}

stock RotatePointVehicleRotation(vehid, Float:Invector[3], &Float:resx, &Float:resy, &Float:resz, worldspace=0)
{
    new Float:Quaternion[4];
    new Float:transformationmatrix[4][4];

    GetVehicleRotationQuat(vehid, Quaternion[0], Quaternion[1], Quaternion[2], Quaternion[3]);

    // build a transformation matrix out of the quaternion
    new Float:xx = Quaternion[0] * Quaternion[0];
    new Float:xy = Quaternion[0] * Quaternion[1];
    new Float:xz = Quaternion[0] * Quaternion[2];
    new Float:xw = Quaternion[0] * Quaternion[3];
    new Float:yy = Quaternion[1] * Quaternion[1];
    new Float:yz = Quaternion[1] * Quaternion[2];
    new Float:yw = Quaternion[1] * Quaternion[3];
    new Float:zz = Quaternion[2] * Quaternion[2];
    new Float:zw = Quaternion[2] * Quaternion[3];

    transformationmatrix[0][0] = 1 - 2 * ( yy + zz );
    transformationmatrix[0][1] =     2 * ( xy - zw );
    transformationmatrix[0][2] =     2 * ( xz + yw );
    transformationmatrix[0][3] = 0.0;

    transformationmatrix[1][0] =     2 * ( xy + zw );
    transformationmatrix[1][1] = 1 - 2 * ( xx + zz );
    transformationmatrix[1][2] =     2 * ( yz - xw );
    transformationmatrix[1][3] = 0.0;

    transformationmatrix[2][0] =     2 * ( xz - yw );
    transformationmatrix[2][1] =     2 * ( yz + xw );
    transformationmatrix[2][2] = 1 - 2 * ( xx + yy );
    transformationmatrix[2][3] = 0;

    transformationmatrix[3][0] = 0;
    transformationmatrix[3][1] = 0;
    transformationmatrix[3][2] = 0;
    transformationmatrix[3][3] = 1;
    // transform the point thru car's rotation
    MatrixTransformVector(Invector, transformationmatrix, resx, resy, resz);
    // if worldspace is set it'll return the coords in global space - useful to check tire coords against tire spike proximity directly, etc..
    if (worldspace == 1) {
        new Float:fX, Float:fY, Float:fZ;
        GetVehiclePos(vehid, fX, fY, fZ);
        resx += fX;
        resy += fY;
        resz += fZ;
    }
}
ok

Quote:
Originally Posted by David Shelby™
Посмотреть сообщение
Cool Nice work
Thanks
Reply
#18

Quote:
Originally Posted by RollTi
View Post
Here is the reason why i hate people who ask rep

- They made a FS/INC/GM then in the last line of the topic

If it help rep me please

- They ask rep in Scripting Disucssion

Please rep me

- They ask rep in Signature

if i ever help you please click REP++

Rep will not make your life better, Rep will just increase your Rep in your details and you can post server advertisement (7 rep) thats it thats all rep can do

OT: Nice Job would be better if you add a flip one too
But How if i do this .
U got this from me Aloushi Rep+
Reply
#19

Realy good and simple !
Reply
#20

Quote:
Originally Posted by HaZaRaS™
Посмотреть сообщение
Realy good and simple !
thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)