AboShanab Posted April 23, 2013 Share Posted April 23, 2013 (edited) السسلام عليككم ورحممة الله وبرككاته .. اخبارككم شباب اليوم مسوي لوحة حق 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 April 23, 2013 by Guest Link to comment
iMr.Dawix~# Posted April 23, 2013 Share Posted April 23, 2013 السسلام عليككم ورحممة الله وبرككاته ..اخبارككم شباب اليوم مسوي لوحة حق 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 في القريدد ليستت !! و ما يصوووتت .. وشككرا كيف عرفت انه مايصوت واسماء المابات ما تجي باللست متأكد الكود سيرفر؟ Link to comment
AboShanab Posted April 23, 2013 Author Share Posted April 23, 2013 متاككدد انه سيرفر + مجربه بسيرفري Link to comment
|Mr|-Talal07-| Posted April 23, 2013 Share Posted April 23, 2013 اضفت المود لقروب الادمن Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now