VeryBigSmoke Posted November 22, 2019 Posted November 22, 2019 Hello, i make a script everthing happened but removeEventHandler not working, pls help me. function dxUyari(durum,yazi,sekil) if durum == oyuncu then dxDrawRectangle(x-150,100,animasyon,50,tocolor(0,0,0,200)) animasyon = animasyon+10 if animasyon >= 299 then animasyon = 300 alpha = 255 end dxDrawText(yazi,x-100,110,0,0,tocolor(255,255,255,alpha),1,Font1) dxDrawRectangle(x-150,143,lineimage,1,tocolor(255,255,255,255)) lineimage = lineimage+9.99 if lineimage >=299 then lineimage = 300 end if sekil == "uyari" then dxDrawImage ( x-145, 105, imageanimasyon, 30, 'dosyalar/uyari.png', 0, 0, 0 ) imageanimasyon = imageanimasyon+3 if imageanimasyon >= 29 then imageanimasyon = 30 end elseif sekil == "yasak" then dxDrawImage ( x-145, 105, imageanimasyon, 30, 'dosyalar/yasak.png', 0, 0, 0 ) imageanimasyon = imageanimasyon+3 if imageanimasyon >= 29 then imageanimasyon = 30 end elseif sekil == "onay" then dxDrawImage ( x-145, 105, imageanimasyon, 30, 'dosyalar/onay.png', 0, 0, 0 ) imageanimasyon = imageanimasyon+3 if imageanimasyon >= 29 then imageanimasyon = 30 end end dxDrawRectangle ( x-150,144, g*2, u+1 ,tocolor(238 ,233, 233)) g = g + 0.3 if (g >= 149) then removeEventHandler("onClientRender",getRootElement(),dxUyari) end end end --TEST addEventHandler("onClientRender",getRootElement(),function() dxUyari(oyuncu,"Test","onay") end) not stop when g = 150 then sorry bad english
فاّرس Posted November 23, 2019 Posted November 23, 2019 function dxUyari(durum,yazi,sekil) if durum == oyuncu then dxDrawRectangle(x-150,100,animasyon,50,tocolor(0,0,0,200)) animasyon = animasyon+10 if animasyon >= 299 then animasyon = 300 alpha = 255 end dxDrawText(yazi,x-100,110,0,0,tocolor(255,255,255,alpha),1,Font1) dxDrawRectangle(x-150,143,lineimage,1,tocolor(255,255,255,255)) lineimage = lineimage+9.99 if lineimage >=299 then lineimage = 300 end if sekil == "uyari" then dxDrawImage ( x-145, 105, imageanimasyon, 30, 'dosyalar/uyari.png', 0, 0, 0 ) imageanimasyon = imageanimasyon+3 if imageanimasyon >= 29 then imageanimasyon = 30 end elseif sekil == "yasak" then dxDrawImage ( x-145, 105, imageanimasyon, 30, 'dosyalar/yasak.png', 0, 0, 0 ) imageanimasyon = imageanimasyon+3 if imageanimasyon >= 29 then imageanimasyon = 30 end elseif sekil == "onay" then dxDrawImage ( x-145, 105, imageanimasyon, 30, 'dosyalar/onay.png', 0, 0, 0 ) imageanimasyon = imageanimasyon+3 if imageanimasyon >= 29 then imageanimasyon = 30 end end dxDrawRectangle ( x-150,144, g*2, u+1 ,tocolor(238 ,233, 233)) g = g + 0.3 if (g >= 149) then removeEventHandler("onClientRender",getRootElement(),TEST) end end end --TEST function TEST() dxUyari(oyuncu,"Test","onay") end addEventHandler("onClientRender",getRootElement(),TEST )
VeryBigSmoke Posted November 23, 2019 Author Posted November 23, 2019 (edited) I want make function Like dxDrawText so remove dxUyari's event but not working Edited November 23, 2019 by VeryBigSmoke
فاّرس Posted November 23, 2019 Posted November 23, 2019 I didn't understand what do you wanna do! As you said, you want to remove dxUyari's event, so that what i did above.
VeryBigSmoke Posted November 23, 2019 Author Posted November 23, 2019 i want the dxUyari function, exist from has function remove Example addEventHandler("onClientRender",getRootElement(),function() dxUyari(oyuncu, "asd","uyari") end) dxUyarı when g does 150 then destroy self. But not working if u do test see. I delete removeEventHandler and make dxUyari = nil its worked but give debug i dont want this what can i do?
فاّرس Posted November 23, 2019 Posted November 23, 2019 (edited) 49 minutes ago, Sha67 said: function dxUyari(durum,yazi,sekil) if durum == oyuncu then dxDrawRectangle(x-150,100,animasyon,50,tocolor(0,0,0,200)) animasyon = animasyon+10 if animasyon >= 299 then animasyon = 300 alpha = 255 end dxDrawText(yazi,x-100,110,0,0,tocolor(255,255,255,alpha),1,Font1) dxDrawRectangle(x-150,143,lineimage,1,tocolor(255,255,255,255)) lineimage = lineimage+9.99 if lineimage >=299 then lineimage = 300 end if sekil == "uyari" then dxDrawImage ( x-145, 105, imageanimasyon, 30, 'dosyalar/uyari.png', 0, 0, 0 ) imageanimasyon = imageanimasyon+3 if imageanimasyon >= 29 then imageanimasyon = 30 end elseif sekil == "yasak" then dxDrawImage ( x-145, 105, imageanimasyon, 30, 'dosyalar/yasak.png', 0, 0, 0 ) imageanimasyon = imageanimasyon+3 if imageanimasyon >= 29 then imageanimasyon = 30 end elseif sekil == "onay" then dxDrawImage ( x-145, 105, imageanimasyon, 30, 'dosyalar/onay.png', 0, 0, 0 ) imageanimasyon = imageanimasyon+3 if imageanimasyon >= 29 then imageanimasyon = 30 end end dxDrawRectangle ( x-150,144, g*2, u+1 ,tocolor(238 ,233, 233)) g = g + 0.3 if (g >= 149) then removeEventHandler("onClientRender",getRootElement(),TEST) end end end --TEST function TEST() dxUyari(oyuncu,"Test","onay") end addEventHandler("onClientRender",getRootElement(),TEST ) Hmmm, have you tried this one yet? i think it's exactly what you want. Edited November 23, 2019 by Sha67
VeryBigSmoke Posted November 23, 2019 Author Posted November 23, 2019 I use this function in a lot of function so i need do: function dxUyari(durum,yazi,sekil) if durum == oyuncu then dxDrawRectangle(x-150,100,animasyon,50,tocolor(0,0,0,200)) animasyon = animasyon+10 if animasyon >= 299 then animasyon = 300 alpha = 255 end dxDrawText(yazi,x-100,110,0,0,tocolor(255,255,255,alpha),1,Font1) dxDrawRectangle(x-150,143,lineimage,1,tocolor(255,255,255,255)) lineimage = lineimage+9.99 if lineimage >=299 then lineimage = 300 end if sekil == "uyari" then dxDrawImage ( x-145, 105, imageanimasyon, 30, 'dosyalar/uyari.png', 0, 0, 0 ) imageanimasyon = imageanimasyon+3 if imageanimasyon >= 29 then imageanimasyon = 30 end elseif sekil == "yasak" then dxDrawImage ( x-145, 105, imageanimasyon, 30, 'dosyalar/yasak.png', 0, 0, 0 ) imageanimasyon = imageanimasyon+3 if imageanimasyon >= 29 then imageanimasyon = 30 end elseif sekil == "onay" then dxDrawImage ( x-145, 105, imageanimasyon, 30, 'dosyalar/onay.png', 0, 0, 0 ) imageanimasyon = imageanimasyon+3 if imageanimasyon >= 29 then imageanimasyon = 30 end end dxDrawRectangle ( x-150,144, g*2, u+1 ,tocolor(238 ,233, 233)) g = g + 0.3 if (g >= 149) then removeEventHandler("onClientRender",getRootElement(),TEST) removeEventHandler("onClientRender",getRootElement(),TEST2) removeEventHandler("onClientRender",getRootElement(),TEST3) removeEventHandler("onClientRender",getRootElement(),TEST4) end end end this? But i dont want that, i want function anywhere do remove self.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now