30.05.2013, 11:13
how do i create a CMD:NOS that lets players put nos in there vehicle
CMD:nos(playerid,params[])
{
#pragma unused params
if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
{
switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
{
case 448,461,462,463,468,471,509,510,521,522,523,581,586,449:
return SendClientMessage(playerid,-1,"ERROR: You can not tune this vehicle!");
}
AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
}else return SendClientMessage(playerid,-1,"ERROR: You must be in a vehicle.");
return 1;
}
CMD:nos(playerid,params[]) {
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,-1,"Get in a vehicle");
AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
SendClientMessage(playerid,-1,"Nos added");
return 1;
}
CMD:nos(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid))
return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle.");
new vehicleID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehicleID, 1010); // Nitro
SendClientMessage(playerid, 0xFFFFFFFF, "The nitro has been installed in your vehicle.");
return 1;
}