Jump to content

تصحيح كود


Mhmd.z

Recommended Posts

السلام عليكم ورحمة الله وبركاته

معي كود ضابط وكل شيئ بس فيه مشكله

resourceRoot ما اقدر احدد اي ماركر يوم يقرب عليه الاعب يصير الحدث , بس اقدر احدد

وانا ابي اني اقدر احدد اي ماركر بالمود مو resourceRoot

marker = {  
{-710.56818,958.04419,12.39771}, 
{-712.20367,947.42712,12.34575} 
} 
  
addEventHandler("onClientResourceStart",root, 
function () 
local number = math.random (#marker) 
local x = marker [number][1] 
local y = marker [number][2] 
local z = marker [number][3] 
local marker = createMarker(x,y,z - 1,"cylinder",2.0,255,0,0,255) 
blip = createBlip(x,y,z,41) 
end ) 
  
addEventHandler ( "onClientMarkerHit", resourceRoot, 
function () 
outputChatBox("marker hit", 255, 0, 0) 
end 
) 

Link to comment
Marker = { 
    {-710.568, 958.044, 12.397}, 
    {-712.203, 947.427, 12.345} 
} 
  
addEventHandler("onClientResourceStart",resourceRoot, 
function() 
    local number = math.random(#Marker) 
    local x, y, z = unpack(Marker[number]) 
    local marker = createMarker(x, y, z-1, "cylinder", 2.0, 255, 0, 0, 255) 
    addEventHandler("onClientMarkerHit", marker, onHit) 
    blip = createBlip(x, y, z, 41) 
end) 
  
function onHit(player) 
    if player == localPlayer then 
        outputChatBox("marker hit", 255, 0, 0) 
    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...