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: getelementdata
1. getElementData
Zrobi?em system leveli tak:

[lua]
addEventHandler('onPlayerLogin',root,function(_,acc)
local EXP = getAccountData(acc,'EXP') or 0
setElementData(source,'EXP',tonumber(EXP))
local LEVEL = getAccountData(acc,'LEVEL') or 1
setElementData(source,'LEVEL',tonumber(LEVEL))
end)

addEventHandler('onPlayerQuit',root,function()
local acc = getPlayerAccount(source)
if not acc then return end
setAccountData(acc,'EXP',tonumber((getElementData(source,'EXP') or 0)))
setAccountData(acc,'LEVEL',tonumber((getElementData(source,'LEVEL') or 1)))
end)


addCommandHandler('level',function(plr)
local exp = getElementData(plr,'EXP') or 0
local level = getElementData(plr,'LEVEL') or 1
outputChatBox("Masz : "..exp.." EXP oraz "..level.." Level", plr)
end)

addCommandHandler('ustaw.EXP',function(player,cmd,target,ilosc)
local acc = getPlayerAccount(player)
if not acc then return end
if isObjectInACLGroup ("user."..getAccountName(acc), aclGetGroup ( "Admin" ) ) then
local target = getPlayerFromName(target)
if not target then
outputChatBox("#dddddd*#FF0000 Nie wybrano celu!",player,255,0,0,true)
return
end
if not tonumber(ilosc) then
outputChatBox("#dddddd*#FF0000 Nie podano ilosci EXP!",player,255,0,0,true)
return
end
setElementData(target,'EXP',tonumber(ilosc))
outputChatBox('Ustawiono '..ilosc..' #dddddd EXP graczu o nicku #FF0000'..getPlayerName(target):...
2. getElementData
Witam ponownie, przy pobieraniu eldaty "przecho:id" niestety ale jej nie pobiera, lecz przy wchodzeniu w marker ?adnie wszystko jest pobierane tylko tutaj co? nie chce ?miga?.

function getCarsFromOrg()
    if 
source ~= wm.combo_rodzaj then return end
    local id 
getElementData(source,"przecho:id")
    if 
not id then outputChatBox("// Wkr?tce") return end
    local item 
guiComboBoxGetSelected(wm.combo_rodzaj)
    
local text guiComboBoxGetItemText(wm.combo_rodzajitem)
    
outputChatBox(item)
    if 
item == 0 then
    triggerServerEvent
("onParkingGetRekords5"root,id)
    
ID_PRZECHO_DO_JAKIEJ_WLAZLES id
    
elseif item == 1 then
    guiGridListClear
(wm.gridlist)
    
triggerServerEvent("onParkingGetRekordsOrg5"root,id)
    
end
end 
addEventHandler 
"onClientGUIClick"rootgetCarsFromOrg)



tutaj jest ona nadawana:
{{700.57, -1567.4614.24+0.3},setElementData(createMarker(700.57, -1567.4614.24-0.99"cylinder"2255,255,255,50),"przecho:id",4),{['Automobile']=true,['Bike']=true,['BMX']=true,['Quad']=true,['Monster Truck']=true,},"Samochody i motocykle",createColCuboid(693.15, -1574.9212.608.907.7014.52),{695.55, -1571.5114.120.0360.0359.6}},
3. Porblem z getElementData
Witam. Mam problem z getElementData, robi? skrypt na suszark?, lecz niekt?re kolumny dzia?aj? a niekt?re nie. Na przyk?ad. dzia?a w?a?ciciel, id pojazdu, ile l paliwa jest w baku, pojemno?? baku, a nie dzia?a model, marka pojazdu. Brak b??d?w w DB3.

Tutaj kod
function isRendering()
    if 
option.actived == true then
        
if not element then return end
        local vx
,vy,vz=getElementVelocity(element)
        --
ID POJAZDU
        local id
=getElementData(element,"vehicle:id") or "Pojazd Publiczny"
        
--W?A?CICIEL POJAZDU
        local wlasciciel 
getElementData(element,"vehicle:driver") or "Pojazd Publiczny"
        
--MARKA POJAZDU
        local marka 
getElementData(element,"vehicle:marka") or "B??d"
        
--MODEL POJAZDU
        local model 
getElementData(element,"vehicle:model") or "B??d"
        
mathSpeed=(vx^2+vy^2+vz^2)^0.5*1.8*100
        
if mathSpeed 0 then return end
        
if value == "vehicle" then
4. getelementdata
Siemka, mam problem dotycz?cy pobierania eldaty a dok?adnie:



elementdata nadawana jest przy respie. HELP
addEventHandler("onPlayerSpawn"root,
  function()
    
local sid getElementData(source,"player:sid") --- To jest ta linijka 
    
if not sid then
      
return
    
end
    
if (getElementData(source"plec")>0then
      
return
    
end
    setTimer
(triggerClientEvent30001source"evc"resourceRoot"wlacz_okno",true)
    --
triggerClientEvent(plr,"evc",resourceRoot,"wlacz_okno",true)
  
end
)
5. element w getElementData
cze??, po wywo?aniu zdarzenia przez gracza getElementData nie chce pobra? jego id, w debugu napisane mam, ?e nie podano elementu jako 1 argument, a takowy zosta? podany. kod:

Kod:


addEvent("mandat", true)
addEventHandler("mandat", root, function()

local id=getElementData(localPlayer,"gracz:id")
if not id then return end

end
)
6. getElementData
Witam, jak mam sprawdzic jaki pojazd ma element date "NaPatrolu" ?? Bo chce go wybrac z parkingu interaktywnego :D
7. GetElementData
Witajcie, posiadam element date do typu silnika do pojazd?w a wygl?da ona tak setElementData(pojazd,"typ","tu z bazy pobiera czy benzyna czy diesel")
i chc? u?y? tego w ten spos?b:

typ = getElementData(pojazd,"typ")
if typ == "Diesel" then
end

Niestety nie wiem czemu to nie dzia?a, w czym jest problem? DB3 Czyste
8. getElementData
Witam mam problem z tym kodem:


function render()
        
local now getTickCount()
        
local endTime start 2000
        local elapsedTime 
now start
        local duration 
endTime start
        local progress 
elapsedTime duration
        local fAnimationTime 
getEasingValue(progress"Linear")
        if 
alpha and alpha <= 255 then
        alpha 
= (1+fAnimationTime)*50
        end
        
if alpha2 and alpha2 <= 162 then
        alpha2 
= (1+fAnimationTime)*50
        end
        guiSetAlpha
(button,alpha*0.005)
        
local whours getElementData(localPlayer,"player:workinjob")    
        
local kasa getElementData(localPlayer,"player:bank_money")    
        
local date getElementData(localPlayer,"player:registerdate") or "0000-00-00 00:00:00"
        
local premiumdate getElementData(localPlayer,"player:premiumdate") or "Brak"
        
local prawkoB getElementData(localPlayer,"player:pjB") or "Brak"
        
local prawkoC getElementData(localPlayer,"player:pjC") or "Brak"
        
local prawkoL getElementData(localPlayer,"player:pjL") or "Brak"




TUTAJ KOD GUI

        
   end


W panelu nie wy?wietla si? nic innego opr?cz minut na s?u?bie, daty rejestracji oraz terminu premium. Zna kto? rozwi?zanie?
9. getElementData
Witajcie :P Zrobi?em wiadomo?ci kt?re wy?wietlaj? si? w staticimage, jest do nich przypisana ElementData, wszystko dzia?a jak nale?y lecz jest BadArgument tego:
if getElementData(v,"Wiadomosc"then

Dlaczego?

Od razu powiem ?e ElementData jest przypisana do tego i to dzia?a, bo jak usun? ten if to usuwa mi ca?e GUI RPG xD ( jest zrobione na staticimage )

function usunWyswietlaneWiadomosci(
    for 
_,v in ipairs(getElementsByType("gui-staticimage")) do
        if 
getElementData(v,"Wiadomosc"then
            destroyElement
(v)
        
end
    end
end


Oczywi?cie za pomoc leci :arrow: :arrow: :piwo:
10. onClientRender i getElementData
Mam pytanko, czy getElementData przy zdarzeniu onClientRender powoduje jakie? spadki FPS ? I czy to optymalne ?
11. getElementData zwraca false
Witam, nie wiem dlaczego ustawiam warto?? tak: setElementData(pojazd,"veh:spawned",v.spawned) oczywi?cie v.spawned ==1

a jak daje:

for k,v in ipairs(getElementsByType("vehicle"))do
local test getElementData(v,"veh:spawned")
outputChatBox(tostring(test))--zwraca false
end

Dlaczego to zwraca false ?
12. getElementData
Witam was wszystkich, jak si? nazywa source po stronie klienta. My?la?em ?eby zrobi? to tak, ale nie podzia?a?o:
local slot1 getElementData(localplayer"Ekw:slot1")
13. getElementData
witam podczas tworzenia pewnego skryptu natkn??em si? na drobn? przeszkode przy odczycie danych mianowicie:

CLIENT:

Kod:

local auto = getPedOccupiedVehicle ( thePlayer )
local gracz = getLocalPlayer ()
function daj1( thePlayer, auto, gracz )
if auto then
if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin")) then
setElementData(auto, "info", false)
end
end
end
addCommandHandler("daj",daj1)

function zobacz( thePlayer, gracz, info )
if getElementData(auto, "info") == true then
outputChatBox("Pojazd ma warto?? A!")
else
outputChatBox("Pojazd ma warto?? B!")
end
end
addCommandHandler("zobacz",zobacz)


dok?adnie to ta linijka:

if getElementData(auto, "info") == true then

i b??d przy pr?bie odczytu:

Bad Argument getElementData Expected element at argument 1 got boolean

z tego wnioskuj? ?e jest przy tym z?y argument :)

jakie? sugestie?