#Paper Posted March 3, 2011 Posted March 3, 2011 I want to make a funny window: function setMajorAlpha () local getAlpha = guiGetAlpha(wndShop) guiSetAlpha(wndShop, tonumber(getAlpha + 0.1)) end function setMinorAlpha () local getAlpha = guiGetAlpha(wndShop) guiSetAlpha(wndShop, tonumber(getAlpha - 0.1)) end function ShowHide (key, keyState) local getAlpha = guiGetAlpha(wndShop) if getAlpha == 0.1 then setTimer(setMajorAlpha, 500, 6) elseif getAlpha == 0.6 then setTimer(setMinorAlpha, 500, 6) end end bindKey("F10", "down", ShowHide) When i press F10 the Alpha doesn't changes it's the same: 0.1 My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
Castillo Posted March 3, 2011 Posted March 3, 2011 Any errors? i'm lazy right now. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Nikula Posted March 4, 2011 Posted March 4, 2011 What's the problem excatly, is the window opening? Do /debugscript 3 in your server, and post the errors there. SinCity Gaming 2.0 - New owner - New servers - More updates http://sincitygaming.net SinCity Gaming - The new generation of gaming!
Wojak Posted March 4, 2011 Posted March 4, 2011 Did you set the default alpha? guiSetAlpha(wndShop, 0.6)) after wndShop cteation also try to secure the condition more if getAlpha <= 0.1 then setTimer(setMajorAlpha, 500, 6) elseif getAlpha >= 0.6 then setTimer(setMinorAlpha, 500, 6) end create your teleports and interiors in MTA map editor want more excitment in your race map? - add a killer bot you may also add some peds (NPC) - CARMAGEDDON STYLE! 2paq MTA:SA Race Server
Moderators Citizen Posted March 6, 2011 Moderators Posted March 6, 2011 Did you set the default alpha? guiSetAlpha(wndShop, 0.6)) after wndShop cteation also try to secure the condition more if getAlpha <= 0.1 then setTimer(setMajorAlpha, 500, 6) elseif getAlpha >= 0.6 then setTimer(setMinorAlpha, 500, 6) end I'm agree, if you put an outputChatBox( "Alpha: "..getAlpha ), you will can noticed that it's not exactly 0.6 or 0.1 but something like 0.599863 or IDK So the Alpha is never exactly 0.6 or 0.1 Wojak is right, but change a little thing: if getAlpha <= 0.13 then setTimer(setMajorAlpha, 500, 6) elseif getAlpha >= 0.57 then setTimer(setMinorAlpha, 500, 6) end It's more secure like that The rEvolution is coming ...
#Paper Posted March 6, 2011 Author Posted March 6, 2011 if getAlpha <= 0.13 then setTimer(function () guiSetAlpha(wndShop, getAlpha + 0.1) end, 500, 6) elseif getAlpha >= 0.57 then setTimer(function () guiSetAlpha(wndShop, getAlpha - 0.1) end, 500, 6) end This can works? My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
Moderators Citizen Posted March 6, 2011 Moderators Posted March 6, 2011 I don't know I never this kind of script. but I think that you ave to put a ; after your guiSetAlpha But why you can't test it yourself ?? The rEvolution is coming ...
#Paper Posted March 6, 2011 Author Posted March 6, 2011 I don't know I never this kind of script.but I think that you ave to put a ; after your guiSetAlpha But why you can't test it yourself ?? I have some problems whit my Video Card... T_T My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
Moderators Citizen Posted March 6, 2011 Moderators Posted March 6, 2011 (edited) lol ok so I'm gonna test it for you Edited March 6, 2011 by Guest The rEvolution is coming ...
Moderators Citizen Posted March 6, 2011 Moderators Posted March 6, 2011 So I test it and it works but I changed 2 things ( and we don't need the ; ^^ ): You have to get the Alpha each time instead of the variable getAlpha because if the getAlpha value is ( for exemple ) 0.3, the server gona make guiSetAlpha(wndShop, 0.3+ 0.1) So the Alpha is always 0.4 do you understand ? I'm sure that you understand And it was not rather fluid so a modified it for you : setTimer(function () guiSetAlpha(wndShop, guiGetAlpha( wndShop )+0.02) end, 100, 30) and setTimer(function () guiSetAlpha(wndShop, guiGetAlpha( wndShop )-0.02) end, 100, 30) It works perfectly on my own server The rEvolution is coming ...
#Paper Posted March 7, 2011 Author Posted March 7, 2011 So I test it and it works but I changed 2 things ( and we don't need the ; ^^ ):You have to get the Alpha each time instead of the variable getAlpha because if the getAlpha value is ( for exemple ) 0.3, the server gona make guiSetAlpha(wndShop, 0.3+ 0.1) So the Alpha is always 0.4 do you understand ? I'm sure that you understand And it was not rather fluid so a modified it for you : setTimer(function () guiSetAlpha(wndShop, guiGetAlpha( wndShop )+0.02) end, 100, 30) and setTimer(function () guiSetAlpha(wndShop, guiGetAlpha( wndShop )-0.02) end, 100, 30) It works perfectly on my own server ye i understand and i fixxed it, but, why i can't set the time of the timer under "50"? My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
Moderators Citizen Posted March 7, 2011 Moderators Posted March 7, 2011 have you see this on the wiki ? I think it's because the internal clock of the server is maybe 50 ms ? So 1 cycle = 50 ms But I'm not sure ^^ The rEvolution is coming ...
MTA Team qaisjp Posted March 7, 2011 MTA Team Posted March 7, 2011 lol, I wonder, Why do people put the ";"?
proracer Posted March 7, 2011 Posted March 7, 2011 Because people first used C++ or any other similiar programming language but you can write it in Lua too if you want.
#Paper Posted March 7, 2011 Author Posted March 7, 2011 have you see this on the wiki ?I think it's because the internal clock of the server is maybe 50 ms ? So 1 cycle = 50 ms But I'm not sure ^^ Ty P.S: Have you skype? My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
Moderators Citizen Posted March 7, 2011 Moderators Posted March 7, 2011 No I don't have skype because I have some problems with my Network when I call a guy. But I have mumble with a local server ( if you want to speak in your mic ) and msn ( see my profile ) The rEvolution is coming ...
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