Guest User

Untitled

a guest
Sep 22nd, 2015
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 KB | None | 0 0
  1. MySQLConnection = dbConnect( "mysql", "dbname=ZEIStats;host=127.0.0.1", "root", "ESTO NO IMPORTA ._.", "share=0" )
  2.  
  3.  
  4. function updateRows()
  5.     if MySQLConnection then
  6.         dbExec(MySQLConnection,"DELETE FROM Scoreboard")
  7.             for index, value in ipairs( getElementsByType("player")) do
  8.                 if isGuestAccount(getPlayerAccount(value)) then return end
  9.                 local Nombre = getPlayerName(value)
  10.                 local Trabajo = getElementData(value,"Trabajo") or "N/A"
  11.                 local Grupo = getElementData(value,"Grupo") or "N/A"
  12.                 local Dinero = getPlayerMoney(value)
  13.                 local ZombieKills = getAccountData(getPlayerAccount(value),"ZEIStats.ZKills") or 0
  14.                 local Pais = getElementData(value,"country") or "N/A"
  15.                 local Ping = getPlayerPing(value)
  16.                 local r,g,b = getPlayerNametagColor(value)
  17.                 local Color = r..','..g..','..b
  18.                     dbExec( MySQLConnection, "INSERT INTO Scoreboard VALUES (?,?,?,?,?,?,?,?)", Nombre, Trabajo, Grupo, Dinero, Pais, ZombieKills, Ping, Color )
  19.             end
  20.     end
  21. end
  22. setTimer(updateRows,120000,0)
  23. updateRows()
Advertisement
Add Comment
Please, Sign In to add comment