Jump to content

عن الماركر | تمت الافادة من قبل ابوشننب


Recommended Posts

السلآم عليكم ..

شباب, انا عندي زر, اذا ضغطته يسوي ماركر في احداثيات عشوائية (بجدول) فـ انا ابيه اذا ضغط الزر مرة, مايقدر يضغط الزر الا اذا طلع من التيم, ورجع دخل

ارجوا المساعدة, لاني من قبل سويت موضوع وحسيت ان شرحي غبي

شكرا

Edited by Guest
Link to comment

السلآم عليكم ..

شباب, انا عندي زر, اذا ضغطته يسوي ماركر في احداثيات عشوائية (بجدول) فـ انا ابيه اذا ضغط الزر مرة, مايقدر يضغط الزر الا اذا طلع من التيم, ورجع دخل

ارجوا المساعدة, لاني من قبل سويت موضوع وحسيت ان شرحي غبي

شكرا

شرحك ما ينفهم منه شي .. :mrgreen:

اطرح الكود يمكن نفهم منه شي .. :wink:

او تقصد اذا ضغط الزر يختفي يصير مايمديه يضغط الا اذا دخل الماركر ولا كيف .. :D

Link to comment

عندك ماركر, فيه نافذ

تدخل الماركر, يفتح لك النافذ

النافذ فيه زر, يسوي ماركر

اذا ضغطت الزر, وضغطته مرة ثانية مايستوي الافنت

طبعا انا بسس ابي اخر سطر, اللي فوق سويته

Link to comment

عندك ماركر, فيه نافذ

تدخل الماركر, يفتح لك النافذ

النافذ فيه زر, يسوي ماركر

اذا ضغطت الزر, وضغطته مرة ثانية مايستوي الافنت

طبعا انا بسس ابي اخر سطر, اللي فوق سويته

استخدم


عشان تخفي الزر .. ^_^

Link to comment

خخخخخخخ, كان قلت لي

