16.08.2013, 19:17
Hello. I have this strange problem. I added 5 vehicles and a stock to check if vehicleid is equal to any of the vehicles. When I try to use this stock in any vehicle which isn't equal to created vehicles, the command won't perform, it just says that command isn't on the server.
This are vehicles:
this is stock:
and command for example:
When I'm not in any vehicle, I get message you must be in veh... and when I go on some bike for example and try to enter the command, I command does not exist on the server. Please does anyone know why is this happening? I really don't know how to fix. Thank you
This are vehicles:
Код:
JobInfo[JOB_TRUCKER][jCars][0] = CreateVehicle(515,-2117.6001000,-175.3000000,36.5000000,270.0000000,6,0,300); //Roadtrain JobInfo[JOB_TRUCKER][jCars][1] = CreateVehicle(515,-2117.5000000,-165.3000000,36.5000000,270.0000000,6,0,300); //Roadtrain JobInfo[JOB_TRUCKER][jCars][2] = CreateVehicle(515,-2117.5000000,-154.7998000,36.5000000,270.0000000,6,0,300); //Roadtrain JobInfo[JOB_TRUCKER][jCars][3] = CreateVehicle(515,-2137.3000500,-131.8000000,36.5000000,0.0000000,6,0,300); //Roadtrain JobInfo[JOB_TRUCKER][jCars][4] = CreateVehicle(515,-2105.0000000,-186.8000000,36.5000000,0.0000000,6,0,300); //Roadtrain JobInfo[JOB_TRUCKER][jCars][5] = CreateVehicle(515,-2144.1999500,-131.8000000,36.5000000,0.0000000,6,0,300); //Roadtrain
Код:
stock IsTruckerVehicle(vehicleid) { for(new i=0; i<20; i++) { if(vehicleid == JobInfo[JOB_TRUCKER][jCars][i]) return 1; } return 0; }
Код:
CMD:istruckerveh(playerid, params[]) { if(IsPlayerInAnyVehicle(playerid)) { new veh = GetPlayerVehicleID(playerid); if(IsTruckerVehicle(veh)) SendClientMessage(playerid, COLOR_PINK, "Yes."); else SendClientMessage(playerid, COLOR_PINK, "Nope."); } else SendClientMessage(playerid, COLOR_WHITE, "You must be in vehicle to use this command."); return 1; }