Jump to content

طلب كود


mohssan

Recommended Posts

createMarker 
"onMarkerHit" 
givePlayerMoney 

ممكن الكود كامل

لان انا مبتدى

جرب هذا كــمثال

addEventHandler("onResourceStart",resourceRoot, -- عند بدء السكربت 
    function() 
        for k,v in ipairs(getElementsByType('player')) do  
            local x, y, z = getElementPosition(v) -- نجيب مكان اللاعب 
            Marker = createMarker(x, y-5, z, "cylinder") -- ونخلي الماركر تتكون في مكان الاعب 
        end 
            addEventHandler("onMarkerHit",Marker,example) -- ونضيف الحدث 
    end 
) 
  
function example(hitElement) 
    if(getElementType(hitElement)=='player')then -- اذا الامس لاعب 
        givePlayerMoney(hitElement,1000) -- يعطيه فلوس 
     end 
end 

لا تنسى تحطه بملف السيرفر عشان لا يجيك اخطاء

Link to comment
  • Other Languages Moderators
marker = createMarker( ... ) 
function hit(hitElement) 
if(hitElement=='player')then 
givePlayerMoney(hitElement,1000) 
end 
end 
addEventHandler("onMarkerHit", marker, hit) 

marker = createMarker( ... ) 
function hit(hitElement) 
if(getElementType(hitElement) == "player")then 
givePlayerMoney(hitElement,1000) 
end 
end 
addEventHandler("onMarkerHit", marker, hit) 

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