Jump to content

مشكلة


Recommended Posts

Posted

السلام عليكم ورحمة الله وبركاته صح انو طلباتي او مشاكلي كثرت بش ابي افهو وش مشكلته والله يوك كامل وانا احاول ما قدرت اتمنى تساعدوني

--Client Side 
local blip2 = createBlip (1536.27, -1686.387, 13.546,5) 
  
addEventHandler( "onClientResourceStart", resourceRoot, function (  ) 
criminal = guiCreateLabel(50, 246, 191, 24, "CTF :- Capturing Criminal location", false) 
    progress = guiCreateProgressBar(44, 280, 207, 32, false)    
    marker = createMarker (1536.27, -1686.387, 13.546,"cylinder", 2, 255, 255, 255, 255) 
    guiSetVisible ( progress, false ) 
    guiSetVisible ( criminal, false ) 
            guiSetFont(criminal, "default-bold-small") 
    guiLabelSetColor(criminal, 255, 0, 0) 
     setElementDimension ( marker, 2 ) 
     Police = guiCreateLabel(50, 246, 191, 24, "CTF :- Capturing Police location", false) 
    progressp = guiCreateProgressBar(44, 280, 207, 32, false)    
    markerp = createMarker (1536.27, -1686.387+5, 13.546,"cylinder", 2, 255, 255, 255, 255) 
    guiSetVisible ( progressp, false ) 
    guiSetVisible ( Police, false ) 
            guiSetFont(Police, "default-bold-small") 
    guiLabelSetColor(Police, 0, 0, 255) 
     setElementDimension ( markerp, 2 ) 
end ) 
  
addEventHandler ( "onClientMarkerHit", resourceRoot, function ( element ) 
  if ( source == marker ) then 
    if ( element == getLocalPlayer (  ) and not getPedOccupiedVehicle ( element ) ) then 
      if ( getElementDimension ( element ) == 2 ) then 
    triggerServerEvent("chp", localPlayer) 
end 
       end  
       end 
end) 
addEvent("p", true) 
addEventHandler("p", root, 
function ()     
       guiSetVisible ( criminal, true ) 
       guiSetVisible ( progress, true ) 
       guiProgressBarSetProgress ( progress, 0 ) 
       function updateProgress (  ) 
           guiProgressBarSetProgress ( progress, guiProgressBarGetProgress ( progress ) + 1 ) 
           if ( guiProgressBarGetProgress ( progress ) == 100 ) then 
            guiSetVisible ( progress, false ) 
                guiSetVisible ( criminal, false ) 
            outputChatBox ( "* CTF Completed" ) 
            triggerServerEvent("CtfP", localPlayer) 
            guiProgressBarSetProgress ( progress, 0 ) 
 if isTimer ( timer ) then killTimer ( timer ) 
 end 
        end   
      end 
timer = setTimer ( updateProgress, 50, 0) 
    end) 
  
       addEventHandler ( "onClientMarkerLeave", resourceRoot, function ( element ) 
  if ( source == marker ) then 
    if ( element == getLocalPlayer (  ) and not getPedOccupiedVehicle ( element ) ) then 
       end    
           if isTimer ( timer ) then killTimer ( timer ) timer = nil 
                    guiProgressBarSetProgress ( progress, 0 ) 
                         guiSetVisible ( progress, false ) 
                            guiSetVisible ( criminal, false ) 
           end 
           end 
           end) 
            
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------           
  
  
addEventHandler ( "onClientMarkerHit", resourceRoot, function ( element ) 
  if ( source == markerp ) then 
    if ( element == getLocalPlayer (  ) and not getPedOccupiedVehicle ( element ) ) then 
      if ( getElementDimension ( element ) == 2 ) then 
    triggerServerEvent("chc", localPlayer) 
end 
       end  
       end 
end) 
addEvent("c", true) 
addEventHandler("c", root, 
function ()     
       guiSetVisible ( Police, true ) 
       guiSetVisible ( progressp, true ) 
       guiProgressBarSetProgress ( progressp, 0 ) 
       function updateProgressp (  ) 
           guiProgressBarSetProgress ( progressp, guiProgressBarGetProgress ( progressp ) + 1 ) 
           if ( guiProgressBarGetProgress ( progressp ) == 100 ) then 
            guiSetVisible ( progressp, false ) 
                guiSetVisible ( Police, false ) 
            outputChatBox ( "* CTF Completed" ) 
            triggerServerEvent("CtfC", localPlayer) 
            guiProgressBarSetProgress ( progressp, 0 ) 
 if isTimer ( timerp ) then killTimer ( timerp ) 
 end 
        end   
      end 
timerp = setTimer ( updateProgressp, 50, 0) 
    end) 
  
       addEventHandler ( "onClientMarkerLeave", resourceRoot, function ( element ) 
  if ( source == markerp ) then 
    if ( element == getLocalPlayer (  ) and not getPedOccupiedVehicle ( element ) ) then 
       end    
           if isTimer ( timerp ) then killTimer ( timerp ) timerp = nil 
                    guiProgressBarSetProgress ( progressp, 0 ) 
                         guiSetVisible ( progressp, false ) 
                            guiSetVisible ( Police, false ) 
           end 
           end 
           end) 
     
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------     
  