local PosX,PosY,PosZ = unpack( vTable [ math.random( #vTable ) ] ) 
addEventHandler ( "onClientGUIClick", root, 
    function() 
    if source == GUIEditor.button[1] then 
               guiSetVisible ( GUIEditor.window[1], false ) 
               showCursor ( false ) 
               setElementData ( source, "Job", true ) 
                        triggerServerEvent ("Setskin", getLocalPlayer()) 
                        triggerServerEvent ("SetTeam", getLocalPlayer()) 
                        if one = createMarker ( PosX,PosY,PosZ, "cylinder", 1.5, 255, 255, 0, 170 ) then 
                        guiSetEnabled ( GUIEditor.button[1], false ) 
                        end 
                        addEventHandler ( "onClientMarkerHit", one, moneys ) 
                              jobV = createMarker ( -2162.873, 254.4054, 34.5, "cylinder", 1.5, 255, 255, 0, 170 ) 
                                    addEventHandler ( "onClientMarkerHit", jobV, showUserPanelV ) 
                                    createBlipAttachedTo ( one, 51 ) 
                                    end 
       end ) 

ادري افنتات بدون وظايف, بسس الوظايف في تكملة المود, ماتوقع انكك تحتاجها

Link to comment

  
local PosX,PosY,PosZ = unpack( vTable [ math.random( #vTable ) ] ) 
addEventHandler ( "onClientGUIClick", root, 
    function() 
    if source == GUIEditor.button[1] then 
               guiSetVisible ( GUIEditor.window[1], false ) 
               showCursor ( false ) 
               setElementData ( source, "Job", true ) 
                        triggerServerEvent ("Setskin", getLocalPlayer()) 
                        triggerServerEvent ("SetTeam", getLocalPlayer()) 
                        guiSetEnabled ( GUIEditor.button[1], false ) 
                        addEventHandler ( "onClientMarkerHit", one, moneys ) 
                              jobV = createMarker ( -2162.873, 254.4054, 34.5, "cylinder", 1.5, 255, 255, 0, 170 ) 
                                    addEventHandler ( "onClientMarkerHit", jobV, showUserPanelV ) 
                                    createBlipAttachedTo ( one, 51 ) 
                                    end 
       end ) 
  

افضل لك لا تحط if لان بس يضغط الزر راح يسوي الماركر ما يحتاج تتاكد .. :wink:

Link to comment
job = createMarker ( -2168.5, 243.39999389648, 34.299999237061, "cylinder", 1.5, 255, 255, 0, 170 ) 
  
addEventHandler('onClientMarkerHit',job, 
function(player) 
    if player == localPlayer then 
  if getPlayerTeam(player) and (getTeamName(getPlayerTeam(player)) == 'Civilian') then return end 
            if not guiGetVisible ( GUIEditor.window[1] ) then guiSetVisible ( GUIEditor.window[1], true ) showCursor ( true ) 
    else 
    outputChatBox('You Must be in team (Civilian)') 
                end 
            end 
            end) 
  
function Click() 
if source == vehicleb1  then 
local Row, Col = guiGridListGetSelectedItem( vehicleG ) 
local NameVehicle = guiGridListGetItemText( vehicleG, Row, Col ) 
if NameVehicle == "Boxville" then 
if triggerServerEvent("createCar", getLocalPlayer()) then 
        guiSetVisible ( vehiclew, false ) 
                showCursor ( false ) 
end 
end 
end   
end 
addEventHandler( "onClientGUIClick", getRootElement(), Click ) 
  
addEventHandler ( "onClientGUIClick", root, 
    function() 
        if source == GUIEditor.button[2] then 
        guiSetVisible ( GUIEditor.window[1], false ) 
                showCursor ( false ) 
        end 
        end 
) 
  
addEventHandler ( "onClientGUIClick", root, 
    function() 
        if source == vehicleb2 then 
        guiSetVisible ( vehiclew, false ) 
                showCursor ( false ) 
        end 
        end 
) 
  
  
vTable = { 
   [ 1 ] = { -2695.6999511719, -185.30000305176, 3.3000001907349 }, 
   [ 2 ] = { -2717, -95.5, 3.3000001907349 }, 
                       
} 
  
  
local PosX,PosY,PosZ = unpack( vTable [ math.random( #vTable ) ] ) 
addEventHandler ( "onClientGUIClick", root, 
    function() 
    if source == GUIEditor.button[1] then 
               guiSetVisible ( GUIEditor.window[1], false ) 
               showCursor ( false ) 
               setElementData ( source, "Job", true ) 
                        triggerServerEvent ("Setskin", getLocalPlayer()) 
                        triggerServerEvent ("SetTeam", getLocalPlayer()) 
                        if one = createMarker ( PosX,PosY,PosZ, "cylinder", 1.5, 255, 255, 0, 170 ) then 
                        guiSetEnabled ( GUIEditor.button[1], false ) 
                        end 
                        addEventHandler ( "onClientMarkerHit", one, moneys ) 
                              jobV = createMarker ( -2162.873, 254.4054, 34.5, "cylinder", 1.5, 255, 255, 0, 170 ) 
                                    addEventHandler ( "onClientMarkerHit", jobV, showUserPanelV ) 
                                    createBlipAttachedTo ( one, 51 ) 
                                    end 
       end ) 
  
  
    function moneys ( hitElement ) 
        local x,y,z = getElementPosition ( source ) 
            local px,py,pz = getElementPosition ( hitElement ) 
                if z and pz then 
                    local check = math.abs ( pz - z ) 
                    if 2 >= check then 
  if getPlayerTeam(hitElement) and (getTeamName(getPlayerTeam(hitElement)) == 'Civilian') then 
                    triggerLatentServerEvent ( "money",hitElement ) 
                    local PosX,PosY,PosZ = unpack( vTable [ math.random( #vTable ) ] ) 
                    setElementPosition (one, PosX, PosY, PosZ)   
                end 
            end 
            end 
            end 

Link to comment

  
job = createMarker ( -2168.5, 243.39999389648, 34.299999237061, "cylinder", 1.5, 255, 255, 0, 170 ) 
  
addEventHandler('onClientMarkerHit',job, 
function(player) 
    if player == localPlayer then 
  if getPlayerTeam(player) and (getTeamName(getPlayerTeam(player)) == 'Civilian') then return end 
  if not guiGetVisible ( GUIEditor.window[1] ) then guiSetVisible ( GUIEditor.window[1], true ) showCursor ( true ) 
  else 
   outputChatBox('You Must be in team (Civilian)') 
        end 
    end 
end) 
  
function Click() 
if source == vehicleb1  then 
local Row, Col = guiGridListGetSelectedItem( vehicleG ) 
local NameVehicle = guiGridListGetItemText( vehicleG, Row, Col ) 
if NameVehicle == "Boxville" then 
if triggerServerEvent("createCar", getLocalPlayer()) then 
    guiSetVisible ( vehiclew, false ) 
    showCursor ( false ) 
end 
end 
end 
end 
addEventHandler( "onClientGUIClick", getRootElement(), Click ) 
  
addEventHandler ( "onClientGUIClick", root, 
    function() 
        if source == GUIEditor.button[2] then 
        guiSetVisible ( GUIEditor.window[1], false ) 
        showCursor ( false ) 
        end 
    end 
) 
  
addEventHandler ( "onClientGUIClick", root, 
    function() 
        if source == vehicleb2 then 
        guiSetVisible ( vehiclew, false ) 
        showCursor ( false ) 
    end 
  end 
) 
  
  
vTable = { 
   [ 1 ] = { -2695.6999511719, -185.30000305176, 3.3000001907349 }, 
   [ 2 ] = { -2717, -95.5, 3.3000001907349 }, 
  
} 
  
  
local PosX,PosY,PosZ = unpack( vTable [ math.random( #vTable ) ] ) 
addEventHandler ( "onClientGUIClick", root, 
    function() 
    if source == GUIEditor.button[1] then 
        guiSetVisible ( GUIEditor.window[1], false ) 
        showCursor ( false ) 
        setElementData ( source, "Job", true ) 
        one = createMarker ( PosX,PosY,PosZ, "cylinder", 1.5, 255, 255, 0, 170 ) 
        triggerServerEvent ("Setskin", getLocalPlayer()) 
        triggerServerEvent ("SetTeam", getLocalPlayer()) 
        if ( one ) then 
        guiSetEnabled ( GUIEditor.button[1], false ) 
        end 
        addEventHandler ( "onClientMarkerHit", one, moneys ) 
        jobV = createMarker ( -2162.873, 254.4054, 34.5, "cylinder", 1.5, 255, 255, 0, 170 ) 
        addEventHandler ( "onClientMarkerHit", jobV, showUserPanelV ) 
        createBlipAttachedTo ( one, 51 ) 
     end 
end) 
  
  
function moneys ( hitElement ) 
        local x,y,z = getElementPosition ( source ) 
            local px,py,pz = getElementPosition ( hitElement ) 
            if z and pz then 
            local check = math.abs ( pz - z ) 
            if 2 >= check then 
            if getPlayerTeam(hitElement) and (getTeamName(getPlayerTeam(hitElement)) == 'Civilian') then 
            triggerLatentServerEvent ( "money",hitElement ) 
            local PosX,PosY,PosZ = unpack( vTable [ math.random( #vTable ) ] ) 
            setElementPosition (one, PosX, PosY, PosZ) 
            end 
        end 
    end 
end 
  

رتبتهـ لك .. خليته اذا ضغط الزر يسوي الماركر ويتاكد اذا الماركر سواهـ يخفي الزر .. :wink:

جربهه ورد علي خبر .. :roll:

Link to comment

لببى الحسساوية كللهم , وانا منهم ض11

مشكؤور يَ الحب

بسس ابي يتاكد اذا اللاعب طلع من التيم, يقدر يرجع للماركر, يعني يصير كانه توه داخل السيرفرض1

Link to comment

لببى الحسساوية كللهم , وانا منهم ض11

مشكؤور يَ الحب

بسس ابي يتاكد اذا اللاعب طلع من التيم, يقدر يرجع للماركر, يعني يصير كانه توه داخل السيرفرض1

وقلبككك .. العفو .. حياك الله .. :wink:

Link to comment

  
job = createMarker ( -2168.5, 243.39999389648, 34.299999237061, "cylinder", 1.5, 255, 255, 0, 170 ) 
  
addEventHandler('onClientMarkerHit',job, 
function(player) 
    if player == localPlayer then 
  if getPlayerTeam(player) and (getTeamName(getPlayerTeam(player)) == 'Civilian') then return end 
  if not guiGetVisible ( GUIEditor.window[1] ) then guiSetVisible ( GUIEditor.window[1], true ) showCursor ( true ) 
  else 
   outputChatBox('You Must be in team (Civilian)') 
        end 
    end 
end) 
  
function Click() 
if source == vehicleb1  then 
local Row, Col = guiGridListGetSelectedItem( vehicleG ) 
local NameVehicle = guiGridListGetItemText( vehicleG, Row, Col ) 
if NameVehicle == "Boxville" then 
if triggerServerEvent("createCar", getLocalPlayer()) then 
    guiSetVisible ( vehiclew, false ) 
    showCursor ( false ) 
end 
end 
end 
end 
addEventHandler( "onClientGUIClick", getRootElement(), Click ) 
  
addEventHandler ( "onClientGUIClick", root, 
    function() 
        if source == GUIEditor.button[2] then 
        guiSetVisible ( GUIEditor.window[1], false ) 
        showCursor ( false ) 
        end 
    end 
) 
  
addEventHandler ( "onClientGUIClick", root, 
    function() 
        if source == vehicleb2 then 
        guiSetVisible ( vehiclew, false ) 
        showCursor ( false ) 
    end 
  end 
) 
  
  
vTable = { 
   [ 1 ] = { -2695.6999511719, -185.30000305176, 3.3000001907349 }, 
   [ 2 ] = { -2717, -95.5, 3.3000001907349 }, 
  
} 
  
  
local PosX,PosY,PosZ = unpack( vTable [ math.random( #vTable ) ] ) 
addEventHandler ( "onClientGUIClick", root, 
    function() 
    if source == GUIEditor.button[1] then 
        guiSetVisible ( GUIEditor.window[1], false ) 
        showCursor ( false ) 
        setElementData ( source, "Job", true ) 
        one = createMarker ( PosX,PosY,PosZ, "cylinder", 1.5, 255, 255, 0, 170 ) 
        triggerServerEvent ("Setskin", getLocalPlayer()) 
        triggerServerEvent ("SetTeam", getLocalPlayer()) 
        if ( one ) then 
        guiSetEnabled ( GUIEditor.button[1], false ) 
        end 
        addEventHandler ( "onClientMarkerHit", one, moneys ) 
        jobV = createMarker ( -2162.873, 254.4054, 34.5, "cylinder", 1.5, 255, 255, 0, 170 ) 
        addEventHandler ( "onClientMarkerHit", jobV, showUserPanelV ) 
        createBlipAttachedTo ( one, 51 ) 
     end 
end) 
  
  
function moneys ( hitElement ) 
        local x,y,z = getElementPosition ( source ) 
            local px,py,pz = getElementPosition ( hitElement ) 
            if z and pz then 
            local check = math.abs ( pz - z ) 
            if 2 >= check then 
            if getPlayerTeam(hitElement) and (getTeamName(getPlayerTeam(hitElement)) == 'Civilian') then 
            triggerLatentServerEvent ( "money",hitElement ) 
            local PosX,PosY,PosZ = unpack( vTable [ math.random( #vTable ) ] ) 
            setElementPosition (one, PosX, PosY, PosZ) 
            end 
        end 
    end 
end 
  
setTimer(function() 
if ( guiGetEnabled(GUIEditor.button[1], false) ) and (getPlayerTeam ( localPlayer ) == nil ) then 
guiSetEnabled(GUIEditor.button[1], true) 
end 
end,5000,0) 
  

جربهـ ورد لي خبر .. ^_^

طبعا راح يتاكد كل 5 ثواني ان الزر مسكر + الاعب مو بتيم .. ^_^

Link to comment
  
job = createMarker ( -2168.5, 243.39999389648, 34.299999237061, "cylinder", 1.5, 255, 255, 0, 170 ) 
  
addEventHandler('onClientMarkerHit',job, 
function(player) 
    if player == localPlayer then 
  if getPlayerTeam(player) and (getTeamName(getPlayerTeam(player)) == 'Civilian') then return end 
  if not guiGetVisible ( GUIEditor.window[1] ) then guiSetVisible ( GUIEditor.window[1], true ) showCursor ( true ) 
  else 
   outputChatBox('You Must be in team (Civilian)') 
        end 
    end 
end) 
  
function Click() 
if source == vehicleb1  then 
local Row, Col = guiGridListGetSelectedItem( vehicleG ) 
local NameVehicle = guiGridListGetItemText( vehicleG, Row, Col ) 
if NameVehicle == "Boxville" then 
if triggerServerEvent("createCar", getLocalPlayer()) then 
    guiSetVisible ( vehiclew, false ) 
    showCursor ( false ) 
end 
end 
end 
end 
addEventHandler( "onClientGUIClick", getRootElement(), Click ) 
  
addEventHandler ( "onClientGUIClick", root, 
    function() 
        if source == GUIEditor.button[2] then 
        guiSetVisible ( GUIEditor.window[1], false ) 
        showCursor ( false ) 
        end 
    end 
) 
  
addEventHandler ( "onClientGUIClick", root, 
    function() 
        if source == vehicleb2 then 
        guiSetVisible ( vehiclew, false ) 
        showCursor ( false ) 
    end 
  end 
) 
  
  
vTable = { 
   [ 1 ] = { -2695.6999511719, -185.30000305176, 3.3000001907349 }, 
   [ 2 ] = { -2717, -95.5, 3.3000001907349 }, 
  
} 
  
  
local PosX,PosY,PosZ = unpack( vTable [ math.random( #vTable ) ] ) 
addEventHandler ( "onClientGUIClick", root, 
    function() 
    if source == GUIEditor.button[1] then 
        guiSetVisible ( GUIEditor.window[1], false ) 
        showCursor ( false ) 
        setElementData ( source, "Job", true ) 
        one = createMarker ( PosX,PosY,PosZ, "cylinder", 1.5, 255, 255, 0, 170 ) 
        triggerServerEvent ("Setskin", getLocalPlayer()) 
        triggerServerEvent ("SetTeam", getLocalPlayer()) 
        if ( one ) then 
        guiSetEnabled ( GUIEditor.button[1], false ) 
        end 
        addEventHandler ( "onClientMarkerHit", one, moneys ) 
        jobV = createMarker ( -2162.873, 254.4054, 34.5, "cylinder", 1.5, 255, 255, 0, 170 ) 
        addEventHandler ( "onClientMarkerHit", jobV, showUserPanelV ) 
        createBlipAttachedTo ( one, 51 ) 
     end 
end) 
  
  
function moneys ( hitElement ) 
        local x,y,z = getElementPosition ( source ) 
            local px,py,pz = getElementPosition ( hitElement ) 
            if z and pz then 
            local check = math.abs ( pz - z ) 
            if 2 >= check then 
            if getPlayerTeam(hitElement) and (getTeamName(getPlayerTeam(hitElement)) == 'Civilian') then 
            triggerLatentServerEvent ( "money",hitElement ) 
            local PosX,PosY,PosZ = unpack( vTable [ math.random( #vTable ) ] ) 
            setElementPosition (one, PosX, PosY, PosZ) 
            end 
        end 
    end 
end 
  
setTimer(function() 
if ( guiGetEnabled(GUIEditor.button[1], false) ) and ( getTeamName(getPlayerTeam(localPlayer)) ~= "Civilian" ) then 
guiSetEnabled(GUIEditor.button[1], true) 
end 
end,5000,0) 
  

Link to comment

المود فيه بق او Bug

انك تدخل التيم, لو تطلع منه تقدر تدخل التيم مرة ثانية, ويطلع لكك الماركر مرتين, انا ابيه حددك ماركر وااحد بسسس, يعني مايطلع لكك ماركر ثاني اببد

هذا الكود

  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {}, 
    label = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
           GUIEditor.window[1] = guiCreateWindow(781, 0, 324, 492, "Mailman", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetVisible(GUIEditor.window[1], false) 
        GUIEditor.label[1] = guiCreateLabel(28, 23, 321, 18, "  In this job you will be able to take some mails and", false, GUIEditor.window[1]) 
        GUIEditor.label[2] = guiCreateLabel(28, 45, 313, 15, " delivery it on a marker located on your map  ....", false, GUIEditor.window[1]) 
        GUIEditor.label[3] = guiCreateLabel(28, 66, 296, 15, " of course after taking the job skin and moving into ", false, GUIEditor.window[1]) 
        GUIEditor.label[4] = guiCreateLabel(28, 87, 296, 17, " the markers the payment around 900$ per mail.", false, GUIEditor.window[1]) 
        GUIEditor.label[5] = guiCreateLabel(28, 172, 170, 34, "Pick your skin:", false, GUIEditor.window[1]) 
        GUIEditor.gridlist[1] = guiCreateGridList(28, 196, 278, 227, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "ID", 0.9) 
        for i = 1, 2 do 
            guiGridListAddRow(GUIEditor.gridlist[1]) 
        end 
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "36", false, false) 
        GUIEditor.button[1] = guiCreateButton(29, 436, 105, 46, "Have Job", false, GUIEditor.window[1]) 
        GUIEditor.button[2] = guiCreateButton(201, 436, 105, 46, "Cancel", false, GUIEditor.window[1]) 
    --vehicle window 
        vehiclew = guiCreateWindow(781, 0, 324, 492, "Vehicles Panel", false) 
        guiWindowSetSizable(vehiclew, false) 
        guiSetVisible(vehiclew, false) 
        vehicleL= guiCreateLabel(35, 51, 170, 34, "Pick your Vehicle:", false, vehiclew) 
        vehicleG= guiCreateGridList(25, 69, 280, 342, false, vehiclew) 
        vehC = guiGridListAddColumn(vehicleG, "Vehicle name", 0.9) 
        for i = 1, 2 do 
        vehrow = guiGridListAddRow(vehicleG) 
        end 
        guiGridListSetItemText(vehicleG, 0, 1, "Boxville", false, false) 
        vehicleb1 = guiCreateButton(29, 436, 105, 46, "Spawn vehicle", false, vehiclew) 
        vehicleb2 = guiCreateButton(201, 436, 105, 46, "Cancel", false, vehiclew)     
     
    end 
) 
  
  
job = createMarker ( -2168.5, 243.39999389648, 34.299999237061, "cylinder", 1.5, 255, 255, 0, 170 ) 
  
addEventHandler('onClientMarkerHit',job, 
function(player) 
    if player == localPlayer then 
  if getPlayerTeam(player) and (getTeamName(getPlayerTeam(player)) == 'Civilian') then return end 
  if not guiGetVisible ( GUIEditor.window[1] ) then guiSetVisible ( GUIEditor.window[1], true ) showCursor ( true ) 
  else 
   outputChatBox('You Must be in team (Civilian)') 
        end 
    end 
end) 
  
function Click() 
if source == vehicleb1  then 
local Row, Col = guiGridListGetSelectedItem( vehicleG ) 
local NameVehicle = guiGridListGetItemText( vehicleG, Row, Col ) 
if NameVehicle == "Boxville" then 
if triggerServerEvent("createCar", getLocalPlayer()) then 
    guiSetVisible ( vehiclew, false ) 
    showCursor ( false ) 
end 
end 
end 
end 
addEventHandler( "onClientGUIClick", getRootElement(), Click ) 
  
addEventHandler ( "onClientGUIClick", root, 
    function() 
        if source == GUIEditor.button[2] then 
        guiSetVisible ( GUIEditor.window[1], false ) 
        showCursor ( false ) 
        end 
    end 
) 
  
addEventHandler ( "onClientGUIClick", root, 
    function() 
        if source == vehicleb2 then 
        guiSetVisible ( vehiclew, false ) 
        showCursor ( false ) 
    end 
  end 
) 
  
  
vTable = { 
   [ 1 ] = { -2695.6999511719, -185.30000305176, 3.3000001907349 }, 
   [ 2 ] = { -2717, -95.5, 3.3000001907349 }, 
} 
  
  
local PosX,PosY,PosZ = unpack( vTable [ math.random( #vTable ) ] ) 
addEventHandler ( "onClientGUIClick", root, 
    function() 
    if source == GUIEditor.button[1] then 
        guiSetVisible ( GUIEditor.window[1], false ) 
        showCursor ( false ) 
        setElementData ( source, "Job", true ) 
        one = createMarker ( PosX,PosY,PosZ, "cylinder", 1.5, 255, 255, 0, 170 ) 
        triggerServerEvent ("Setskin", getLocalPlayer()) 
        triggerServerEvent ("SetTeam", getLocalPlayer()) 
        if ( guiGetEnabled(GUIEditor.button[1], false) ) and (getPlayerTeam ( localPlayer ) ~= 'Civilian' ) then 
        guiSetEnabled ( GUIEditor.button[1], true ) 
        end 
        addEventHandler ( "onClientMarkerHit", one, moneys ) 
        jobV = createMarker ( -2162.873, 254.4054, 34.5, "cylinder", 1.5, 255, 255, 0, 170 ) 
        addEventHandler ( "onClientMarkerHit", jobV, showUserPanelV ) 
        blipy = createBlipAttachedTo ( one, 51 ) 
     end 
end) 
  
function moneys ( hitElement ) 
        local x,y,z = getElementPosition ( source ) 
            local px,py,pz = getElementPosition ( hitElement ) 
            if z and pz then 
            local check = math.abs ( pz - z ) 
            if 2 >= check then 
            if getPlayerTeam(hitElement) and (getTeamName(getPlayerTeam(hitElement)) == 'Civilian') then 
            triggerLatentServerEvent ( "money",hitElement ) 
            local PosX,PosY,PosZ = unpack( vTable [ math.random( #vTable ) ] ) 
            setElementPosition (one, PosX, PosY, PosZ) 
            end 
        end 
    end 
end 
  
        function showUserPanelV ( hitPlayer ) 
    if hitPlayer == localPlayer then 
    if guiGetVisible ( vehiclew ) then 
        guiSetVisible ( vehiclew, false ) 
        showCursor ( false ) 
    else 
        guiSetVisible ( vehiclew, true ) 
        showCursor ( true ) 
    end 
    end 
end 

Link to comment
  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {}, 
    label = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
           GUIEditor.window[1] = guiCreateWindow(781, 0, 324, 492, "Mailman", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetVisible(GUIEditor.window[1], false) 
        GUIEditor.label[1] = guiCreateLabel(28, 23, 321, 18, "  In this job you will be able to take some mails and", false, GUIEditor.window[1]) 
        GUIEditor.label[2] = guiCreateLabel(28, 45, 313, 15, " delivery it on a marker located on your map  ....", false, GUIEditor.window[1]) 
        GUIEditor.label[3] = guiCreateLabel(28, 66, 296, 15, " of course after taking the job skin and moving into ", false, GUIEditor.window[1]) 
        GUIEditor.label[4] = guiCreateLabel(28, 87, 296, 17, " the markers the payment around 900$ per mail.", false, GUIEditor.window[1]) 
        GUIEditor.label[5] = guiCreateLabel(28, 172, 170, 34, "Pick your skin:", false, GUIEditor.window[1]) 
        GUIEditor.gridlist[1] = guiCreateGridList(28, 196, 278, 227, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "ID", 0.9) 
        for i = 1, 2 do 
            guiGridListAddRow(GUIEditor.gridlist[1]) 
        end 
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "36", false, false) 
        GUIEditor.button[1] = guiCreateButton(29, 436, 105, 46, "Have Job", false, GUIEditor.window[1]) 
        GUIEditor.button[2] = guiCreateButton(201, 436, 105, 46, "Cancel", false, GUIEditor.window[1]) 
    --vehicle window 
        vehiclew = guiCreateWindow(781, 0, 324, 492, "Vehicles Panel", false) 
        guiWindowSetSizable(vehiclew, false) 
        guiSetVisible(vehiclew, false) 
        vehicleL= guiCreateLabel(35, 51, 170, 34, "Pick your Vehicle:", false, vehiclew) 
        vehicleG= guiCreateGridList(25, 69, 280, 342, false, vehiclew) 
        vehC = guiGridListAddColumn(vehicleG, "Vehicle name", 0.9) 
        for i = 1, 2 do 
        vehrow = guiGridListAddRow(vehicleG) 
        end 
        guiGridListSetItemText(vehicleG, 0, 1, "Boxville", false, false) 
        vehicleb1 = guiCreateButton(29, 436, 105, 46, "Spawn vehicle", false, vehiclew) 
        vehicleb2 = guiCreateButton(201, 436, 105, 46, "Cancel", false, vehiclew) 
  
    end 
) 
  
  
job = createMarker ( -2168.5, 243.39999389648, 34.299999237061, "cylinder", 1.5, 255, 255, 0, 170 ) 
  
addEventHandler('onClientMarkerHit',job, 
function(player) 
    if player == localPlayer then 
  if getPlayerTeam(player) and (getTeamName(getPlayerTeam(player)) == 'Civilian') then return end 
  if not guiGetVisible ( GUIEditor.window[1] ) then guiSetVisible ( GUIEditor.window[1], true ) showCursor ( true ) 
  else 
   outputChatBox('You Must be in team (Civilian)') 
        end 
    end 
end) 
  
function Click() 
if source == vehicleb1  then 
local Row, Col = guiGridListGetSelectedItem( vehicleG ) 
local NameVehicle = guiGridListGetItemText( vehicleG, Row, Col ) 
if NameVehicle == "Boxville" then 
if triggerServerEvent("createCar", getLocalPlayer()) then 
    guiSetVisible ( vehiclew, false ) 
    showCursor ( false ) 
end 
end 
end 
end 
addEventHandler( "onClientGUIClick", getRootElement(), Click ) 
  
addEventHandler ( "onClientGUIClick", root, 
    function() 
        if source == GUIEditor.button[2] then 
        guiSetVisible ( GUIEditor.window[1], false ) 
        showCursor ( false ) 
        end 
    end 
) 
  
addEventHandler ( "onClientGUIClick", root, 
    function() 
        if source == vehicleb2 then 
        guiSetVisible ( vehiclew, false ) 
        showCursor ( false ) 
    end 
  end 
) 
  
  
vTable = { 
   [ 1 ] = { -2695.6999511719, -185.30000305176, 3.3000001907349 }, 
   [ 2 ] = { -2717, -95.5, 3.3000001907349 }, 
} 
  
  
local PosX,PosY,PosZ = unpack( vTable [ math.random( #vTable ) ] ) 
addEventHandler ( "onClientGUIClick", root, 
    function() 
    if source == GUIEditor.button[1] then 
        guiSetVisible ( GUIEditor.window[1], false ) 
        showCursor ( false ) 
        setElementData ( source, "Job", true ) 
        one = createMarker ( PosX,PosY,PosZ, "cylinder", 1.5, 255, 255, 0, 170 ) 
        triggerServerEvent ("Setskin", getLocalPlayer()) 
        triggerServerEvent ("SetTeam", getLocalPlayer()) 
        if ( isElement(one) ) then destroyElement(one) one = nil end 
        if ( guiGetEnabled(GUIEditor.button[1], false) ) and (getPlayerTeam ( localPlayer ) ~= 'Civilian' ) then 
        guiSetEnabled ( GUIEditor.button[1], true ) 
        end 
        addEventHandler ( "onClientMarkerHit", one, moneys ) 
        jobV = createMarker ( -2162.873, 254.4054, 34.5, "cylinder", 1.5, 255, 255, 0, 170 ) 
        addEventHandler ( "onClientMarkerHit", jobV, showUserPanelV ) 
        blipy = createBlipAttachedTo ( one, 51 ) 
     end 
end) 
  
function moneys ( hitElement ) 
        local x,y,z = getElementPosition ( source ) 
            local px,py,pz = getElementPosition ( hitElement ) 
            if z and pz then 
            local check = math.abs ( pz - z ) 
            if 2 >= check then 
            if getPlayerTeam(hitElement) and (getTeamName(getPlayerTeam(hitElement)) == 'Civilian') then 
            triggerLatentServerEvent ( "money",hitElement ) 
            local PosX,PosY,PosZ = unpack( vTable [ math.random( #vTable ) ] ) 
            setElementPosition (one, PosX, PosY, PosZ) 
            end 
        end 
    end 
end 
  
function showUserPanelV ( hitPlayer ) 
    if hitPlayer == localPlayer then 
    if guiGetVisible ( vehiclew ) then 
        guiSetVisible ( vehiclew, false ) 
        showCursor ( false ) 
    else 
        guiSetVisible ( vehiclew, true ) 
        showCursor ( true ) 
end 
end 
end 
  

Link to comment

كل عام وانتم بخير :lol:

الحين انت صدق لحست مخي ,

الي فهمته انك تبيه اذا ضغط الزر يسوي الوظيفه واذا ضغطه مره ثانيه ما يقدر لازم يخرج من التيم ويدخل مره ثانيه ؟

بس تبيه لتيم محدد ولا وش وضعك :lol: ؟

Link to comment
كل عام وانتم بخير :lol:

الحين انت صدق لحست مخي ,

الي فهمته انك تبيه اذا ضغط الزر يسوي الوظيفه واذا ضغطه مره ثانيه ما يقدر لازم يخرج من التيم ويدخل مره ثانيه ؟

بس تبيه لتيم محدد ولا وش وضعك :lol: ؟

ههههههههههههههههههه بيست لا تتعب حالك معهـ .. انا ضبطته لهـ .. راح افيدهـ ان شاء الله .. :wink:

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...