TogglePlayerControllable bug - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP (
https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: Bug Reports (
https://sampforum.blast.hk/forumdisplay.php?fid=20)
+--- Thread: TogglePlayerControllable bug (
/showthread.php?tid=494274)
TogglePlayerControllable bug -
Gigi-The-Beast - 12.02.2014
Hello
There is a bug with TogglePlayerControllable and vehicles.
If you break your car, when its HP is 250 or less, the car will start to burn.
If you then use TogglePlayerControllable, the car will stop burning.
EDIT
Код:
YCMD:setv(playerid,params[],help)
{
new Float:hp = strval(params);
SetVehicleHealth(GetPlayerVehicleID(playerid),hp);
return 1;
}
public OnPlayerUpdate(playerid)
{
new Float:VehHP;
new string[128];
GetVehicleHealth(GetPlayerVehicleID(playerid),VehHP);
format(string,sizeof(string),"ID:%d - HP:%f",GetPlayerVehicleID(playerid),VehHP);
SendClientMessage(playerid,COLOR_WHITE,string);
return 1;
}
You can use this code to simulate the bug, just set the vehicle Hp to a lower value than 250.
You will see that the car instantly fixes to 300.0 HP.
EDIT2:
Even if you leave the car and then use TogglePlayerControllable, it will still repair to 300.0 HP.
I didn't test this with more players.