[Filterscript] Speed Boost for 0.3 -
Matite - 02.09.2009
Speed Boost Filterscript
Here is a little filterscript for the stunters out there... it allows you to use speed boost on any vehicle by pressing the horn key (note some vehicles cannot be boosted very fast, for example the rhino tank).
You can customise the speed boost applied by typing /setspeedboost (/ssb).
_________________________________________________
I realise it is quite basic but I hope it will help some of the new scripters.
Direct Download AMX File (compiled):
http://www.gamerxserver.com/downloads/SpeedBoost.amx
Direct Download PAWN File (source code):
http://www.gamerxserver.com/downloads/SpeedBoost.pwn
Any questions? Please post.
Re: Speed Boost Filterscript for 0.3 -
javind0 - 02.09.2009
Haha awesome
Re: Speed Boost Filterscript for 0.3 -
brett7 - 02.09.2009
nice i had the same idea to :P
Re: Speed Boost Filterscript for 0.3 -
Shubham - 02.09.2009
nice
Re: [Filterscript] Speed Boost for 0.3 -
@TheShadow@ - 02.09.2009
ah yeah the new possibilities in 0.3 are awesome
well done
Re: [Filterscript] Speed Boost for 0.3 -
GAYA - 21.10.2009
D:\SERVER~1.MP\SERVER~1.3RC\FILTER~1\SPEEDB~2.PWN( 180) : error 017: undefined symbol "SetVehicleVelocity"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Error
why Matite
Re: [Filterscript] Speed Boost for 0.3 -
heufix - 21.10.2009
LOL!
Already done
http://forum.sa-mp.com/index.php?topic=122079.msg749377
Re: [Filterscript] Speed Boost for 0.3 -
Luka P. - 22.10.2009
That script is on GamerX Euro?
Nice work
Re: [Filterscript] Speed Boost for 0.3 -
SamSam - 24.10.2009
Nice work!!
Re: [Filterscript] Speed Boost for 0.3 -
addysnow1 - 24.10.2009
DUDE this focking awesome!!
Re: Speed Boost Filterscript for 0.3 -
ke6i - 24.10.2009
Quote:
Originally Posted by brett7
nice i had the same idea to :P
|
Re: [Filterscript] Speed Boost for 0.3 -
SergiKirov - 24.10.2009
great job! love speed boosts!
Re: [Filterscript] Speed Boost for 0.3 -
meegan1 - 08.11.2009
very good!
there is a lot that people can do with this.
Re: [Filterscript] Speed Boost for 0.3 -
rk01-1 - 08.11.2009
Hahaha thx alot :P I gona have SPEED PARTY
Re: [Filterscript] Speed Boost for 0.3 -
[TBB]Darkness - 16.12.2009
C:\Documents and Settings\WINXP\Escritorio\bost.pwn(127) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Warning.
why?
xD
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Vehicle Speed Boost FilterScript for SAMP 0.3
// 2nd September 2009
// By Matite
// Special thanks to kc!
// v1.0.1
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Includes...
// -----------
// SAMP
#include <a_samp>
// -----------------------------------------------------------------------------
// Defines...
// ----------
// Used for messages sent to the player
#define COLOR_MESSAGE_YELLOW 0xFFDD00AA
// -----------------------------------------------------------------------------
// Variables...
// ------------
// Stores the players speed boost factor
// (it is set to the default of 1.5 when the FS is loaded or when a player connects)
new Float:SpeedBoostMultiplier[MAX_PLAYERS];
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
public OnFilterScriptInit()
{
// Print to server console
print("\n-------------------------------------------------");
print(" Speed Boost Filterscript for SAMP 0.3 by Matite");
print("-------------------------------------------------\n");
// Loop
for (new i = 0; i < MAX_PLAYERS; i++)
{
// Check if player is connected and not a NPC
if (IsPlayerConnected(i) && !IsPlayerNPC(i))
{
// Set the default speed boost for each player
SpeedBoostMultiplier[i] = 1.5;
}
}
// Exit here
return 1;
}
// -----------------------------------------------------------------------------
public OnFilterScriptExit()
{
// Print to server console
print("\n------------------------------------------------");
print(" Unloaded Speed Boost Filterscript for SAMP 0.3");
print("------------------------------------------------\n");
// Exit here
return 1;
}
// -----------------------------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
{
// Create variables
new cmd[256];
new idx;
// Get the command
cmd = strtok(cmdtext, idx);
// Check command typed
if (strcmp(cmd, "/setspeedboost", true) == 0 || strcmp(cmd, "/ssb", true) == 0)
{
// Create string variables
new strBoostMultiplier[256];
new strTempString[256];
// Get the vaue typed
strBoostMultiplier = strtok(cmdtext, idx);
// Check a boost factor was supplied
if (!strlen(strBoostMultiplier))
{
// Send message and exit here
SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "** Usage: /setspeedboost <SpeedBoostMultiplier>");
SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* Allows you to set the speed boost multiplier that is applied when you press the horn key.");
SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* Accepted speed boost multiplier values are between 1.0 and 3.0");
SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* The shortcut for this command is: /ssb");
format(strTempString,sizeof(strTempString), "* Your current speed boost multiplier is: %0.2f", SpeedBoostMultiplier[playerid]);
SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, strTempString);
return 1;
}
// Check the boost factor supplied is numeric
if (!IsNumeric2(strBoostMultiplier))
{
// Send message and exit here
SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "** Usage: /setspeedboost <BoostMultiplier>");
SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* Allows you to set the speed boost multiplier that is applied when you press the horn key.");
SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* Accepted speed boost multiplier values are between 1.0 and 3.0");
SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* The shortcut for this command is: /ssb");
format(strTempString,sizeof(strTempString), "* Your current speed boost multiplier is: %0.2f", SpeedBoostMultiplier[playerid]);
SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, strTempString);
return 1;
}
// Convert to float
new Float:BoostMultiplier = floatstr(strBoostMultiplier);
// Check speed boost multiplier is not too high or low
if (BoostMultiplier < 1.0 || BoostMultiplier > 3.0)
{
// Send message and exit here
SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* Sorry, you must enter a speed boost multiplier between 1.0 and 3.0");
return 1;
}
// Store the new speed boost multiplier value for the player
// Format and send message
SpeedBoostMultiplier[playerid] = BoostMultiplier;
format(strTempString,sizeof(strTempString), "* You set your speed boost multiplier to %0.2f", SpeedBoostMultiplier[playerid]);
SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, strTempString);
// Exit here
return 1;
}
// Exit here and return 0 (the command was not processed here)
return 0;
}
// -----------------------------------------------------------------------------
public OnPlayerConnect(playerid)
{
// Set the default speed boost for the player
// (the previous player may of changed it)
SpeedBoostMultiplier[playerid] = 1.5;
// Send message
SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* Speed Boost v1.01 by Matite - type /ssb to set your speed boost factor.");
// Exit here
return 1;
}
// -----------------------------------------------------------------------------
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
// Check if the player is in any vehicle and is the driver
if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
// Check for the HORN key (Crouch key is the same as the horn key)
if (newkeys & KEY_CROUCH)
{
// Create variables
new Float:vx, Float:vy, Float:vz;
// Get the vehicles velocity
GetVehicleVelocity(GetPlayerVehicleID(playerid), vx, vy, vz);
// Check the values are not too high already
if (floatabs(vx) < 3 && floatabs(vy) < 3 && floatabs(vz) < 3)
{
// Boost the vehicle speed
SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * SpeedBoostMultiplier[playerid], vy * SpeedBoostMultiplier[playerid], vz * SpeedBoostMultiplier[playerid]);
}
// Exit here
return 1;
}
}
// Exit here
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[])
{
// Is Numeric Check 2
// ------------------
// By DracoBlue... handles negative numbers
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;
}
// -----------------------------------------------------------------------------
// --------------------------------------------------------------
Re: [Filterscript] Speed Boost for 0.3 -
DiddyBop - 25.12.2009
did same thing
just for bunneh hop..
Re: [Filterscript] Speed Boost for 0.3 -
winczek1 - 09.01.2010
C:\Users\SnipeR4\Desktop\SpeedBoost.pwn(4
: error 017: undefined symbol "IsPlayerNPC"
C:\Users\SnipeR4\Desktop\SpeedBoost.pwn(174) : error 017: undefined symbol "GetVehicleVelocity"
C:\Users\SnipeR4\Desktop\SpeedBoost.pwn(180) : error 017: undefined symbol "SetVehicleVelocity"
And the link for amx download is not running
Re: [Filterscript] Speed Boost for 0.3 -
Cedimedi - 09.01.2010
Quote:
Originally Posted by winczek1
C:\Users\SnipeR4\Desktop\SpeedBoost.pwn(4 : error 017: undefined symbol "IsPlayerNPC"
C:\Users\SnipeR4\Desktop\SpeedBoost.pwn(174) : error 017: undefined symbol "GetVehicleVelocity"
C:\Users\SnipeR4\Desktop\SpeedBoost.pwn(180) : error 017: undefined symbol "SetVehicleVelocity"
And the link for amx download is not running
|
You are not using 0.3 includes
Re: [Filterscript] Speed Boost for 0.3 -
[NNFc]MinDs - 06.02.2010
Nice ..
Re: [Filterscript] Speed Boost for 0.3 -
CristianTdj - 07.04.2010
Wow, it's awesome. I needed it, thanks