Jump to content

Need help with script


iJustD

Recommended Posts

[2017-03-10 16:55:55] WARNING: admin/server/admin_server.lua:1163: Bad argument @ 'destroyElement' [Expected element at argument 1] < Console log . I cant fix it help me plz.

Script is : 

            elseif ( action == "setcolor" ) then
                    r, g, b = hex2rgb(data[1])
                    r2, g2, b2 = hex2rgb(data[2])
                    r3, g3, b3 = hex2rgb(data[3])
                    r4, g4, b4 = hex2rgb(data[4])
                    if ( not setVehicleColor ( vehicle, r, g, b, r2, g2, b2, r3, g3, b3, r4, g4, b4 ) ) then
                        action = nil
                    end
            elseif ( action == "setlights" ) then
                    r, g, b = hex2rgb(data[1])
                    if ( not setVehicleHeadLightColor ( vehicle, r, g, b) ) then
                        action = nil
                    end
            elseif ( action == "setplates" ) then
                mdata = data[1]
                setVehiclePlateText ( vehicle, data[1] )
            elseif ( action == "blowvehicle" ) then
                setTimer ( blowVehicle, 100, 1, vehicle )
            elseif ( action == "destroyvehicle" ) then
                setTimer ( destroyElement, 100, 1, vehicle )
            else
                action = nil
            end

Link to comment
18 hours ago, Unitts said:

The way I would write it:


setTimer ( destroyElement(ElementName), 100, 1, vehicle )

 

Now I might be wrong but if you put inside the brackets the element you're trying to destroy it will probably fix it.

yes you are wrong as setTimer will provide vehicle as a parameter and what you wrote will cause the error

this

[16:16:11] WARNING: lol\x.lua:91: Bad argument @ 'destroyElement' [Expected elem
ent at argument 1, got nil]
[16:16:11] WARNING: lol\x.lua:91: Bad argument @ 'setTimer' [Expected function a
t argument 1, got boolean]

  • Like 1
Link to comment
On 3/11/2017 at 10:49, Ayush Rathore said:

yes you are wrong as setTimer will provide vehicle as a parameter and what you wrote will cause the error

this

[16:16:11] WARNING: lol\x.lua:91: Bad argument @ 'destroyElement' [Expected elem
ent at argument 1, got nil]
[16:16:11] WARNING: lol\x.lua:91: Bad argument @ 'setTimer' [Expected function a
t argument 1, got boolean]

My bad hmm

Link to comment
2 hours ago, Ayush Rathore said:

well he has not given full script :D

 

2 hours ago, Unitts said:

That is true mate :D

This is the default admin resource.

 

On 3/10/2017 at 11:03, iJustD said:

[2017-03-10 16:55:55] WARNING: admin/server/admin_server.lua:1163: Bad argument @ 'destroyElement' [Expected element at argument 1] < Console log . I cant fix it help me plz.

 

I suggest redownloading the admin resource from here or post the changes you have made to the resource that may be the cause of the error.

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