Jump to content

طلب فنكشااااااااااات #_@!_$@(


EH10

Recommended Posts

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

ابي فنكشات

اذا كتبت باف8 Shop

يجي قدام الاعب الي كتب ماركر واي واحد يدخل الماركر يجية شوب والي يشتري من الشوب يجي الفلوس للي فاتح الماركر

والي يبيع يجية فريز مشان مايتحرك

واذا كتب Shop

ثاني مره يختفي الماركر وينفك الفريز

ابي الفنكشات مع الشرح + كل شي

Link to comment

انتا عسل بس ممكن تقولي الكود ذا وش يسوي بضبط

local markers = { } 
  
addCommandHandler( "markerC", function( player ) 
    if isElement( markers[player] ) then destroyElement( markers[player] ) end 
    local x,y,z = getElementPosition( player ) 
    markers[player] = createMarker( x, y, z, "cylinder", 3, 255, 0, 2 ) 
    setElementData( markers[player], "Creater", player ) 
end ) 
  
addEventHandler( "onMarkerHit", resourceRoot, function( hitElement ) 
    if getElementType( hitElement ) == "player" then 
        triggerClientEvent( hitElement, "open_window", hitElement, source ) 
    end 
end ) 
  
addEvent( "Trigger", true ) 
addEventHandler( "Trigger", root, function( marker ) 
    local player = getElementData( marker, "Creater" ) 
    if getPlayerMoney( source ) >= 100 and isElement( player ) then 
        takePlayerMoney( source, 100 ) 
        givePlayerMoney( player, 50 ) 
    end 
end ) 

* Client side :

local theMarker = false 
  
addEventHandler( "onClientGUIClick", button, function( ) 
    triggerServerEvent( "Trigger", localPlayer, theMarker ) 
end, false ) 
  
addEvent( "open_window",true ) 
addEventHandler( "open_window", root, function( marker ) 
    guiSetVisible( window, true ) 
    showCursor( true ) 
    theMarker = marker 
end ) 

Link to comment
الكود هذا تكتب امر من اف8 ويسوي لك ماركر , واي واحد يلمسه تنفتح له لوحه , واذا ضغط زر من اللوحه يعطي الي سوى الماركر فلوس , ويسحب من الي ضغط الزر

ممكن تخلي ماحد يقدر ياخذ الوظيفة ذي الى تيم معين

Link to comment

-- Server Side #  
local markers = { } 
  
addCommandHandler( "markerC", function( player ) 
    if isElement( markers[player] ) then destroyElement( markers[player] ) end 
        if ( getPlayerTeam(player) and getTeamName(getPlayerTeam(player)) == 'teamName' ) then 
            local x,y,z = getElementPosition( player ) 
            markers[player] = createMarker( x, y, z, "cylinder", 3, 255, 0, 2 ) 
            setElementData( markers[player], "Creater", player ) 
    end 
end ) 
  
addEventHandler( "onMarkerHit", resourceRoot, function( hitElement ) 
    if getElementType( hitElement ) == "player" then 
        triggerClientEvent( hitElement, "open_window", hitElement, source ) 
    end 
end ) 
  
addEvent( "Trigger", true ) 
addEventHandler( "Trigger", root, function( marker ) 
    local player = getElementData( marker, "Creater" ) 
    if getPlayerMoney( source ) >= 100 and isElement( player ) then 
        takePlayerMoney( source, 100 ) 
        givePlayerMoney( player, 50 ) 
    end 
end ) 

teamName = سطر 6 , استبدله بإسم التيم

Link to comment
-- Server Side #  
local markers = { } 
  
addCommandHandler( "markerC", function( player ) 
    if isElement( markers[player] ) then destroyElement( markers[player] ) end 
        if ( getPlayerTeam(player) and getTeamName(getPlayerTeam(player)) == 'teamName' ) then 
            local x,y,z = getElementPosition( player ) 
            markers[player] = createMarker( x, y, z, "cylinder", 3, 255, 0, 2 ) 
            setElementData( markers[player], "Creater", player ) 
    end 
end ) 
  
addEventHandler( "onMarkerHit", resourceRoot, function( hitElement ) 
    if getElementType( hitElement ) == "player" then 
        triggerClientEvent( hitElement, "open_window", hitElement, source ) 
    end 
end ) 
  
addEvent( "Trigger", true ) 
addEventHandler( "Trigger", root, function( marker ) 
    local player = getElementData( marker, "Creater" ) 
    if getPlayerMoney( source ) >= 100 and isElement( player ) then 
        takePlayerMoney( source, 100 ) 
        givePlayerMoney( player, 50 ) 
    end 
end ) 

teamName = سطر 6 , استبدله بإسم التيم

شكرا ياجميل

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