Jump to content

GTX

Members
  • Posts

    1,273
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by GTX

  1. GTX

    Slothbot problems

    How about if you set bots to one team, others to another team? https://wiki.multitheftauto.com/wiki/Sl ... setBotTeam
  2. I did some test and it's true, this function is bugged. https://bugs.multitheftauto.com/view.php?id=8941
  3. Which editor? Map editor? Do you want to copy an object? https://wiki.multitheftauto.com/wiki/Editor#Cloning
  4. Timer inside onClientRender event? No, no, no. You know this isn't going to work.
  5. GTX

    Check dot symbol

    string.find(register_email, ".", 1, true) viewtopic.php?f=91&t=89996#p808826 If you would like to check if email matches its original pattern. local email = "[email protected]" if email:match("[A-Za-z0-9%.%%%+%-]+@[A-Za-z0-9%.%%%+%-]+%.%w%w%w?%w?") then outputChatBox("VALID EMAIL") else outputChatBox("INVALID EMAIL") end
  6. It's not better organised, because if you would like to add more teams, his code would be better. You would just need to add a team name into table. Is this solved? To send a message to team only, iterate through players in the server and then do an if check to check whether player is on team or not. After that, you'll need to pass a player argument to dropMessage function. If you'd show that function, I could solve the problem for you.
  7. GTX

    getElementType

    You're both welcome I didn't know that it exists also, but I found it out pretty easily Makes sense tho, since it's a useful function. By the way, does it work with weapons? I had small doubt in this case.
  8. If you can't understand English, then go ask on Spanish forums, I can't help you further. As I said, refer to viewforum.php?f=145.
  9. Me? You're the one using Google Translate. Please, refer to viewforum.php?f=145.
  10. Check if cursor is actually showing with: isCursorShowing Otherwise, yes, it's probably a bug.
  11. What? I don't understand you. I told you what to do.
  12. GTX

    getElementType

    Use onClientObjectDamage.
  13. Put different names for each row.
  14. Are ALL rows in the database SAME?
  15. Answer my questions, please. I can't help you if you can't answer my questions.
  16. It's impossible lol. Are rows even there? Are they EXACTLY the same?
  17. Client: logadmin = guiCreateGridList(0.01, 0.04, 0.70, 0.91, true, TabTest2) logadm1 = guiGridListAddColumn(logadmin, "Fecha", 0.1) logadm2 = guiGridListAddColumn(logadmin, "Admin", 0.3) logadm3 = guiGridListAddColumn(logadmin, "Premio", 0.3) logadm4 = guiGridListAddColumn(logadmin, "Cantidad", 0.3) logadm5 = guiGridListAddColumn(logadmin, "Selecc/Todos", 0.3) logadm6 = guiGridListAddColumn(logadmin, "Jugador", 0.3) actualizarlogadm = guiCreateButton(0.73, 0.24, 0.13, 0.09, "Actualizar", true, TabTest2) function onbtn() if source == actualizarlogadm then borrarlogadmin() end end addEventHandler("onClientGUIClick", root, onbtn) function veryaellogad(tab) guiGridListClear(logadmin) for i, gs in pairs(tab) do local row = guiGridListAddRow(logadmin) guiGridListSetItemText(logadmin, row,logadm1, gs.Fecha, false, true) guiGridListSetItemText(logadmin, row,logadm2, gs.Admin, false, true) guiGridListSetItemText(logadmin, row,logadm3, gs.Premio, false, true) guiGridListSetItemText(logadmin, row,logadm4, gs.Cantidad, false, true) guiGridListSetItemText(logadmin, row,logadm5, gs.SelecTodos, false, true) guiGridListSetItemText(logadmin, row,logadm6, gs.Jugador, false, true) end end addEvent("veryaellog", true) addEventHandler("veryaellog", root, veryaellogad) function borrarlogadmin() local path = guiGridListGetItemText(logadmin, guiGridListGetSelectedItem(logadmin), 1) local admin = guiGridListGetItemText(logadmin, guiGridListGetSelectedItem(logadmin), 2) local premio = guiGridListGetItemText(logadmin, guiGridListGetSelectedItem(logadmin), 3) local cantidad = guiGridListGetItemText(logadmin, guiGridListGetSelectedItem(logadmin), 4) local selectodos = guiGridListGetItemText(logadmin, guiGridListGetSelectedItem(logadmin), 5) local plr = guiGridListGetItemText(logadmin, guiGridListGetSelectedItem(logadmin), 6) if path and path ~= -1 then triggerServerEvent("borrarlogadmin", localPlayer, path, admin, premio, cantidad, selectodos, plr) end end Server: executeSQLQuery("CREATE TABLE IF NOT EXISTS LogAdmin (Fecha TEXT, Admin TEXT, Premio TEXT,Cantidad TEXT,SelecTodos TEXT,Jugador TEXT)") function VerLogAdmin() tablodelgadmin = executeSQLQuery("SELECT * FROM LogAdmin") triggerClientEvent (source,"veryaellog",source,tablodelgadmin) end addEvent ("VerLogAdmin", true) addEventHandler ("VerLogAdmin", root, VerLogAdmin) addEvent("borrarlogadmin", true) function borrarlogadmin(path, admin, premio, cantidad, selectodos, plr) if path then executeSQLQuery("DELETE FROM LogAdmin WHERE Fecha=? AND Admin=? AND Premio=? AND Cantidad=? AND SelecTodos=? AND Jugador=?", path, admin, premio, cantidad, selectodos, plr) VerLogAdmin() end end addEventHandler("borrarlogadmin", root, borrarlogadmin)
  18. Try this: executeSQLQuery("CREATE TABLE IF NOT EXISTS LogAdmin (Fecha TEXT, Admin TEXT, Premio TEXT,Cantidad TEXT,SelecTodos TEXT,Jugador TEXT)") function VerLogAdmin() tablodelgadmin = executeSQLQuery("SELECT * FROM LogAdmin") triggerClientEvent (source,"veryaellog",source,tablodelgadmin) end addEvent ("VerLogAdmin", true) addEventHandler ("VerLogAdmin", root, VerLogAdmin) addEvent("borrarlogadmin", true) function borrarlogadmin(path, plr) if path and plr then executeSQLQuery("DELETE FROM LogAdmin WHERE Fecha='"..path.."' AND Jugador='"..plr.."' LIMIT 1") VerLogAdmin() end end addEventHandler("borrarlogadmin", root, borrarlogadmin) And if you could translate that words to english, it would be helpful.
  19. To add all resources? One by one? I don't think so. Writing 3 lines of code, including meta, 6 lines, is much easier.
  20. GTX

    getElementType

    onClientPlayerDamage doesn't trigger when an object is hit. You forgot to pass a parameter to the function. function onlyFunction (hitElement) if getElementType (hitElement) == "object" and getElementModel (hitElement) == 1812 then local x,y,z = getElementPosition(hitElement) createPed (0, x, y, z, true) end end addEventHandler ("onClientPlayerWeaponFire", getRootElement(), onlyFunction)
  21. If you want to add this for each resource in your server, go ahead. You'll have 100 lines, where you could only do 3. he can use this resource viewtopic.php?f=108&t=51389&p=507974#p507974 It's almost the same as the mtaserver.conf, you would need to add 100 resources into this. It's much more work
  22. GTX

    Timer

    setTimer(function(thePlayer) local money = math.random(1000,10000) givePlayerMoney(thePlayer, money) outputChatBox("Congratulations you have done the mission successfuly and got "..money.." $", thePlayer) end, 10000, 1, thePlayer)
  23. Only MTA developers can decrypt the compiled scripts as far as I know, to prevent hacking. viewtopic.php?f=91&t=78858
  24. createWeapon setWeaponState bindKey setWeaponProperty attachElements
  25. https://community.multitheftauto.com/index.php?p= ... ls&id=5477
×
×
  • Create New...