---Server Side 
 addEvent("chp", true) 
addEventHandler("chp", root, 
 function () 
 local policeTeam = getTeamFromName ("Police") 
        if (policeTeam) then 
        local police = getPlayersInTeam (policeTeam) 
         triggerClientEvent(client, "p", client) 
        end 
          end) 
          
 addEvent("chc", true) 
addEventHandler("chc", root, 
 function () 
 local CriminalTeam = getTeamFromName ("Criminal") 
        if (CriminalTeam) then 
        local Criminal = getPlayersInTeam (CriminalTeam) 
         triggerClientEvent(client, "c", client) 
        end 
          end)        
          
          
          
          
           addEvent("CtfC", true) 
addEventHandler("CtfC", root, 
function() 
outputChatBox("Police") 
end) 
  
addEvent("CtfP", true) 
addEventHandler("CtfP", root, 
function() 
outputChatBox("Criminal") 
end) 

Posted

طيب شو المشكله الي تصير معك اصلا ... يعني ما يشتغل المود ولا الماركر ما يضهر الخ ... حدد مشكلتك عشان نعرف نساعدك

Posted

انا عامل ماركرين كل ماركر لتيم معين يظهر عندي كل شي بس الماركر حق الشرطة يصير برضو للحرامية والعكس كمان

Posted

الي فهمته انه الماركرين لما توقف على واحد منهم بدك يتحول تيم شرطه

والماركر الثاني لما يوقفغ عليه يتحول تيم حرامي

اذا المقصود مو هيك فهمني اكثر لانه ما افهمت اكثير والله

Posted

هاذا السيرفر

---Server Side 
  
Criminal = createTeam ( "Criminal", 255, 2, 0 ) 
Police = createTeam ( "Police", 255, 2, 0 ) 
  
  
 addEvent("chp", true) 
addEventHandler("chp", root, 
 function () 
 local policeTeam = getTeamFromName ("Police") 
        if (policeTeam) then 
        local police = getPlayersInTeam (policeTeam) 
         triggerClientEvent(client, "p", client) 
             setPlayerTeam ( source, Criminal )  
        end 
          end) 
          
 addEvent("chc", true) 
addEventHandler("chc", root, 
 function () 
 local CriminalTeam = getTeamFromName ("Criminal") 
        if (CriminalTeam) then 
        local Criminal = getPlayersInTeam (CriminalTeam) 
         triggerClientEvent(client, "c", client) 
          setPlayerTeam ( source, Police )  
        end 
          end)        
          
          
          
          
addEvent("CtfC", true) 
addEventHandler("CtfC", root, 
function() 
outputChatBox("Police") 
end) 
  
addEvent("CtfP", true) 
addEventHandler("CtfP", root, 
function() 
outputChatBox("Criminal") 
end) 

هاذا الكلينت

  
--Client Side 
local blip2 = createBlip (1536.27, -1686.387, 13.546,5) 
  
