Jump to content

Help with a script !


novo

Recommended Posts

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 !!!!!!!!!!

Link to comment

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 by Guest
Link to comment
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 :S

LOL

You use it in client side and local player( only you ) can see it you need create it in server side.

Link to comment

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

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...