[FilterScript] Speedgun; excellent for RP servers!
#1

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..
Reply
#2

Nice, but you should make a function:

GetPlayerSpeed(playerid);

So things like:


if(GetPlayerSpeed ==.....


could be made.
Reply
#3

Quote:
Originally Posted by Las Venturas CNR
Посмотреть сообщение
Nice, but you should make a function:

GetPlayerSpeed(playerid);

Thanks for the tip!

I shall update soon
Reply
#4

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.
Reply
#5

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
Reply
#6

Sounds cool, i'll test it soon.
Reply
#7

Quote:
Originally Posted by Matej_
Посмотреть сообщение
Sounds cool, i'll test it soon.
I hope you like it
Reply
#8

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!
Reply
#9

LOL prety weard i tryed today to make my own but you already did XD Thanks

(you can do this just in your car?)
Reply
#10

you can do it on foot too
Reply
#11

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.
Reply
#12

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
Reply
#13

nice FilterScript
Reply
#14

Very nice man i do believe i am going to use this.
Reply
#15

Quote:
Originally Posted by Robert_Crawford
Посмотреть сообщение
Very nice man i do believe i am going to use this.
thank you very much
Reply
#16

What's the Speedgun?
Deagle?
Reply
#17

as default its a normal pistol

EDIT:

although you can change it by a simple variable at the top =D
Reply
#18

OK, thanks .
Reply
#19

UPDATED V2!
Reply
#20

Nice
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)