Jump to content

تم الحل من قبلي ذذ


Recommended Posts

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

اخبارككم شباب

اليوم مسوي لوحة حق tdma تصويتات

حاولة اعدل على بعض اكواد سعد لاكن ما ضبط هذي الاكوادد

-- Client Side !

  
lp = getLocalPlayer() 
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(290, 134, 254, 330, "VoteMap DeathMatch v1 By AboShanab", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetVisible(GUIEditor.window[1],false) 
        GUIEditor.gridlist[1] = guiCreateGridList(34, 32, 194, 245, false, GUIEditor.window[1]) 
        guiGridListSetSelectionMode(GUIEditor.gridlist[1],2) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "  Tdma-   ID ", 0.85) 
        GUIEditor.button[1] = guiCreateButton(76, 292, 105, 28, "Vote", false, GUIEditor.window[1]) 
    end 
) 
------------ 
local columns = guiGridListAddColumn(GUIEditor.gridlist[1], "  Tdma-   ID ", 0.85) 
addEvent("returnVoteDatas",true) 
addEventHandler("returnVoteDatas",root, 
function (resTable) 
guiGridListClear(GUIEditor.gridlist[1]) 
    for index, resource in pairs(resTable) do 
        if string.find(resource,"tdma",1) then 
             row = guiGridListAddRow(GUIEditor.gridlist[1]) 
             resource =  gettok ( resource, 2, string.byte('_') ) 
            guiGridListSetItemText(GUIEditor.gridlist[1],row,columns,tostring(resource),false,false) 
            guiGridListSetItemColor ( GUIEditor.gridlist[1], row, 1, 0, 255, 150, 255 ) 
        end 
    end 
end) 
------------- 
function onresourceStart () 
    bindKey ("F1", "down", showUserPanel) 
end 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) 
  
function showUserPanel () 
local getVisible = guiGetVisible (GUIEditor.window[1]) 
if (getVisible) then 
    guiSetVisible (GUIEditor.window[1], false) 
    showCursor (false) 
else 
    guiSetVisible (GUIEditor.window[1], true) 
    showCursor (true) 
    triggerServerEvent("getVoteDatas",localPlayer) 
    end 
end 
------------------------------ 
--- On Click 
------------------------------ 
function onClick (button, state, absoluteX, absoluteY) 
  
selectedRow1, selectedCol1 = guiGridListGetSelectedItem( GUIEditor.gridlist[1] ) 
theMap1 = guiGridListGetItemText( GUIEditor.gridlist[1], selectedRow1, selectedCol1 ) 
if ( source == GUIEditor.button[1] ) then 
guiSetVisible(GUIEditor.window[1],false) 
    showCursor (false) 
if theMap1 then 
triggerServerEvent("tdma",lp,lp,theMap1) 
end 
end 
end 
addEventHandler( "onClientGUIClick", root, onClick ) 
  
  

-- Server Side !

  
addEvent("tdma",true) 
addEventHandler("tdma",root, 
function (client, action) 
    executeCommandHandler("votemap", client, "tdma_".. tostring(action)) 
end) 
addEvent("getVoteDatas",true) 
addEventHandler("getVoteDatas",root, 
function () 
    local theTable = {} 
    for index, resource in ipairs(getResources()) do 
        if getResourceInfo(resource,"type") == "map" then 
         name = getResourceName(resource) 
         result = gettok ( name, 2, string.byte('_') ) 
                if string.find(name,"tdma",1) and not string.find(name,"arena",1) and not string.find(name,"dm",1) then 
                local aname = "tdma_"..result 
                table.insert(theTable,aname) 
                end 
        end 
    end 
    table.sort(theTable) 
    triggerClientEvent(source,"returnVoteDatas",source,theTable) 
end) 
  
  

المششكلة ما يجي حتى اسماء المابات حق tdma في القريدد ليستت !!

و ما يصوووتت ..

وشككرا

Edited by Guest
Link to comment
السسلام عليككم ورحممة الله وبرككاته ..

