iJustD Posted March 10, 2017 Share Posted March 10, 2017 [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
HomerSimpson Posted March 10, 2017 Share Posted March 10, 2017 From what I can see is you've defined what destroyElement is doing. Example: The way you've wrote it: setTimer ( destroyElement, 100, 1, vehicle ) 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. Link to comment
Ayush Rathore Posted March 11, 2017 Share Posted March 11, 2017 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] 1 Link to comment
HomerSimpson Posted March 12, 2017 Share Posted March 12, 2017 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
Ayush Rathore Posted March 12, 2017 Share Posted March 12, 2017 Just now, Unitts said: My bad hmm no problem as now you know Link to comment
HomerSimpson Posted March 12, 2017 Share Posted March 12, 2017 Just now, Ayush Rathore said: no problem as now you know Only other thing I can assume is hes not defined the element 'vehicles' Link to comment
Ayush Rathore Posted March 12, 2017 Share Posted March 12, 2017 Just now, Unitts said: Only other thing I can assume is hes not defined the element 'vehicles' well he has not given full script 1 Link to comment
HomerSimpson Posted March 12, 2017 Share Posted March 12, 2017 Just now, Ayush Rathore said: well he has not given full script That is true mate 1 Link to comment
Mr.Loki Posted March 12, 2017 Share Posted March 12, 2017 2 hours ago, Ayush Rathore said: well he has not given full script 2 hours ago, Unitts said: That is true mate 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
Investor Posted March 12, 2017 Share Posted March 12, 2017 I just wanted to point out that you should honestly give more descriptive titles to attract attention from the right people who can actually help you. 1 Link to comment
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