SA-MP Forums Archive
Unlimated Nos (please help) - 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)
+--- Thread: Unlimated Nos (please help) (/showthread.php?tid=453198)



Unlimated Nos (please help) - James Coral - 24.07.2013

I need code, That if player is in car and klicks NOS button then NOS will be added ,)


Re: Unlimated Nos (please help) - ThePhenix - 24.07.2013

Example:
PHP код:
CMD:nos(playeridparams[])
{
     
AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
     
SendClientMessage(playerid, -1"You have successfully added NOS to your car");
     return 
1;




Re: Unlimated Nos (please help) - Tayab - 24.07.2013

That should bring up unlimited NOS whenever player presses this key
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
    if(!(GetPlayerVehicleSeat(playerid) == 0)) return 0;
    {
        new vid = GetPlayerVehicleID(playerid);
        if(oldkeys & 4))
        {
            RemoveVehicleComponent(vid, 1010);
            AddVehicleComponent(vid, 1010);
        }
    }
    return 1;
}