23.12.2016, 14:39
(
Последний раз редактировалось RIDE2DAY; 10.03.2019 в 14:35.
Причина: new video, some new features, updated download link.
)
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
Refill NOS
I didn't add a /refill command, it's easy though, it would look something like this:
PHP код:
COMMAND:refill(playerid, params[])
{
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;
}
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.