[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):...
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?.
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
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")>0) then return end
setTimer(triggerClientEvent, 3000, 1, source, "evc", resourceRoot, "wlacz_okno",true)
--triggerClientEvent(plr,"evc",resourceRoot,"wlacz_okno",true) end )
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:
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
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?
Witajcie 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
witam podczas tworzenia pewnego skryptu natkn??em si? na drobn? przeszkode przy odczycie danych mianowicie:
CLIENT:
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