Jump to content

||BuLLeT||

Members
  • Posts

    112
  • Joined

  • Last visited

Posts posted by ||BuLLeT||

  1. Hello, its me again, i have problem with pilot job, when ever i go to marker on airport without plane i get money, i want to get it only when you do delivery from one airport to another

    server

    rootElement = getRootElement() 
    local lvairportblip = createBlip(1674, 1447.5, 11, 5) 
      
    planemarkerlv = createMarker(1674, 1447.5, 9.5, "cylinder", 5, 255, 0, 0, 160) 
    gate1LVmarker = createMarker(1576.5, 1495.30, 13, "cylinder", 18, 0, 155, 255, 30) 
    gate2LVmarker = createMarker(1570.8, 1532.87, 13, "cylinder", 18, 0, 155, 255, 30) 
    gate3LVmarker = createMarker(1602.5, 1546.54, 13, "cylinder", 18, 0, 155, 255, 30) 
    gate4LVmarker = createMarker(1576.7, 1401.46, 13, "cylinder", 18, 0, 155, 255, 30) 
    gate5LVmarker = createMarker(1570.8, 1363.94, 13, "cylinder", 18, 0, 155, 255, 30) 
    gate6LVmarker = createMarker(1601.4, 1350.91, 13, "cylinder", 18, 0, 155, 255, 30) 
      
      
    gate1SFmarker = createMarker(-1350.1, -235.77, 16, "cylinder", 18, 0, 155, 255, 30) 
    gate2SFmarker = createMarker(-1298.6, -366.46, 16, "cylinder", 18, 0, 155, 255, 30) 
    gate3SFmarker = createMarker(-1462.2, -157.35, 16, "cylinder", 18, 0, 155, 255, 30) 
    gate4SFmarker = createMarker(-1362.5, -146.57, 16, "cylinder", 18, 0, 155, 255, 30) 
    gate5SFmarker = createMarker(-1257.2, -252.85, 16, "cylinder", 18, 0, 155, 255, 30) 
      
    gate1LSmarker = createMarker(1569.78, -2433.4, 15, "cylinder", 18, 0, 155, 255, 30) 
    gate2LSmarker = createMarker(1654.20, -2440, 15, "cylinder", 18, 0, 155, 255, 30) 
    gate3LSmarker = createMarker(1884.6, -2388.15, 15, "cylinder", 18, 0, 155, 255, 30) 
      
    addEvent ("airLVviewGUI", true) 
    function markerHit (hitPlayer, matchingDimension) 
      if (source == planemarkerlv) then 
        triggerClientEvent ("airLVviewGUI", hitPlayer) 
        outputChatBox ("Welcome to Las Venturas Airport!", hitPlayer, 255, 255, 255) 
      end 
    end 
    addEventHandler ("onMarkerHit", getRootElement(), markerHit) 
      
    addEvent ("gateLVviewGUI", true) 
    function markerHitLVgate (hitPlayer, matchingDimension) 
    local theVehicle = getPedOccupiedVehicle (hitPlayer) 
    local id = getElementModel(theVehicle) 
      if ((source == gate1LVmarker) or (source == gate2LVmarker) or (source == gate3LVmarker) or (source == gate4LVmarker) or (source == gate5LVmarker) or (source == gate6LVmarker)) and (id == 511 or id == 577 or id == 592) then 
        if ((getAccountData (getPlayerAccount (hitPlayer), "flightDestination")) == "LV") then 
        givePlayerMoney (hitPlayer, 3000) 
        outputChatBox ("Welcome to Las Venturas Int. wait while you're unloading", hitPlayer, 255, 255, 0) 
        end  
        triggerClientEvent ("gateLVviewGUI", hitPlayer) 
        setTimer(function() 
        outputChatBox ("You are loaded and ready for departure", hitPlayer, 255, 255, 0) end, 
        5000,1) 
            elseif ((source == gate1LVmarker) or (source == gate2LVmarker) or (source == gate3LVmarker) or (source == gate4LVmarker) or (source == gate5LVmarker) or (source == gate6LVmarker)) then 
        outputChatBox ("You can't pick up passegers without a plane", hitPlayer, 255, 0, 0) 
      end 
    end 
    addEventHandler ("onMarkerHit", getRootElement(), markerHitLVgate) 
      
      
    addEvent ("gateSFviewGUI", true) 
    function markerHitSFgate (hitPlayer, matchingDimension) 
    local theVehicle = getPedOccupiedVehicle (hitPlayer) 
    local id = getElementModel(theVehicle) 
      if ((source == gate1SFmarker) or (source == gate2SFmarker) or (source == gate3SFmarker) or (source == gate4SFmarker) or (source == gate5SFmarker)) and (id == 511 or id == 577 or id == 592) then 
        if ((getAccountData (getPlayerAccount (hitPlayer), "flightDestination")) == "SF")  then 
        givePlayerMoney (hitPlayer, 3000) 
        outputChatBox ("Welcome to San Fierro Int. wait while you're unloading", hitPlayer, 255, 255, 0) 
        end 
        triggerClientEvent ("gateSFviewGUI", hitPlayer) 
        setTimer(function() 
        outputChatBox ("You are loaded and ready for departure", hitPlayer, 255, 255, 0) end, 
        5000,1) 
        elseif ((source == gate1SFmarker) or (source == gate2SFmarker) or (source == gate3SFmarker)) then 
        outputChatBox ("You can't pick up passegers without a plane", hitPlayer, 255, 0, 0) 
      end 
    end 
    addEventHandler ("onMarkerHit", getRootElement(), markerHitSFgate) 
      
    addEvent ("gateLSviewGUI", true) 
    function markerHitLSgate (hitPlayer, matchingDimension) 
    local theVehicle = getPedOccupiedVehicle (hitPlayer) 
    local id = getElementModel(theVehicle) 
      if ((source == gate1LSmarker) or (source == gate2LSmarker) or (source == gate3LSmarker)) and (id == 511 or id == 577 or id == 592) then 
        if ((getAccountData (getPlayerAccount (hitPlayer), "flightDestination")) == "LS")  then 
        outputChatBox ("Welcome to Los Santos Int. wait while you're unloading", hitPlayer, 255, 255, 0) 
        givePlayerMoney(hitPlayer, 3000)     
        end 
        triggerClientEvent ("gateLSviewGUI", hitPlayer) 
        setTimer(function() 
        outputChatBox ("You are loaded and ready for departure", hitPlayer, 0, 255, 0) end, 
        5000,1) 
        elseif ((source == gate1LSmarker) or (source == gate2LSmarker) or (source == gate3LSmarker)) then 
        outputChatBox ("You can't pick up passegers without a plane", hitPlayer, 255, 0, 0) 
      end 
    end 
    addEventHandler ("onMarkerHit", getRootElement(), markerHitLSgate) 
      
    addEvent ("planeSpawn", true) 
    addEventHandler ("planeSpawn", getRootElement(), 
        function (aircraft) 
        Plane = createVehicle(tonumber(aircraft), 1477.4, 1270.9, 11) 
        setCameraMatrix(1502, 1292, 11, 1475, 1288, 13.8, 90, 90) 
        warpPedIntoVehicle ( source, Plane ) 
        outputChatBox ("Pickup passengers at the terminal.", source, 0, 255, 0) 
         
    end) 
      
    addEvent ("setFlightPlan", true) 
    addEventHandler ("setFlightPlan", getRootElement(), 
        function (departure, destination) 
         
        outputChatBox (departure.." Airport: You have clearance to taxi to runway 69", source, 255, 255, 255)  
        setTimer(function()  
        outputChatBox (departure.." Airport: You have clearance for take-off", source, 0, 255, 0)  
        outputChatBox (departure.." Airport: Have a nice flight to "..destination, source, 0, 255, 0) end, 12000,1) 
         
        setAccountData (getPlayerAccount (source), "flightDeparture", (tostring(departure))) 
        setAccountData (getPlayerAccount (source), "flightDestination", (tostring(destination))) 
        setElementData(source, "flightDeparture", departure) 
        setElementData(source, "flightDestination", destination) 
         
    end) 
      
    addEvent ("destroyPlane", true) 
    function destroyplane() 
    local theVehicle = getPedOccupiedVehicle (source) 
    local id = getElementModel(theVehicle) 
    if (id == 511 or id == 577 or id == 592) then 
    destroyElement(Plane) 
    else 
    end 
    end 
      
      
    addEvent ("visiblePlaneMarkers", true) 
    function visiblePlaneMarkers(thePlayer) 
    local theVehicle = getPedOccupiedVehicle (thePlayer) 
    local id = getElementModel(theVehicle) 
    if (id == 511 or id == 577 or id == 592) then 
      
    else  
    end 
    end 
      
    addEventHandler("onVehicleEnter", rootElement, visiblePlaneMarkers) 
    addEventHandler("onVehicleExit", rootElement, destroyplane) 
    addEventHandler("onPlayerQuit", rootElement, destroyplane) 
    

    client

    --- PLANE SPAWN WINDOW --- 
    planeWindow = guiCreateWindow(0.35, 0.35, 0.3, 0.3,"NSH planes",true) 
    guiSetVisible (planeWindow, false) 
    guiSetAlpha(planeWindow,1) 
    guiWindowSetSizable(planeWindow,false) 
    selectLabel = guiCreateLabel(0.0423,0.1009,0.8889,0.078,"Select your plane",true,planeWindow) 
    guiSetAlpha(selectLabel,1) 
    guiLabelSetColor(selectLabel,255,255,255) 
    guiLabelSetVerticalAlign(selectLabel,"top") 
    guiLabelSetHorizontalAlign(selectLabel,"left",false) 
    guiSetFont(selectLabel,"default-bold-small") 
    planeGridList = guiCreateGridList(0.0476,0.1789,0.9048,0.6789,true,planeWindow) 
    guiGridListSetSelectionMode(planeGridList,0) 
    planeColumn = guiGridListAddColumn(planeGridList,"ID",0.2) 
    planeColumn = guiGridListAddColumn(planeGridList,"Aircraft",0.7) 
    planes = {[511] = true, [592] = true, [577] = true} 
    local planelist = { 
    {511, "KLM  Fokker 50 Cityhopper"}, 
    {577, "KLM  Boeing 737-800"}, 
    {592, "KLM  Boeing 747-400"}} 
    for i,v in ipairs (planelist) do   
        local row = guiGridListAddRow (planeGridList) 
        guiGridListSetItemText (planeGridList, row, 1, (v[1]), false, true) 
        guiGridListSetItemText (planeGridList, row, 2, tostring(v[2]), false, true) 
    end 
    flyButton = guiCreateButton(0.0476,0.8624,0.905,0.0963,"Get in a plane",true,planeWindow) 
    guiSetAlpha(flyButton,1) 
      
      
    --- LAS VENTURAS GATE WINDOW --- 
    gateLVWindow = guiCreateWindow(0.35, 0.35, 0.3, 0.2,"Las Venturas Airport",true) 
    guiSetVisible (gateLVWindow, false) 
    guiSetAlpha(gateLVWindow,1) 
    guiWindowSetSizable(gateLVWindow,false) 
    selectDestLabel = guiCreateLabel(0.0423,0.2009,0.8889,0.10,"Select your destination:",true,gateLVWindow) 
    guiSetAlpha(selectDestLabel,1) 
    guiLabelSetColor(selectLabel,255,255,150) 
    guiLabelSetVerticalAlign(selectLabel,"top") 
    guiLabelSetHorizontalAlign(selectLabel,"left",false) 
    guiSetFont(selectLabel,"default-bold-small") 
    LVtoSFbutton = guiCreateButton(0.0476,0.6624,0.45,0.2963,"San Fierro",true,gateLVWindow) 
    guiSetAlpha(LVtoSFbutton,1) 
    LVtoLSbutton = guiCreateButton(0.5476,0.6624,0.45,0.2963,"Los Santos",true,gateLVWindow) 
    guiSetAlpha(LVtoLSbutton,1) 
      
    --- SAN FIERRO GATE WINDOW --- 
    gateSFWindow = guiCreateWindow(0.35, 0.35, 0.3, 0.2,"San Fierro Airport",true) 
    guiSetVisible (gateSFWindow, false) 
    guiSetAlpha(gateSFWindow,1) 
    guiWindowSetSizable(gateSFWindow,false) 
    selectDestLabel = guiCreateLabel(0.0423,0.2009,0.8889,0.10,"Select your destination:",true,gateSFWindow) 
    guiSetAlpha(selectDestLabel,1) 
    guiLabelSetColor(selectLabel,255,255,150) 
    guiLabelSetVerticalAlign(selectLabel,"top") 
    guiLabelSetHorizontalAlign(selectLabel,"left",false) 
    guiSetFont(selectLabel,"default-bold-small") 
    SFtoLVbutton = guiCreateButton(0.0476,0.6624,0.45,0.2963,"Las Venturas",true,gateSFWindow) 
    guiSetAlpha(SFtoLVbutton,1) 
    SFtoLSbutton = guiCreateButton(0.5476,0.6624,0.45,0.2963,"Los Santos",true,gateSFWindow) 
    guiSetAlpha(SFtoLSbutton,1) 
      
    --- LOS SANTOS GATE WINDOW --- 
    gateLSWindow = guiCreateWindow(0.35, 0.35, 0.3, 0.2,"Los Santos Airport",true) 
    guiSetVisible (gateLSWindow, false) 
    guiSetAlpha(gateLSWindow,1) 
    guiWindowSetSizable(gateLSWindow,false) 
    selectDestLabel = guiCreateLabel(0.0423,0.2009,0.8889,0.10,"Select your destination:",true,gateLSWindow) 
    guiSetAlpha(selectDestLabel,1) 
    guiLabelSetColor(selectLabel,255,255,150) 
    guiLabelSetVerticalAlign(selectLabel,"top") 
    guiLabelSetHorizontalAlign(selectLabel,"left",false) 
    guiSetFont(selectLabel,"default-bold-small") 
    LStoLVbutton = guiCreateButton(0.0476,0.6624,0.45,0.2963,"Las Venturas",true,gateLSWindow) 
    guiSetAlpha(SFtoLVbutton,1) 
    LStoSFbutton = guiCreateButton(0.5476,0.6624,0.45,0.2963,"San Fierro",true,gateLSWindow) 
    guiSetAlpha(SFtoLSbutton,1) 
      
      
    addEvent ("airLVviewGUI", true) 
    function airLVviewGUI () 
      if (getLocalPlayer() == source) then 
        guiSetVisible (planeWindow, true) 
        showCursor (true) 
      end 
    end 
    addEventHandler ("airLVviewGUI", getRootElement(), airLVviewGUI) 
      
    addEvent ("gateLVviewGUI", true) 
    function gateLVviewGUI () 
      if (getLocalPlayer() == source) then 
        guiSetVisible (gateLVWindow, true) 
        showCursor (true) 
      end 
    end 
    addEventHandler ("gateLVviewGUI", getRootElement(), gateLVviewGUI) 
      
    addEvent ("gateSFviewGUI", true) 
    function gateSFviewGUI () 
      if (getLocalPlayer() == source) then 
        guiSetVisible (gateSFWindow, true) 
        showCursor (true) 
      end 
    end 
    addEventHandler ("gateSFviewGUI", getRootElement(), gateSFviewGUI) 
      
    addEvent ("gateLSviewGUI", true) 
    function gateLSviewGUI () 
      if (getLocalPlayer() == source) then 
        guiSetVisible (gateLSWindow, true) 
        showCursor (true) 
      end 
    end 
    addEventHandler ("gateLSviewGUI", getRootElement(), gateLSviewGUI) 
      
    addEvent ("onClientGUIClick", true) 
    function onClientGUIClick (button, state, absoluteX, absoluteY) 
    if (source == flyButton) then guiSetVisible (planeWindow, false) showCursor (false) 
        if (guiGridListGetSelectedItem (planeGridList)) then 
          local planeID = guiGridListGetItemText (planeGridList, guiGridListGetSelectedItem (planeGridList), 1) 
          triggerServerEvent ("planeSpawn", getLocalPlayer(), planeID) 
        end 
    elseif (source == LVtoSFbutton) then guiSetVisible (gateLVWindow, false) showCursor (false) 
        departure = tostring("LV") 
        destination = tostring("SF") 
          triggerServerEvent ("setFlightPlan", getLocalPlayer(), departure, destination) 
    elseif (source == LVtoLSbutton) then guiSetVisible (gateLVWindow, false) showCursor (false) 
        departure = tostring("LV") 
        destination = tostring("LS") 
          triggerServerEvent ("setFlightPlan", getLocalPlayer(), departure, destination) 
    elseif (source == SFtoLVbutton) then guiSetVisible (gateSFWindow, false) showCursor (false) 
        departure = tostring("SF") 
        destination = tostring("LV") 
          triggerServerEvent ("setFlightPlan", getLocalPlayer(), departure, destination) 
    elseif (source == SFtoLSbutton) then guiSetVisible (gateSFWindow, false) showCursor (false) 
        departure = tostring("SF") 
        destination = tostring("LS") 
          triggerServerEvent ("setFlightPlan", getLocalPlayer(), departure, destination) 
    elseif (source == LStoLVbutton) then guiSetVisible (gateLSWindow, false) showCursor (false) 
        departure = tostring("LS") 
        destination = tostring("LV") 
          triggerServerEvent ("setFlightPlan", getLocalPlayer(), departure, destination) 
    elseif (source == LStoSFbutton) then guiSetVisible (gateLSWindow, false) showCursor (false) 
        departure = tostring("LS") 
        destination = tostring("SF") 
          triggerServerEvent ("setFlightPlan", getLocalPlayer(), departure, destination) 
      end 
      end 
      addEventHandler ("onClientGUIClick", getRootElement(), onClientGUIClick) 
    

  2. function restoreWeather() 
        local ww,bb = getWeather() 
        triggerClientEvent(source, "restoreWeather", source, ww) 
    end 
      
    addEvent("restoreWeather", true) 
    addEventHandler("restoreWeather", getRootElement(), restoreWeather) 
      
    function takeMoney(howmuch) 
        takePlayerMoney(source,tonumber(howmuch)) 
    end 
      
      
    addEvent("takeMoney", true) 
    addEventHandler("takeMoney", getRootElement(), takeMoney) 
      
    function teamName ( source, key, newTeamName ) 
        local playerTeam = getPlayerTeam ( source )          -- get the player's team 
        if ( playerTeam ) then                               -- if he's on a team 
            local oldTeamName = getTeamName ( playerTeam )   -- get the team's current name 
            setTeamName ( playerTeam, Drug Dealer )          -- change its name 
            outputChatBox ( "Changed " .. getPlayerName ( source ).."'s team name from " .. oldTeamName .. " to " .. newTeamName ) 
        else 
            outputChatBox ( getPlayerName ( source ) .. " isn't on a team" ) 
        end 
    end 
      
    function whatTeamAmIOn ( source ) 
        -- Get the player's team (source is the player who entered the command) 
        local playerTeam = getPlayerTeam ( source ) 
      
        if ( playerTeam ) then -- if he was on a team 
            outputChatBox ( getPlayerName ( source ) .. " is on team: " .. getTeamName ( playerTeam ) ) 
        else 
            outputChatBox ( getPlayerName ( source ) .. " isn't on a team" ) 
        end 
    end 
      
    -- Add console command to find your team when 'myteam' is typed. 
    addCommandHandler ( "myteam", whatTeamAmIOn ) 
    

    good?

  3. Hello, i just downloaded a drug store from community and i want this drug store cant use teams

    "Military" and "Police"!

    Server

    function restoreWeather() 
        local ww,bb = getWeather() 
        triggerClientEvent(source, "restoreWeather", source, ww) 
    end 
      
    addEvent("restoreWeather", true) 
    addEventHandler("restoreWeather", getRootElement(), restoreWeather) 
      
    function takeMoney(howmuch) 
        takePlayerMoney(source,tonumber(howmuch)) 
    end 
      
      
    addEvent("takeMoney", true) 
    addEventHandler("takeMoney", getRootElement(), takeMoney) 
    

    client

    function timeCheck() 
        local hh, mm = getTime()
        if (hh<7) then
            local ww, bb = getWeather()
            if (ww ~= -52123) then
                setWeather(-52123)
            end    
        else
            local ww, bb = getWeather()
            if (ww ~= 190) then
                setWeather(190)
            end
        end
    end
     
    function fall()
        if (isDrugActive) then
            setPedAnimation(getLocalPlayer(), "ped", "getup_front",1000, false, false)
            setTimer(function() fall() end, math.random(10000, 30000), 1)
            setTimer(function() setControlState ('jump',true) end, 1500, 1)
            setTimer(function() setControlState ('jump',false) end, 2000, 1)
        end
    end
     
    function fades()
        local rnd = math.random(2,4)
        fadeCamera(false, rnd, math.random(1,255), math.random(1,255), math.random(1,255))
        local xx, yy, zz = getElementPosition(getLocalPlayer())
        setTimer(function() fadeCamera(true, 1) end, rnd*1000/2, 1)
    end
     
     
    function drugSteer()
        left=false
        right=false
        up=false
        down=false
       
        local keys = getBoundKeys ('vehicle_left')
        if keys then
            tmpLeft = false
            for keyName, state in pairs(keys) do
                if (getKeyState(keyName)) then
                    tmpLeft=true
                end
            end
            if tmpLeft then
                left=true
                right=false
            end
        end
     
        local keys = getBoundKeys ('vehicle_right')
        if keys then
            tmpRight = false
            for keyName, state in pairs(keys) do
                if (getKeyState(keyName)) then
                    tmpRight=true
                end
            end
            if tmpRight then
                left=false
                right=true
            end
        end
     
        if (left) then
            setControlState('vehicle_left', false)
            setControlState('vehicle_right', true)
        elseif (right) then
            setControlState('vehicle_right', false)
            setControlState('vehicle_left', true)
        else
            setControlState('vehicle_right', false)
            setControlState('vehicle_left', false)
        end
       
       
        local keys = getBoundKeys ('accelerate')
        if keys then
            tmpUp = false
            for keyName, state in pairs(keys) do
                if (getKeyState(keyName)) then
                    tmpUp=true
                end
            end
            if tmpUp then
                down=false
                up=true
            end
        end
       
        local keys = getBoundKeys ('brake_reverse')
        if keys then
            tmpDown = false
            for keyName, state in pairs(keys) do
                if (getKeyState(keyName)) then
                    tmpDown=true
                end
            end
            if tmpDown then
                down=true
                up=false
            end
        end
       
        if (up) then
            setControlState('accelerate', false)
            setControlState('brake_reverse', true)
        elseif (down) then
            setControlState('brake_reverse', false)
            setControlState('accelerate', true)
        else
            setControlState('brake_reverse', false)
            setControlState('accelerate', false)
        end
    end
     
    roll = 0
    rollGrow = false
    function drugCam()
        if (rollGrow) then
            if (roll > 15) then rollGrow = false end
            roll = roll + 1
        else
            if (roll < -15) then rollGrow = true end
            roll = roll -1
        end
        local xx, yy, zz = getElementPosition(getLocalPlayer())
        local rot = getPedRotation(getLocalPlayer())
        local lx = xx + math.sin (math.rad(-rot)) * -10
        local ly = yy + math.cos (math.rad(-rot)) * -10
        setCameraMatrix(lx, ly, zz + 4, xx, yy, zz, roll)
        fxAddBlood(xx, yy, zz, 0, 0, 0, 6)
    end
     
    function startDrug(time)
        fadeCamera(false)
        setTimer(function(time)
            if (time == nil) then
                time = 10*1000
            else
                if (tonumber(time) < 5000) then
                tiaaame = 10*1000
                end
            end
           
            timerWeather = setTimer(function() timeCheck() end, 1000)
            timerFades = setTimer(function() fades() end, 4000)
            isDrugActive = true
            setTimer(function() fall() end, 1000, 1)
            addEventHandler("onClientRender", getRootElement(), drugSteer)
            addEventHandler("onClientPreRender", getRootElement(), drugCam)
           
            setTimer(function() stopDrug() end, time, 1)
        end, 1500, 1, time)
    end
     
    function stopDrug()
        fadeCamera(false)
        killTimer(timerFades)
        killTimer(timerWeather)
        isDrugActive = false
        fadeCamera(false)
        removeEventHandler("onClientRender", getRootElement(), drugSteer)
        removeEventHandler("onClientPreRender", getRootElement(), drugCam)
        fadeCamera(false)
        triggerServerEvent("restoreWeather", getLocalPlayer())
        setTimer(function()
            setCameraTarget(getLocalPlayer())
            fadeCamera(true)
        end, 2500, 1)
    end
     
    function startDrug2()
        startDrug(4)
    end
    function stopDrug2()
        stopDrug()
    end
     
    --addCommandHandler("sd", startDrug2)
    --addCommandHandler("sds", stopDrug2)
     
    function restoreWeather(ww)
        setWeather(ww)
    end
     
    addEvent("restoreWeather", true)
    addEventHandler("restoreWeather", getRootElement(), restoreWeather)
     
     
     
     
     
    function missionStart(whichMouse, state, absoluteX, absoluteY)
        local number = getElementData(source,"number") -- this is the button "id"
       
        local money=getPlayerMoney(getLocalPlayer())
        if (number=='a') then
            if (money>=1000) then
                startDrug(1*60*1000)
                triggerServerEvent("takeMoney", getLocalPlayer(),1000)
            else
                outputChatBox("You don't have the money!", 255, 0, 0)
            end
        elseif (number=='b') then
            if (money>=3000) then
                startDrug(3*60*1000)
                triggerServerEvent("takeMoney", getLocalPlayer(),3000)
            else
                outputChatBox("You don't have the money!", 255, 0, 0)
            end
        elseif (number=='c') then
            if (money>=5000) then
                startDrug(6*60*1000)
                triggerServerEvent("takeMoney", getLocalPlayer(),5000)
            else
                outputChatBox("You don't have the money!", 255, 0, 0)
            end
        else
            if (money>=8000) then
                startDrug(10*60*1000)
                triggerServerEvent("takeMoney", getLocalPlayer(),8000)
            else
                outputChatBox("You don't have the money!", 255, 0, 0)
            end
        end
     
        --outputChatBox("#00ff00\"dfdf\" #ffffff started!",255,255,255,true)
        guiSetVisible (missionSelectWindow1, false)
        showCursor (false)
    end
     
     
    -- this fires when player hits the marker
    function missionSelect(hitPlayer, matchingDimension)
        if (hitPlayer == getLocalPlayer()) and (isPedOnGround (getLocalPlayer()) and not isPedInVehicle(hitPlayer)) then
            if isDrugActive then
                outputChatBox("You are already drugged! Do you want to die?!", 255, 0, 0)
            else
                guiSetVisible (missionSelectWindow1, true)
                guiBringToFront (missionSelectWindow1)
                showCursor (true)   
            end
        end
    end
     
    function guiCancel ()
        guiSetVisible (missionSelectWindow1, false)
       
  4. now GUI is showing only when i stand on disc in LS,thats good, but when i go to disc in SF it wont show up, and when i click "Close" on GUI, GUI is not closing and when i click "Start New Life" it dont kill me...hope you can fix it and sorry for bothering you for soo long

  5. good but problem is in GUI now, its showing when i start script

    GUIEditor = { 
        tab = {}, 
        button = {}, 
        edit = {}, 
        window = {}, 
        gridlist = {}, 
        label = {}, 
        tabpanel = {}, 
    } 
    GUIEditor.window[1] = guiCreateWindow(240, 267, 632, 467, "Hawk|RPG Disc System", false) 
    guiWindowSetSizable(GUIEditor.window[1], false) 
      
    GUIEditor.tabpanel[1] = guiCreateTabPanel(10, 23, 613, 388, false, GUIEditor.window[1]) 
      
    GUIEditor.tab[1] = guiCreateTab("Disc", GUIEditor.tabpanel[1]) 
      
    GUIEditor.label[1] = guiCreateLabel(15, 36, 226, 59, "Address:", false, GUIEditor.tab[1]) 
    local font_0 = guiCreateFont(":[Hawk]GuiEditor/fonts/PetitFormalScript.ttf") 
    guiSetFont(GUIEditor.label[1], font_0) 
    guiLabelSetColor(GUIEditor.label[1], 255, 254, 254) 
    GUIEditor.label[2] = guiCreateLabel(15, 95, 226, 59, "Value:", false, GUIEditor.tab[1]) 
    guiSetFont(GUIEditor.label[2], font_0) 
    guiLabelSetColor(GUIEditor.label[2], 255, 254, 254) 
    GUIEditor.label[3] = guiCreateLabel(15, 154, 226, 59, "Owner:", false, GUIEditor.tab[1]) 
    guiSetFont(GUIEditor.label[3], font_0) 
    guiLabelSetColor(GUIEditor.label[3], 255, 254, 254) 
    GUIEditor.button[1] = guiCreateButton(21, 229, 129, 44, "Buy", false, GUIEditor.tab[1]) 
    GUIEditor.button[2] = guiCreateButton(21, 300, 129, 44, "Sell", false, GUIEditor.tab[1]) 
      
    GUIEditor.tab[2] = guiCreateTab("Garage", GUIEditor.tabpanel[1]) 
      
    GUIEditor.gridlist[1] = guiCreateGridList(13, 23, 587, 197, false, GUIEditor.tab[2]) 
    guiGridListAddColumn(GUIEditor.gridlist[1], "Names", 0.2) 
    guiGridListAddColumn(GUIEditor.gridlist[1], "Health", 0.2) 
    guiGridListAddColumn(GUIEditor.gridlist[1], "Fuel", 0.2) 
    guiGridListAddColumn(GUIEditor.gridlist[1], "Cost", 0.2) 
    guiGridListAddColumn(GUIEditor.gridlist[1], "Status", 0.2) 
    GUIEditor.button[3] = guiCreateButton(28, 234, 175, 67, "Spawn Vehicle", false, GUIEditor.tab[2]) 
    GUIEditor.button[4] = guiCreateButton(226, 234, 175, 67, "Repair Vehicle", false, GUIEditor.tab[2]) 
    GUIEditor.button[5] = guiCreateButton(420, 234, 175, 67, "Park Vehicle", false, GUIEditor.tab[2]) 
      
    GUIEditor.tab[3] = guiCreateTab("Weapons", GUIEditor.tabpanel[1]) 
      
    GUIEditor.gridlist[2] = guiCreateGridList(26, 69, 220, 285, false, GUIEditor.tab[3]) 
    guiGridListAddColumn(GUIEditor.gridlist[2], "Weapon", 0.4) 
    guiGridListAddColumn(GUIEditor.gridlist[2], "Ammo", 0.4) 
    GUIEditor.gridlist[3] = guiCreateGridList(383, 69, 220, 285, false, GUIEditor.tab[3]) 
    guiGridListAddColumn(GUIEditor.gridlist[3], "Weapon", 0.4) 
    guiGridListAddColumn(GUIEditor.gridlist[3], "Ammo", 0.4) 
    GUIEditor.label[4] = guiCreateLabel(63, 48, 219, 42, "Your Weapons", false, GUIEditor.tab[3]) 
    guiSetFont(GUIEditor.label[4], font_0) 
    GUIEditor.label[5] = guiCreateLabel(468, 48, 219, 42, "Storage", false, GUIEditor.tab[3]) 
    guiSetFont(GUIEditor.label[5], font_0) 
    GUIEditor.button[6] = guiCreateButton(262, 118, 103, 55, "--->", false, GUIEditor.tab[3]) 
    GUIEditor.button[7] = guiCreateButton(262, 228, 103, 55, "<---", false, GUIEditor.tab[3]) 
    GUIEditor.edit[1] = guiCreateEdit(264, 180, 101, 43, "     ammo     ", false, GUIEditor.tab[3]) 
    GUIEditor.button[9] = guiCreateButton(255, 10, 125, 61, "Done", false, GUIEditor.tab[3]) 
      
      
    GUIEditor.button[10] = guiCreateButton(32, 419, 187, 39, "Start New Life", false, GUIEditor.window[1]) 
    GUIEditor.button[11] = guiCreateButton(426, 418, 187, 39, "Close", false, GUIEditor.window[1]) 
    function kill3() 
        triggerServerEvent("kill", localPlayer) 
        guiSetVisible(GUIEditor_Window[1], false) 
        guiSetVisible(GUIEditor_Label[1], false) 
        guiSetVisible(GUIEditor_Label[2], false) 
        guiSetVisible(GUIEditor_Label[3], false) 
        guiSetVisible(GUIEditor_Label[4], false) 
        guiSetVisible(GUIEditor_Label[5], false) 
        guiSetVisible(GUIEditor_Label[6], false) 
        guiSetVisible(GUIEditor_Label[7], false) 
        guiSetVisible(GUIEditor_Label[8], false) 
        guiSetVisible(GUIEditor_Label[9], false) 
        guiSetVisible(GUIEditor_Label[10], false) 
        guiSetVisible(GUIEditor_TabPanel[1], false) 
        guiSetVisible(GUIEditor_Label[6], false) 
        guiSetVisible(GUIEditor_Tab[2], false) 
        guiSetVisible(GUIEditor_Tab[3], false) 
        guiSetVisible(GUIEditor_Label[7], false) 
        guiSetVisible(GUIEditor_Button[2], false) 
        showCursor(false) 
    end 
    addEventHandler("onClientGUIClick", GUIEditor_Button[5], kill3, false) 
      
    function hide() 
        guiSetVisible(GUIEditor_Window[1], false) 
        guiSetVisible(GUIEditor_Label[1], false) 
        guiSetVisible(GUIEditor_Label[2], false) 
        guiSetVisible(GUIEditor_Label[3], false) 
        guiSetVisible(GUIEditor_Label[4], false) 
        guiSetVisible(GUIEditor_Label[5], false) 
        guiSetVisible(GUIEditor_Label[6], false) 
        guiSetVisible(GUIEditor_Label[7], false) 
        guiSetVisible(GUIEditor_Label[8], false) 
        guiSetVisible(GUIEditor_Label[9], false) 
        guiSetVisible(GUIEditor_Label[10], false) 
        guiSetVisible(GUIEditor_TabPanel[1], false) 
        guiSetVisible(GUIEditor_Label[6], false) 
        guiSetVisible(GUIEditor_Tab[2], false) 
        guiSetVisible(GUIEditor_Tab[3], false) 
        guiSetVisible(GUIEditor_Label[7], false) 
        guiSetVisible(GUIEditor_Button[2], false) 
        showCursor ( false ) 
    end 
    addEventHandler( "onClientResourceStart", getRootElement( ), hide) 
    addEventHandler ( "onClientGUIClick", GUIEditor_Button[4], hide, false ) 
      
      
    addEvent ("RespawnGUI",true) 
    addEventHandler ("RespawnGUI",getResourceRootElement(getThisResource()),RespawnGUI2) 
    

  6. function Respawnfunction1() 
            Respawn = createMarker(1565.5197753906,-1634.7216796875,13.55480670929,"cylinder",0.2999, 248, 248, 255, 150 ) 
        cph = createPickup (1565.5197753906,-1634.7216796875,13.55480670929, 3, 1277, 0 ) 
            Respawn2 = createMarker(-2442.1293,753.10,35.17,"cylinder",0.2999, 248, 248, 255, 150 ) 
        cpp = createPickup (-2442.1293,753.10,35.17, 3, 1277, 0 ) 
            
    end 
    addEventHandler ("onResourceStart",getResourceRootElement(getThisResource()),Respawn-function1) 
      
    blip = createBlip ( 1565.5197753906,-1634.7216796875,13.55480670929,35 ) 
    blip2 = createBlip ( -2442.1293,753.10,35.17,35 )   
      
    function RespawnGUI2(hitElement) 
        if source == Respawn1 then 
            triggerClientEvent (hitElement,"RespawnGUI",getRootElement()) 
        elseif source == Respawn then 
        triggerClientEvent (hitElement,"RespawnGUI",getRootElement()) 
        end 
    end 
    addEventHandler ("onMarkerHit",getRootElement(),RespawnGUI) 
      
    function kill2() 
        setElementHealth(source,0) 
    end 
    addEvent("kill", true) 
    addEventHandler("kill",getRootElement(),kill2) 
    

×
×
  • Create New...