iFoReX Posted May 11, 2012 Share Posted May 11, 2012 I dont have problems in debugscript 3 GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.4925,0.3317,0.51,0.6717,"GUI Admin",true) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(11,87,167,307,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) column = guiGridListAddColumn(GUIEditor_Grid[1],"Players",0.7) GUIEditor_Edit[1] = guiCreateEdit(11,46,167,34,"",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(191,46,103,38,"Mute",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(191,96,103,38,"Ban",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(191,146,103,38,"Kick",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(191,200,103,38,"Dimension",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(191,259,103,38,"Warp to Player",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(190,345,213,51,"Admin Panel By ElMota",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Button[6] = guiCreateButton(313,46,86,38,"Resources",false,GUIEditor_Window[1]) GUIEditor_Window[2] = guiCreateWindow(0.35,0.2783,0.3388,0.4217,"Ban Times",true) guiWindowSetSizable(GUIEditor_Window[2],false) GUIEditor_Button[7] = guiCreateButton(32,39,189,40,"1 Year",false,GUIEditor_Window[2]) GUIEditor_Button[8] = guiCreateButton(32,87,189,40,"1 Month",false,GUIEditor_Window[2]) GUIEditor_Button[9] = guiCreateButton(32,138,189,38,"1 Day",false,GUIEditor_Window[2]) GUIEditor_Button[10] = guiCreateButton(172,216,90,28,"Cancelar",false,GUIEditor_Window[2]) GUIEditor_Window[3] = guiCreateWindow(0.2988,0.2867,0.4737,0.4267,"Dimension GUI",true) GUIEditor_Label[2] = guiCreateLabel(48,102,107,18,"Set Dimension ...",false,GUIEditor_Window[3]) GUIEditor_Edit[2] = guiCreateEdit(131,123,65,27,"",false,GUIEditor_Window[3]) GUIEditor_Button[11] = guiCreateButton(246,199,120,44,"Set Dimension",false,GUIEditor_Window[3]) GUIEditor_Button[12] = guiCreateButton(9,199,120,44,"Cancel",false,GUIEditor_Window[3]) GUIEditor_Window[4] = guiCreateWindow(0.3613,0.13,0.3025,0.845,"GUI Resources",true) guiWindowSetSizable(GUIEditor_Window[4],false) GUIEditor_Grid[2] = guiCreateGridList(21,71,201,358,false,GUIEditor_Window[4]) guiGridListSetSelectionMode(GUIEditor_Grid[2],2) guiGridListAddColumn(GUIEditor_Grid[2],"resources :",0.2) GUIEditor_Edit[3] = guiCreateEdit(23,32,197,35,"",false,GUIEditor_Window[4]) GUIEditor_Button[13] = guiCreateButton(141,453,92,37,"Start Resource",false,GUIEditor_Window[4]) GUIEditor_Button[14] = guiCreateButton(10,453,92,37,"Cancel",false,GUIEditor_Window[4]) guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],false) guiSetVisible(GUIEditor_Window[3],false) guiSetVisible(GUIEditor_Window[4],false) showCursor(false) function GUIOpen() guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) showCursor(guiGetVisible(GUIEditor_Window[1])) end addEvent("onVisibleAdmin", true) addEventHandler("onVisibleAdmin", getLocalPlayer(), GUIOpen) function clientsideResourceStart () guiGridListClear(GUIEditor_Grid[1]) if (guiGridListClear) then for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, column, getPlayerName ( playeritem ), false, false ) end end end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), clientsideResourceStart ) addEventHandler ( "onClientPlayerJoin", getLocalPlayer(), clientsideResourceStart ) addEventHandler ( "onClientPlayerQuit", getLocalPlayer(), clientsideResourceStart ) addEventHandler ( "onClientPlayerChangeNick", getLocalPlayer(), clientsideResourceStart ) addEventHandler("onClientGUIClick", root, function() if source == GUIEditor_Button[2] then guiSetVisible(GUIEditor_Window[2],true) elseif source == GUIEditor_Button[10] then guiSetVisible(GUIEditor_Window[2],false) elseif source == GUIEditor_Button[4] then guiSetVisible(GUIEditor_Window[3],true) elseif source == GUIEditor_Button[12] then guiSetVisible(GUIEditor_Window[3],false) elseif source == GUIEditor_Button[1] then triggerServerEvent("mute", getLocalPlayer()) outputChatBox("Has Sido Muteado por un Admin", elPlayer) end end ) addEventHandler ( "onClientGUIChanged", GUIEditor_Edit[1], function() for i=1,guiGridListGetRowCount(GRIDLIST) do if(guiGridListGetItemText(GRIDLIST,i,1)==string)then guiGridListSetSelectedItem(GRIDLIST,i,1) end end end ) addEvent("argms", true) addEventHandler("argms", getLocalPlayer(), function() local playername = guiGridListGetItemText ( source, row, col ) elPlayer = getPlayerFromName ( playername ) end ) sv-side function opGUI ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user.".. accName, aclGetGroup ( "Admin" ) ) then triggerClientEvent ( thePlayer, "onVisibleAdmin", thePlayer ) end end addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "p", "down", opGUI ) end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for index, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( player, "p", "down", opGUI ) end end ) addEvent("mute", true) addEventHandler("mute", getRootElement(), function() triggerClientEvent("argms", elPlayer) setPlayerMuted(elPlayer, true) end ) img Link to comment
DNL291 Posted May 11, 2012 Share Posted May 11, 2012 You gave rights to the resource? Link to comment
iFoReX Posted May 11, 2012 Author Share Posted May 11, 2012 Yeh, I add it to my ACL GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.4925,0.3317,0.51,0.6717,"GUI Admin",true) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(11,87,167,307,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) column = guiGridListAddColumn(GUIEditor_Grid[1],"Players",0.7) GUIEditor_Edit[1] = guiCreateEdit(11,46,167,34,"",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(191,46,103,38,"Mute",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(191,96,103,38,"Ban",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(191,146,103,38,"Kick",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(191,200,103,38,"Dimension",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(191,259,103,38,"Warp to Player",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(190,345,213,51,"Admin Panel By ElMota",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Button[6] = guiCreateButton(313,46,86,38,"Resources",false,GUIEditor_Window[1]) GUIEditor_Window[2] = guiCreateWindow(0.35,0.2783,0.3388,0.4217,"Ban Times",true) guiWindowSetSizable(GUIEditor_Window[2],false) GUIEditor_Button[7] = guiCreateButton(32,39,189,40,"1 Year",false,GUIEditor_Window[2]) GUIEditor_Button[8] = guiCreateButton(32,87,189,40,"1 Month",false,GUIEditor_Window[2]) GUIEditor_Button[9] = guiCreateButton(32,138,189,38,"1 Day",false,GUIEditor_Window[2]) GUIEditor_Button[10] = guiCreateButton(172,216,90,28,"Cancelar",false,GUIEditor_Window[2]) GUIEditor_Window[3] = guiCreateWindow(0.2988,0.2867,0.4737,0.4267,"Dimension GUI",true) GUIEditor_Label[2] = guiCreateLabel(48,102,107,18,"Set Dimension ...",false,GUIEditor_Window[3]) GUIEditor_Edit[2] = guiCreateEdit(131,123,65,27,"",false,GUIEditor_Window[3]) GUIEditor_Button[11] = guiCreateButton(246,199,120,44,"Set Dimension",false,GUIEditor_Window[3]) GUIEditor_Button[12] = guiCreateButton(9,199,120,44,"Cancel",false,GUIEditor_Window[3]) GUIEditor_Window[4] = guiCreateWindow(0.3613,0.13,0.3025,0.845,"GUI Resources",true) guiWindowSetSizable(GUIEditor_Window[4],false) GUIEditor_Grid[2] = guiCreateGridList(21,71,201,358,false,GUIEditor_Window[4]) guiGridListSetSelectionMode(GUIEditor_Grid[2],2) guiGridListAddColumn(GUIEditor_Grid[2],"resources :",0.2) GUIEditor_Edit[3] = guiCreateEdit(23,32,197,35,"",false,GUIEditor_Window[4]) GUIEditor_Button[13] = guiCreateButton(141,453,92,37,"Start Resource",false,GUIEditor_Window[4]) GUIEditor_Button[14] = guiCreateButton(10,453,92,37,"Cancel",false,GUIEditor_Window[4]) guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],false) guiSetVisible(GUIEditor_Window[3],false) guiSetVisible(GUIEditor_Window[4],false) showCursor(false) function GUIOpen() guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) showCursor(guiGetVisible(GUIEditor_Window[1])) end addEvent("onVisibleAdmin", true) addEventHandler("onVisibleAdmin", getLocalPlayer(), GUIOpen) function clientsideResourceStart () guiGridListClear(GUIEditor_Grid[1]) if (guiGridListClear) then for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, column, getPlayerName ( playeritem ), false, false ) end end end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), clientsideResourceStart ) addEventHandler ( "onClientPlayerJoin", getLocalPlayer(), clientsideResourceStart ) addEventHandler ( "onClientPlayerQuit", getLocalPlayer(), clientsideResourceStart ) addEventHandler ( "onClientPlayerChangeNick", getLocalPlayer(), clientsideResourceStart ) addEventHandler("onClientGUIClick", root, function() if source == GUIEditor_Button[2] then guiSetVisible(GUIEditor_Window[2],true) elseif source == GUIEditor_Button[10] then guiSetVisible(GUIEditor_Window[2],false) elseif source == GUIEditor_Button[4] then guiSetVisible(GUIEditor_Window[3],true) elseif source == GUIEditor_Button[12] then guiSetVisible(GUIEditor_Window[3],false) elseif source == GUIEditor_Button[1] then triggerServerEvent("mute", getLocalPlayer()) outputChatBox("Has Sido Muteado por un Admin", elPlayer) end end ) addEventHandler ( "onClientGUIChanged", GUIEditor_Edit[1], function() for i=1,guiGridListGetRowCount(GRIDLIST) do if(guiGridListGetItemText(GRIDLIST,i,1)==string)then guiGridListSetSelectedItem(GRIDLIST,i,1) end end end ) addEvent("argms", true) addEventHandler("argms", getLocalPlayer(), function() row, col = guiGridListGetSelectedItem ( GUIEditor_Grid[1] ) local playername = guiGridListGetItemText ( GUIEditor_Grid[1], row, col ) elPlayer = getPlayerFromName ( playername ) end ) Link to comment
DNL291 Posted May 11, 2012 Share Posted May 11, 2012 (edited) try function opGUI ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user.".. accName, aclGetGroup ( "Admin" ) ) then triggerClientEvent ( thePlayer, "onVisibleAdmin", thePlayer ) end end addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "p", "down", opGUI ) end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for index, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( player, "p", "down", opGUI ) end end ) addEvent("mute", true) addEventHandler("mute", getRootElement(), function() setPlayerMuted(source, true) end ) Edited May 11, 2012 by Guest Link to comment
Castillo Posted May 11, 2012 Share Posted May 11, 2012 (edited) That's really wrong. -- client side: GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.4925,0.3317,0.51,0.6717,"GUI Admin",true) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(11,87,167,307,false,GUIEditor_Window[1]) column = guiGridListAddColumn(GUIEditor_Grid[1],"Players",0.7) GUIEditor_Edit[1] = guiCreateEdit(11,46,167,34,"",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(191,46,103,38,"Mute",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(191,96,103,38,"Ban",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(191,146,103,38,"Kick",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(191,200,103,38,"Dimension",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(191,259,103,38,"Warp to Player",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(190,345,213,51,"Admin Panel By ElMota",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Button[6] = guiCreateButton(313,46,86,38,"Resources",false,GUIEditor_Window[1]) GUIEditor_Window[2] = guiCreateWindow(0.35,0.2783,0.3388,0.4217,"Ban Times",true) guiWindowSetSizable(GUIEditor_Window[2],false) GUIEditor_Button[7] = guiCreateButton(32,39,189,40,"1 Year",false,GUIEditor_Window[2]) GUIEditor_Button[8] = guiCreateButton(32,87,189,40,"1 Month",false,GUIEditor_Window[2]) GUIEditor_Button[9] = guiCreateButton(32,138,189,38,"1 Day",false,GUIEditor_Window[2]) GUIEditor_Button[10] = guiCreateButton(172,216,90,28,"Cancelar",false,GUIEditor_Window[2]) GUIEditor_Window[3] = guiCreateWindow(0.2988,0.2867,0.4737,0.4267,"Dimension GUI",true) GUIEditor_Label[2] = guiCreateLabel(48,102,107,18,"Set Dimension ...",false,GUIEditor_Window[3]) GUIEditor_Edit[2] = guiCreateEdit(131,123,65,27,"",false,GUIEditor_Window[3]) GUIEditor_Button[11] = guiCreateButton(246,199,120,44,"Set Dimension",false,GUIEditor_Window[3]) GUIEditor_Button[12] = guiCreateButton(9,199,120,44,"Cancel",false,GUIEditor_Window[3]) GUIEditor_Window[4] = guiCreateWindow(0.3613,0.13,0.3025,0.845,"GUI Resources",true) guiWindowSetSizable(GUIEditor_Window[4],false) GUIEditor_Grid[2] = guiCreateGridList(21,71,201,358,false,GUIEditor_Window[4]) guiGridListSetSelectionMode(GUIEditor_Grid[2],2) guiGridListAddColumn(GUIEditor_Grid[2],"resources :",0.2) GUIEditor_Edit[3] = guiCreateEdit(23,32,197,35,"",false,GUIEditor_Window[4]) GUIEditor_Button[13] = guiCreateButton(141,453,92,37,"Start Resource",false,GUIEditor_Window[4]) GUIEditor_Button[14] = guiCreateButton(10,453,92,37,"Cancel",false,GUIEditor_Window[4]) guiSetVisible ( GUIEditor_Window[1], false ) guiSetVisible ( GUIEditor_Window[2], false ) guiSetVisible ( GUIEditor_Window[3], false ) guiSetVisible ( GUIEditor_Window[4], false ) showCursor ( false ) function GUIOpen ( ) guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) end addEvent ( "onVisibleAdmin", true ) addEventHandler ( "onVisibleAdmin", getLocalPlayer(), GUIOpen ) function clientsideResourceStart ( ) guiGridListClear ( GUIEditor_Grid[1] ) for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, column, getPlayerName ( playeritem ), false, false ) end end addEventHandler ( "onClientResourceStart", resourceRoot, clientsideResourceStart ) addEventHandler ( "onClientPlayerJoin", root, clientsideResourceStart ) addEventHandler ( "onClientPlayerQuit", root, clientsideResourceStart ) addEventHandler ( "onClientPlayerChangeNick", root, clientsideResourceStart ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor_Button[2] ) then guiSetVisible(GUIEditor_Window[2],true) elseif ( source == GUIEditor_Button[10] ) then guiSetVisible ( GUIEditor_Window[2], false ) elseif ( source == GUIEditor_Button[4] ) then guiSetVisible ( GUIEditor_Window[3], true) elseif ( source == GUIEditor_Button[12] ) then guiSetVisible ( GUIEditor_Window[3], false ) elseif ( source == GUIEditor_Button[1] ) then local row, col = guiGridListGetSelectedItem ( GUIEditor_Grid[1] ) if ( row and col and row ~= -1 and col ~= -1 ) then local playerName = guiGridListGetItemText ( GUIEditor_Grid[1], row, column ) triggerServerEvent ( "mute", localPlayer, playerName ) end end end ) addEventHandler ( "onClientGUIChanged", GUIEditor_Edit[1], function ( ) local text = guiGetText ( source ) for row = 1, guiGridListGetRowCount ( GUIEditor_Grid[1] ) do if ( guiGridListGetItemText ( GUIEditor_Grid[1], row, 1 ) == text ) then guiGridListSetSelectedItem ( GUIEditor_Grid[1], row, 1 ) end end end ,false ) -- server side: function opGUI ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user.".. accName, aclGetGroup ( "Admin" ) ) then triggerClientEvent ( thePlayer, "onVisibleAdmin", thePlayer ) end end addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "p", "down", opGUI ) end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for index, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( player, "p", "down", opGUI ) end end ) addEvent("mute", true) addEventHandler("mute", getRootElement(), function ( playerName ) local thePlayer = getPlayerFromName ( playerName ) if ( not thePlayer ) then outputChatBox ( "Este jugador no esta online.", source ) end if setPlayerMuted ( thePlayer, true ) then outputChatBox ( "Has Sido Muteado por un Admin", thePlayer ) end end ) Edited May 11, 2012 by Guest Link to comment
Jaysds1 Posted May 11, 2012 Share Posted May 11, 2012 lol, isn't there another topic about this GUI: viewtopic.php?f=91&t=43167 Link to comment
Jaysds1 Posted May 11, 2012 Share Posted May 11, 2012 I mean: viewtopic.php?f=91&t=43201 Link to comment
iFoReX Posted May 11, 2012 Author Share Posted May 11, 2012 aaa Yeh, But it is a different Problem Link to comment
Jaysds1 Posted May 11, 2012 Share Posted May 11, 2012 you could still post your problems that related to the same thing there. Link to comment
iFoReX Posted May 11, 2012 Author Share Posted May 11, 2012 Ok Ok sorry I dont know it Link to comment
Jaysds1 Posted May 11, 2012 Share Posted May 11, 2012 Ok Ok sorry I dont know it It's ok Does the script work now? Link to comment
iFoReX Posted May 11, 2012 Author Share Posted May 11, 2012 the Mute Button Doesnt work in Chatbox said me 'Este jugador no esta online.' Link to comment
Jaysds1 Posted May 11, 2012 Share Posted May 11, 2012 try this: Client-side GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.4925,0.3317,0.51,0.6717,"GUI Admin",true) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(11,87,167,307,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) column = guiGridListAddColumn(GUIEditor_Grid[1],"Players",0.7) GUIEditor_Edit[1] = guiCreateEdit(11,46,167,34,"",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(191,46,103,38,"Mute",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(191,96,103,38,"Ban",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(191,146,103,38,"Kick",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(191,200,103,38,"Dimension",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(191,259,103,38,"Warp to Player",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(190,345,213,51,"Admin Panel By ElMota",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Button[6] = guiCreateButton(313,46,86,38,"Resources",false,GUIEditor_Window[1]) GUIEditor_Window[2] = guiCreateWindow(0.35,0.2783,0.3388,0.4217,"Ban Times",true) guiWindowSetSizable(GUIEditor_Window[2],false) GUIEditor_Button[7] = guiCreateButton(32,39,189,40,"1 Year",false,GUIEditor_Window[2]) GUIEditor_Button[8] = guiCreateButton(32,87,189,40,"1 Month",false,GUIEditor_Window[2]) GUIEditor_Button[9] = guiCreateButton(32,138,189,38,"1 Day",false,GUIEditor_Window[2]) GUIEditor_Button[10] = guiCreateButton(172,216,90,28,"Cancelar",false,GUIEditor_Window[2]) GUIEditor_Window[3] = guiCreateWindow(0.2988,0.2867,0.4737,0.4267,"Dimension GUI",true) GUIEditor_Label[2] = guiCreateLabel(48,102,107,18,"Set Dimension ...",false,GUIEditor_Window[3]) GUIEditor_Edit[2] = guiCreateEdit(131,123,65,27,"",false,GUIEditor_Window[3]) GUIEditor_Button[11] = guiCreateButton(246,199,120,44,"Set Dimension",false,GUIEditor_Window[3]) GUIEditor_Button[12] = guiCreateButton(9,199,120,44,"Cancel",false,GUIEditor_Window[3]) GUIEditor_Window[4] = guiCreateWindow(0.3613,0.13,0.3025,0.845,"GUI Resources",true) guiWindowSetSizable(GUIEditor_Window[4],false) GUIEditor_Grid[2] = guiCreateGridList(21,71,201,358,false,GUIEditor_Window[4]) guiGridListSetSelectionMode(GUIEditor_Grid[2],2) guiGridListAddColumn(GUIEditor_Grid[2],"resources :",0.2) GUIEditor_Edit[3] = guiCreateEdit(23,32,197,35,"",false,GUIEditor_Window[4]) GUIEditor_Button[13] = guiCreateButton(141,453,92,37,"Start Resource",false,GUIEditor_Window[4]) GUIEditor_Button[14] = guiCreateButton(10,453,92,37,"Cancel",false,GUIEditor_Window[4]) guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],false) guiSetVisible(GUIEditor_Window[3],false) guiSetVisible(GUIEditor_Window[4],false) showCursor(false) function GUIOpen() guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) showCursor(guiGetVisible(GUIEditor_Window[1])) end addEvent("onVisibleAdmin", true) addEventHandler("onVisibleAdmin", getLocalPlayer(), GUIOpen) function clientsideResourceStart () guiGridListClear(GUIEditor_Grid[1]) if (guiGridListClear) then for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, column, getPlayerName ( playeritem ), false, false ) end end end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), clientsideResourceStart ) addEventHandler ( "onClientPlayerJoin", getLocalPlayer(), clientsideResourceStart ) addEventHandler ( "onClientPlayerQuit", getLocalPlayer(), clientsideResourceStart ) addEventHandler ( "onClientPlayerChangeNick", getLocalPlayer(), clientsideResourceStart ) addEventHandler("onClientGUIClick", root,function() if source == GUIEditor_Button[2] then guiSetVisible(GUIEditor_Window[2],true) elseif source == GUIEditor_Button[10] then guiSetVisible(GUIEditor_Window[2],false) elseif source == GUIEditor_Button[4] then guiSetVisible(GUIEditor_Window[3],true) elseif source == GUIEditor_Button[12] then guiSetVisible(GUIEditor_Window[3],false) elseif source == GUIEditor_Button[1] then local row, col = guiGridListGetSelectedItem ( GUIEditor_Grid[1] ) if ( row and col and row ~= -1 and col ~= -1 ) then local playerName = guiGridListGetItemText ( GUIEditor_Grid[1], row, col ) triggerServerEvent("mute", localPlayer, playerName ) end end end) addEventHandler ( "onClientGUIChanged", GUIEditor_Edit[1],function() for i=1,guiGridListGetRowCount(GRIDLIST) do if(guiGridListGetItemText(GRIDLIST,i,1)==string)then guiGridListSetSelectedItem(GRIDLIST,i,1) end end end) Sever-side function opGUI ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user.".. accName, aclGetGroup ( "Admin" ) ) then triggerClientEvent ( thePlayer, "onVisibleAdmin", thePlayer ) end end addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "p", "down", opGUI ) end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for index, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( player, "p", "down", opGUI ) end end ) addEvent("mute", true) addEventHandler("mute", root,function( playerName ) local thePlayer = getPlayerFromName ( playerName ) if ( not thePlayer ) then outputChatBox ( "Este jugador no esta online.", source ) end if setPlayerMuted ( thePlayer, true ) then outputChatBox ( "Has Sido Muteado por un Admin", thePlayer ) end end) Link to comment
Castillo Posted May 11, 2012 Share Posted May 11, 2012 @ElMota: Copy my client side code again, I've fixed a small problem. P.S: I also fixed your player-search function. Link to comment
iFoReX Posted May 11, 2012 Author Share Posted May 11, 2012 thank you solid work the mute button, now I done it but the message in chatbox doesnt appear and the player dont unmuted :c function opGUI ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user.".. accName, aclGetGroup ( "Admin" ) ) then triggerClientEvent ( thePlayer, "onVisibleAdmin", thePlayer ) end end addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "p", "down", opGUI ) end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for index, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( player, "p", "down", opGUI ) end end ) addEvent("mute", true) addEventHandler("mute", getRootElement(), function ( playerName ) local thePlayer = getPlayerFromName ( playerName ) if ( not thePlayer ) then outputChatBox ( "Este jugador no esta online.", source ) end if setPlayerMuted ( thePlayer, true ) then outputChatBox ( "Has Sido Muteado por un admin", thePlayer ) end end ) addEvent("unmute", true) addEventHandler("unmute", getRootElement(), function ( playerName ) local thePlayer = getPlayerFromName ( playerName ) if ( not thePlayer ) then outputChatBox ( "Este jugador no esta online.", source ) end if setPlayerMuted ( thePlayer, false ) then outputChatBox ( "te ha sacado el mute", thePlayer ) end end ) GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.4925,0.3317,0.51,0.6717,"GUI Admin",true) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(11,87,167,307,false,GUIEditor_Window[1]) column = guiGridListAddColumn(GUIEditor_Grid[1],"Players",0.7) GUIEditor_Edit[1] = guiCreateEdit(11,46,167,34,"",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(191,46,103,38,"Mute",false,GUIEditor_Window[1]) GUIEditor_Button[15] = guiCreateButton(191,46,103,38,"UnMute",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(191,96,103,38,"Ban",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(191,146,103,38,"Kick",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(191,200,103,38,"Dimension",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(191,259,103,38,"Warp to Player",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(190,345,213,51,"Admin Panel By ElMota",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Button[6] = guiCreateButton(313,46,86,38,"Resources",false,GUIEditor_Window[1]) GUIEditor_Window[2] = guiCreateWindow(0.35,0.2783,0.3388,0.4217,"Ban Times",true) guiWindowSetSizable(GUIEditor_Window[2],false) GUIEditor_Button[7] = guiCreateButton(32,39,189,40,"1 Year",false,GUIEditor_Window[2]) GUIEditor_Button[8] = guiCreateButton(32,87,189,40,"1 Month",false,GUIEditor_Window[2]) GUIEditor_Button[9] = guiCreateButton(32,138,189,38,"1 Day",false,GUIEditor_Window[2]) GUIEditor_Button[10] = guiCreateButton(172,216,90,28,"Cancelar",false,GUIEditor_Window[2]) GUIEditor_Window[3] = guiCreateWindow(0.2988,0.2867,0.4737,0.4267,"Dimension GUI",true) GUIEditor_Label[2] = guiCreateLabel(48,102,107,18,"Set Dimension ...",false,GUIEditor_Window[3]) GUIEditor_Edit[2] = guiCreateEdit(131,123,65,27,"",false,GUIEditor_Window[3]) GUIEditor_Button[11] = guiCreateButton(246,199,120,44,"Set Dimension",false,GUIEditor_Window[3]) GUIEditor_Button[12] = guiCreateButton(9,199,120,44,"Cancel",false,GUIEditor_Window[3]) GUIEditor_Window[4] = guiCreateWindow(0.3613,0.13,0.3025,0.845,"GUI Resources",true) guiWindowSetSizable(GUIEditor_Window[4],false) GUIEditor_Grid[2] = guiCreateGridList(21,71,201,358,false,GUIEditor_Window[4]) guiGridListSetSelectionMode(GUIEditor_Grid[2],2) guiGridListAddColumn(GUIEditor_Grid[2],"resources :",0.2) GUIEditor_Edit[3] = guiCreateEdit(23,32,197,35,"",false,GUIEditor_Window[4]) GUIEditor_Button[13] = guiCreateButton(141,453,92,37,"Start Resource",false,GUIEditor_Window[4]) GUIEditor_Button[14] = guiCreateButton(10,453,92,37,"Cancel",false,GUIEditor_Window[4]) guiSetVisible ( GUIEditor_Window[1], false ) guiSetVisible ( GUIEditor_Window[2], false ) guiSetVisible ( GUIEditor_Window[3], false ) guiSetVisible ( GUIEditor_Window[4], false ) guiSetVisible ( GUIEditor_Button[15], false ) showCursor ( false ) function GUIOpen ( ) guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) end addEvent ( "onVisibleAdmin", true ) addEventHandler ( "onVisibleAdmin", getLocalPlayer(), GUIOpen ) function clientsideResourceStart ( ) guiGridListClear ( GUIEditor_Grid[1] ) for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, column, getPlayerName ( playeritem ), false, false ) end end addEventHandler ( "onClientResourceStart", resourceRoot, clientsideResourceStart ) addEventHandler ( "onClientPlayerJoin", root, clientsideResourceStart ) addEventHandler ( "onClientPlayerQuit", root, clientsideResourceStart ) addEventHandler ( "onClientPlayerChangeNick", root, clientsideResourceStart ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor_Button[2] ) then guiSetVisible(GUIEditor_Window[2],true) elseif ( source == GUIEditor_Button[10] ) then guiSetVisible ( GUIEditor_Window[2], false ) elseif ( source == GUIEditor_Button[4] ) then guiSetVisible ( GUIEditor_Window[3], true) elseif ( source == GUIEditor_Button[12] ) then guiSetVisible ( GUIEditor_Window[3], false ) elseif ( source == GUIEditor_Button[1] ) then local row, col = guiGridListGetSelectedItem ( GUIEditor_Grid[1] ) if ( row and col and row ~= -1 and col ~= -1 ) then playerName = guiGridListGetItemText ( GUIEditor_Grid[1], row, column ) triggerServerEvent ( "mute", localPlayer, playerName ) guiSetVisible(GUIEditor_Button[1], false) guiSetVisible ( GUIEditor_Button[15], true ) end end end ) addEventHandler("onClientGUIClick", root, function() if ( source == GUIEditor_Button[15] ) then if ( row and col and row ~= -1 and col ~= -1 ) then triggerServerEvent ( "unmute", localPlayer, playerName ) guiSetVisible(GUIEditor_Button[15], false) guiSetVisible ( GUIEditor_Button[1], true ) end end end ) addEventHandler ( "onClientGUIChanged", GUIEditor_Edit[1], function ( ) local text = guiGetText ( source ) for row = 1, guiGridListGetRowCount ( GUIEditor_Grid[1] ) do if ( guiGridListGetItemText ( GUIEditor_Grid[1], row, 1 ) == text ) then guiGridListSetSelectedItem ( GUIEditor_Grid[1], row, 1 ) end end end ,false ) I added the button 15 ' unmute button ' Link to comment
Castillo Posted May 11, 2012 Share Posted May 11, 2012 GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.4925,0.3317,0.51,0.6717,"GUI Admin",true) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(11,87,167,307,false,GUIEditor_Window[1]) column = guiGridListAddColumn(GUIEditor_Grid[1],"Players",0.7) GUIEditor_Edit[1] = guiCreateEdit(11,46,167,34,"",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(191,46,103,38,"Mute",false,GUIEditor_Window[1]) GUIEditor_Button[15] = guiCreateButton(191,46,103,38,"UnMute",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(191,96,103,38,"Ban",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(191,146,103,38,"Kick",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(191,200,103,38,"Dimension",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(191,259,103,38,"Warp to Player",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(190,345,213,51,"Admin Panel By ElMota",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Button[6] = guiCreateButton(313,46,86,38,"Resources",false,GUIEditor_Window[1]) GUIEditor_Window[2] = guiCreateWindow(0.35,0.2783,0.3388,0.4217,"Ban Times",true) guiWindowSetSizable(GUIEditor_Window[2],false) GUIEditor_Button[7] = guiCreateButton(32,39,189,40,"1 Year",false,GUIEditor_Window[2]) GUIEditor_Button[8] = guiCreateButton(32,87,189,40,"1 Month",false,GUIEditor_Window[2]) GUIEditor_Button[9] = guiCreateButton(32,138,189,38,"1 Day",false,GUIEditor_Window[2]) GUIEditor_Button[10] = guiCreateButton(172,216,90,28,"Cancelar",false,GUIEditor_Window[2]) GUIEditor_Window[3] = guiCreateWindow(0.2988,0.2867,0.4737,0.4267,"Dimension GUI",true) GUIEditor_Label[2] = guiCreateLabel(48,102,107,18,"Set Dimension ...",false,GUIEditor_Window[3]) GUIEditor_Edit[2] = guiCreateEdit(131,123,65,27,"",false,GUIEditor_Window[3]) GUIEditor_Button[11] = guiCreateButton(246,199,120,44,"Set Dimension",false,GUIEditor_Window[3]) GUIEditor_Button[12] = guiCreateButton(9,199,120,44,"Cancel",false,GUIEditor_Window[3]) GUIEditor_Window[4] = guiCreateWindow(0.3613,0.13,0.3025,0.845,"GUI Resources",true) guiWindowSetSizable(GUIEditor_Window[4],false) GUIEditor_Grid[2] = guiCreateGridList(21,71,201,358,false,GUIEditor_Window[4]) guiGridListSetSelectionMode(GUIEditor_Grid[2],2) guiGridListAddColumn(GUIEditor_Grid[2],"resources :",0.2) GUIEditor_Edit[3] = guiCreateEdit(23,32,197,35,"",false,GUIEditor_Window[4]) GUIEditor_Button[13] = guiCreateButton(141,453,92,37,"Start Resource",false,GUIEditor_Window[4]) GUIEditor_Button[14] = guiCreateButton(10,453,92,37,"Cancel",false,GUIEditor_Window[4]) guiSetVisible ( GUIEditor_Window[1], false ) guiSetVisible ( GUIEditor_Window[2], false ) guiSetVisible ( GUIEditor_Window[3], false ) guiSetVisible ( GUIEditor_Window[4], false ) guiSetVisible ( GUIEditor_Button[15], false ) showCursor ( false ) function GUIOpen ( ) guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) end addEvent ( "onVisibleAdmin", true ) addEventHandler ( "onVisibleAdmin", getLocalPlayer(), GUIOpen ) function clientsideResourceStart ( ) guiGridListClear ( GUIEditor_Grid[1] ) for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, column, getPlayerName ( playeritem ), false, false ) end end addEventHandler ( "onClientResourceStart", resourceRoot, clientsideResourceStart ) addEventHandler ( "onClientPlayerJoin", root, clientsideResourceStart ) addEventHandler ( "onClientPlayerQuit", root, clientsideResourceStart ) addEventHandler ( "onClientPlayerChangeNick", root, clientsideResourceStart ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor_Button[2] ) then guiSetVisible(GUIEditor_Window[2],true) elseif ( source == GUIEditor_Button[10] ) then guiSetVisible ( GUIEditor_Window[2], false ) elseif ( source == GUIEditor_Button[4] ) then guiSetVisible ( GUIEditor_Window[3], true) elseif ( source == GUIEditor_Button[12] ) then guiSetVisible ( GUIEditor_Window[3], false ) elseif ( source == GUIEditor_Button[1] ) then local row, col = guiGridListGetSelectedItem ( GUIEditor_Grid[1] ) if ( row and col and row ~= -1 and col ~= -1 ) then playerName = guiGridListGetItemText ( GUIEditor_Grid[1], row, column ) triggerServerEvent ( "mute", localPlayer, playerName ) guiSetVisible(GUIEditor_Button[1], false) guiSetVisible ( GUIEditor_Button[15], true ) end elseif ( source == GUIEditor_Button[15] ) then local row, col = guiGridListGetSelectedItem ( GUIEditor_Grid[1] ) if ( row and col and row ~= -1 and col ~= -1 ) then playerName = guiGridListGetItemText ( GUIEditor_Grid[1], row, column ) triggerServerEvent ( "unmute", localPlayer, playerName ) guiSetVisible(GUIEditor_Button[1], true) guiSetVisible ( GUIEditor_Button[15], false ) end end end ) addEventHandler ( "onClientGUIChanged", GUIEditor_Edit[1], function ( ) local text = guiGetText ( source ) for row = 1, guiGridListGetRowCount ( GUIEditor_Grid[1] ) do if ( guiGridListGetItemText ( GUIEditor_Grid[1], row, 1 ) == text ) then guiGridListSetSelectedItem ( GUIEditor_Grid[1], row, 1 ) end end end ,false ) You had missing: playerName = guiGridListGetItemText ( GUIEditor_Grid[1], row, column ) Link to comment
iFoReX Posted May 11, 2012 Author Share Posted May 11, 2012 Now Doesnt work my Dimension Button GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.4925,0.3317,0.51,0.6717,"GUI Admin",true) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(11,87,167,307,false,GUIEditor_Window[1]) column = guiGridListAddColumn(GUIEditor_Grid[1],"Players",0.7) GUIEditor_Edit[1] = guiCreateEdit(11,46,167,34,"",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(191,46,103,38,"Mute",false,GUIEditor_Window[1]) GUIEditor_Button[15] = guiCreateButton(191,46,103,38,"UnMute",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(191,96,103,38,"Ban",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(191,146,103,38,"Kick",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(191,200,103,38,"Dimension",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(191,259,103,38,"Warp to Player",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(190,345,213,51,"Admin Panel By ElMota",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Button[6] = guiCreateButton(313,46,86,38,"Resources",false,GUIEditor_Window[1]) GUIEditor_Window[2] = guiCreateWindow(0.35,0.2783,0.3388,0.4217,"Ban Times",true) guiWindowSetSizable(GUIEditor_Window[2],false) GUIEditor_Button[7] = guiCreateButton(32,39,189,40,"1 Year",false,GUIEditor_Window[2]) GUIEditor_Button[8] = guiCreateButton(32,87,189,40,"1 Month",false,GUIEditor_Window[2]) GUIEditor_Button[9] = guiCreateButton(32,138,189,38,"1 Day",false,GUIEditor_Window[2]) GUIEditor_Button[10] = guiCreateButton(172,216,90,28,"Cancelar",false,GUIEditor_Window[2]) GUIEditor_Window[3] = guiCreateWindow(0.2988,0.2867,0.4737,0.4267,"Dimension GUI",true) GUIEditor_Label[2] = guiCreateLabel(48,102,107,18,"Set Dimension ...",false,GUIEditor_Window[3]) GUIEditor_Edit[2] = guiCreateEdit(131,123,65,27,"",false,GUIEditor_Window[3]) GUIEditor_Button[11] = guiCreateButton(246,199,120,44,"Set Dimension",false,GUIEditor_Window[3]) GUIEditor_Button[12] = guiCreateButton(9,199,120,44,"Cancel",false,GUIEditor_Window[3]) GUIEditor_Window[4] = guiCreateWindow(0.3613,0.13,0.3025,0.845,"GUI Resources",true) guiWindowSetSizable(GUIEditor_Window[4],false) GUIEditor_Grid[2] = guiCreateGridList(21,71,201,358,false,GUIEditor_Window[4]) guiGridListSetSelectionMode(GUIEditor_Grid[2],2) guiGridListAddColumn(GUIEditor_Grid[2],"resources :",0.2) GUIEditor_Edit[3] = guiCreateEdit(23,32,197,35,"",false,GUIEditor_Window[4]) GUIEditor_Button[13] = guiCreateButton(141,453,92,37,"Start Resource",false,GUIEditor_Window[4]) GUIEditor_Button[14] = guiCreateButton(10,453,92,37,"Cancel",false,GUIEditor_Window[4]) guiSetVisible ( GUIEditor_Window[1], false ) guiSetVisible ( GUIEditor_Window[2], false ) guiSetVisible ( GUIEditor_Window[3], false ) guiSetVisible ( GUIEditor_Window[4], false ) guiSetVisible ( GUIEditor_Button[15], false ) showCursor ( false ) function GUIOpen ( ) guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) end addEvent ( "onVisibleAdmin", true ) addEventHandler ( "onVisibleAdmin", getLocalPlayer(), GUIOpen ) function clientsideResourceStart ( ) guiGridListClear ( GUIEditor_Grid[1] ) for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, column, getPlayerName ( playeritem ), false, false ) end end addEventHandler ( "onClientResourceStart", resourceRoot, clientsideResourceStart ) addEventHandler ( "onClientPlayerJoin", root, clientsideResourceStart ) addEventHandler ( "onClientPlayerQuit", root, clientsideResourceStart ) addEventHandler ( "onClientPlayerChangeNick", root, clientsideResourceStart ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor_Button[2] ) then guiSetVisible(GUIEditor_Window[2],true) elseif ( source == GUIEditor_Button[10] ) then guiSetVisible ( GUIEditor_Window[2], false ) elseif ( source == GUIEditor_Button[4] ) then guiSetVisible ( GUIEditor_Window[3], true) elseif ( source == GUIEditor_Button[12] ) then guiSetVisible ( GUIEditor_Window[3], false ) elseif ( source == GUIEditor_Button[1] ) then local row, col = guiGridListGetSelectedItem ( GUIEditor_Grid[1] ) if ( row and col and row ~= -1 and col ~= -1 ) then playerName = guiGridListGetItemText ( GUIEditor_Grid[1], row, column ) triggerServerEvent ( "mute", localPlayer, playerName ) guiSetVisible(GUIEditor_Button[1], false) guiSetVisible ( GUIEditor_Button[15], true ) end elseif ( source == GUIEditor_Button[15] ) then local row, col = guiGridListGetSelectedItem ( GUIEditor_Grid[1] ) if ( row and col and row ~= -1 and col ~= -1 ) then playerName = guiGridListGetItemText ( GUIEditor_Grid[1], row, column ) triggerServerEvent ( "unmute", localPlayer, playerName ) guiSetVisible(GUIEditor_Button[1], true) guiSetVisible ( GUIEditor_Button[15], false ) end elseif source == GUIEditor_Button[11] then local row, col = guiGridListGetSelectedItem ( GUIEditor_Grid[1] ) if ( row and col and row ~= -1 and col ~= -1 ) then playerName = guiGridListGetItemText ( GUIEditor_Grid[1], row, column ) setElementDimension( playerName, (tonumber(guiGetText(GUIEditor_Edit[2])))) end end end ) addEventHandler ( "onClientGUIChanged", GUIEditor_Edit[1], function ( ) local text = guiGetText ( source ) for row = 1, guiGridListGetRowCount ( GUIEditor_Grid[1] ) do if ( guiGridListGetItemText ( GUIEditor_Grid[1], row, 1 ) == text ) then guiGridListSetSelectedItem ( GUIEditor_Grid[1], row, 1 ) end end end ,false ) Link to comment
Castillo Posted May 11, 2012 Share Posted May 11, 2012 You're trying to set the dimension of a string, that'll never work, go and think on what you're doing. 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