CMD:repair(playerid, params[]){ new parancs[30]; if(sscanf(params, \"s\", parancs)) return SendClientMessage(playerid, -1, \"Használat: /repair [engine, panels, doors, lights, tires]\"); new vehicleid, panels, doors, lights, tires; vehicleid = GetPlayerVehicleID(playerid); GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires); if(strfind(parancs,\"engine\", true,0) != -1) { SetVehicleHealth(vehicleid, 1000); // Motor } if(strfind(parancs, \"panels\", true,0) != -1) { panels = encode_panels(0, 0, 0, 0, 0, 0, 0); // Karosszéria UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires); } if(strfind(parancs, \"doors\", true,0) != -1) { doors = encode_doors(0, 0, 0, 0, 0, 0); // Csomagtartó, Motorháztető, Ajtók UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires); } if(strfind(parancs, \"lights\", true,0) != -1) { lights = encode_lights(0, 0, 0, 0); // Fényszórók } if(strfind(parancs, \"tire\", true,0) != -1) { tires = encode_tires(0, 0, 0, 0); // Kerekek UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires); } return 1;}encode_tires(tire1, tire2, tire3, tire4){ return tire1 | (tire2 << 1) | (tire3 << 2) | (tire4 << 3);}encode_panels(flp, frp, rlp, rrp, windshield, front_bumper, rear_bumper){ return flp | (frp << 4) | (rlp << | (rrp << 12) | (windshield << 16) | (front_bumper << 20) | (rear_bumper << 24);}encode_doors(bonnet, boot, driver_door, passenger_door, behind_driver_door, behind_passenger_door){ #pragma unused behind_driver_door #pragma unused behind_passenger_door return bonnet | (boot << | (driver_door << 16) | (passenger_door << 24);}encode_lights(light1, light2, light3, light4){ return light1 | (light2 << 1) | (light3 << 2) | (light4 << 3);}
if(sscanf(params, \"s\", parancs))
if(sscanf(params, \"s[32]\", parancs))
new parancs[30]
new parancs[32]
az a bugg ha megtörik az ajtó, lámpa, lökös stb. akkor elsőnek a lámpát kell utána meg be kell írni az ajtó meg a karosszéria parancsot és csak akkor javul meg (már nem zcmd-t használok)
if(sscanf(params, \"s[30]\", parancs)) return SendClientMessage(playerid, -1, \"Használat: /repair [engine, panels, doors, lights, tires]\");
én csak segítettem de te leszólod, más is látod beírta h ez is a fő baj...... :mistrust: