Jump to content

Jokeℝ1472771893

Members
  • Posts

    334
  • Joined

  • Last visited

Everything posted by Jokeℝ1472771893

  1. 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
  2. can i ask another question here? or i need to open new topic?
  3. Tapl i mean i whant it works not by team.i whant it work by occupation (if player occupation is Mechanic hecan spawn vehicle for exampl)
  4. thnx and how to make this job by Occupation now by team? addEventHandler("onPlayerLogin", root, function() setTimer( function(source) if isPlayerInTeam(source, "Mechanics") then triggerClientEvent(source, "setMechanic", source) setElementData(source, "canFix", true) end setElementData(source, "orderedMechanic", false) end , 500, 1, source) end ) Edit:look line 5
  5. teamcivil = createTeam ("Civilian Jobs",255,255,0) local hook= createMarker (1978.3990478516,-1784.8236083984,13, "cylinder", 1.5,255,0,255) function hookjob( hitPlayer, matchingDimension ) fadeCamera(hitPlayer,false,1 ) setTimer(fadeCamera,1000,1,hitPlayer,true,5 ) setPlayerTeam ( hitPlayer, teamcivil ) setElementData ( hookjob, "Occupation", "Hooker" ) takeAllWeapons ( hitPlayer ) giveWeapon ( hitPlayer, 12, 1 ) setPlayerNametagColor ( hitPlayer,255,0,255 ) setElementModel ( hitPlayer, 85 ) end addEventHandler( "onMarkerHit",hook,hookjob ) when i hit marker my team set to Civilian Jobs i don't have occupation please help
  6. Server Side local vehicles = { } addEvent ( "spawnvehicle", true ) addEventHandler ( "spawnvehicle", root, function ( vehID ) if ( isElement ( vehicles [ source ] ) ) then destroyElement ( vehicles [ source ] ) end vehicles [ source ] = createVehicle ( vehID, 2168.0910644531, -2275.087890625, 13.5,0,0,220 ) if ( vehicles [ source ] ) then end setTimer ( warpPedIntoVehicle, 200, 1, source, vehicles [ source ] ) triggerClientEvent ( source, "closeWindow", root ) end) when I spawn a car always it spawn 2 of them .
  7. hhm ok and what i will change to fix that problem?
  8. i have question when players die they lose their team how to fix it
  9. "JokeR" name="warp" version="1.2" type="script" description="N/A" />
  10. hhm please someone can tell me the link or script where i can learn how to create /warp system(when player type /warp he spawn in some x,y,z location and he is frozen)
×
×
  • Create New...