addEventHandler( "onClientResourceStart", resourceRoot, function (  ) 
criminal = guiCreateLabel(50, 246, 191, 24, "CTF :- Capturing Criminal location", false) 
    progress = guiCreateProgressBar(44, 280, 207, 32, false)   
    marker = createMarker (1539.2294921875, -1670.24609375, 13.546875,"cylinder", 2, 255, 255, 255, 255) 
    guiSetVisible ( progress, false ) 
    guiSetVisible ( criminal, false ) 
            guiSetFont(criminal, "default-bold-small") 
    guiLabelSetColor(criminal, 255, 0, 0) 
     setElementDimension ( marker, 0 ) 
     Police = guiCreateLabel(50, 246, 191, 24, "CTF :- Capturing Police location", false) 
    progressp = guiCreateProgressBar(44, 280, 207, 32, false)   
    markerp = createMarker (1539.4091796875, -1677.6494140625, 13.546875,"cylinder", 2, 255, 255, 255, 255) 
    guiSetVisible ( progressp, false ) 
    guiSetVisible ( Police, false ) 
            guiSetFont(Police, "default-bold-small") 
    guiLabelSetColor(Police, 0, 0, 255) 
     setElementDimension ( markerp, 0 ) 
end ) 
  
addEventHandler ( "onClientMarkerHit", resourceRoot, function ( element ) 
  if ( source == marker ) then 
    if ( element == getLocalPlayer (  ) and not getPedOccupiedVehicle ( element ) ) then 
      if ( getElementDimension ( element ) == 0 ) then 
    triggerServerEvent("chp", localPlayer) 
end 
       end 
       end 
end) 
addEvent("p", true) 
addEventHandler("p", root, 
function ()    
       guiSetVisible ( criminal, true ) 
       guiSetVisible ( progress, true ) 
       guiProgressBarSetProgress ( progress, 0 ) 
       function updateProgress (  ) 
           guiProgressBarSetProgress ( progress, guiProgressBarGetProgress ( progress ) + 1 ) 
           if ( guiProgressBarGetProgress ( progress ) == 100 ) then 
            guiSetVisible ( progress, false ) 
                guiSetVisible ( criminal, false ) 
            outputChatBox ( "* CTF Completed" ) 
            triggerServerEvent("CtfP", localPlayer) 
            guiProgressBarSetProgress ( progress, 0 ) 
 if isTimer ( timer ) then killTimer ( timer ) 
 end 
        end   
      end 
timer = setTimer ( updateProgress, 50, 0) 
    end) 
  
       addEventHandler ( "onClientMarkerLeave", resourceRoot, function ( element ) 
  if ( source == marker ) then 
    if ( element == getLocalPlayer (  ) and not getPedOccupiedVehicle ( element ) ) then 
       end   
           if isTimer ( timer ) then killTimer ( timer ) timer = nil 
                    guiProgressBarSetProgress ( progress, 0 ) 
                         guiSetVisible ( progress, false ) 
                            guiSetVisible ( criminal, false ) 
           end 
           end 
           end) 
            
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------           
  
  
addEventHandler ( "onClientMarkerHit", resourceRoot, function ( element ) 
  if ( source == markerp ) then 
    if ( element == getLocalPlayer (  ) and not getPedOccupiedVehicle ( element ) ) then 
      if ( getElementDimension ( element ) == 0 ) then 
    triggerServerEvent("chc", localPlayer) 
end 
       end 
       end 
end) 
  
addEvent("c", true) 
addEventHandler("c", root, 
function ()    
       guiSetVisible ( Police, true ) 
       guiSetVisible ( progressp, true ) 
       guiProgressBarSetProgress ( progressp, 0 ) 
       function updateProgressp (  ) 
           guiProgressBarSetProgress ( progressp, guiProgressBarGetProgress ( progressp ) + 1 ) 
           if ( guiProgressBarGetProgress ( progressp ) == 100 ) then 
            guiSetVisible ( progressp, false ) 
                guiSetVisible ( Police, false ) 
            outputChatBox ( "* CTF Completed" ) 
            triggerServerEvent("CtfC", localPlayer) 
            guiProgressBarSetProgress ( progressp, 0 ) 
 if isTimer ( timerp ) then killTimer ( timerp ) 
 end 
        end   
      end 
timerp = setTimer ( updateProgressp, 50, 0) 
    end) 
  
       addEventHandler ( "onClientMarkerLeave", resourceRoot, function ( element ) 
  if ( source == markerp ) then 
    if ( element == getLocalPlayer (  ) and not getPedOccupiedVehicle ( element ) ) then 
       end   
           if isTimer ( timerp ) then killTimer ( timerp ) timerp = nil 
                    guiProgressBarSetProgress ( progressp, 0 ) 
                         guiSetVisible ( progressp, false ) 
                            guiSetVisible ( Police, false ) 
           end 
           end 
           end) 

