Tematy otagowane jako: getelementhealth
1. getElementHealth
Witam, testuje sobie ostatnim czasem event vehicle damage.Tylko nie wiem czemu db wywala.
kod:
local vehicle = getPedOccupiedVehicle ( client )
function new ()
local hp = getElementHealth ( vehicle )
if hp < 500 then
outputChatBox ( "co? tam" )
end
end
addEventHandler ( "onVehicleDamage" , root , new)
DB 3:
[20-08-26 22] ERROR: [skrypciory]/Silniki/s.lua:4: attempt to compare boolean with number
2. getElementHealth
Witam, mam taki problem ?e chcem zrobi? ?e je?li auto ma mniej ni? 500 hp to si? powinien attachowa? marker do niego.Pr?bowa?em zrobi? lecz nie wiem czemu mi nie dzia?a.
local marker = createMarker (- 1753.71 , 885.03 , 295.88 - 1 , "cylinder" , 1.5 , 0 , 255 , 0 , 255 )
local auto = getPedOccupiedVehicle ( localPlayer )
if auto then
local hp = getElementHealth ( auto )
if hp < 500 then
attachElements ( marker , auto , 0 , 0 , 0 )
end
end
3. setElementHealth i getElementHealth
Witam, robie zapis stanu auta i mam proble poniewa? jak zapisuje dane auta do sqlite to po restarcie skryptu pojazdy wybuchaj? db3 czyste
Ustawianie
setElementHealth( auto , "hppojazd" , v [ "hpauta" ])
Sprawdzanie
local autohp = getElementHealth ( v , "hppojazd" )