Killerhamster10 Posted April 5, 2010 Posted April 5, 2010 Hey, I try to make a script which can change the sky colour. That's my code: function changeSkyColor ( commandName, topred, topgreen, topblue, bottomred,bottomgreen,bottomblue ) topRed = tonumber ( topRed ) topGreen = tonumber ( topGreen ) topBlue = tonumber ( topBlue ) bottomRed = tonumber ( bottomRed ) bottomGreen = tonumber ( bottomGreen ) bottomBlue = tonumber ( bottomBlue ) if topRed and topGreen and topBlue and bottomRed and bottomGreen and bottomBlue then setSkyGradient( topRed, topGreen, topBlue, bottomRed, bottomGreen, bottomBlue ) else outputChatBox ( "Failed to change the sky colour!" ) end end addCommandHandler ( "setsky", changeSkyColor ) But it is not working Can someone help me? Greetings
Dark Dragon Posted April 5, 2010 Posted April 5, 2010 variables are case sensitive. it must be "topRed" not "topred" etc: function changeSkyColor ( commandName, topRed, topGreen, topBlue, bottomRed,bottomGreen,bottomBlue ) --capital letters here topRed = tonumber ( topRed ) topGreen = tonumber ( topGreen ) topBlue = tonumber ( topBlue ) bottomRed = tonumber ( bottomRed ) bottomGreen = tonumber ( bottomGreen ) bottomBlue = tonumber ( bottomBlue ) if topRed and topGreen and topBlue and bottomRed and bottomGreen and bottomBlue then setSkyGradient( topRed, topGreen, topBlue, bottomRed, bottomGreen, bottomBlue ) else outputChatBox ( "Failed to change the sky colour!" ) end end addCommandHandler ( "setsky", changeSkyColor ) Loads of fun for free! Also a lot of fun for free!
Killerhamster10 Posted April 5, 2010 Author Posted April 5, 2010 Okay thanks, but now it only sais: Failed to change the sky colour I type: /setsky 200 0 100 150 0 70 and again this error message But i think it'a allright? Greetings
Gamesnert Posted April 5, 2010 Posted April 5, 2010 Is this function server-side or client-side? If it's server-side, you're missing the player argument: function changeSkyColor ( player, commandName, topRed, topGreen, topBlue, bottomRed, bottomGreen, bottomBlue ) Projects: Slothbot | Maximap
Killerhamster10 Posted April 5, 2010 Author Posted April 5, 2010 Okay very nice It was on server side, so i changed it Okey, one other question: Is it possible to change the sky color in a loop? So that is like this: Blue Green Red Black Red --Start Again Blue Green Red Black Red --Start Again So that it allways change? Pls answer Greetings
dzek (varez) Posted April 6, 2010 Posted April 6, 2010 setTimer Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
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