اتمنى انه مثل طلبك

الي عدلته شي بسيط بس سويته انه اذا وقف على ماركر الالو يوخد تيم محدد

والماركر التاني يوخد التييم الثاني من غير اخطاء ارجى انه المطلوب

انا حطيت امر اضافه تيم عشان اجربه عندي احذفه من السيرفر اذا ما تبيه

هو موجود اول الكتابه فوقق بالمود

تقبل مروري

Posted

ليه سيرفر كامله ما له لازمه لانه

تقدر تعمل الكود كلنت حسب يلي انت عامله

Posted
ليه سيرفر كامله ما له لازمه لانه

تقدر تعمل الكود كلنت حسب يلي انت عامله

انا والله عدلت عالكود فقط

بعدين ما اتوقع يزبط المود بلا سيرفر لانه

شابك ترايقر سيرفر مع الفكنشن الخاص بالتيم

يمكن ما يزبط معه مدري اذا في طريقه ثانيه بس ذا رأيي

وشكرا ..اهم شي يكون المطلوب انه سويته له

Posted
ليه سيرفر كامله ما له لازمه لانه

تقدر تعمل الكود كلنت حسب يلي انت عامله

انا والله عدلت عالكود فقط

بعدين ما اتوقع يزبط المود بلا سيرفر لانه

شابك ترايقر سيرفر مع الفكنشن الخاص بالتيم

يمكن ما يزبط معه مدري اذا في طريقه ثانيه بس ذا رأيي

وشكرا ..اهم شي يكون المطلوب انه سويته له

ما اقول لك انت اقول له هو

شوف قصدي كيف

addEventHandler ( "onClientMarkerHit", resourceRoot, function ( element )
  if ( source == marker ) then
    if ( element == getLocalPlayer (  ) and not getPedOccupiedVehicle ( element ) ) then
      if ( getElementDimension ( element ) == 2 ) then
       local Teams = getTeamFromName('criminal')
           if (Teams) then
           if ( getPlayersInTeam (Teams) )then
            guiSetVisible ( criminal, true )
       guiSetVisible ( progress, true )
       guiProgressBarSetProgress ( progress, 0 )
       function updateProgress (  )
           guiProgressBarSetProgress ( progress, guiProgressBarGetProgress ( progress ) + 1 )
           if ( guiProgressBarGetProgress ( progress ) == 100 ) then
            guiSetVisible ( progress, false )
                guiSetVisible ( criminal, false )
            outputChatBox ( "* CTF Completed" )
            triggerServerEvent("CtfP", localPlayer)
            guiProgressBarSetProgress ( progress, 0 )
 if isTimer ( timer ) then killTimer ( timer )
 end
        end  
    end
      end
timer = setTimer ( updateProgress, 50, 0)    
   end
end
       end
       end
end)
 

بدل ما تعمل تحقق بترايقر و حوسه

تعمله كلنت

Posted

 [/lua]

---Server Side 
 addEvent("chp", true) 
addEventHandler("chp", root, 
 function () 
 local policeTeam = getTeamFromName ("Police") 
        if (policeTeam) then 
        local police = getPlayersInTeam (policeTeam) 
         triggerClientEvent(client, "p", client) 
        end 
          end) 
          
 addEvent("chc", true) 
addEventHandler("chc", root, 
 function () 
 local CriminalTeam = getTeamFromName ("Criminal") 
        if (CriminalTeam) then 
        local Criminal = getPlayersInTeam (CriminalTeam) 
         triggerClientEvent(client, "c", client) 
        end 
          end)        
          
          
          
          
           addEvent("CtfC", true) 
addEventHandler("CtfC", root, 
function() 
outputChatBox("Police") 
end) 
  
