SA-MP Forums Archive
[FilterScript] NOS Gauge (clock style) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] NOS Gauge (clock style) (/showthread.php?tid=624827)



NOS Gauge (clock style) - RIDE2DAY - 23.12.2016

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: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.


Re: NOS Gauge (clock style) - DarkLight - 23.12.2016

nice


Re: NOS Gauge (clock style) - Swedky - 23.12.2016

Sweet!


Re: NOS Gauge (clock style) - 4D1L - 23.12.2016

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


Re: NOS Gauge (clock style) - SickAttack - 23.12.2016

I thought it was for the default nos :c


Re: NOS Gauge (clock style) - JustMe.77 - 23.12.2016

This is very neat, well done !


Re: NOS Gauge (clock style) - ElMaestro123 - 13.04.2017

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