iJustD Posted March 10, 2017 Share Posted March 10, 2017 WARNING: [gamemode]/weapon/backpack/server.lua:43: Bad argument @ 'setPedAnimation' [Expected number at argument 8, got boolean] < Console Log. Script is : addEvent("backpackGroundOpen",true) addEventHandler("backpackGroundOpen",getRootElement(),function() if isPedInVehicle(source) then return end if isElementInWater(source) then return end --setPedAnimation (source,"BOMBER","BOM_Plant_Loop",nil,false,false,false,false) setPedAnimation(source,"BOMBER","BOM_Plant_Loop",nil,true,false,false,false) local x,y,z = getElementPosition(source) prot = getPedRotation(source) local offsetRot = math.rad(prot+90) local vx = x + 0.75 * math.cos(offsetRot) local vy = y + 0.75 * math.sin(offsetRot) local vrot = prot+180 local backpackSlots = getElementData(source,"MAX_Slots") if (backpackSlots == 12 or backpackSlots == 16) then backpackGround[source] = createObject(1866,vx,vy,z-0.8,100,180,vrot) elseif (backpackSlots == 13 or backpackSlots == 17) then backpackGround[source] = createObject(1867,vx,vy,z-0.8,100,180,vrot) elseif (backpackSlots == 20 or backpackSlots == 24) then backpackGround[source] = createObject(1868,vx,vy,z-0.8,100,180,vrot) elseif (backpackSlots == 25 or backpackSlots == 29) then backpackGround[source] = createObject(1869,vx,vy,z-0.9,100,180,vrot) elseif (backpackSlots == 30 or backpackSlots == 34) then backpackGround[source] = createObject(1870,vx,vy,z-0.8,100,180,vrot) elseif (backpackSlots == 35 or backpackSlots == 39) then backpackGround[source] = createObject(1871,vx,vy,z-0.75,-70,0,vrot) end if elementBackpack[source] and isElement(elementBackpack[source]) then setElementAlpha(elementBackpack[source],0) end end) Link to comment
MTA Team ccw Posted March 10, 2017 MTA Team Share Posted March 10, 2017 16 minutes ago, iJustD said: setPedAnimation(source,"BOMBER","BOM_Plant_Loop",nil,true,false,false,false) 4th argument should be a number, not nil https://wiki.multitheftauto.com/wiki/SetPedAnimation Link to comment
iJustD Posted March 10, 2017 Author Share Posted March 10, 2017 7 minutes ago, ccw said: 4th argument should be a number, not nil https://wiki.multitheftauto.com/wiki/SetPedAnimation give me fixed code plz 26 minutes ago, ccw said: 4th argument should be a number, not nil https://wiki.multitheftauto.com/wiki/SetPedAnimation Give me plz full fixed code Link to comment
Ayush Rathore Posted March 11, 2017 Share Posted March 11, 2017 addEvent("backpackGroundOpen",true) addEventHandler("backpackGroundOpen",getRootElement(),function() if isPedInVehicle(source) then return end if isElementInWater(source) then return end setPedAnimation(source,"BOMBER","BOM_Plant_Loop",1000,true,false,false,false) local x,y,z = getElementPosition(source) prot = getPedRotation(source) local offsetRot = math.rad(prot+90) local vx = x + 0.75 * math.cos(offsetRot) local vy = y + 0.75 * math.sin(offsetRot) local vrot = prot+180 local backpackSlots = getElementData(source,"MAX_Slots") if (backpackSlots == 12 or backpackSlots == 16) then backpackGround[source] = createObject(1866,vx,vy,z-0.8,100,180,vrot) elseif (backpackSlots == 13 or backpackSlots == 17) then backpackGround[source] = createObject(1867,vx,vy,z-0.8,100,180,vrot) elseif (backpackSlots == 20 or backpackSlots == 24) then backpackGround[source] = createObject(1868,vx,vy,z-0.8,100,180,vrot) elseif (backpackSlots == 25 or backpackSlots == 29) then backpackGround[source] = createObject(1869,vx,vy,z-0.9,100,180,vrot) elseif (backpackSlots == 30 or backpackSlots == 34) then backpackGround[source] = createObject(1870,vx,vy,z-0.8,100,180,vrot) elseif (backpackSlots == 35 or backpackSlots == 39) then backpackGround[source] = createObject(1871,vx,vy,z-0.75,-70,0,vrot) end if elementBackpack[source] and isElement(elementBackpack[source]) then setElementAlpha(elementBackpack[source],0) end end) Try This 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