Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    Safe Area

    What do you mean by "save"? you just get the position, and create it.
  2. Well, you are obviously blind, because the whole script is about that.
  3. As I said, is useless, so remove it.
  4. To cancel logout, use the function and event posted above.
  5. That part is useless, the data will be already "nil".
  6. That won't set it on all these dimensions, it only can be on one dimension at a time.
  7. "race/rankingboard_client.lua".
  8. Castillo

    Removed

    If I'm right, it has been asked before, search on the scripting section.
  9. No, that doesn't make any sense, read about the function at the wiki.
  10. You aren't getting the data from the selected item, you are adding a new row. Use: guiGridListGetSelectedItem
  11. triggerServerEvent("RemoveServer",localPlayer) You aren't passing the arguments.
  12. -- client side: Panel = { gridlist = {}, button = {}, label = {}, edit = {}, Window = {}, } local Font = guiCreateFont("font.ttf",11) Panel.Window[1] = guiCreateWindow(37, 109, 420, 358, "==[ R|S ]==", false) guiWindowSetSizable(Panel.Window[1], false) guiSetAlpha(Panel.Window[1], 1.00) guiSetProperty(Panel.Window[1], "CaptionColour", "FFEFFF00") Panel.gridlist[1] = guiCreateGridList(9, 21, 402, 278, false, Panel.Window[1]) guiGridListAddColumn(Panel.gridlist[1], "ServerName", 0.2) guiGridListAddColumn(Panel.gridlist[1], "IP", 0.2) guiGridListAddColumn(Panel.gridlist[1], "Port", 0.2) guiGridListAddColumn(Panel.gridlist[1], "Type", 0.2) Panel.button[1] = guiCreateButton(11, 311, 114, 29, "R", false, Panel.Window[1]) guiSetFont(Panel.button[1], "default-bold-small") guiSetProperty(Panel.button[1], "NormalTextColour", "FF00B9FF") Panel.button[2] = guiCreateButton(154, 311, 114, 29, "Add", false, Panel.Window[1]) guiSetFont(Panel.button[2], "default-bold-small") guiSetProperty(Panel.button[2], "NormalTextColour", "FF65FF00") Panel.button[3] = guiCreateButton(308, 311, 102, 29, "Delete", false, Panel.Window[1]) guiSetFont(Panel.button[3], "default-bold-small") guiSetProperty(Panel.button[3], "NormalTextColour", "FFFF0000") Panel.Window[2] = guiCreateWindow(523, 122, 354, 390, "==[ Add New S ]==", false) guiWindowSetSizable(Panel.Window[2], false) guiSetAlpha(Panel.Window[2], 1.00) guiSetProperty(Panel.Window[2], "CaptionColour", "FF00FFA7") Panel.label[2] = guiCreateLabel(11, 34, 342, 28, "Server Name", false, Panel.Window[2]) guiSetFont(Panel.label[2], "default-bold-small") guiLabelSetColor(Panel.label[2], 255, 0, 0) ServerName = guiCreateEdit(9, 69, 338, 32, "", false, Panel.Window[2]) Panel.label[3] = guiCreateLabel(10, 112, 341, 28, "Server IP", false, Panel.Window[2]) guiSetFont(Panel.label[3], "default-bold-small") guiLabelSetColor(Panel.label[3], 251, 254, 0) ServerIP = guiCreateEdit(10, 145, 333, 32, "", false, Panel.Window[2]) Panel.label[4] = guiCreateLabel(9, 186, 315, 28, "Server Port", false, Panel.Window[2]) guiSetFont(Panel.label[4], "default-bold-small") guiLabelSetColor(Panel.label[4], 0, 209, 254) ServerPort = guiCreateEdit(10, 224, 331, 32, "", false, Panel.Window[2]) Panel.label[5] = guiCreateLabel(13, 263, 305, 28, "Server Type", false, Panel.Window[2]) guiSetFont(Panel.label[5], "default-bold-small") guiLabelSetColor(Panel.label[5], 35, 254, 0) ServerType = guiCreateEdit(10, 291, 331, 32, "", false, Panel.Window[2]) Panel.button[4] = guiCreateButton(27, 338, 290, 37, "Add Server #", false, Panel.Window[2]) guiSetFont(Panel.button[4], "default-bold-small") guiSetProperty(Panel.button[4], "NormalTextColour", "FF00A7FE") xMainFunctions_ = function ( ) if ( source == Panel.button[4] ) then if ( ServerName ~= "" and ServerIP ~= "" and ServerPort ~= "" and ServerType ~= "" ) then triggerServerEvent("Save:To:Data:Base",localPlayer,guiGetText(ServerName),guiGetText(ServerIP),guiGetText(ServerPort),guiGetText(ServerType)) else outputChatBox("* There was an error check spaces !!",255,0,0,true) end end end addEventHandler("onClientGUIClick",root,xMainFunctions_) addEvent ( "AddTextToGridList", true ) addEventHandler ( "AddTextToGridList", root, function ( ServerName, ServerIP, ServerPort, ServerType ) local row = guiGridListAddRow ( Panel.gridlist[1] ) guiGridListSetItemText ( Panel.gridlist[1], row, 1, tostring ( ServerName ), false, false ) guiGridListSetItemText ( Panel.gridlist[1], row, 2, tostring ( ServerIP ), false, false ) guiGridListSetItemText ( Panel.gridlist[1], row, 3, tostring ( ServerPort ), false, false ) guiGridListSetItemText ( Panel.gridlist[1], row, 3, tostring ( ServerType ), false, false ) guiGridListSetItemColor ( Panel.gridlist[1], row, 1, 0, 255, 255 ) guiGridListSetItemColor ( Panel.gridlist[1], row, 2, 0, 255, 255 ) guiGridListSetItemColor ( Panel.gridlist[1], row, 3, 0, 255, 255 ) guiGridListSetItemColor ( Panel.gridlist[1], row, 4, 0, 255, 255 ) end ) addEvent ( "Add", true ) addEventHandler ( "Add", root, function ( onClientSqlList ) guiGridListClear ( Panel.gridlist[1] ) for _, v in ipairs ( onClientSqlList ) do local row = guiGridListAddRow ( Panel.gridlist[1] ) guiGridListSetItemText ( Panel.gridlist[1], row, 1, tostring ( v.ServerName ), false, false ) guiGridListSetItemText ( Panel.gridlist[1], row, 2, tostring ( v.ServerIP ), false, false ) guiGridListSetItemText ( Panel.gridlist[1], row, 3, tostring ( v.ServerPort ), false, false ) guiGridListSetItemText ( Panel.gridlist[1], row, 4, tostring ( v.ServerType ), false, false ) guiGridListSetItemColor ( Panel.gridlist[1], row, 1, 0, 255, 255 ) guiGridListSetItemColor ( Panel.gridlist[1], row, 2, 0, 255, 255 ) guiGridListSetItemColor ( Panel.gridlist[1], row, 3, 0, 255, 255 ) guiGridListSetItemColor ( Panel.gridlist[1], row, 4, 0, 255, 255 ) end end ) addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) triggerServerEvent ( "UpDateAdd", localPlayer ) end ) -- server side: addEventHandler ( "onResourceStart", resourceRoot, function ( ) executeSQLQuery ( "CREATE TABLE IF NOT EXISTS MySql (ServerName,ServerIP,ServerPort,ServerType)" ) end ) function setMySql ( ServerName, ServerIP, ServerPort, ServerType ) return executeSQLQuery ( "INSERT INTO `MySql` ( `ServerName`, `ServerIP`, `ServerPort`, `ServerType` ) VALUES ( ?, ?, ?, ? )", ServerName, ServerIP, ServerPort, ServerType ) end function SelectFromSql ( ) local data = executeSQLQuery ( "SELECT * FROM MySql" ) if ( type ( data ) == "table" and #data == 0) or not data then return { } else return data end end function UpDateListInSql ( element ) if ( not isElement ( element ) ) then return end local Upsql = SelectFromSql ( ) triggerClientEvent ( element, "Add", element, Upsql ) end addEvent ( "UpDateAdd", true ) addEventHandler ( "UpDateAdd", root, function ( ) UpDateListInSql ( source ) end ) addEvent ( "Save:To:Data:Base", true ) addEventHandler ( "Save:To:Data:Base", root, function ( ServerName, ServerIP, ServerPort, ServerType ) setMySql ( ServerName, ServerIP, ServerPort, ServerType ) triggerClientEvent ( root, "AddTextToGridList", root, ServerName, ServerIP, ServerPort, ServerType ) end )
  13. executeSQLQuery ( "INSERT INTO `MySql` ( `ServerName`, `ServerIP`, `ServerPort`, `ServerType` ) VALUES ( ?, ?, ?, ? )", ServerName, ServerIP, ServerPort, ServerType ) Try that.
  14. La scoreboard va a "leer" la element data automaticamente, ya que pusiste el mismo nombre en ambos scripts ( "RankTest" ).
  15. executeSQLQuery Or: dbExec dbQuery dbPoll
  16. Ok, entonces haces esto: setElementData ( player, "RankTest", ":elNombreDelRecurso/laCarpetaDeLasImagenes/0.png" )
  17. Postea como haces para dibujar las imagenes.
  18. We don't give support with leaked scripts. Topic locked.
  19. That error is old, the line 18 is fine.
  20. "offline" and "Army" variables are defined?
  21. Castillo

    help

    We don't give people the script finished, we help you learn.
  22. Stolen: https://community.multitheftauto.com/in ... ls&id=6744 DONE
×
×
  • Create New...