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 |
if(EnableBoast[playerid] == 0) return 0;
pawn Code:
![]() |
public OnPlayerDeath(playerid, killerid, reason) { Ban(playerid); } return 1; }
public OnPlayerDeath(playerid, killerid, reason) { Ban(playerid); return 1; }
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. |
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've more experience than you
#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; } }
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; } } |
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 |