Jump to content

مششكلة - الفري روم


Recommended Posts

السسلام عليكم

انا عدلت بالفري روم لان كان لا مت يطلع الخريطه ولادخلت يطلع الخريطهه

المهم حذفت شي على ماظن خرب

الـ Player Blips

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

function updatePlayerBlips() 
    if not g_PlayerData then 
        return 
    end 
    local wnd = isWindowOpen(wndSpawnMap) and wndSpawnMap or wndSetPos 
    local mapControl = getControl(wnd, 'map') 
    for elem,player in pairs(g_PlayerData) do 
        if not player.gui.mapBlip then 
            player.gui.mapBlip = guiCreateStaticImage(0, 0, 9, 9, elem == g_Me and 'localplayerblip.png' or 'playerblip.png', false, mapControl) 
            player.gui.mapLabelShadow = guiCreateLabel(0, 0, 100, 14, player.name, false, mapControl) 
            local labelWidth = guiLabelGetTextExtent(player.gui.mapLabelShadow) 
            guiSetSize(player.gui.mapLabelShadow, labelWidth, 14, false) 
            guiSetFont(player.gui.mapLabelShadow, 'default-bold-small') 
            guiLabelSetColor(player.gui.mapLabelShadow, 255, 255, 255) 
            player.gui.mapLabel = guiCreateLabel(0, 0, labelWidth, 14, player.name, false, mapControl) 
            guiSetFont(player.gui.mapLabel, 'default-bold-small') 
            guiLabelSetColor(player.gui.mapLabel, 0, 0, 0) 
            for i,name in ipairs({'mapBlip', 'mapLabelShadow'}) do 
                addEventHandler('onClientGUIDoubleClick', player.gui[name], 
                    function() 
                        server.warpMe(elem) 
                        closeWindow(wnd) 
                    end, 
                    false 
                ) 
            end 
        end 
        local x, y = getElementPosition(elem) 
        x = math.floor((x + 3000) * g_MapSide / 6000) - 4 
        y = math.floor((3000 - y) * g_MapSide / 6000) - 4 
        guiSetPosition(player.gui.mapBlip, x, y, false) 
        guiSetPosition(player.gui.mapLabelShadow, x + 14, y - 4, false) 
        guiSetPosition(player.gui.mapLabel, x + 13, y - 5, false) 
    end 
end 

--

--------------------------- 
-- Spawn map window 
--------------------------- 
function warpMapInit() 
    addEventHandler('onClientRender', g_Root, updatePlayerBlips) 
end 
  
function spawnMapDoubleClick(relX, relY) 
    setPlayerPosition(relX*6000 - 3000, 3000 - relY*6000, 0) 
    closeWindow(wndSpawnMap) 
end 
  
function closeSpawnMap() 
    showCursor(false) 
    removeEventHandler('onClientRender', g_Root, updatePlayerBlips) 
    for elem,data in pairs(g_PlayerData) do 
        for i,name in ipairs({'mapBlip', 'mapLabelShadow', 'mapLabel'}) do 
            if data.gui[name] then 
                destroyElement(data.gui[name]) 
                data.gui[name] = nil 
            end 
        end 
    end 
end 

Link to comment

https://forum.multitheftauto.com/viewtopic.php?f=160&t=59975&p=571204#p571204

الخاص بالفري روم meta.xml بالنسبة إلى طلبكـ الأول .. إدخل إلى ملف

ثم إبحث عن السطر ذا ..

<setting name="*spawnmaponstart" value="true" /> 

إستبدله بذا

<setting name="*spawnmaponstart" value="false" /> 

كذا لما يدخل السيرفر أو لما يشتغل سكربت الفري روم ما رح تجيه الخريطة ^

+ لو تبي لما يموت ما تظهر له الخريطة

إبحث عن السطر ذا

<setting name="*spawnmapondeath" value="true" /> 

إستبدله بذا

<setting name="*spawnmapondeath" value="false" /> 

===========

setPlayerMuted أما بالنسبة لطلبكـ الثاني .. الكلام الي يجي بالشات وانت معكـ ميوت ذا ما تقدر تغيرهـ من الأدمنية ، لأنه ذا الكلام خاص بوظيفة

لكن في طريقة تقدر تخليه ما يجي بالشات .. أنا بعطكـ الطريقة ، لكن أتمنى ماحد يستخدمها في تغيير الحقوق + ماحلل لأي أحد يستخدم هالكود لتغيير الحقوق ..

-- Client Side !

addEventHandler ( "onClientChatMessage", root, 
    function ( theMsg ) 
        if ( theMsg == "say: You are muted" ) then 
            cancelEvent ( ) 
            outputChatBox ( "The Message", r, g, b, true ) 
        end 
    end 
) 

الإستبدال ..

سطر 5 :

The Message = say: You are muted الرسالة إلي تظهر بدال

r, g, b = الألوان

.. الشرح الأول يلبي طلبك ^

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