Jump to content

Jokeℝ1472771893

Members
  • Posts

    334
  • Joined

  • Last visited

Everything posted by Jokeℝ1472771893

  1. EDIT: how to make when i take Swat job my team set "SWAT Team" + Skin (ID)
  2. no no try to stand and don't move
  3. nvm i think Castiol will understand me
  4. i told u when i spawn car from 1st marker then i spawn car from 2nd marker the car still their(spawned in 1st makrer)
  5. nvm about it i was trying to make makrer visible only Medic
  6. nope it's closed again after 6-8 sec
  7. how to make this cods together ( if player spawn car from 1st marker and whan't to spawn car from 2nd the dirst car destrooyed?) ambulancee= createMarker(2000.921875, -1412.892578125, 16, "cylinder", 2.0, 255, 255,255, 255) setElementVisibleTo(ambulance, root, false) local jobVehicles = {} addEventHandler("onMarkerHit", ambulancee, function(hitElement) if (getElementType(hitElement) ~= "player") then return end local x, y, z = getElementPosition(hitElement) -- Gets the player's position and get his x,y,z coordinates local team = getPlayerTeam(hitElement) -- Gets the player's current team if(isPedInVehicle(hitElement)) then return end if (jobVehicles[hitElement] and isElement(jobVehicles[hitElement])) then destroyElement(jobVehicles[hitElement]) end if (team and getTeamName(team) == "Medic") then setElementVisibleTo(ambulance, root, true) jobVehicles[hitElement] = createVehicle (416, x, y, z, 0, 0, 180) -- creates a infernus at the player coordenates setTimer(warpPedIntoVehicle, 250, 1, hitElement, jobVehicles[hitElement]) -- warps the player inside the vehicle end end ) ambulancee= createMarker(1178.0423583984, -1338.7836914063, 13, "cylinder", 2.0, 255, 255,255, 255) -- Creates a marker in the center of the map setElementVisibleTo(ambulance, root, false) local jobVehicles = {} addEventHandler("onMarkerHit", ambulancee, function(hitElement) if (getElementType(hitElement) ~= "player") then return end local x, y, z = getElementPosition(hitElement) -- Gets the player's position and get his x,y,z coordinates local team = getPlayerTeam(hitElement) -- Gets the player's current team if(isPedInVehicle(hitElement)) then return end if (jobVehicles[hitElement] and isElement(jobVehicles[hitElement])) then destroyElement(jobVehicles[hitElement]) end if (team and getTeamName(team) == "Medic") then setElementVisibleTo(ambulance, root, true) jobVehicles[hitElement] = createVehicle (416, x, y, z, 0, 0, -90) -- creates a infernus at the player coordenates setTimer(warpPedIntoVehicle, 250, 1, hitElement, jobVehicles[hitElement]) -- warps the player inside the vehicle end end )
  8. yes i just need that onMarkerLeav Script
  9. thnx it's work but how to make gates closed onMarkerLeave ?
  10. this is my gates now how to make it openned by acl group members? local gate = createObject(980, 1128.3000488281, -1541.0999755859, 16.10000038147, 0, 0, 180) local marker = createMarker(1128.3000488281, -1543.5999755859, 13.300000190735, "cylinder", 2, 255, 255, 255, 255) function moveGate(hitPlayer, matchingDimension) if hasObjectPermissionTo(hitPlayer, "function.kickPlayer") then moveObject(gate, 2000, 1118, -1541.0999755859, 16.10000038147) setTimer(moveBack, 2000, 1) end end addEventHandler("onMarkerHit", marker, moveGate) function moveBack() moveObject(gate, 2000, 1128.3000488281, -1541.0999755859, 16.10000038147) end
  11. how to make gates openned by ACL group? i create one but it's oppenned by team
  12. i know what i need to do but i don't know script
  13. but Tapl how to make if player occupation is Pilot then i can see marker for exampl?
  14. ok when i go to destanation the car destroyed and i can' see another blip how to fix it? addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function () missionXML = xmlLoadFile("truckmissions.xml"); end ) TruckMissionMarker = createMarker (-76, -1136, 1, "cylinder", 2, 255, 0, 0, 127, getRootElement()) TruckingMinigameBlip = createBlipAttachedTo ( TruckMissionMarker, 51, 2, 0, 0, 255, 255, 0, 250, getRootElement() ) addEventHandler ("onMarkerHit", getRootElement(), function (hitElement, matchingDim) if (source == TruckMissionMarker) and (getElementType(hitElement) == "player") then if not (isGuestAccount (getPlayerAccount (hitElement))) then local lastTruckMission = getAccountData (getPlayerAccount (hitElement), "lastTruckMission") if (lastTruckMission) then preTruckMission (hitElement, tonumber(lastTruckMission)+1) else preTruckMission (hitElement, 0) end end end if (getElementType (hitElement) == "vehicle") and (getElementID (hitElement) == "missiontruck") and (getElementID (source) == "TruckFinishMarker") and (getVehicleOccupant (hitElement)) then local markerParent = getElementParent (source) local truckParent = getElementParent (hitElement) if (markerParent == truckParent) then local reward = getElementData (markerParent, "reward") local damage = getElementHealth (hitElement) local exactReward = (damage / 1000 * reward ) local actualReward = math.round(tonumber(exactReward)) givePlayerMoney (getVehicleOccupant(hitElement), actualReward) local thePlayer = getVehicleOccupant(hitElement) outputChatBox ("#00aafftruck Mission:#ffffff Mission passed! You've won $" .. tostring(actualReward) .. "!", getVehicleOccupant(hitElement), 255, 255, 255, true) destroyElement (markerParent) triggerClientEvent (thePlayer, "ClientHideTruckMissionGUI", thePlayer) if not isGuestAccount (getPlayerAccount(thePlayer)) then local lastTruckMission = getAccountData (getPlayerAccount (thePlayer), "lastTruckMission") if (lastTruckMission) then setAccountData ( getPlayerAccount (thePlayer), "lastTruckMission", tonumber(lastTruckMission) +1) else setAccountData ( getPlayerAccount (thePlayer), "lastTruckMission", 0) end end end end end ) function preTruckMission (thePlayer, number) local missionroot = xmlFindChild (missionXML, "mission", number) if (missionroot) and (xmlNodeGetAttributes (missionroot)) then local misAtt = xmlNodeGetAttributes (missionroot) local title = misAtt["title"] local time = tostring (tonumber(misAtt["time"])) .. " seconds" local truckname = getVehicleNameFromModel(tonumber(misAtt["truck"])) local reward = tostring (misAtt["reward"]) .. " $" local description = xmlNodeGetValue (missionroot) triggerClientEvent (thePlayer, "ClientStartTruckMission", thePlayer, number, title, time, truckname, description, reward) else outputChatBox ("#00aaffTruck Mission:#ffffff All missions sucessfully done", thePlayer, 255, 255, 255, true) end end addEvent ("ServerStartTruckMission", true) addEventHandler ("ServerStartTruckMission", getRootElement(), function() if not (getElementByID (getPlayerNametagText (source) .. "_mission")) then if not (isGuestAccount (getPlayerAccount (source))) then local lastTruckMission = getAccountData (getPlayerAccount (source), "lastTruckMission") if (lastTruckMission) then number = tonumber(lastTruckMission) +1 else number = 0 end end local missionroot = xmlFindChild (missionXML, "mission", number) local misAtt = xmlNodeGetAttributes (missionroot) local title = misAtt["title"] local time = tonumber(misAtt["time"]) local truckId = tonumber(misAtt["truck"]) local x = tonumber(misAtt["x"]) local y = tonumber(misAtt["y"]) local z = tonumber(misAtt["z"]) local reward = tonumber(misAtt["reward"]) local description = xmlNodeGetValue (missionroot) local truck = createVehicle (truckId, -81, -1127, 2, 0, 0, 65, "MISSION") local trailer = createVehicle (584, 0, 0, 0, 0, 0, 0, "MISSION") attachTrailerToVehicle(truck, trailer) local destinationMarker = createMarker (x, y, z, "cylinder", 5, 0, 255, 255, 128, source) destinationBlip = createBlipAttachedTo (destinationMarker, 53, 2, 255, 255, 255, 255, 0, 9999, source ) local truckJobElement = createElement ("truckMission", getPlayerNametagText(source) .. "_mission") setElementData (truckJobElement, "reward", reward) warpPedIntoVehicle (source, truck) setVehicleLocked (truck, true) setElementData (truck, "TruckMisison", true) setElementID (truck, "missiontruck") setElementID (destinationMarker, "TruckFinishMarker") setElementID (destinationBlip, "TruckDestinationBlip") setElementParent (truck, truckJobElement) setElementParent (destinationMarker, truckJobElement) setElementParent (destinationBlip, truckJobElement) setElementParent (trailer, truckJobElement) setTimer(endTruckMission, time*1000, 1, source) triggerClientEvent (source, "ClientShowTruckMissionGUI", source) else outputChatBox ("#00aaffTruck Mission:#ffffff First finish your current mission!", source, 255, 255, 255, true) end end ) function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end
×
×
  • Create New...