BieHDC Posted August 18, 2013 Share Posted August 18, 2013 Hello, i have created a script for clientside, but then the colours wont be synct and now i have problems at porting. Some things i have ported already sucsessfully, but now i am stuck. i dont want you to write for me, because i wanna learn. The problem is now, how to define theplayer and some other things. Here are some errors i get and pls tell me how to. I dont wanna post the script, because then i cant try myself and pls tell me why to set so^ [19:00:15] WARNING: [new]/vehcol/vehcolch.lua:25: Bad argument @ 'getVehicleOccu pant' [19:00:16] WARNING: [new]/vehcol/vehcolch.lua:25: Bad argument @ 'getVehicleOccu pant' [19:09:42] WARNING: [new]/vehcol/vehcolch.lua:27: Bad 'vehicle' pointer @ 'getVe hicleColor'(1) [19:09:42] WARNING: [new]/vehcol/vehcolch.lua:27: Bad 'vehicle' pointer @ 'getVe hicleColor'(1) [19:00:28] WARNING: [new]/vehcol/vehcolch.lua:54: Bad argument @ 'getVehicleOccu pant' [19:00:28] WARNING: [new]/vehcol/vehcolch.lua:56: Bad argument @ 'setVehicleColo r' [19:00:28] WARNING: [new]/vehcol/vehcolch.lua:61: Bad argument @ 'getPedOccupied Vehicle' [19:00:28] WARNING: [new]/vehcol/vehcolch.lua:62: Bad argument @ 'getElementHeal th' [Expected element at argument 1, got boolean] Link to comment
BieHDC Posted August 18, 2013 Author Share Posted August 18, 2013 Dont fix tell me how to fix isitflickering = "false" function plssavemycolor ( thePlayer ) isitflickering = "false" setTimer (plssavemycolor2, 15000, 1, thePlayer) end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), plssavemycolor ) function plssavemycolor2 ( root ) isitflickering = "false" car = getVehicleOccupant ( root ) if ( car ) then d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12 = getVehicleColor (car, true ) end end function plsresetmycolor ( thePlayer ) setVehicleColor ( car, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12 ) isitflickering = "false" end function burningcar ( root ) car = getVehicleOccupant ( source ) vhealth = getElementHealth ( car ) if ( car ) then if vhealth <= 300 then if isitflickering == "false" then setTimer ( flickit, 50, 1 ) isitflickering = "true" elseif vhealth >= 1000 then isitflickering = "false" setTimer ( plsresetmycolor, 100, 1 ) end end end end addEventHandler("onVehicleDamage", getRootElement(), burningcar ) function flickit ( root ) car = getVehicleOccupant ( thePlayer ) c = 1 setVehicleColor ( car, c, c, c, c ) setTimer ( burcrd, 100, 1, root ) end function burcrd ( thePlayer ) local car = getPedOccupiedVehicle( thePlayer ) local vhealth = getElementHealth( car ) if ( car ) then if vhealth <= 300 then local cc = 3 setVehicleColor ( car, cc, cc, cc, cc ) setTimer ( flickit, 100, 1, thePlayer ) elseif vhealth >= 1000 then isitflickering = "false" setTimer ( plsresetmycolor, 100, 1, thePlayer ) end end end Link to comment
xXMADEXx Posted August 18, 2013 Share Posted August 18, 2013 check to make sure that 'car' returns an element and not a bool. Link to comment
BieHDC Posted August 18, 2013 Author Share Posted August 18, 2013 Hmmm i stuck now very hard :c i managed one part to work but the others i cant made. Pls put out the lines with error, fix it and write with comment why this have to be so that it works -.- reduced to 3 errors: [12:03:35] WARNING: [new]/vehcol/vehcolch.lua:11: Bad argument @ 'getVehicleOccu pant' [12:03:39] WARNING: [new]/vehcol/vehcolch.lua:23: Bad argument @ 'getPedOccupied Vehicle' [12:03:39] WARNING: [new]/vehcol/vehcolch.lua:24: Bad argument @ 'getElementHeal th' [Expected element at argument 1, got boolean] isitflickering = "false" function plssavemycolor ( thePlayer ) isitflickering = "false" setTimer (plssavemycolor2, 15000, 1, thePlayer) end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), plssavemycolor ) function plssavemycolor2 ( root ) isitflickering = "false" car = getVehicleOccupant ( thePlayer ) if ( car ) then d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12 = getVehicleColor (car, true ) end end function plsresetmycolor ( thePlayer ) setVehicleColor ( car, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12 ) isitflickering = "false" end function burningcar ( root ) car = getPedOccupiedVehicle( thePlayer ) vhealth = getElementHealth ( car ) if ( car ) then if vhealth <= 300 then if isitflickering == "false" then setTimer ( flickit, 50, 1 ) isitflickering = "true" elseif vhealth >= 1000 then isitflickering = "false" setTimer ( plsresetmycolor, 100, 1, player ) end end end end addEventHandler("onVehicleDamage", root, burningcar ) function flickit ( player ) car = getVehicleOccupant ( player ) c = 1 setVehicleColor ( car, c, c, c, c ) setTimer ( burcrd, 100, 1, thePlayer ) end function burcrd ( thePlayer ) car = getPedOccupiedVehicle( player ) vhealth = getElementHealth( car ) if ( car ) then if vhealth <= 300 then local cc = 3 setVehicleColor ( car, cc, cc, cc, cc ) setTimer ( flickit, 100, 1, thePlayer ) elseif vhealth >= 1000 then isitflickering = "false" setTimer ( plsresetmycolor, 100, 1, player ) end end end 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