Plate Posted April 9, 2013 Share Posted April 9, 2013 Hola necesito ayuda con este resource es que me da error en el "removeEventHandler" function rdx(message) setTimer(removeEventHandler, 9000, 1, "onClientRender", getRootElement(), dx ) function dx() dxDrawText(getPlayerName(localPlayer)..":",12.0,176.0,141.0,214.0,tocolor(255,0,0,255),1.0,"bankgothic","left","top",false,false,false) dxDrawText(message,129.0,176.0,796.0,207.0,tocolor(255,255,255,255),2.0,"arial","left","top",false,false,false) end addEventHandler("onClientRender", getRootElement(), dx) end addEvent("onAdminMessage", true ) addEventHandler("onAdminMessage", getRootElement(), rdx) Link to comment
Castillo Posted April 9, 2013 Share Posted April 9, 2013 Pone la funcion "dx" fuera de la funcion "rdx". Link to comment
AlvareZ_ Posted April 9, 2013 Share Posted April 9, 2013 intenta esto: function rdx(message) setTimer(function() removeEventHandler("onClientRender",getRootElement(),dx) end,9000,1) function dx() dxDrawText(getPlayerName(localPlayer)..":",12.0,176.0,141.0,214.0,tocolor(255,0,0,255),1.0,"bankgothic","left","top",false,false,false) dxDrawText(message,129.0,176.0,796.0,207.0,tocolor(255,255,255,255),2.0,"arial","left","top",false,false,false) end addEventHandler("onClientRender", getRootElement(), dx) end addEvent("onAdminMessage", true ) addEventHandler("onAdminMessage", getRootElement(), rdx) Link to comment
Sasu Posted April 9, 2013 Share Posted April 9, 2013 function dx() dxDrawText(getPlayerName(localPlayer)..":",12.0,176.0,141.0,214.0,tocolor(255,0,0,255),1.0,"bankgothic","left","top",false,false,false) dxDrawText(message,129.0,176.0,796.0,207.0,tocolor(255,255,255,255),2.0,"arial","left","top",false,false,false) end function rdx(message) addEventHandler("onClientRender", getRootElement(), dx) setTimer( function() removeEventHandler("onClientRender",getRootElement(),dx) end ,9000,1 ) end addEvent("onAdminMessage", true ) addEventHandler("onAdminMessage", getRootElement(), rdx) Ahi te va a funcionar. Link to comment
Castillo Posted April 9, 2013 Share Posted April 9, 2013 No veo para que le dan todo hecho, con mi comentario ya era suficiente. Link to comment
AlvareZ_ Posted April 9, 2013 Share Posted April 9, 2013 Creo que el mio esta malo, no? Link to comment
Plate Posted April 9, 2013 Author Share Posted April 9, 2013 Muchas a los 2 ya me ayudo alex_steel PD:Vuery tank llu alex_stealth Link to comment
Sasu Posted April 9, 2013 Share Posted April 9, 2013 ._. Entonces solid, yo y alvarez respondimos para nada ._. No veo para que le dan todo hecho, con mi comentario ya era suficiente. Solo lo puse para mostrarle por si las dudas y porque estoy aburrido u.u Link to comment
Plate Posted April 9, 2013 Author Share Posted April 9, 2013 Lo unico es que tengo un problema con esto mira yo creo los zombies en el spot y si alguien los mata no respawnea ese respawnean la cantidad que aya en el spot llega un momento que da un lagg terrible! function Zomb_respawn (ped) if isElement(ped) then if (getElementData (ped, "zombie") == true) then for theKey,thePed in ipairs(zombiesInSpot) do if ped == thePed then table.remove( zombiesInSpot, theKey ) break end end local zombieSkin = getElementModel(ped) local zombieLevel = getElementData(ped,"level") local maxHP = getElementData(ped,"maxhealth") local zombieSpot = getElementData(ped,"zombieSpot") local spotRadius = getElementData(zombieSpot,"radius") local sortZombies = spotRadius/1.2 local sx,sy,sz = getElementPosition(zombieSpot) local zom = createZombie (sx+math.random(-sortZombies,sortZombies),sy+math.random(-sortZombies,sortZombies),sz+1.5,math.random(1,360),zombieSkin,0,0,zombieLevel,maxHP) table.insert(zombiesInSpot,zom) setElementData(zom,"zombieSpot",zombieSpot) end end end function respawnZombieWhenDead(dataName) if getElementType ( source ) == "ped" and dataName == "status" then if (getElementData (source, "zombie") == true) then if (getElementData ( source, "status" ) == "dead" ) then setTimer ( Zomb_respawn, 9000, 1, source) end end end end addEventHandler ( "onElementDataChange", getRootElement(),respawnZombieWhenDead ) Link to comment
Recommended Posts