PDA

View Full Version : Add nitro?


Gooday
05/04/2012, 03:31 PM
How to add nitro in ALL the cars:

This doesnt work:

CMD:nitro(playerid, params[])
{
if(GetPlayerSkin(playerid) == 59 || GetPlayerSkin(playerid) == 285 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 288)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "(INFO) You are not in a vehicle!");
new vehicleid = GetPlayerVehicleID(playerid);
AddVehicleComponent(154, 1010); // x10 nitro
SendClientMessage(playerid, COLOR_GOLD, "(INFO) Your vehicle has been equipped with a nitro!");
}
else return SendClientMessage(playerid, COLOR_RED, "(INFO) You are not a BCSD Officer!");
return (1);
}

Jonny5
05/04/2012, 03:34 PM
change this

new vehicleid = GetPlayerVehicleID(playerid);
AddVehicleComponent(154, 1010); // x10 nitro

to this

new vehicleid = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehicleid , 1010); // x10 nitro


you where only adding it to veh 154

as a side note you may want to make sure a vehicle can use nitro and also see if it
already has it.

regards,

.FuneraL.
05/04/2012, 03:34 PM
Top of Script :

new TuneCar[MAX_PLAYERS];

Command :

CMD:nitro(playerid, params[])
{
if(GetPlayerSkin(playerid) == 59 || GetPlayerSkin(playerid) == 285 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 288)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "(INFO) You are not in a vehicle!");
TuneCar[playerid] = GetPlayerVehicleID(playerid);
AddVehicleComponent(TuneCar[playerid], 1010); // x10 nitro
SendClientMessage(playerid, COLOR_GOLD, "(INFO) Your vehicle has been equipped with a nitro!");
}
else return SendClientMessage(playerid, COLOR_RED, "(INFO) You are not a BCSD Officer!");
return (1);
}

Try This.

Wickeed
05/04/2012, 03:35 PM
Try this:

CMD:nitro(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFF0000AA,"You are not in a vehicle!");
if(GetVehicleComponentInSlot(GetPlayerVehicleID(pl ayerid),GetVehicleComponentType(1010)) != 1010) // Check if the vehicle has no nitro
{
AddVehicleComponent(GetPlayerVehicleID(playerid),1 010);
PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
}
return 1;
}

This working for me :)

Jonny5
05/04/2012, 03:36 PM
why does he need an array for this?
its just a waste!!!!

Bogdan1992
05/04/2012, 03:48 PM
change this

new vehicleid = GetPlayerVehicleID(playerid);
AddVehicleComponent(154, 1010); // x10 nitro

to this

new vehicleid = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehicleid , 1010); // x10 nitro


you where only adding it to veh 154

as a side note you may want to make sure a vehicle can use nitro and also see if it
already has it.

regards,


This!

SkyWings
05/04/2012, 03:55 PM
change this

new vehicleid = GetPlayerVehicleID(playerid);
AddVehicleComponent(154, 1010); // x10 nitro

to this

new vehicleid = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehicleid , 1010); // x10 nitro


you where only adding it to veh 154

as a side note you may want to make sure a vehicle can use nitro and also see if it
already has it.

regards,

This script is working, i tested it.