addEvent("CtfP", true) 
addEventHandler("CtfP", root, 
function() 
outputChatBox("Criminal") 
end) 

وينه ! :-$

انا قلت ردي لصاحب الموضوع مو للطرح كوده يوم تلمس المارك يحطك بتيم

+

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

Posted

انا مسوي ماركرين بس ادخل واد لازم اكون تيم معين والثاني برضو تيم معين بس المشكلة انو الوظيفة تصير للتيمين يعني ماركر الشرطة ينفع للحراميه

Posted
انا مسوي ماركرين بس ادخل واد لازم اكون تيم معين والثاني برضو تيم معين بس المشكلة انو الوظيفة تصير للتيمين يعني ماركر الشرطة ينفع للحراميه

اقلك خلي كودك كلنت

مثل ما وريتك فوق

Posted

انا اعطيتك الحل ورا خليته لما يوقف على الماركر يعطي للكريمنال بس

ولما يوقف عالماركر التاني يعطي الشرطه بس تيم

انته اذا مشكلتك هيك بس استبدل الكود تاعي الي يخلك بتيم معين وخله مثل ما بدك

يعني مشكلتك بسيط بس استبدل الكود فقط ورح يزبط

وسوي مثل ما قلك الاخ يزن افضل واسهل الك

اذا ما تبي تحاول وتجرب انته اشرح كل شي او فكره المود كلها

لانه ما حد بقدر يساعدك غير كذا بس الافضل تحاول وتسوي مثل ما قلت لك

Posted
انا مسوي ماركرين بس ادخل واد لازم اكون تيم معين والثاني برضو تيم معين بس المشكلة انو الوظيفة تصير للتيمين يعني ماركر الشرطة ينفع للحراميه

اقلك خلي كودك كلنت

مثل ما وريتك فوق

اذا اعملها على ماركر ثاني ما يضبط

يصير نفس المشكلة يشتغل عكل لتيمات

Posted

شو طريفة عمل التيم

يعني كيف التيم ينعمل عن طريق كود ولا لوحة ولا كيف الوضع

Posted

يعني نفس الكود بس على تيم بوليس والنوافذ والماركرموجودة فوق انا جربت ما ظبطت ما ادري ليه

Posted
يعني نفس الكود بس على تيم بوليس والنوافذ والماركرموجودة فوق انا جربت ما ظبطت ما ادري ليه

طيب ورنا اللي جربته

Posted
local blip2 = createBlip (1536.27, -1686.387, 13.546,5) 
  
addEventHandler( "onClientResourceStart", resourceRoot, function (  ) 
criminal = guiCreateLabel(50, 246, 191, 24, "CTF :- Capturing Criminal location", false) 
    progress = guiCreateProgressBar(44, 280, 207, 32, false)    
    marker = createMarker (1536.27, -1686.387, 13.546,"cylinder", 2, 255, 255, 255, 255) 
    guiSetVisible ( progress, false ) 
    guiSetVisible ( criminal, false ) 
            guiSetFont(criminal, "default-bold-small") 
    guiLabelSetColor(criminal, 255, 0, 0) 
     setElementDimension ( marker, 2 ) 
     Police = guiCreateLabel(50, 246, 191, 24, "CTF :- Capturing Police location", false) 
    progressp = guiCreateProgressBar(44, 280, 207, 32, false)    
    markerp = createMarker (1536.27, -1686.387+5, 13.546,"cylinder", 2, 255, 255, 255, 255) 
    guiSetVisible ( progressp, false ) 
    guiSetVisible ( Police, false ) 
            guiSetFont(Police, "default-bold-small") 
    guiLabelSetColor(Police, 0, 0, 255) 
     setElementDimension ( markerp, 2 ) 
end ) 
  
