SA-MP Forums Archive
I think that I found a way to make an unlimited nitrous but .. EDIT: it WORKS :D - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I think that I found a way to make an unlimited nitrous but .. EDIT: it WORKS :D (/showthread.php?tid=261414)



I think that I found a way to make an unlimited nitrous but .. EDIT: it WORKS :D - Ehab1911 - 13.06.2011

Hey guys, I've been thinking about something that can give Unlimited Nitrous or Nitrous for usage

So, I went to work on it Here is the script:

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (HOLDING( KEY_FIRE ))
    {
        if (IsPlayerInAnyVehicle(playerid))
        {
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
        }
            else if (RELEASED(KEY_FIRE))
    {
            RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1010);
    }
}
    return 1;
}
But I get this problem, I don't know why ..

pawn Код:
C:\SA-MP PROJECT\samp03csvr_R2-2_win32\gamemodes\project.pwn(1873) : error 017: undefined symbol "RELEASED"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.

I will try to Define it, brb. If it works I'm gonna update this thread =]

Let's hope that It'll work











----------------------------







UPDATE:

IT WORKS, Awesome !!! It's like When you press the first time, Nitrous runs and the second time it Stops :O
Coool


Re: I think that I found a way to make an unlimited nitrous but .. EDIT: it WORKS :D - Ehab1911 - 13.06.2011

IF YOU WANNA TEST THIS,

ADD THIS TO THE TOP OF YOUR SCRIPT:

pawn Код:
#define RELEASED(%0) \
    ((newkeys & (%0)) == (%0))
#define HOLDING(%3) \
    ((newkeys & (%3)) == (%3))

AND REPLACE THIS:

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (HOLDING( KEY_FIRE ))
    {
        if (IsPlayerInAnyVehicle(playerid))
        {
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
        }
            else if (RELEASED(KEY_FIRE))
    {
            RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1010);
            //RemoveVehicleComponent(playerid, 1010);
    }
}
    return 1;
}
THIS WILL WORK LIKE THE POLICE SIRENS, IF YOU CLICK TIGHTLY-HARD ON THE MOUSE BUTTON, NITROUS STARTS, AND IF YOU PRESS/RELEASE YOUR FINGER FROM IT SOFTLY-NICE IT STOPS .. O.O, Awesome XD