Код:
if(strcmp(cmd,"/car",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED, "You are not driving a vehicle!");
new vehicleid = GetPlayerVehicleID(playerid);
if(IsBicycle(vehicleid)) return SendClientMessage(playerid, COLOR_RED, "You are not driving a vehicle!");
new id = GetVehicleID(vehicleid);
if(GetPlayerVehicleAccess(playerid, id) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have the keys for this vehicle!");
SetPVarInt(playerid, "DialogValue1", id);
ShowDialog(playerid, DIALOG_VEHICLE);
new carpart[64];
carpart = strtok(cmdtext, idx);
if(!strlen(carpart))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /car [name]");
SendClientMessage(playerid, COLOR_GREY, "Available names: Engine, Lights, Hood, Trunk, FillTank");
return 1;
}
else if(strcmp(carpart,"engine",true) == 0)
{
new vehicleid = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(engine == 0 && Fuel[vehicleid] <= 0)
{
ShowErrorDialog(playerid, "This vehicle is out of fuel!");
return 1;
}
if(engine == 1) { engine = 0; lights = 0; }
else { engine = 1; lights = 1; }
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
}
else if(strcmp(carpart,"lights",true) == 0)
{
new vehicleid = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(lights == 1) lights = 0; else lights = 1;
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
}
else if(strcmp(carpart,"hood",true) == 0)
{
new vehicleid = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(bonnet == 1) bonnet = 0; else bonnet = 1;
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
}
else if(strcmp(carpart,"trunk",true) == 0)
{
new vehicleid = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(boot == 1) boot = 0; else boot = 1;
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
}
else if(strcmp(carpart,"filltank",true) == 0)
{
if(!GetPVarInt(playerid, "GasCan"))
{
ShowErrorDialog(playerid, "You don't have a gas can!");
return 1;
}
new vehicleid = GetPlayerVehicleID(playerid);
if(Fuel[vehicleid] < 80.0) Fuel[vehicleid] += 20.0;
else Fuel[vehicleid] = 100.0;
SetPVarInt(playerid, "GasCan", 0);
SendClientMessage(playerid, COLOR_WHITE, "You have filled the fuel tank with 20 fuel");
}
}
return 1;
}
}
Remove them and I will try and help you.
I removed it...i dont know why it appeared here xd its not like that in script
I added it. And when i add it then it comes undefined symbol "idx"
-may i just simpli give you the pastebin of whole Fs and you guys try to fix it. But dont delete anything. Just remove errors xd