Jump to content

External

Members
  • Posts

    20
  • Joined

  • Last visited

Everything posted by External

  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
  13. I've made a script to saves logs into files. The text replaces each other.. For example; He logged in - Logged in the player's file He said something - Logged in the player's file but it replaces the line that was above
  14. local playerName = {} local playerSkin = {} function player() local playerName2 = getPlayerName( source ) table.insert(playerName, playerName2) end addEventHandler("onPlayerLogin", root, player) function output() outputChatBox(table.concat(playerName)) outputDebugString( "Working" ) end addCommandHandler("table2", output) output chatbox isn't working Why?
  15. External

    File path

    so hi, I've made a label that uses a custom font. The font file is in my resource folder but the server can't detect it. There could be something wrong in my code idk GUIEditor = { label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() myLabel = guiCreateLabel(1122, 699, 240, 59, "VehicleName", false) local font0 = guiCreateFont("PetitFormalScript.tff", 19) guiSetFont(myLabel, font0) guiLabelSetColor(myLabel, 255, 140, 0) guiLabelSetHorizontalAlign(myLabel, "center", false) guiLabelSetVerticalAlign(myLabel, "center") guiSetVisible(myLabel, false) end ) function vehicle1(player, seat) if ( player == getLocalPlayer() ) then local name = getVehicleName(source) local id = getElementModel(source) guiSetVisible( myLabel, true ) guiSetText(myLabel, name) end end addEventHandler("onClientVehicleEnter", root, vehicle1)
×
×
  • Create New...