Plate Posted May 13, 2013 Share Posted May 13, 2013 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) Link to comment
Lucario Posted May 13, 2013 Share Posted May 13, 2013 Pasa el client side tambien, puede que sea problema con eso, si no tienes el client no funcionara Link to comment
Plate Posted May 14, 2013 Author Share Posted May 14, 2013 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) Link to comment
Castillo Posted May 14, 2013 Share Posted May 14, 2013 addEventHandler("onClientGUIClick", todos, checkSelected, false) Que es 'todos' ahi? Link to comment
Plate Posted May 14, 2013 Author Share Posted May 14, 2013 Tengo una grid (ya testeada y se que funciona) que pone a los jugadores con la elementData "EXPEvent250" en ella Link to comment
Castillo Posted May 14, 2013 Share Posted May 14, 2013 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. Link to comment
Plate Posted May 14, 2013 Author Share Posted May 14, 2013 ya lo arregle gracias solid Link to comment
Castillo Posted May 14, 2013 Share Posted May 14, 2013 Podrias mencionar cual era el problema? Link to comment
Plate Posted May 14, 2013 Author Share Posted May 14, 2013 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 Link to comment
Castillo Posted May 15, 2013 Share Posted May 15, 2013 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 Link to comment
Plate Posted May 15, 2013 Author Share Posted May 15, 2013 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?? Link to comment
Plate Posted May 15, 2013 Author Share Posted May 15, 2013 Para el edit? pero tendrian que poner enves de 1 minuto 60000 Link to comment
Castillo Posted May 15, 2013 Share Posted May 15, 2013 No, podes hacer una multiplicacion: local minutes = tonumber ( guiGetText ( editBox ) ) or 1 local milliseconds = ( minutes * 60000 ) Link to comment
Plate Posted May 15, 2013 Author Share Posted May 15, 2013 No sabia que se pueden hacer multiplicaciones gracias por el dato solid Link to comment
Castillo Posted May 15, 2013 Share Posted May 15, 2013 Eso es algo muy obvio, no te ofendas. De nada. Link to comment
Recommended Posts