27.09.2012, 16:23
how to make that when you press left mouse key you get nitro
I will ad the funtion to the gamemode
I will ad the funtion to the gamemode
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_FIRE)
{
new veh = GetPlayerVehicleID(playerid);
AddVehicleComponent(veh,1010);
return 1;
}
return 1;
}
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_FIRE))
{
if (IsPlayerInAnyVehicle(playerid))
{
new gpvi = GetPlayerVehicleID(playerid);
RemoveVehicleComponent(gpvi, 1010);
AddVehicleComponent(gpvi, 1010);
}
}
return 1;
}