Jump to content

ednatmp

Members
  • Posts

    15
  • Joined

About ednatmp

  • Birthday October 8

Details

  • Gang
    Gaming
  • Location
    Argentina
  • Occupation
    Scripter

Recent Profile Visitors

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

ednatmp's Achievements

Square

Square (6/54)

0

Reputation

  1. Now it works perfectly, thank you very much dude!
  2. Oh, sorry. On the server, executing a command with that function appears like this: [CHAT] Usted se encuentra silenciado. Expira en 0 día(s), 22 hora(s) y -77823 minuto(s)
  3. Hello everyone, I am trying to make a converter from seconds to days, hours and minutes, and gives me error, could you tell me where the problem is? Sorry for my bad English. function secondsToClock(seconds) local seconds = tonumber(seconds) if seconds <= 0 then return "0 día(s), 0 hora(s) y 0 minuto(s)" else local days = math.floor(seconds/86400) local hours = string.format("%02.f", math.floor(seconds/3600 - (days*24))) local mins = string.format("%02.f", math.floor(seconds/60 - (hours*3600) - (days*24))) return days.." día(s), "..hours.." hora(s) y "..mins.." minuto(s)" end end
  4. Well, i tested again, and still same error, i don't know what is it...
  5. Okay, im gonna tested right now. Im triggering server function from client side, and triggering client function from client side, i think its correct, and one more thing, im using a custom "account system", coded by me!
  6. Hey dude, thank you, but this still doesn't work properly, same error.
  7. Hi all, several weeks ago I was trying to solve a problem which i can not find solution. I've tried everything and nothing has worked. I need something to check if the user account is banner from the arena, and this code does not work... The console give me this error: [2016-11-02 14:58:26] WARNING: MassiveGaming\general\arenaban_s.lua:35: Bad argument @ 'xmlNodeGetAttribute' [Expected xml-node at argument 1] [2016-11-02 14:58:26] WARNING: MassiveGaming\general\arenaban_s.lua:40: Bad argument @ 'xmlUnloadFile' [Expected xml-node at argument 1] arenaban_s.lua (server side) function checkArenaBan(player, account, arena) if fileExists("general/banlist.xml") == false then return false end local banlist = xmlLoadFile("general/banlist.xml") for i, m in ipairs(xmlNodeGetChildren(banlist)) do if xmlNodeGetAttribute(m, "account") == account and xmlNodeGetAttribute(m, "arena") == arena then xmlUnloadFile(banlist) local returned = "true" triggerClientEvent(player, "checkArenaBan", player, returned) else xmlUnloadFile(banlist) local returned = "false" triggerClientEvent(player, "checkArenaBan", player, returned) end end end addEvent("checkArenaBan", true) addEventHandler("checkArenaBan", getRootElement(), checkArenaBan) lobby_c.lua (client side) local isPlayerBannedFromArena = "false" addEvent("checkArenaBan", true) addEventHandler("checkArenaBan", getLocalPlayer(), function (returned) if returned == "true" then isPlayerBannedFromArena = "true" else isPlayerBannedFromArena = "false" end end) other part of lobby_c.lua (client side) triggerServerEvent("checkArenaBan", _local, _local, getAccountNamePlayer(_local), getElementID(arena.Element)) if isPlayerBannedFromArena == "true" then addNotification("Usted está prohibido en esta arena.", "error") return end
  8. Thanks dude, now I understand. I was wondering if you have Skype so I can help with this problem, because I understood but not how to do it, you can help by Skype?
  9. Oh right, thank you, but i have a question, how can i use a function from serverside to clientside with a return value, like true or false?
  10. I defined _local local _local = getLocalPlayer()
  11. Hi all, several weeks ago I was trying to solve a problem which i can not find solution. I've tried everything and nothing has worked. I need something to check if the user account is banner from the arena, and this code does not work ... Any help? All the code is in client side. The part of the function who call the checker: if checkArenaBan(getAccountNamePlayer(_local), getElementID(arena.Element)) then addNotification("Usted está prohibido en esta arena.", "error") return else etc end The checker: function checkArenaBan(account, arena) local banlist = xmlLoadFile("arenas/acl/banlist.xml") for i, m in ipairs(xmlNodeGetChildren(banlist)) do if xmlNodeGetAttribute(m, "account") == account and xmlNodeGetAttribute(m, "arena") == arena then xmlUnloadFile(banlist) return true else xmlUnloadFile(banlist) return false end end end
  12. ednatmp

    dbQuery

    I thinks is working right now, thank you very much dude!
  13. ednatmp

    dbQuery

    Hey guys , well, I 'm scripting a database to store passwords , money, among other things, and I get error " espected near ' =' " and not to do , probe thousand things and nothing, any help? Sorry for my bad English , I'm Spanish . Image: http://imgur.com/GWZVaA6 My code, copy and paste so full error numbers match . local dataconnection = exports.CCS_db:getPlayersDatabase() function clientWantToCheckHisState() triggerClientEvent(source, "onServerWantIniteteLoginPanel", getRootElement(), colorCode) end addEvent("onClientWantCheckHisState", true) addEventHandler("onClientWantCheckHisState", getRootElement(), clientWantToCheckHisState) function onRequestRegister(usernameregister, passwordregister) regusername = string.lower(usernameregister) reguserplayernickname = getPlayerName(source) if (selectqq = dbQuery(dataconnection, "SELECT * FROM dbPlayersData WHERE username=? LIMIT 1", regusername)) then displayServerMessage(source, "El nombre de usuario elegido ya existe!", "warning") dbFree(selectqq) else if (dbExec(dataconnection, "INSERT INTO dbPlayersData (username, password, name, isonline, dms, wins, loses, cash, points, kills, deaths, level, rank, gametime, carcolor) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", regusername, passwordregister, reguserplayernickname, "false", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "none")) displayServerMessage(source, "Éxito al crear la nueva cuenta. Ahora Inicia sesión!") triggerClientEvent(source, "onClientSuccessfullyRegisterNewAccount", getRootElement()) end end end addEventHandler("onRequestRegister", getRootElement(), onRequestRegister) addEvent("onRequestRegister", true) function onRequestLogin(usernamelogin, passwordlogin) logusername = string.lower(usernamelogin) if (selectq = dbQuery(dataconnection, "SELECT * FROM dbPlayersData WHERE username=? LIMIT 1", logusername)) then dbFree(selectq) local accountData = dbQuery(dataconnection, "SELECT isonline FROM dbPlayersData WHERE username=? AND password=?",logusername, passwordlogin) if (accountData == "false") then displayServerMessage(source, "Has iniciado sesión correctamente.", "warning") setElementData(source, "gametime", getTickCount()) triggerClientEvent(source, "onClientIsLoggedIn", getRootElement()) triggerClientEvent(source, "onClientSuccessfullyLogIn", getRootElement()) dbQuery(dataconnection, "UPDATE dbPlayersData SET isonline=? WHERE username=? AND password=?", "true", logusername, passwordlogin) dbFree(accountData) else displayServerMessage(source, "Nombre de usuario o contraseña incorrecta!", "warning") end else displayServerMessage(source, "Nombre de usuario o contraseña incorrecta!", "warning") end end addEventHandler("onRequestLogin", getRootElement(), onRequestLogin) addEvent("onRequestLogin", true) function displayServerMessage(thePlayer, message, type) triggerClientEvent(thePlayer, "createNotification", getRootElement(), message, type) end
  14. Hello Gravestone , setFPSlimit for each player is not possible, the only thing I know there is global setFPSlimit .
  15. Hello Forum, first of all, I'm from Argentina so sorry for my bad English. Well, I 'm scripting is a command which lets you listen to music from youtube. Already finished but I would like to know if there is any way to get the name of the video. Please help. Regards, Enz0Z
×
×
  • Create New...