Jump to content

Price.

Members
  • Posts

    244
  • Joined

  • Last visited

Everything posted by Price.

  1. sorry for double post, I get error at client2 (2nd gui) when i attached the first one to the 2nd Function client (1) function Window2Load () if not GUIEditor.window[2] then triggerEvent ("newWindow",source) end if guiGetVisible ( GUIEditor.window[2],true ) then guiSetVisible ( GUIEditor.window[2],false) else guiSetVisible ( GUIEditor.window[2],true) end end addEventHandler ( "onClientGUIClick", sackbutton, Window2Load, false ) 2nd gui GUIEditor = { button = {}, window = {}, progressbar = {}, edit = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[2] = guiCreateWindow(316, 354, 368, 96, "Sack reason", false) guiWindowSetSizable(GUIEditor.window[2], false) GUIEditor.button[1] = guiCreateButton(297, 24, 61, 28, "Sack", false, GUIEditor.window[2]) GUIEditor.edit[1] = guiCreateEdit(9, 67, 245, 19, "", false, GUIEditor.window[2]) GUIEditor.progressbar[1] = guiCreateProgressBar(9, 24, 272, 33, false, GUIEditor.window[2]) end ) function Sack () triggerServerEvent ("sack",localPlayer) end addEventHandler ( "onClientGUIClick", GUIEditor.button[1], Sack, false ) so basically in the 1st gui I Should press on "sack" button then the 2nd gui opens then pressing the button in gui2 does the event of server side, instead i get error at addEventHandler ( "onClientGUIClick", GUIEditor.button[1], Sack, false ) says bad argument expected element at argument 2 , got nil EDIT: server side part where "sack event" is triggered timersTable = { } function banFromLaw(plr, cmd, victim, time, reason, accountName, admin) local accName = getAccountName(getPlayerAccount(plr)) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Police Chief" )) then local vic = getPlayerFromName(victim) if not isElement(vic) then return end if getPlayerTeam(vic) ~= getTeamFromName("Police") then outputChatBox("This player is not a police officer", plr) return end -- Toggle the ban setElementData( vic , "bannedFromLaw", true ) timersTable[vic] = makeCoolDownTimer(300, vic) -- Reset job and team setPlayerTeam(vic, getTeamFromName("Unemployed")) setPlayerNametagColor(vic, 255, 255, 0) setElementModel(vic, 0) setElementData(vic, "Occupation", "Jobless") end end addEvent("sack", true) addEventHandler("sack", getRootElement(), banFromLaw)
  2. this function is not my biggest fears, for now I'm still having lots of troubles because of invalid variables in this function function Blip () local x, y, z = getElementPosition(client) local blip = createBlip( x, y, z, 20 ) setElementParent( blip, client ) end addEvent("onDes", true) addEventHandler("onDes", getRootElement(), Blip) I'm still getting lots of errors from all "client" and yes I'am triggering it from client side but... still having bad argument because of client.
  3. Well it now works perfectly thanks , I was wondering how to attach this gui GUIEditor = { button = {}, window = {}, progressbar = {}, edit = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[2] = guiCreateWindow(316, 354, 368, 96, "Sack reason", false) guiWindowSetSizable(GUIEditor.window[2], false) GUIEditor.button[1] = guiCreateButton(297, 24, 61, 28, "Sack", false, GUIEditor.window[2]) GUIEditor.button[2] = guiCreateButton(295, 60, 63, 26, "Close window", false, GUIEditor.window[2]) GUIEditor.edit[1] = guiCreateEdit(9, 67, 245, 19, "", false, GUIEditor.window[2]) GUIEditor.progressbar[1] = guiCreateProgressBar(9, 24, 272, 33, false, GUIEditor.window[2]) end ) to my original gui? when I press on sack button? the original gui ------->> -- GUI ------->> --Window local sWidth,sHeight = guiGetScreenSize() local Width,Height = 600,500 local X = (sWidth/2) - (Width/2) local Y = (sHeight/2) - (Height/2) windowJobStats = guiCreateWindow(X,Y,Width,Height,"Police chief",false) guiWindowSetSizable(windowJobStats,false) guiWindowSetMovable(windowJobStats,false) grid = guiCreateGridList(9,30,183,375,false,windowJobStats) guiGridListSetSelectionMode(grid,1) guiGridListAddColumn(grid, "Player", 30) edit = guiCreateEdit(9,406,180,30,"",false,windowJobStats) sackbutton = guiCreateButton(450,33,100,34,"Sack Selected",false,windowJobStats) unsackbutton = guiCreateButton(450,79,100,34,"Unsack Selected",false,windowJobStats) placeAPBbutton = guiCreateButton(450,125,100,34,"Place APB",false,windowJobStats) gochiefbtton = guiCreateButton(450,174,100,34,"/GoChief",false,windowJobStats) closebutton = guiCreateButton(500,450,50,50,"X",false,windowJobStats) guiSetVisible(windowJobStats,false) --[[ Create a function to handle toggling of PC GUI ]]-- function CloseWindowSet () if guiGetVisible(windowJobStats) ~= true then guiSetVisible (windowJobStats, true ) showCursor ( true ) guiSetInputEnabled( true ) putAllPlayersInList() else showCursor ( false ) guiSetVisible (windowJobStats,false) guiSetInputEnabled( false) end end addEvent("onCommand", true) addEventHandler("onCommand", getRootElement(), CloseWindowSet) function putAllPlayersInList() guiGridListClear(grid) for i,v in ipairs(getElementsByType("player")) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid,row,1,getPlayerName(v),false,false) guiGridListSetItemColor(grid,row,1,0,255,0) end end function closeGUI( button, state ) if source ~= windowJobStats then if button == "left" and state == "up" then guiSetVisible( windowJobStats, false ) showCursor ( false ) end end end addEventHandler( "onClientGUIClick", closebutton, closeGUI ) addEventHandler("onClientGUIClick",root, function () local sel = guiGridListGetSelectedItem(grid) local text = guiGridListGetItemText(grid,sel,1) if ( source == unsack ) then -- Unsack if ( sel ~= -1 ) then triggerServerEvent("unsackplr",localPlayer,text) end elseif ( source == placeAPBbutton ) then --- APB if ( sel ~= -1 ) then triggerServerEvent("onDes",localPlayer,text) end elseif ( source == gochiefbtton ) then -- chief if ( sel ~= -1 ) then triggerServerEvent("setteam",localPlayer,text) end end end )
  4. so what to do then? still brutus's code hasn't worked
  5. I don't want bind key I want a command instead, and yea I've just added command handler at client side so if he is a in ACl group policechief he could open the gui, or what's wrong with it?
  6. that's server side to destroy blip
  7. tried doing this but couldn't work I still can open gui without being in PoliceChief ACL group server side function testingpc( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "PoliceChief" ) ) then triggerClientEvent(thePlayer, "onCommand", thePlayer) end end client side function CloseWindowSet () if guiGetVisible(windowJobStats) ~= true then guiSetVisible (windowJobStats, true ) showCursor ( true ) guiSetInputEnabled( true ) putAllPlayersInList() else showCursor ( false ) guiSetVisible (windowJobStats,false) guiSetInputEnabled( false) end end addEvent("onCommand", true) addEventHandler("onCommand", getRootElement(), CloseWindowSet) addCommandHandler("pcpanel", CloseWindowSet)
  8. ahhh yes local players source ...etc I just having problem with that I cant make this work
  9. not really, but Is P right anyways?
  10. what would I say in the server side? if isobjectinacl group then output? and trigger?
  11. would you give me side event example of what Should be done in the server side?, also how to fix cursor being showed after I pressed on "X"?
  12. still, cursor does appears even after i press "X" , also I want to add line to check whether if a player is in ACL Group police chief then he could use this command.
  13. I want to create blip attached to a player and keeps following him like "attachedTo" him and when he dies or quit the blip gets destroyed got few errors just need to know how to solve this script function Blip () local myplayer = getElementType ( p ) local x, y, z = getElementPosition( p ) blip = createBlip( x, y, z, 20,p ) setElementParent( blip, p ) end addEvent("onDes", true) addEventHandler("onDes", getRootElement(), Blip) function destroyBlipAttachedTo ( player ) local attached = getAttachedElements ( player ) if not attached then return end for index , attachedElement in pairs ( attached ) do if getElementType ( attachedElement ) == "blip" then destroyElement ( attachedElement ) outputChatBox("APB has been Jailed Successfully", source, 0, 55, 255) end end end addEventHandler( "onPlayerWasted", getRootElement(), destroyBlipAttachedTo) bad argument @ 'createBlip' [Expected vector3 at argument 1, got boolean], Bad argument @ 'setElementParent' [Expected element at argument 1, got boolean]
  14. works great but got error when I try to place the blip, when I click on the button to place blip gives me this error attempt to call global 'localPlayer' (a nil value) same with thePlayer
  15. I've got this problem, I wanna attach a blip to a player i created a function for that but when I destroy blip addEventHandler returns nill, expected function at argument 3, got nill I want to attach the blip to player and when he dies the blip is destroyed function Blip (player) local myplayer = localPlayer() local x, y, z = getElementPosition( myPlayer ) blip = createBlip( x, y, z, 20, myPlayer ) setElementParent( blip, myPlayer ) addEvent("onDes", true) addEventHandler("onDes", getRootElement, Blip) function destroyBlipAttachedTo ( player ) local attached = getAttachedElements ( player ) if not attached then return end for index , attachedElement in pairs ( attached ) do if getElementType ( attachedElement ) == "blip" then destroyElement ( attachedElement ) outputChatBox("APB has been Jailed Successfully", source, 0, 55, 255) end end end end addEventHandler( "onPlayerWasted", getRootElement(), destroyBlipAttachedTo)
  16. I've edited my request, any help?
  17. I'am having some error, uhm when I open the window I want to make sure that player is in group ACL "PoliceChief" then he could open it, also when I open the window and press on "X" the gui closes but cursor remains on, help please? ------->> -- GUI ------->> --Window local sWidth,sHeight = guiGetScreenSize() local Width,Height = 600,500 local X = (sWidth/2) - (Width/2) local Y = (sHeight/2) - (Height/2) windowJobStats = guiCreateWindow(X,Y,Width,Height,"Police chief",false) guiWindowSetSizable(windowJobStats,false) guiWindowSetMovable(windowJobStats,false) grid = guiCreateGridList(9,30,183,375,false,windowJobStats) guiGridListSetSelectionMode(grid,1) guiGridListAddColumn(grid, "Player", 30) edit = guiCreateEdit(9,406,180,30,"",false,windowJobStats) sackbutton = guiCreateButton(450,33,100,34,"Sack Selected",false,windowJobStats) unsackbutton = guiCreateButton(450,79,100,34,"Unsack Selected",false,windowJobStats) placeAPBbutton = guiCreateButton(450,125,100,34,"Place APB",false,windowJobStats) gochiefbtton = guiCreateButton(450,174,100,34,"/GoChief",false,windowJobStats) closebutton = guiCreateButton(500,450,50,50,"X",false,windowJobStats) guiSetVisible(windowJobStats,false) --[[ Create a function to handle toggling of PC GUI ]]-- function CloseWindowSet () if guiGetVisible (windowJobStats ) ~= true then guiSetVisible (windowJobStats, true ) showCursor ( true ) guiSetInputEnabled( true ) putAllPlayersInList() else showCursor ( false ) guiSetVisible (windowJobStats,false) guiSetInputEnabled( false) outputChatBox("You are not a Police Chief", 255, 255, 255) end end end addCommandHandler("pcpanel", CloseWindowSet) function putAllPlayersInList() guiGridListClear(grid) for i,v in ipairs(getElementsByType("player")) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid,row,1,getPlayerName(v),false,false) guiGridListSetItemColor(grid,row,1,0,255,0) end end function closeGUI( button, state ) if source ~= windowJobStats then if button == "left" and state == "up" then guiSetVisible( windowJobStats, false ) showCursor ( false ) end end end addEventHandler( "onClientGUIClick", closebutton, closeGUI ) addEventHandler("onClientGUIClick",root, function () local sel = guiGridListGetSelectedItem(grid) local text = guiGridListGetItemText(grid,sel,1) if ( source == unsack ) then -- Unsack if ( sel ~= -1 ) then triggerServerEvent("unsackplr",localPlayer,text) end elseif ( source == placeAPBbutton ) then --- APB if ( sel ~= -1 ) then triggerServerEvent("onDes",localPlayer,text) end elseif ( source == gochiefbtton ) then -- chief if ( sel ~= -1 ) then triggerServerEvent("setteam",localPlayer,text) end end end )
  18. ------>> -- GUI ------->> local GUIEditor = { gridlist = {}, window = {}, scrollbar = {}, button = {} } --Window local sWidth,sHeight = guiGetScreenSize() local Width,Height = 600,500 local X = (sWidth/2) - (Width/2) local Y = (sHeight/2) - (Height/2) GUIEditor.window[1] = guiCreateWindow(283, 263, 282, 352, "", false) guiWindowSetSizable(GUIEditor.window[1], false) gochiefbtton = guiCreateButton(193, 36, 79, 44, "/gochief", false, GUIEditor.window[1]) sackbutton = guiCreateButton(192, 100, 80, 36, "Sack", false, GUIEditor.window[1]) unsackbutton = guiCreateButton(191, 159, 81, 41, "UnSack", false, GUIEditor.window[1]) placeAPBbutton = guiCreateButton(192, 228, 80, 39, "Place APB", false, GUIEditor.window[1]) closebutton = guiCreateButton(188, 294, 84, 36, "Close Window", false, GUIEditor.window[1]) grid = guiCreateGridList(9, 23, 172, 319, false, GUIEditor.window[1]) edit = guiCreateEdit(9,406,182,40,"",false,GUIEditor.window[1]) guiGridListSetSelectionMode(grid,1) column = guiGridListAddColumn(grid,"Players",30) GUIEditor.scrollbar[1] = guiCreateScrollBar(158, 4, 14, 315, false, false, grid) guiSetVisible(GUIEditor.window[1], false) showCursor(false) --[[ Create a function to handle toggling of PC GUI ]]-- function toggleGUI( source ) if not guiGetVisible( GUIEditor.window[1] ) then showCursor( true ) guiSetVisible( GUIEditor.window[1], true ) guiSetInputEnabled( true ) putAllPlayersInList() else showCursor( false ) guiSetVisible( GUIEditor.window[1], false ) guiSetInputEnabled( false ) end end addCommandHandler( "gochief", toggleGUI ) bindKey( "F7", "down", "pchief" ) function putAllPlayersInList() guiGridListClear(grid) for i,v in ipairs(getElementsByType("player")) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid,row,1,getPlayerName(v),false,false) guiGridListSetItemColor(grid,row,1,0,255,0) end end function closeGUI( button, state ) if source ~= GUIEditor.window[1] then if button == "left" and state == "up" then guiSetVisible( GUIEditor.window[1], false ) showCursor( false ) end end end addEventHandler( "onClientGUIClick", closebutton, closeGUI ) addEventHandler("onClientGUIClick",root, function () local sel = guiGridListGetSelectedItem(grid) local text = guiGridListGetItemText(grid,sel,1) if ( source == sackbutton ) then -- sack if ( sel ~= -1 ) then triggerServerEvent("sackplr",localPlayer,text) end elseif ( source == unsackbutton ) then -- Unsack if ( sel ~= -1 ) then triggerServerEvent("unsackplr",localPlayer,text) end elseif ( source == placeAPBbutton ) then --- APB if ( sel ~= -1 ) then triggerServerEvent("onDes",localPlayer,text) end elseif ( source == gochiefbtton ) then -- chief if ( sel ~= -1 ) then triggerServerEvent("setteam",localPlayer,text) end end end )
  19. uhmm it works but when I press on close window the cursor still shows up
  20. instead editing the rest to GUI editor, could i just edit GUIEditor.window[1] to window = guicreatwindow ?
  21. alright remove the function but still this error there line 11: attempt to index global 'GUIEditor' (a nil value) ------>> -- GUI ------->> --Window local sWidth,sHeight = guiGetScreenSize() local Width,Height = 600,500 local X = (sWidth/2) - (Width/2) local Y = (sHeight/2) - (Height/2) GUIEditor.window[1] = guiCreateWindow(283, 263, 282, 352, "", false) guiWindowSetSizable(GUIEditor.window[1], false) gochiefbtton = guiCreateButton(193, 36, 79, 44, "/gochief", false, GUIEditor.window[1]) sackbutton = guiCreateButton(192, 100, 80, 36, "Sack", false, GUIEditor.window[1]) unsackbutton = guiCreateButton(191, 159, 81, 41, "UnSack", false, GUIEditor.window[1]) placeAPBbutton = guiCreateButton(192, 228, 80, 39, "Place APB", false, GUIEditor.window[1]) closebutton = guiCreateButton(188, 294, 84, 36, "Close Window", false, GUIEditor.window[1]) grid = guiCreateGridList(9, 23, 172, 319, false, GUIEditor.window[1]) edit = guiCreateEdit(9,406,182,40,"",false,GUIEditor.window[1]) guiGridListSetSelectionMode(grid,1) column = guiGridListAddColumn(grid,"Players",30) GUIEditor.scrollbar[1] = guiCreateScrollBar(158, 4, 14, 315, false, false, grid) guiSetVisible(GUIEditor.window[1], false) showCursor(false) --[[ Create a function to handle toggling of PC GUI ]]-- function toggleGUI( source ) if not guiGetVisible( GUIEditor.window[1] ) then showCursor( true ) guiSetVisible( GUIEditor.window[1], true ) guiSetInputEnabled( true ) putAllPlayersInList() else showCursor( false ) guiSetVisible( GUIEditor.window[1], false ) guiSetInputEnabled( false ) end end addCommandHandler( "gochief", toggleGUI ) bindKey( "F7", "down", "pchief" ) function putAllPlayersInList() guiGridListClear(grid) for i,v in ipairs(getElementsByType("player")) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid,row,1,getPlayerName(v),false,false) guiGridListSetItemColor(grid,row,1,0,255,0) end end function closeGUI( button, state ) if source ~= GUIEditor.window[1] then if button == "left" and state == "up" then guiSetVisible( GUIEditor.window[1], false ) showCursor( false ) end end end addEventHandler( "onClientGUIClick", closebutton, closeGUI ) addEventHandler("onClientGUIClick",root, function () local sel = guiGridListGetSelectedItem(grid) local text = guiGridListGetItemText(grid,sel,1) if ( source == sackbutton ) then -- sack if ( sel ~= -1 ) then triggerServerEvent("sackplr",localPlayer,text) end elseif ( source == unsackbutton ) then -- Unsack if ( sel ~= -1 ) then triggerServerEvent("unsackplr",localPlayer,text) end elseif ( source == placeAPBbutton ) then --- APB if ( sel ~= -1 ) then triggerServerEvent("onDes",localPlayer,text) end elseif ( source == gochiefbtton ) then -- chief if ( sel ~= -1 ) then triggerServerEvent("setteam",localPlayer,text) end end end )
  22. function customDamage(attacker,attackerweapon,bodypart,loss) if attacker and getElementType(attacker) == "player" then if not attacker then outputDebugString("player got damage,no attacker") return end if attackerweapon == 38 or attackerweapon == 35 or attackerweapon == 36 then killPed(source,attacker,bodypart,false) outputDebugString("weapon was 38 or 36 or 35 and player got killed.") end end end end addEventHandler("onPlayerDamage",root,customDamage) try this and tell me if there is any error /debugscript 3
  23. Actually I've tried doing this and changed a bit in the code ------>> -- GUI ------->> --Window local sWidth,sHeight = guiGetScreenSize() local Width,Height = 600,500 local X = (sWidth/2) - (Width/2) local Y = (sHeight/2) - (Height/2) function theGUI() GUIEditor.window[1] = guiCreateWindow(283, 263, 282, 352, "", false) guiWindowSetSizable(GUIEditor.window[1], false) gochiefbtton = guiCreateButton(193, 36, 79, 44, "/gochief", false, GUIEditor.window[1]) sackbutton = guiCreateButton(192, 100, 80, 36, "Sack", false, GUIEditor.window[1]) unsackbutton = guiCreateButton(191, 159, 81, 41, "UnSack", false, GUIEditor.window[1]) placeAPBbutton = guiCreateButton(192, 228, 80, 39, "Place APB", false, GUIEditor.window[1]) closebutton = guiCreateButton(188, 294, 84, 36, "Close Window", false, GUIEditor.window[1]) grid = guiCreateGridList(9, 23, 172, 319, false, GUIEditor.window[1]) edit = guiCreateEdit(9,406,182,40,"",false,GUIEditor.window[1]) guiGridListSetSelectionMode(grid,1) column = guiGridListAddColumn(grid,"Players",0.-- s8) --> GUIEditor.scrollbar[1] = guiCreateScrollBar(158, 4, 14, 315, false, false, grid) guiSetVisible(GUIEditor.window[1], false) showCursor(false) end --[[ Create a function to handle toggling of PC GUI ]]-- function toggleGUI( source ) if not guiGetVisible( GUIEditor.window[1] ) then showCursor( true ) guiSetVisible( GUIEditor.window[1], true ) guiSetInputEnabled( true ) putAllPlayersInList() else showCursor( false ) guiSetVisible( GUIEditor.window[1], false ) guiSetInputEnabled( false ) end end addCommandHandler( "gochief", toggleGUI ) bindKey( "F7", "down", "pchief" ) function putAllPlayersInList() guiGridListClear(grid) for i,v in ipairs(getElementsByType("player")) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid,row,1,getPlayerName(v),false,false) guiGridListSetItemColor(grid,row,1,0,255,0) end end function closeGUI( button, state ) if source ~= GUIEditor.window[1] then if button == "left" and state == "up" then guiSetVisible( GUIEditor.window[1], false ) showCursor( false ) end end end addEventHandler( "onClientGUIClick", closebutton, closeGUI ) addEventHandler("onClientGUIClick",root, function () local sel = guiGridListGetSelectedItem(grid) local text = guiGridListGetItemText(grid,sel,1) if ( source == sackbutton ) then -- sack if ( sel ~= -1 ) then triggerServerEvent("sackplr",localPlayer,text) end elseif ( source == unsackbutton ) then -- Unsack if ( sel ~= -1 ) then triggerServerEvent("unsackplr",localPlayer,text) end elseif ( source == placeAPBbutton ) then --- APB if ( sel ~= -1 ) then triggerServerEvent("onDes",localPlayer,text) end elseif ( source == gochiefbtton ) then -- chief if ( sel ~= -1 ) then triggerServerEvent("setteam",localPlayer,text) end end end ) Still got 1 error @ line 65 , Bad argument @ 'addEventHandler'[Expected element at argument 2, got nil]
  24. Well this is just simple gui, I'am trying to add All players in Team "Police" to appear in the grid list but still don't know how so far, help ? local GUIEditor = { gridlist = {}, window = {}, scrollbar = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function () GUIEditor.window[1] = guiCreateWindow(283, 263, 282, 352, "", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(193, 36, 79, 44, "/gochief", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(192, 100, 80, 36, "Sack", false, GUIEditor.window[1]) GUIEditor.button[3] = guiCreateButton(191, 159, 81, 41, "UnSack", false, GUIEditor.window[1]) GUIEditor.button[4] = guiCreateButton(192, 228, 80, 39, "Place APB", false, GUIEditor.window[1]) GUIEditor.button[5] = guiCreateButton(188, 294, 84, 36, "Close Window", false, GUIEditor.window[1]) GUIEditor.gridlist[1] = guiCreateGridList(9, 23, 172, 319, false, GUIEditor.window[1]) edit = guiCreateEdit(9,406,182,40,"",false,GUIEditor.window[1]) guiGridListSetSelectionMode(GUIEditor.gridlist[1],1) column = guiGridListAddColumn(GUIEditor.gridlist[1],"Players",0.-- s8) --> GUIEditor.scrollbar[1] = guiCreateScrollBar(158, 4, 14, 315, false, false, GUIEditor.gridlist[1]) guiSetVisible(GUIEditor.window[1], false) showCursor(false) end ) function togglePCPanel() if (guiGetVisible(GUIEditor.window[1])) then guiSetVisible(GUIEditor.window[1], false) showCursor(false) else guiSetVisible(GUIEditor.window[1], true) showCursor(true) end end addCommandHandler("pcpanel",togglePCPanel) addEventHandler("onClientGUIClick", root, function () if (source == GUIEditor.button[2]) then triggerServerEvent ("sackbutton", getRootElement(), localPlayer) elseif (source == GUIEditor.button[3]) then triggerServerEvent("Unsackbutton", getRootElement(), localPlayer) end end ) addEventHandler("onClientGUIClick", root, function () if (source == GUIEditor.button[5]) then if (guiGetVisible(GUIEditor.window[1])) then guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end end ) addEventHandler("onClientGUIClick", root, function () if (source == GUIEditor.button[1]) then triggerServerEvent ("gochief", getRootElement(), localPlayer) end end ) function text() for id, player in ipairs (getElementsByType("player")) do guiGridListSetItemText(GUIEditor.gridlist[1], guiGridListAddRow(GUIEditor.gridlist[1]), column, getPlayerName(player), false, false) end end Look at the last function i tried to make them appear in gridlist but not working, remember i need people who are in Team "Police" Names to appear in gridlist,
×
×
  • Create New...