اخبارككم شباب

اليوم مسوي لوحة حق tdma تصويتات

حاولة اعدل على بعض اكواد سعد لاكن ما ضبط هذي الاكوادد

-- Client Side !

  
lp = getLocalPlayer() 
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(290, 134, 254, 330, "VoteMap DeathMatch v1 By AboShanab", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetVisible(GUIEditor.window[1],false) 
        GUIEditor.gridlist[1] = guiCreateGridList(34, 32, 194, 245, false, GUIEditor.window[1]) 
        guiGridListSetSelectionMode(GUIEditor.gridlist[1],2) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "  Tdma-   ID ", 0.85) 
        GUIEditor.button[1] = guiCreateButton(76, 292, 105, 28, "Vote", false, GUIEditor.window[1]) 
    end 
) 
------------ 
local columns = guiGridListAddColumn(GUIEditor.gridlist[1], "  Tdma-   ID ", 0.85) 
addEvent("returnVoteDatas",true) 
addEventHandler("returnVoteDatas",root, 
function (resTable) 
guiGridListClear(GUIEditor.gridlist[1]) 
    for index, resource in pairs(resTable) do 
        if string.find(resource,"tdma",1) then 
             row = guiGridListAddRow(GUIEditor.gridlist[1]) 
             resource =  gettok ( resource, 2, string.byte('_') ) 
            guiGridListSetItemText(GUIEditor.gridlist[1],row,columns,tostring(resource),false,false) 
            guiGridListSetItemColor ( GUIEditor.gridlist[1], row, 1, 0, 255, 150, 255 ) 
        end 
    end 
end) 
------------- 
function onresourceStart () 
    bindKey ("F1", "down", showUserPanel) 
end 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) 
  
function showUserPanel () 
local getVisible = guiGetVisible (GUIEditor.window[1]) 
if (getVisible) then 
    guiSetVisible (GUIEditor.window[1], false) 
    showCursor (false) 
else 
    guiSetVisible (GUIEditor.window[1], true) 
    showCursor (true) 
    triggerServerEvent("getVoteDatas",localPlayer) 
    end 
end 
------------------------------ 
--- On Click 
------------------------------ 
function onClick (button, state, absoluteX, absoluteY) 
  
selectedRow1, selectedCol1 = guiGridListGetSelectedItem( GUIEditor.gridlist[1] ) 
theMap1 = guiGridListGetItemText( GUIEditor.gridlist[1], selectedRow1, selectedCol1 ) 
if ( source == GUIEditor.button[1] ) then 
guiSetVisible(GUIEditor.window[1],false) 
    showCursor (false) 
if theMap1 then 
triggerServerEvent("tdma",lp,lp,theMap1) 
end 
end 
end 
addEventHandler( "onClientGUIClick", root, onClick ) 
  
  

-- Server Side !

  
addEvent("tdma",true) 
addEventHandler("tdma",root, 
function (client, action) 
    executeCommandHandler("votemap", client, "tdma_".. tostring(action)) 
end) 
addEvent("getVoteDatas",true) 
addEventHandler("getVoteDatas",root, 
function () 
    local theTable = {} 
    for index, resource in ipairs(getResources()) do 
        if getResourceInfo(resource,"type") == "map" then 
         name = getResourceName(resource) 
         result = gettok ( name, 2, string.byte('_') ) 
                if string.find(name,"tdma",1) and not string.find(name,"arena",1) and not string.find(name,"dm",1) then 
                local aname = "tdma_"..result 
                table.insert(theTable,aname) 
                end 
        end 
    end 
    table.sort(theTable) 
    triggerClientEvent(source,"returnVoteDatas",source,theTable) 
end) 
  
  

المششكلة ما يجي حتى اسماء المابات حق tdma في القريدد ليستت !!

و ما يصوووتت ..

وشككرا

:lol: كيف عرفت انه مايصوت واسماء المابات ما تجي باللست

متأكد الكود سيرفر؟

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