novo Posted December 3, 2011 Posted December 3, 2011 Hi all. I'm using the discopogo script with timer that i had on mta 1.0, and now on 1.1.* isn't working fine. On 1.0, when i did the command "party" it played music and did disco effects for all the players, but now on 1.1.* isn't the same, just i see the effects and hear the music. Here's the code: addCommandHandler ( "party", function () local sound = playSound("disco_pogo.mp3") setSoundVolume(sound, 0.5) function xxx() for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random(0,255) color[2] = math.random(0,255) color[3] = math.random(0,255) color[4] = math.random(0,255) setVehicleColor ( car, color[1], color[2], color[3], color[4] ) setSkyGradient ( math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255) ) setWaterColor(math.random (0,255), math.random (0,255), math.random (0,255)) end end setTimer(xxx,300,46) end) Thanks. PLEASE HELP !!!!!!!!!!
Kenix Posted December 3, 2011 Posted December 3, 2011 (edited) Because you not use correct arguments for function setVehicleColor see where from 1.1 https://wiki.multitheftauto.com/wiki/SetVehicleColor addCommandHandler ( "party", function () local sound = playSound( "disco_pogo.mp3" ) setSoundVolume( sound, 0.5 ) local function xxx() for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random( 0,255 ) color[2] = math.random( 0,255 ) color[3] = math.random( 0,255 ) setVehicleColor ( car, color[1], color[2], color[3] ) setSkyGradient ( math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255) ) setWaterColor( math.random (0,255), math.random (0,255), math.random (0,255) ) end end setTimer(xxx,300,46) end ) Edited December 3, 2011 by Guest
novo Posted December 3, 2011 Author Posted December 3, 2011 Testing... and thanks... i'll edit if works or no
novo Posted December 3, 2011 Author Posted December 3, 2011 I had problems too with adding it for just "Admins" (acl group) but i don't know the right code. Please help me <3 Edit: It's not showing to other players. Just i see effects and hear the music
Kenix Posted December 3, 2011 Posted December 3, 2011 I had problems too with adding it for just "Admins" (acl group) but i don't know the right code.Please help me <3 You not needed add it to acl. or you need create only admin can use this command or what? Edit: It's not showing to other players. Just i see effects and hear the music LOL You use it in client side and local player( only you ) can see it you need create it in server side.
novo Posted December 3, 2011 Author Posted December 3, 2011 1. I don't want to use ACL. I want to know where should be the code for just Admins has right for the command. 2. I'm a noob. Thanks
Kenix Posted December 3, 2011 Posted December 3, 2011 server addCommandHandler ( "party", function ( source ) triggerClientEvent( "PlaySound",root ) local function xxx( ) for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random( 0,255 ) color[2] = math.random( 0,255 ) color[3] = math.random( 0,255 ) setVehicleColor ( car, color[1], color[2], color[3] ) setSkyGradient ( math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255) ) setWaterColor( math.random (0,255), math.random (0,255), math.random (0,255) ) end end setTimer( xxx,300,46 ) end ) client addEvent( "PlaySound",true ) addEventHandler( "PlaySound",root, function( ) local sound = playSound( "disco_pogo.mp3" ) setSoundVolume( sound, 0.5 ) end ) 1. I don't want to use ACL. I want to know where should be the code for just Admins has right for the command. Open acl.xml find: and add <right name="command.party" access="true"></right> Also you can create it with admin resource
novo Posted December 3, 2011 Author Posted December 3, 2011 Edit: Thanks it's working <3 u thank you a lot !
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