Need some Nos ?

Started by KrOoB_, Oct 01, 2020, 09:30 PM

Previous topic - Next topic

KrOoB_

INFORMATION
It's a basic nos script :D

Credits
KrOoB_

Code
class nos{
basili = false;
sure = 10; // nos amount/second
durum = false;
}

function onScriptLoad()
{
turbo <- array(GetMaxPlayers(), null);
CTRL <- BindKey(true, 0x11, 0, 0);
}



// u can use timers if u wish
function onTimeChange(oldHour, oldMin, newHour, newMin)
{
for (local i = 0; i < GetMaxPlayers(); ++i)
{
local player = FindPlayer(i);
if (player)
{
if (player.IsSpawned)
{
if ( turbo[ player.ID ].basili == true)
{
if ( turbo[ player.ID ].durum == true)
{
if ( turbo[ player.ID ].sure > 0 )
{
turbo[ player.ID ].sure -= 1;
}else {
local veh = player.Vehicle;
turbo[ player.ID ].sure = 0;
veh.ResetHandlingData(13);
veh.ResetHandlingData(14);
MessagePlayer("Vehicle's nos tube is empty get a new one",player);
}
}
}
}
}
}
}



function onKeyDown( player, key )
{
if ( key == CTRL )
{
if ( player.Vehicle )
{
turbo[ player.ID ].basili = true;
if ( turbo[ player.ID ].sure > 0 )
{
local veh = player.Vehicle;
veh.Lights = true;
turbo[ player.ID ].durum = true;
veh.SetHandlingData(14, 100)
veh.SetHandlingData(13, 1000)
}else return MessagePlayer("Empty",player);
}
}
}

function onKeyUp( player, key )
{
if ( key == CTRL )
{
if ( player.Vehicle )
{
local veh = player.Vehicle;
veh.Lights = false;
turbo[ player.ID ].basili = false;
veh.ResetHandlingData(13);
veh.ResetHandlingData(14);
}
}
}

NicusorN5

I recommend using client-side key bindings. Server side key bindings are known to break when reloading the script for example.