Speedgun; excellent for RP servers! UPDATED V2! -
WillyP - 28.10.2010
Speedgun!
Hey everyone, this is a Speedgun, where you aim at players' cars to get their speed, and then show it to the person who is using the speedgun
HOW TO USE
Load the filterscript in your server. Get a friend to drive a car, and then you aim the Speedgun and then press handbrake, (space) and the cars speed will be logged and given to you, simple!
Its easy to change, with variables at the top making it easier to edit the gun which you wish to use.
DONT REMOVE THE CREDITS!
Download
http://pastebin.com/Qb3cND99
**NEW V2**
- Whats new
Easier to use, neater code, thanks to willsuckformoney's stock < edited by me
Video
[ame="http://www.youtube.com/watch?v=hjLFqEg21rc"]Here![/ame]]
How to use
Just aim at the closest vehicle!
Simple!
Credits
stock that i edited: willsuckformoney
testing: Hiddos
testing: NotoriousMOB
coding: Me
Download:
http://pastebin.com/z0j8Vg9N
p.s
and for the noob who stole my v1, learn from your mistakes, and dont steal this one..
Re: Speedgun; excellent for RP servers! -
Las Venturas CNR - 28.10.2010
Nice, but you should make a function:
GetPlayerSpeed(playerid);
So things like:
if(GetPlayerSpeed ==.....
could be made.
Re: Speedgun; excellent for RP servers! -
WillyP - 28.10.2010
Quote:
Originally Posted by Las Venturas CNR
Nice, but you should make a function:
GetPlayerSpeed(playerid);
|
Thanks for the tip!
I shall update soon
Re: Speedgun; excellent for RP servers! -
Las Venturas CNR - 28.10.2010
Quote:
Originally Posted by [FU]Victious
Thanks for the tip!
I shall update soon
|
Post updated, lol.
Also, make it so the function "GetPlayerSpeed(playerid);", detects it in MPH.
Re: Speedgun; excellent for RP servers! -
WillyP - 28.10.2010
Quote:
Originally Posted by Las Venturas CNR
Post updated, lol.
Also, make it so the function "GetPlayerSpeed(playerid);", detects it in MPH.
|
yeah, I commented on the code for the *amount to make it either MPH or KMH/h
Re: Speedgun; excellent for RP servers! -
Matej_ - 28.10.2010
Sounds cool, i'll test it soon.
Re: Speedgun; excellent for RP servers! -
WillyP - 28.10.2010
Quote:
Originally Posted by Matej_
Sounds cool, i'll test it soon.
|
I hope you like it
Re: Speedgun; excellent for RP servers! -
Luis- - 28.10.2010
How does this work? I have added to my script but I press Space for the Handbrake?, Sorry, I just saw the "How to use"
, Anyway good work!
Re: Speedgun; excellent for RP servers! -
sten112 - 28.10.2010
LOL prety weard i tryed today to make my own but you already did
XD Thanks
(you can do this just in your car?)
Re: Speedgun; excellent for RP servers! -
WillyP - 28.10.2010
you can do it on foot too
Re: Speedgun; excellent for RP servers! -
willsuckformoney - 28.10.2010
pawn Код:
stock GetPlayerSpeed(playerid) //MPH
{
new veh = GetClosestVehicle(playerid), pSpeed[MAX_PLAYERS];
if (veh)
{
new Float:x,Float:y,Float:z/*,string[128]*/;
GetVehiclePos(veh,x,y,z);
//IsPlayerAimingAt(veh,x,y,z,25);
new Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,final_speed_int;
GetVehicleVelocity(veh, speed_x, speed_y, speed_z);
final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*85.4166672; // 136.666667 = kmph // 85.4166672= mph
final_speed_int = floatround(final_speed,floatround_round);
/*format(string,sizeof(string),"Speed: %i MPH",final_speed_int,2000);
SendClientMessage(playerid,lightblue,string);*/
pSpeed[playerid] = final_speed+int,2000;
}
return 1;
}
Something like that should work, that is not tested so I am not sure if it will work. Nice work with this.
Re: Speedgun; excellent for RP servers! -
WillyP - 28.10.2010
Quote:
Originally Posted by willsuckformoney
pawn Код:
stock GetPlayerSpeed(playerid) //MPH { new veh = GetClosestVehicle(playerid), pSpeed[MAX_PLAYERS]; if (veh) { new Float:x,Float:y,Float:z/*,string[128]*/; GetVehiclePos(veh,x,y,z); //IsPlayerAimingAt(veh,x,y,z,25); new Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,final_speed_int; GetVehicleVelocity(veh, speed_x, speed_y, speed_z); final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*85.4166672; // 136.666667 = kmph // 85.4166672= mph final_speed_int = floatround(final_speed,floatround_round); /*format(string,sizeof(string),"Speed: %i MPH",final_speed_int,2000); SendClientMessage(playerid,lightblue,string);*/ pSpeed[playerid] = final_speed+int,2000; } return 1; }
Something like that should work, that is not tested so I am not sure if it will work. Nice work with this.
|
thanks, im trying to fix my gamemode problems atm
Re: Speedgun; excellent for RP servers! -
Mr.Jvxmc - 29.10.2010
nice FilterScript
Re: Speedgun; excellent for RP servers! -
Robert_Crawford - 29.10.2010
Very nice man i do believe i am going to use this.
Re: Speedgun; excellent for RP servers! -
WillyP - 29.10.2010
Quote:
Originally Posted by Robert_Crawford
Very nice man i do believe i am going to use this.
|
thank you very much
Re: Speedgun; excellent for RP servers! -
oliver12 - 30.10.2010
What's the Speedgun?
Deagle?
Re: Speedgun; excellent for RP servers! -
WillyP - 30.10.2010
as default its a normal pistol
EDIT:
although you can change it by a simple variable at the top =D
Re: Speedgun; excellent for RP servers! -
oliver12 - 30.10.2010
OK, thanks
.
Re: Speedgun; excellent for RP servers! -
WillyP - 30.10.2010
UPDATED V2!
Re: Speedgun; excellent for RP servers! -
Elviss - 30.10.2010
Nice