Horizontal: 581,509,481,462,521,463,510,522,461,448,471,468,586 Vertical: 581 509 481 462 521 436 510 522 461 448 471 468 586
if(bikeid == 581 || bikeid == 509 || bikeid == 481 [....] || bikeid == 586)
== equals != differs || or && and
if (!strcmp (cmdtext,"/nos", true))
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehid;
vehid = GetPlayerVehicleID(playerid);
if(vehid != 581 || vehid != 509 || vehid != 481 || vehid != 462 || vehid != 521 || vehid != 436 || vehid != 510 || vehid != 522 || vehid != 461 || vehid != 448 || vehid !=471 || vehid !=468 || vehid != 586)
{
AddVehicleComponent(vehid,1010);
return 1;
}
return SendClientMessage(playerid,0xFF0000FF,"Invalid vehicle!(probably a bike)");
}
return SendClientMessage(playerid,0xFF0000FF,"Enter a vehicle first!");
}
Originally Posted by Coolman12
can you see the error?
|
if (!strcmp (cmdtext,"/nos", true))
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehid, modid;
vehid = GetPlayerVehicleID(playerid);
modid = GetVehicleModel(vehid);
if(modid != 581 && modid != 509 && modid != 481 && modid != 462 && modid != 521 && modid != 436 && modid != 510 && modid != 522 && modid != 461 && modid != 448 && modid != 471 && modid != 468 && modid != 586)
{
AddVehicleComponent(vehid,1010);
return 1;
}
return SendClientMessage(playerid,0xFF0000FF,"Invalid vehicle!(probably a bike)");
}
return SendClientMessage(playerid,0xFF0000FF,"Enter a vehicle first!");
}
if (!strcmp (cmdtext,"/nos", true))
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehid;
new vehicle;
vehid = GetVehicleModel(vehicle);
vehicle = GetPlayerVehicleID(playerid);
if(vehid != 581 || vehid != 509 || vehid != 481 || vehid != 462 || vehid != 521 || vehid != 436 || vehid != 510 || vehid != 522 || vehid != 461 || vehid != 448 || vehid != 471 || vehid != 468 || vehid != 586)
{
AddVehicleComponent(vehid,1010);
return 1;
}
return SendClientMessage(playerid,0xFF0000FF,"Invalid vehicle!(probably a bike)");
}
return SendClientMessage(playerid,0xFF0000FF,"Enter a vehicle first!");
}
if(strcmp(cmdtext,"/nos",true)==0) { if(IsPlayerInInvalidNosVehicle(playerid)) { SendClientMessage(playerid,0xFFFF00FF,"You can't add nitro to this car."); return 1; } if(IsPlayerInAnyVehicle(playerid)) { if(GetPlayerState(playerid) == 2) { AddVehicleComponent(GetPlayerVehicleID(playerid),1010); SendClientMessage(playerid,0x00FF00FF,"Your car now has nitro."); return 1; } else { SendClientMessage(playerid,0xFFFF00FF"You must be the driver of the vehicle in order to add nitro."); return 1; } } else { SendClientMessage(playerid,0xFFFF00FF,"Seriously... you have to be in a vehicle to add nitro."); return 1; } }
stock IsPlayerInInvalidNosVehicle(playerid) { new vehicleid = GetPlayerVehicleID(playerid); if(IsPlayerInAnyVehicle(playerid)) { for(new i = 0; i < MAX_INVALID_NOS_VEHICLES; i++) { if(GetVehicleModel(vehicleid) == InvalidNosVehicles[i]) { return true; } } } return false; }
native IsPlayerInInvalidNosVehicle(playerid); new InvalidNosVehicles[MAX_INVALID_NOS_VEHICLES] = { 581,523,462,521,463,522,461,448,468,586,417,425,469,487,512,520,563,593, 509,481,510,472,473,493,520,595,484,430,453,432,476,497,513,533,577, 452,446,447,454,590,569,537,538,570,449,519,460,488,511,519,548,592 };
new bikes[] = { 581, 523, 462, 521, 463, 522, 461, 448, 468, 586, 509, 481, 510, 471, 539};
IsABike(carid)
{
carid=GetVehicleModel(carid);
for(new i=0;i<sizeof(bikes);i++)
{
if(carid==bikes[i]){return 1;}
}
return 0;
}
if(!IsABike(vehid)
{
// add the shit
}
else
{
// you kow if it is a bike =)
}