addEventHandler ( "onClientMarkerHit", resourceRoot, function ( element ) 
  if ( source == marker ) then 
    if ( element == getLocalPlayer (  ) and not getPedOccupiedVehicle ( element ) ) then 
      if ( getElementDimension ( element ) == 2 ) then 
       local Teams = getTeamFromName('criminal') 
           if (Teams) then 
           if ( getPlayersInTeam (Teams) )then 
            guiSetVisible ( criminal, true ) 
       guiSetVisible ( progress, true ) 
       guiProgressBarSetProgress ( progress, 0 ) 
       function updateProgress (  ) 
           guiProgressBarSetProgress ( progress, guiProgressBarGetProgress ( progress ) + 1 ) 
           if ( guiProgressBarGetProgress ( progress ) == 100 ) then 
            guiSetVisible ( progress, false ) 
                guiSetVisible ( criminal, false ) 
            outputChatBox ( "* CTF Completed" ) 
            triggerServerEvent("CtfP", localPlayer) 
            guiProgressBarSetProgress ( progress, 0 ) 
 if isTimer ( timer ) then killTimer ( timer ) 
 end 
        end   
    end 
      end 
timer = setTimer ( updateProgress, 50, 0)     
   end 
end 
       end 
       end 
end) 
  
       addEventHandler ( "onClientMarkerLeave", resourceRoot, function ( element ) 
  if ( source == marker ) then 
    if ( element == getLocalPlayer (  ) and not getPedOccupiedVehicle ( element ) ) then 
       end    
           if isTimer ( timer ) then killTimer ( timer ) timer = nil 
                    guiProgressBarSetProgress ( progress, 0 ) 
                         guiSetVisible ( progress, false ) 
                            guiSetVisible ( criminal, false ) 
           end 
           end 
           end) 
            
            
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------           
  
addEventHandler ( "onClientMarkerHit", resourceRoot, function ( element ) 
  if ( source == markerp ) then 
    if ( element == getLocalPlayer (  ) and not getPedOccupiedVehicle ( element ) ) then 
      if ( getElementDimension ( element ) == 2 ) then 
       local Teamsp = getTeamFromName('Police') 
           if (Teamsp) then 
           if ( getPlayersInTeam (Teamsp) )then 
            guiSetVisible ( Police, true ) 
       guiSetVisible ( progress, true ) 
       guiProgressBarSetProgress ( progress, 0 ) 
       function updateProgressp (  ) 
           guiProgressBarSetProgress ( progressp, guiProgressBarGetProgress ( progressp ) + 1 ) 
           if ( guiProgressBarGetProgress ( progressp ) == 100 ) then 
            guiSetVisible ( progressp, false ) 
                guiSetVisible ( Police, false ) 
            outputChatBox ( "* CTF Completed" ) 
            triggerServerEvent("CtfP", localPlayer) 
            guiProgressBarSetProgress ( progressp, 0 ) 
 if isTimer ( timerp ) then killTimer ( timerp ) 
 end 
        end   
    end 
      end 
timerp = setTimer ( updateProgressp, 50, 0)     
   end 
end 
       end 
       end 
end) 
  
       addEventHandler ( "onClientMarkerLeave", resourceRoot, function ( element ) 
  if ( source == markerp ) then 
    if ( element == getLocalPlayer (  ) and not getPedOccupiedVehicle ( element ) ) then 
       end    
           if isTimer ( timerp ) then killTimer ( timerp ) timerp = nil 
                    guiProgressBarSetProgress ( progress, 0 ) 
                         guiSetVisible ( progress, false ) 
                            guiSetVisible ( criminal, false ) 
           end 
           end 
           end) 
            

تفضل

Posted

كود كثير :shock:

بس اكتشفت اخطاء صغيرة

local blip2 = createBlip (1536.27, -1686.387, 13.546,5) 
  
addEventHandler( "onClientResourceStart", resourceRoot, function (  ) 
criminal = guiCreateLabel(50, 246, 191, 24, "CTF :- Capturing Criminal location", false) 
    progress = guiCreateProgressBar(44, 280, 207, 32, false)   
    marker = createMarker (1536.27, -1686.387, 13.546,"cylinder", 2, 255, 255, 255, 255) 
    guiSetVisible ( progress, false ) 
    guiSetVisible ( criminal, false ) 
            guiSetFont(criminal, "default-bold-small") 
    guiLabelSetColor(criminal, 255, 0, 0) 
     setElementDimension ( marker, 2 ) 
     Police = guiCreateLabel(50, 246, 191, 24, "CTF :- Capturing Police location", false) 
    progressp = guiCreateProgressBar(44, 280, 207, 32, false)   
    markerp = createMarker (1536.27, -1686.387+5, 13.546,"cylinder", 2, 255, 255, 255, 255) 
    guiSetVisible ( progressp, false ) 
    guiSetVisible ( Police, false ) 
            guiSetFont(Police, "default-bold-small") 
    guiLabelSetColor(Police, 0, 0, 255) 
     setElementDimension ( markerp, 2 ) 
end ) 
  
