Trzecim moim problemem jest Suszarka.
Rzecz jest w tym, ?e wysiadaj?c z auta ona przestaje dzia?a? i nie sprawdza kogo to pojazd tak jak powinna to robi?.
[lua]local sw,sh = guiGetScreenSize()
function onSuszarka(target)
if target then
if getElementType(target) == "vehicle" then
vehicle = target
end
end
end
addEventHandler ("onClientPlayerTarget", getRootElement(), onSuszarka)
function wlaczLPM()
render = true
end
bindKey ("mouse1", "down", wlaczLPM)
function wylaczLPM()
render = false
end
bindKey ("mouse1", "up", wylaczLPM)
function dxDrawSuszarkaInfo()
if render then
if vehicle then
if isElement(vehicle) then
--if getPlayerTeam(localPlayer) == getTeamFromName("Policja") then --zamiast Policja dowolna nazwa teamu, wazne by w cudzyslowiu (i taki team faktycznie istnial )
if getPedWeapon(localPlayer) == 22 then
local x, y, z = getElementPosition(localPlayer)
local tx, ty, tz = getElementPosition(vehicle)
local dis = getDistanceBetweenPoints3D(x, y, z, tx, ty, tz)
local id = getElementData(vehicle, "car_id") or "Brak ID pojazdu"
local wl = getElementData(vehicle, "car_owner") or "Brak W?a?cicela"
if 80 >= dis then --jestesmy dosyc blisko gracza
local kmh = getVehicleSpeed(vehicle)
dxDrawRectangle(1115/1440*sw, 401/900*sh,... |