Jump to content

LiOneLMeSsIShoT

Members
  • Posts

    609
  • Joined

  • Last visited

Everything posted by LiOneLMeSsIShoT

  1. It's the script local sm = {} sm.moov = 0 sm.object1, sm.object2 = nil, nil function removeCamHandler () if(sm.moov == 1) then sm.moov = 0 removeEventHandler ( "onClientPreRender", getRootElement(), camRender ) end end function camRender () local x1, y1, z1 = getElementPosition ( sm.object1 ) local x2, y2, z2 = getElementPosition ( sm.object2 ) setCameraMatrix ( x1, y1, z1, x2, y2, z2 ) end function smoothMoveCamera ( 2317.369140625, 687.4677734375, 59.040821075439, 2407.83984375, 569.1337890625, 40.787521362305, 2227.458984375, 598.650390625, 29.868627548218, 2298.16015625, 572.3984375, 28.285842895508, 5000 ) if(sm.moov == 1) then return false end sm.object1 = createObject ( 1337, x1, y1, z1 ) sm.object2 = createObject ( 1337, x1t, y1t, z1t ) setElementAlpha ( sm.object1, 0 ) setElementAlpha ( sm.object2, 0 ) setObjectScale(sm.object1, 0.01) setObjectScale(sm.object2, 0.01) moveObject ( sm.object1, time, x2, y2, z2, 0, 0, 0, "InOutQuad" ) moveObject ( sm.object2, time, x2t, y2t, z2t, 0, 0, 0, "InOutQuad" ) addEventHandler ( "onClientPreRender", getRootElement(), camRender ) sm.moov = 1 setTimer ( removeCamHandler, time, 1 ) setTimer ( destroyElement, time, 1, sm.object1 ) setTimer ( destroyElement, time, 1, sm.object2 ) return true end the full
  2. Yea..it works really fine...but i want to know...how to get the number of pickups still not removed? and how to check if the pickups being removed? i ask about that because i'm looking to outputChatBox ("number of briefcases around the map"...pickups)... or when pickup be removed ... it says outputChatBox ("numbers of the briefcases now are "...now) like this..i hope you got it...
  3. local sm = {} sm.moov = 0 sm.object1, sm.object2 = nil, nil function removeCamHandler () if(sm.moov == 1) then sm.moov = 0 removeEventHandler ( "onClientPreRender", getRootElement(), camRender ) end end function camRender () local x1, y1, z1 = getElementPosition ( sm.object1 ) local x2, y2, z2 = getElementPosition ( sm.object2 ) setCameraMatrix ( x1, y1, z1, x2, y2, z2 ) end function smoothMoveCamera ( 2317.369140625, 687.4677734375, 59.040821075439, 2407.83984375, 569.1337890625, 40.787521362305, 2227.458984375, 598.650390625, 29.868627548218, 2298.16015625, 572.3984375, 28.285842895508, 5000 ) if(sm.moov == 1) then return false end sm.object1 = createObject ( 1337, x1, y1, z1 ) sm.object2 = createObject ( 1337, x1t, y1t, z1t ) setElementAlpha ( sm.object1, 0 ) setElementAlpha ( sm.object2, 0 ) setObjectScale(sm.object1, 0.01) setObjectScale(sm.object2, 0.01) moveObject ( sm.object1, time, x2, y2, z2, 0, 0, 0, "InOutQuad" ) moveObject ( sm.object2, time, x2t, y2t, z2t, 0, 0, 0, "InOutQuad" ) addEventHandler ( "onClientPreRender", getRootElement(), camRender ) sm.moov = 1 setTimer ( removeCamHandler, time, 1 ) setTimer ( destroyElement, time, 1, sm.object1 ) setTimer ( destroyElement, time, 1, sm.object2 ) return true end Error: :18: <name> or '...' expected near '2317.369140625'
  4. Actuallly works fine with some sides...but with onPlayerQuit side.. not works fine...because i'm tried to quit while i'm carrying the bag...then joined again and i found the bag...but when i try to pickup it...not works.. function onPlayerQuit ( ) if ( gotBag [ source ] ) then destroyElement ( gotBag [ source ] ) local x, y, z = getElementPosition ( source ) baga = createPickup ( x, y, z, 3, 1210 ) gotBag [ source ] = nil end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit )
  5. Still able to pick another one ... function onPickupHit ( player ) if ( not isPedInVehicle ( player ) and not isPedDead ( player ) and not gotBag [ player ] ) then exports.bone_attach:attachElementToBone ( bags [ source ], player, 12, 0, 0.1, 0.3, 0, 180, 0 ) gotBag [ player ] = bags [ source ] destroyElement ( source ) end end When i'm tried to click on the btn without the bag .. i get my rewards too why?! ?! ?! and when i click without the bag i get error too: :37: Bad argument @ 'destroyElement' [Expected element at argument 1]
  6. Still able to pick another one ... function onPickupHit ( player ) if ( not isPedInVehicle ( player ) and not isPedDead ( player ) and not gotBag [ player ] ) then exports.bone_attach:attachElementToBone ( bags [ source ], player, 12, 0, 0.1, 0.3, 0, 180, 0 ) gotBag [ player ] = bags [ source ] destroyElement ( source ) end end
  7. Please...can you explain what you did? because for me you made Complex things I have tried to add if ( not isPedInVehicle ( player ) and not isPedDead ( player ) and not gotBag [ source ] ) then ""and not gotBag [ source ] ... i'm just copied it from the destroyElement ( gotBag [ source ] ) because it's only thing i understand..because i don't know how i check if the bagb attached to the player after you changed it to more tables .. can you tell me how i describ if bagb attached ? in the script after this edits?
  8. Please...can you explain what you did? because for me you made Complex things
  9. local pbags = { 1 = {2028.2314453125, 648.09765625, 11.366704940796}, 2 = {2340.6474609375, 750.9208984375, 11.218271255493}, 3 = {1632.525390625, 1035.7626953125, 13.769004821777}, 4 = {1494.2626953125, 751.025390625, 29.161626815796}, 5 = {1454.25, 751.05859375, 32.736267089844}, 6 = {1533.3515625, 751.1181640625, 32.64266204834}, 7 = {1427.3037109375, 1462.958984375, 10.8203125} } for _, i in ipairs(pbags) do baga = createPickup(i[1], i[2], i[3], 3, 1210) bagb = createObject(1210, 0, 0, 0) end function onPickupHit(player) if not isPedInVehicle(player) and not isPedDead(player) then exports.bone_attach:attachElementToBone(bagb,player,12,0,0.1,0.3,0,180,0) end end addEventHandler("onPickupHit", root, onPickupHit) function onBtnClick() local atthedTo = exports.bone_attach:getElementBoneAttachmentDetails(bagb) if atthedTo == source then local money = math.random(1000, 2000) givePlayerMoney(source, money) destroyElement(bagb) triggerClientEvent(source, "WarningText", source, "reward", "You have rewarded and got "..money.. "$ from the dealer!! Good Job Pro!") outputChatBox ("you have Rewarded and got "..money.."$ from the dealer...You are PRO!! Good JOB!", source, 0, 255, 0, false) triggerClientEvent (source,"winSound", source) else triggerClientEvent(source, "WarningText", source, "reward", "You have to get the briefcase of weapons First!") end end addEvent("reward", true) addEventHandler ("reward", root, onBtnClick) function onPlayerQuit() local atthedTo = exports.bone_attach:getElementBoneAttachmentDetails(bagb) if atthedTo == source then destroyElement(bagb) local x, y, z = getElementPosition(source) baga = createPickup(x, y, z, 3, 1210) end end addEventHandler("onPlayerQuit", root, onPlayerQuit)
  10. ah...yes...found it i was removing it...whatever the pickup attach is really bad...so i made attached object and attached it..anyway Thanks a lot... and actually without your reply i wasn't will check the script again ! ah...but still there's a problem....if the player pickup it then if if destroyElement (baga) all pickups will be destroyed ... and i need only the pickup which the player picked be destroyed..how to do this can i describe the x, y, z by this table? local pbags = { 1 = {2028.2314453125, 648.09765625, 11.366704940796}, 2 = {2340.6474609375, 750.9208984375, 11.218271255493}, 3 = {1632.525390625, 1035.7626953125, 13.769004821777}, 4 = {1494.2626953125, 751.025390625, 29.161626815796}, 5 = {1454.25, 751.05859375, 32.736267089844}, 6 = {1533.3515625, 751.1181640625, 32.64266204834}, 7 = {1427.3037109375, 1462.958984375, 10.8203125} }
  11. ah...yes...found it i was removing it...whatever the pickup attach is really bad...so i made attached object and attached it..anyway Thanks a lot... and actually without your reply i wasn't will check the script again ! ah...but still there's a problem....if the player pickup it then if if destroyElement (baga) all pickups will be destroyed ... and i need only the pickup which the player picked be destroyed..how to do this
  12. ah...yes...found it i was removing it...whatever the pickup attach is really bad...so i made attached object and attached it..anyway Thanks a lot... and actually without your reply i wasn't will check the script again !
  13. When the player click on the button...then it be destroyed from him...so he get his rewards...understand this part ?! in onBtnClick..
  14. I'm going to make a simple inventory system...but idk which things should i use? can you give me functions...events for it ? or any guid can to lead me to make a simple one?
  15. Thanks Tapl too Still need help guys. I've made this but still not work. local skill = math.floor(getPedStat(localPlayer, 69) * 10/10)
  16. You made baga a local variable, so it wouldn't work. Change local baga = createPickup(i[1], i[2], i[3], 3, 1210) to baga = createPickup(i[1], i[2], i[3], 3, 1210) Didn't Change anything .
  17. ِAlright...i've tried ti attach the pickup....but still not work..see local pbags = { {2028.2314453125, 648.09765625, 11.366704940796}, {2340.6474609375, 750.9208984375, 11.218271255493}, {1632.525390625, 1035.7626953125, 13.769004821777}, {1494.2626953125, 751.025390625, 29.161626815796}, {1454.25, 751.05859375, 32.736267089844}, {1533.3515625, 751.1181640625, 32.64266204834}, {1427.3037109375, 1462.958984375, 10.8203125} } for _, i in ipairs(pbags) do local baga = createPickup(i[1], i[2], i[3], 3, 1210) end function onPickupHit(player) if source == baga then if not isPedInVehicle(player) and not isPedDead(player) then exports.bone_attach:attachElementToBone(baga,player,12,0,0.1,0.3,0,180,0) destroyElement(source) end end end addEventHandler("onPickupHit", root, onPickupHit) function onBtnClick() local atthedTo = exports.bone_attach:getElementBoneAttachmentDetails(baga) if atthedTo == source then local money = math.random(1000, 2000) givePlayerMoney(source, money) destroyElement(baga) setTimer(function() x, y, z = unpack(pbags[math.random(#pbags)]) baga = createPickup(x, y, z, 3, 1210) end, 50000, 1) triggerClientEvent(source, "WarningText", source, "reward", "You have rewarded and got "..money.. "$ from the dealer!! Good Job Pro!") outputChatBox ("you have Rewarded and got "..money.."$ from the dealer...You are PRO!! Good JOB!", source, 0, 255, 0, false) triggerClientEvent (source,"winSound", source) else triggerClientEvent(source, "WarningText", source, "reward", "You have to get the briefcase of weapons First!") end end addEvent("reward", true) addEventHandler ("reward", root, onBtnClick) function onPlayerQuit() local atthedTo = exports.bone_attach:getElementBoneAttachmentDetails(baga) if atthedTo == source then destroyElement(baga) local x, y, z = getElementPosition(source) baga = createPickup(x, y, z, 3, 1210) end end addEventHandler("onPlayerQuit", root, onPlayerQuit)
  18. Because 1210 is an ID of an object(suitcase), not a pickup. If you want to attach the suitcase to you, use attachElements I'm using Bone attach bagb = createObject(1210, 0, 0, 0) exports.bone_attach:attachElementToBone(bagb,player,12,0,0.1,0.3,0,180,0 so why it don't be attached?
  19. Because 1210 is an ID of an object(suitcase), not a pickup. If you want to attach the suitcase to you, use attachElements I'm using Bone attach bagb = createObject(1210, 0, 0, 0) exports.bone_attach:attachElementToBone(bagb,player,12,0,0.1,0.3,0,180,0 so why don't be attached?
  20. Alright ...well now when all objects spawned in one time....when i try to pick up the object...it don't be attached to me... why?
  21. alright...should i createPed in clientside too? or what should i do ?
  22. I mean...after the objects spawn in one time...how i defined them to use themm???
  23. source is not a ped. yeah but the ped not defined in the client side..so ?
×
×
  • Create New...