addEventHandler ( "onClientMarkerHit", resourceRoot, function ( element ) 
    if ( source == marker ) then 
        if ( element == getLocalPlayer (  ) and not getPedOccupiedVehicle ( element ) ) then 
            if ( getElementDimension ( element ) == 2 ) then 
                local Teams = getTeamFromName('criminal') 
                if (Teams) then 
                    if ( getPlayersInTeam (Teams) )then -- 
                        guiSetVisible ( criminal, true ) 
                        guiSetVisible ( progress, true ) 
                        guiProgressBarSetProgress ( progress, 0 ) 
                        function updateProgress (  ) 
                            guiProgressBarSetProgress ( progress, guiProgressBarGetProgress ( progress ) + 1 ) 
                            if ( guiProgressBarGetProgress ( progress ) == 100 ) then 
                                guiSetVisible ( progress, false ) 
                                guiSetVisible ( criminal, false ) 
                                outputChatBox ( "* CTF Completed" ) 
                                triggerServerEvent("CtfP", localPlayer) 
                                guiProgressBarSetProgress ( progress, 0 ) 
                                if isTimer ( timer ) then killTimer ( timer ) end 
                            end   
                        end 
                    end 
                    timer = setTimer ( updateProgress, 50, 0)     
                end 
            end 
        end 
    end 
end) 
  
addEventHandler ( "onClientMarkerLeave", resourceRoot, function ( element ) 
    if ( source == marker ) then 
        if ( element == getLocalPlayer (  ) and not getPedOccupiedVehicle ( element ) ) then 
            if isTimer ( timer ) then 
                killTimer ( timer ) 
                timer = nil 
                guiProgressBarSetProgress ( progress, 0 ) 
                guiSetVisible ( progress, false ) 
                guiSetVisible ( criminal, false ) 
            end 
        end 
    end 
end) 
            
            
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------           
  
addEventHandler ( "onClientMarkerHit", resourceRoot, function ( element ) 
    if ( source == markerp ) then 
        if ( element == getLocalPlayer (  ) and not getPedOccupiedVehicle ( element ) ) then 
            if ( getElementDimension ( element ) == 2 ) then 
                local Teamsp = getTeamFromName('Police') 
                if (Teamsp) then 
                    if ( getPlayersInTeam (Teamsp) )then 
                        guiSetVisible ( Police, true ) 
                        guiSetVisible ( progress, true ) 
                        guiProgressBarSetProgress ( progress, 0 ) 
                        function updateProgressp (  ) 
                            guiProgressBarSetProgress ( progressp, guiProgressBarGetProgress ( progressp ) + 1 ) 
                            if ( guiProgressBarGetProgress ( progressp ) == 100 ) then 
                                guiSetVisible ( progressp, false ) 
                                guiSetVisible ( Police, false ) 
                                outputChatBox ( "* CTF Completed" ) 
                                triggerServerEvent("CtfP", localPlayer) 
                                guiProgressBarSetProgress ( progressp, 0 ) 
                                if isTimer ( timerp ) then killTimer ( timerp ) end 
                            end   
                        end 
                    end 
                    timerp = setTimer ( updateProgressp, 50, 0)     
                end 
            end 
        end 
    end 
end) 
  
addEventHandler ( "onClientMarkerLeave", resourceRoot, function ( element ) 
    if ( source == markerp ) then 
        if ( element == getLocalPlayer (  ) and not getPedOccupiedVehicle ( element ) ) then 
            if isTimer ( timerp ) then  
                killTimer ( timerp ) 
                timerp = nil 
                guiProgressBarSetProgress ( progress, 0 ) 
                guiSetVisible ( progress, false ) 
                guiSetVisible ( criminal, false ) 
            end 
        end 
    end 
end) 

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...