SA-MP Forums Archive
stunting 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: stunting help (/showthread.php?tid=289747)



stunting help - DaRkAnGeL[NBK] - 12.10.2011

how to add unlimited nos to cars? also how to spawn cars ?


Re: stunting help - Tigerkiller - 12.10.2011

i explain it tomorrow too


Re: stunting help - Kush - 12.10.2011

Quote:
Originally Posted by Tigerkiller
Посмотреть сообщение
i explain it tomorrow too
Nothing needed...

If the person is in a vehicle, check if they press the button which activates nitro, then -> https://sampwiki.blast.hk/wiki/AddVehicleComponent


Re: stunting help - Stigg - 12.10.2011

Quote:
Originally Posted by DaRkAnGeL[NBK]
Посмотреть сообщение
how to add unlimited nos to cars? also how to spawn cars ?
Unlimited nos:

pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(PRESSED(KEY_FIRE))
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        if(vehicleid)
        {
            AddVehicleComponent(vehicleid, 1010);
        }
    }
    return 1;
}
Simple, but work's.


Re: stunting help - DaRkAnGeL[NBK] - 12.10.2011

Quote:
Originally Posted by Stigg
Посмотреть сообщение
Unlimited nos:

pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(PRESSED(KEY_FIRE))
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        if(vehicleid)
        {
            AddVehicleComponent(vehicleid, 1010);
        }
    }
    return 1;
}
thanks man