Jump to content

External

Members
  • Posts

    20
  • Joined

  • Last visited

About External

  • Birthday August 7

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

External's Achievements

Civilian

Civilian (7/54)

2

Reputation

  1. How do i set the color of the new function that i've created?
  2. get("spawnreset") ?? did you create a function called get?
  3. Do what? I can't understand your question
  4. External

    Help.

    Actually, it's easier to get the position of the place that you want to create the marker in and create it there instead of using map editor
  5. External

    Help.

    You have to code for such thing
  6. External

    Coords

    Hi, I've made a mystery bag script still under progress. I made 3 text boxes for position but the server script doesn't determine which one is the x, y, z Client: addEvent("Coords", true) function Coords(x, y, z) if not isElement(_bag) then _bag = createPickup(x+2, y+2, z, 3, 1210) Blip = createBlipAttachedTo(_bag, 37) bagx, bagy, bagz = getElementPosition(_bag) areaB = getZoneName(bagx, bagy, bagz) cityB = getZoneName(bagx, bagy, bagz, true) outputChatBox("A Mystery Bag has appeared at "..areaB..", "..cityB..", go and get it!", getRootElement(), 0, 255, 0) else outputChatBox("There is already a bag in progress", client, 255, 0, 0) end end addEventHandler("Coords", resourceRoot, Coords) Server: elseif GUIEditor.edit[3] and GUIEditor.edit[2] and GUIEditor.edit[1] ~= "" or " " then --[[ local x = guiGetText(GUIEditor.edit[3]) local y = guiGetText(GUIEditor.edit[2]) local z = guiGetText(GUIEditor.edit[1]) _bag = createPickup(x+2, y+2, z, 3, 1210) Blip = createBlipAttachedTo(_bag, 37) bagx, bagy, bagz = getElementPosition(_bag) areaB = getZoneName(bagx, bagy, bagz) cityB = getZoneName(bagx, bagy, bagz, true) outputChatBox("A Mystery Bag has appeared at "..areaB..", "..cityB..", go and get it!", 0, 255, 0) --]] -- For local Player only triggerServerEvent( "Coords", getRootElement(), guiGetText(GUIEditor.edit[3]), guiGetText(GUIEditor.edit[2]), guiGetText(GUIEditor.edit[1]) ) end end end
  7. so I've turned it on and the debug was. 'attempt to call global 'guiGetText' (a nil value). Thats cuz it's client side only but how can I fix that issue? I'm not pro in triggering events if u can show me an example of a script that u made, I would be thankful
  8. Can you fix this for me please?
  9. Server side:- function Updates(plr) local text = guiGetText(Edit) outputChatBox("UPDATE:" .. text, plr) end addEvent("myEvent", true) addEventHandler("myEvent", root, Updates) Client side:- GUIEditor = { button = {}, window = {}, edit = {} } function GUI() Button = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "Output!", true ) Edit = guiCreateEdit( 0.3, 0.1, 0.4, 0.1, "Type your message here!", true ) guiEditSetMaxLength ( Edit, 128 ) showCursor(true) addEventHandler( "onClientGUIClick", Button, Updates, false ) end addCommandHandler("updates", GUI) function Updates() triggerServerEvent( "myEvent", localPlayer, guiGetText ) end I want to know whats wrong with this cuz its not working
  10. What? That's not even related to tables
  11. GUIEditor = { gridlist = {}, button = {}, edit = {} } local GUItext = {} local Admin = {} function PGUI() local screenW, screenH = guiGetScreenSize() bla = guiCreateWindow((screenW - 371) / 2, (screenH - 557) / 2, 371, 557, "bla bla ", false) guiWindowSetMovable(bla, false) guiWindowSetSizable(bla, false) GUIEditor.gridlist[1] = guiCreateGridList(12, 40, 349, 463, false, bla) local column = guiGridListAddColumn(GUIEditor.gridlist[1], "Player Name", 0.5) local column2 = guiGridListAddColumn(GUIEditor.gridlist[1], "Admin Name", 0.5) GUIEditor.edit[1] = guiCreateEdit(10, 513, 171, 34, "", false, bla) GUIEditor.button[1] = guiCreateButton(191, 532, 80, 15, "Add", false, bla) GUIEditor.button[2] = guiCreateButton(281, 532, 80, 15, "Remove", false, bla) GUIEditor.button[3] = guiCreateButton(281, 19, 80, 15, "Close", false, bla) showCursor(true) addEventHandler( "onClientGUIClick", GUIEditor.button[3], Close, false ) addEventHandler( "onClientGUIClick", GUIEditor.button[1], AddIntoGridList, false ) addEventHandler( "onClientGUIClick", GUIEditor.button[2], RemoveFromGridList, false ) guiGridListAddRow( GUIEditor.gridlist[1] ) end addCommandHandler("bla", PGUI) function Close() guiSetVisible( bla, false) showCursor(false) end function AddIntoGridList() local row = guiGridListAddRow( GUIEditor.gridlist[1] ) if guiGetText(GUIEditor.edit[1]) == "" then outputChatBox("You have to fill the TextBox", 255, 0, 0) else local text = guiGetText( GUIEditor.edit[1] ) guiGridListSetItemText( GUIEditor.gridlist[1], row, 1, text, false, false ) guiGridListSetItemText( GUIEditor.gridlist[1], row, 2, getPlayerName(getLocalPlayer()), false, false ) table.insert(GUItext, text) local AdminName = getPlayerName(getLocalPlayer()) table.insert(Admin, AdminName) outputChatBox("The row was added successfully!", 0, 220, 0) end end function RemoveFromGridList() local selected = guiGridListGetSelectedItem( GUIEditor.gridlist[1] ) guiGridListRemoveRow( GUIEditor.gridlist[1], selected ) table.remove(GUItext, selected) table.remove(Admin, selected) outputChatBox("The row was removed successfully!", 255, 0 , 0) end function cmd() for i=1, #GUItext do outputChatBox("GUItext: " .. GUItext[i], 255, 20, 147, true) end for i=1, #Admin do outputChatBox("Admin: " .. Admin[i], 255, 20, 147, true) end end addCommandHandler("bls", cmd) Here is my code. I want to load the data in the tables once I open the GUI (Each name in a separate row) I save the text in the textbox by pressing on 'add' button
  12. GUIEditor = { gridlist = {}, button = {}, edit = {} } local GUItext = {} local Admin = {} function PGUI() local screenW, screenH = guiGetScreenSize() bla = guiCreateWindow((screenW - 371) / 2, (screenH - 557) / 2, 371, 557, "bla bla ", false) guiWindowSetMovable(bla, false) guiWindowSetSizable(bla, false) GUIEditor.gridlist[1] = guiCreateGridList(12, 40, 349, 463, false, bla) local column = guiGridListAddColumn(GUIEditor.gridlist[1], "Player Name", 0.5) local column2 = guiGridListAddColumn(GUIEditor.gridlist[1], "Admin Name", 0.5) GUIEditor.edit[1] = guiCreateEdit(10, 513, 171, 34, "", false, bla) GUIEditor.button[1] = guiCreateButton(191, 532, 80, 15, "Add", false, bla) GUIEditor.button[2] = guiCreateButton(281, 532, 80, 15, "Remove", false, bla) GUIEditor.button[3] = guiCreateButton(281, 19, 80, 15, "Close", false, bla) showCursor(true) addEventHandler( "onClientGUIClick", GUIEditor.button[3], Close, false ) addEventHandler( "onClientGUIClick", GUIEditor.button[1], AddIntoGridList, false ) addEventHandler( "onClientGUIClick", GUIEditor.button[2], RemoveFromGridList, false ) guiGridListAddRow( GUIEditor.gridlist[1] ) end addCommandHandler("bla", PGUI) function Close() guiSetVisible( bla, false) showCursor(false) end function AddIntoGridList() local row = guiGridListAddRow( GUIEditor.gridlist[1] ) if guiGetText(GUIEditor.edit[1]) == "" then outputChatBox("You have to fill the TextBox", 255, 0, 0) else local text = guiGetText( GUIEditor.edit[1] ) guiGridListSetItemText( GUIEditor.gridlist[1], row, 1, text, false, false ) guiGridListSetItemText( GUIEditor.gridlist[1], row, 2, getPlayerName(getLocalPlayer()), false, false ) table.insert(GUItext, text) local AdminName = getPlayerName(getLocalPlayer()) table.insert(Admin, AdminName) outputChatBox("The row was added successfully!", 0, 220, 0) end end function RemoveFromGridList() local selected = guiGridListGetSelectedItem( GUIEditor.gridlist[1] ) guiGridListRemoveRow( GUIEditor.gridlist[1], selected ) table.remove(GUItext, selected) table.remove(Admin, selected) outputChatBox("The row was removed successfully!", 255, 0 , 0) end function cmd() for i=1, #GUItext do outputChatBox("GUItext: " .. GUItext[i], 255, 20, 147, true) end for i=1, #Admin do outputChatBox("Admin: " .. Admin[i], 255, 20, 147, true) end end addCommandHandler("bls", cmd) Here is my code. I want to load the data in the tables once I open the GUI (Each name in a separate row) I save the text in the textbox by pressing on 'add' button
×
×
  • Create New...