UpdateVehicleDamageStatus not update - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: UpdateVehicleDamageStatus not update (
/showthread.php?tid=615642)
UpdateVehicleDamageStatus not update -
n00el - 25.08.2016
Hello..
I have a small test code.
Код:
CMD:test(playerid, params[])
{
new vehicleid = GetPlayerVehicleID(playerid);
new panels, doors, lights, tires;
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
new bonnet, boot, driver_door, passenger_door;
decode_doors(doors, bonnet, boot, driver_door, passenger_door);
doors = encode_doors(bonnet, boot, 0, passenger_door);
UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
return 1;
}
When I am in a vehicle and break a driver's door, and use this command, thets not doing anything until i respawn a vehicle? Why? How to do its working without I need to respawn the vehicle to see, the driver's door is now repaired and good?!
Re: UpdateVehicleDamageStatus not update -
DarkSkull - 25.08.2016
If you want to repair the vehicle you can use the function
RepairVehicle()
PHP код:
CMD:test(playerid, params[])
{
new vehicleid = GetPlayerVehicleID(playerid);
RepairVehicle(vehicleid);
return 1;
}
Ofcourse you need to do the checks to see if the player is in a vehicle and all.
Re: UpdateVehicleDamageStatus not update -
DeeadPool - 25.08.2016
Here the code:-
PHP код:
CMD:test(playerid, parmas[])
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "You can only use this command when you are in a vehicle!");// Checks if the player is in a vehicle or not. If yes, it will show the player an error message.
RepairVehicle(playerid);//repairs the vehicle.
SendClientMessage(playerid, -1, "Vehicle successfully repaired!");//Sends the clientmessage about the vehicle to be repaired.
return 1;
}