Jump to content

ayuda elementData


Plate

Recommended Posts

Posted

hola tengo un problema es que este script no da error pero tampoco funciona

function todos() 
for i, k in ipairs(getElementsByType("player")) do 
setElementData(k, "EXPEvent250", true) 
end 
end 
addEvent("onEvent250", true) 
addEventHandler("onEvent250", getRootElement(), todos) 

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Como ejecutas "onEvent250"?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
function checkSelected() 
if (guiRadioButtonGetSelected(evento1)) then 
triggerServerEvent("onEvent250", localPlayer) 
elseif (guiRadioButtonGetSelected(evento2)) then 
triggerServerEvent("onEvent500", localPlayer) 
elseif (guiRadioButtonGetSelected(evento3)) then 
triggerServerEvent("onEvent750", localPlayer) 
elseif (guiRadioButtonGetSelected(evento4)) then 
triggerServerEvent("onEvent1000", localPlayer) 
end 
end 
addEventHandler("onClientGUIClick", todos, checkSelected, false) 

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted
addEventHandler("onClientGUIClick", todos, checkSelected, false) 

Que es 'todos' ahi?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Y como sabes que no funciona?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Tengo una grid (ya testeada y se que funciona) que pone a los jugadores con la elementData "EXPEvent250" en ella

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted
function todos ( ) 
    for _, k in ipairs(getElementsByType("player")) do 
        if setElementData ( k, "EXPEvent250", true ) then 
            outputChatBox ( "ELEMENT DATA" ) 
        end 
    end 
end 
addEvent ( "onEvent250", true ) 
addEventHandler ( "onEvent250", getRootElement(), todos ) 

Fijate a ver que dice.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Podrias mencionar cual era el problema?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Sip era esto mira

function setGridEvent() 
guiGridListClear(expGrid) 
for i, k in ipairs(getElementsByType("player")) do 
if getElementData(k, "EXPEvent250") then 
elseif getElementData(k, "EXPEvent500") then 
elseif getElementData(k, "EXPEvent750") then 
elseif getElementData(k, "EXPEvent1000") then 
local name = getPlayerName ( k ):gsub ( "#%x%x%x%x%x%x", "" ) 
local row = guiGridListAddRow ( expGrid ) 
guiGridListSetItemText ( expGrid, row, 1, name, false, false ) 
end 
end 
end 
addEvent("onClientEXPEvent", true) 
addEventHandler("onClientEXPEvent", getRootElement(), setGridEvent) 
addEventHandler("onClientPlayerJoin", getRootElement(), setGridEvent) 
addEventHandler("onClientResourceStart", getRootElement(), setGridEvent) 

no entiendo por que si me lo podrias arreglar te lo agradeceria

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted
if getElementData(k, "EXPEvent250") then 
elseif getElementData(k, "EXPEvent500") then 
elseif getElementData(k, "EXPEvent750") then 
elseif getElementData(k, "EXPEvent1000") then 

Me parece que lo que queres usar es:

if getElementData(k, "EXPEvent250") or getElementData(k, "EXPEvent500") or getElementData(k, "EXPEvent750") or getElementData(k, "EXPEvent1000") then 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Si muchas gracias pero alguna idea de como detener el evento usando getRealTime()? osea hay una edit que vos pones los minutos de evento que queres quisiera que el evento parara despeus de esos minutos que puedo usar??

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Usa un timer:

setTimer 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Para el edit? pero tendrian que poner enves de 1 minuto 60000

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

No, podes hacer una multiplicacion:

local minutes = tonumber ( guiGetText ( editBox ) ) or 1 
local milliseconds = ( minutes * 60000 ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

No sabia que se pueden hacer multiplicaciones gracias por el dato solid

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Eso es algo muy obvio, no te ofendas.

De nada.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...