Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: interakcję
1. pasazer widzi interakcje
[lua]
local dx = exports.ad_dx;
local font = dx:getFont("rbt-b", 10);
local font2 = dx:getFont("rbt-r", 4);
local font3 = dx:getFont("rbt-r", 5);

local sw,sh = guiGetScreenSize();
local baseX = 1920;
local zoom = 1;
local minzoom = 2;
if sw < baseX then
zoom = math.min(minzoom, baseX/sw);
end;

local selected = 1;
local tick = getTickCount();
local interaction = {};
local type_i = "join"

local a1,a2,a3 = 0,0,0;

local textures = { -- Teksturki
"img/I_brutto.png",
"img/I_engine.png",
"img/I_handbrake.png",
"img/I_getout.png",
"img/I_carlock.png",
"img/bagaznik.png",
"img/maska.png",
"img/I_leftbutton.png",
"img/I_rightbutton.png",
"img/I_spacebutton.png",

};

local tbl = {
[1] = "light",
[2] = "engine",
[3] = "handbrake",
[4] = "cancel",
[5] = "leave",
[6] = "lock",
[7] = "bagaznik",
[8] = "maska",

};

local img = {} -- Wszystkie tekstury
for i,v in pairs(textures) do
img[i] = dxCreateTexture(v, "argb", false, "clamp")
end

function isEventHandlerAdded( sEventName, pElementAttachedTo, func )
local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo )
if #aAttachedFunctions > 0 then
for i, v in ipairs( aAttache...
2. Interakcje
Witam, dzi? przychodz? z czym? nie co trudniejszym. A mianowicie, mam pytanie, jak zrobi? interakcj? z jakim? elementem. Naprzyklad podchodz? do samochodu, klikam na niego kursorem i wy?wietla mi si? GUI w kt?rym b?d? m?g? sobie otworzy? drzwi. Lub podchodz? do PED'a i tak samo klikam na niego i pokazuje mi si? GUI. Mam nadziej? ?e zrozumia? kto?. Z g?ry dzi?kuj? za pomoc. Pomocne odpowiedzi wynagrodze :piwo: i R*
3. Mam Interakcje i nie mogę odpalić pojazdu !!!
[lua] local w,h = guiGetScreenSize()
local rowery = {[509]=true,[481]=false,[510]=true}

function gui()
local v = getPedOccupiedVehicle(localPlayer)
local x,y,z = getElementPosition(v)
r = getGroundPosition(x,y,z)


if getVehicleOverrideLights(v) ~= 2 then
w1 = "Zapal swiatla"
else
w1 = "Zgas swiatla"
end

local silnik = getVehicleEngineState(v)
if silnik == false then
w2 = "Zapal silnik"
else
w2 = "Zgas silnik"
end

w3 = "Wysad? pasa?er?w"

if isElementFrozen(v) then
w4 = "Spusc reczny"
else
w4 = "Zaciagnij reczny"
end

if getVehicleDoorOpenRatio(v,0) == 0 then
w5 = "Otworz maske"
else
w5 = "Zamknij maske"
end

if getVehicleDoorOpenRatio(v,1) == 0 then
w6 = "Otworz bagaznik"
else
w6 = "Zamknij bagaznik"
end

r1,r2,r3,r4,r5,r6 = 0.9,0.9,0.9,0.9,0.9,0.9
local wybor = getElementData(localPlayer,"wybor")
if wybor == 1 then
r1 = 1.5
elseif wybor == 2 then
r2 = 1.2
elseif wybor == 3 then
r3 = 1.2
elseif wybor == 4 then
r4 = 1.2
elseif wybor == 5 then
r5 = 1.2
elseif wybor == 6 then
r6 = 1.5
end

local sx,sy,sz = getElementVelocity(v)
local kmhs = math.ceil(((sx^2+sy^2+sz^2)^(0.5))*155)
if kmhs < 20 then
setElementData(localPlayer,"maxwybor",6...