[FilterScript] NOS Gauge (clock style)
#1

NOS Gauge v0.1


[*] Introduction
Hello guys, I scripted this simple system in order to get some experience with GTA's angles since it has an inverted reference system. I applied some simple trigonometry to make the gauge move. Basically it's a "nitro tank", while you hold LMB (KEY_FIRE) vehicle's NOS decreases. I scripted this fast, if there is any bug just let me know.


[*] Media
Here you can find a video.

Okay, just in case of you don't want to watch the video:



[*] Download
Copy, paste and do ya' thang: pastebin.com


[*] Documentation
With some basic PAWN knowledge the code is understandable. Anyway, if you wanna modify this script, here you have some basic steps:

Move the NOS indicator
To move the entire system you must change these values:
  • BASE_X
  • BASE_Y
In my opinion the default BASE_Y value is the ideal one, modify BASE_X in order to move it left/right.

Refill NOS
I didn't add a /refill command, it's easy though, it would look something like this:
PHP код:
COMMAND:refill(playeridparams[])
{
    if(!
IsPlayerInAnyVehicle(playerid)) return 1;
    
Vehicle_NOS{GetPlayerVehicle(ID) - 1} = 100;
    
/* vehicleid - 1 due the array index! */
    /* Watch out, I used { } to access the array because it's a char array (to save memory)! */
    
return 1;

Amout of NOS which decreases
The amount of NOS which decreases on every timer repeat is DECREASE_UNITS, you can change it but keep in mind that if you use high values the gauge might move weird. The variable which stores the amount of NOS is Vehicle_NOS, it's a char array which store integers; if you wanna use values between 0 - 1 you must use floats. Using smaller values the gauge will move smoother and the NOS will last more. On the other hand, if you decrease SetTimerEx's repeat time, the gauge will move smoother also but the NOS will last less.

Exclude vehicles which don't support NOS
Add the vehicles you wish to exclude to Invalid_NOS_Vehicles, due my laziness I've added air vehicles only!


[*] Other
Thank you for reading my thread, if you want to support what I do you might buy me a coffe! Join to my Discord server if you want to follow the development of my gamemode.

If you find any bug, please let me know.

Best regards.
Reply
#2

nice
Reply
#3

Sweet!
Reply
#4

Nice, but is the gauge only affected by holding down LMB?
Reply
#5

I thought it was for the default nos :c
Reply
#6

This is very neat, well done !
Reply
#7

I like the thing that asin and acos are being used.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)