Jump to content

سؤال


Recommended Posts

آستخدم فنكشن

عشآن تخلي آلماركر ب دمنشن معين

setElementDimension 
  

وبخصوص آلرسبنه

ركز على آرقمنتات آلفنكشن حق spawnPlayer

bool spawnPlayer ( player thePlayer, float x, float y, float z, [ int rotation = 0, int skinID = 0, int interior = 0, int dimension = 0, team theTeam = nil ] ) 

Link to comment
local marker = createMarker(1789, 812, 11, "cylinder", 10, 0, 0, 0, 0) 
  
addEventHandler("onMarkerHit", resourceRoot, 
function(element) 
 if source == marker then 
  if getElementType(element) == "player" then 
   spawnPlayer (element, x, y, z, _, _, _, 3) 
  end 
 end 
end) 
  
addEventHandler("onResourceStart", resourceRoot, 
    function(mm) 
if getElementType(mm) == "Marker" then 
 if (getElementDimension (mm) == 0) then    
  setElementDimension (mm, 1)  
  end 
 end 
end)    

Link to comment
--Client Side 
local blip2 = createBlip (1536.27, -1686.387, 13.546,5) 
  
addEventHandler( "onClientResourceStart", resourceRoot, function (  ) 
    progress = guiCreateProgressBar( 0.8, 0.8, 0.1, 0.1, true ) 
    marker = createMarker ( 3005.3,817,45.6,"cylinder", 2, 255, 255, 255, 50) 
    guiSetVisible ( progress, false ) 
       setElementDimension ( marker, 2 ) 
end ) 
  
addEventHandler ( "onClientMarkerHit", resourceRoot, function ( element ) 
  if ( source == marker ) then 
    if ( element == getLocalPlayer (  ) and not getPedOccupiedVehicle ( element ) ) then 
    triggerServerEvent("chp", localPlayer) 
end 
       end 
end) 
addEvent("p", true) 
addEventHandler("p", root, 
function        
       guiSetVisible ( progress, true ) 
       guiProgressBarSetProgress ( progress, 0 ) 
       function updateProgress (  ) 
           guiProgressBarSetProgress ( progress, guiProgressBarGetProgress ( progress ) + 1 ) 
           if ( guiProgressBarGetProgress ( progress ) == 100 ) then 
            guiSetVisible ( progress, false ) 
            outputChatBox ( "* CTF Completed" ) 
            triggerServerEvent("CtfC", localPlayer) 
            guiProgressBarSetProgress ( progress, 0 ) 
 if isTimer ( timer ) then killTimer ( timer ) 
 end 
        end   
      end 
timer = setTimer ( updateProgress, 600, 0) 
    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 ) 
           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 
          end 
          

Link to comment

استخدم تحقق ذا

if ( getElementDimension ( source ) == 1 ) then

-----------------------------------

addEventHandler ( "onClientMarkerHit", resourceRoot, function ( element ) 
  if ( source == marker ) then 
    if ( element == localPlayer ) and not ( getPedOccupiedVehicle ( element ) ) then 
  if ( getElementDimension ( element ) == 1 ) then  
    triggerServerEvent("chp", localPlayer) 
end 
 end 
  end 
   end) 

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