
Focker
Members-
Posts
66 -
Joined
-
Last visited
Details
-
Gang
Revolution
Focker's Achievements

Snitch (10/54)
0
Reputation
-
a function to Server.lua for creating something with some number forbid if that function is, but I need to and exit with warning .. there functions that could provide me?
-
Hi All . how to make you can not use numbers in the guiCreateEdit ?
-
Hello I need your help on a function. I need the function that if a player buys a gun with a bullet then it can not buy it again until the end of that one bullet has
-
admin error took off but still Ban ERROR:[bans]NGBans\bans_server.lua:58: Database query failed: no such table: accountdata
-
I get this error debugscript: ERROR:[bans]NGBans\bans_server.lua:58: Database query failed: no such table: accountdata Bad argument @ 'getPlayerAccount' [Expected element at argument 1,got string' Focker']
-
Hello everyone, I mainly want to help me with script that is not mine, it's actually a fellow named xXMADEXx I have added to Skype and does not help me because they do not have much free time, so I ask all the privacy of this script, what I need is to walk this ban system with admin panel, because this system goes only to the admin panel of Nerd Gaming, And I want to make it work with the panel P common.. I want the punishment to be exported P panel. Titles for xXMADEXx "Or if I would have a similar system to help me get this systema" It is a similar system to that of cit Client: local ban = nil local sx, sy = guiGetScreenSize ( ) local rsx, rsy = sx, sy local sx, sy = sx/1280, sy/960 local open = false local banY = -(rsy/1.2) local font_size =(sx+sy) function drawBanScreen ( ) if not startTime then startTime = getTickCount ( ) end if not endTime then endTime = getTickCount ( ) + 3500 end local now = getTickCount() local elapsedTime = now - startTime local duration = endTime - startTime local progress = elapsedTime / duration local _, y, _ = interpolateBetween ( 0, -(rsy/1.2), 0, 0, 0, 0, progress, "OutBack" ) banY = y dxDrawBoarderedText("Baned Nerd Gaming", 0, banY, sx*1280, banY+sy*98, tocolor(255, 0, 0, 255), 2, "default", "center", "center", false, false, true, false, false) dxDrawRectangle(sx*87, banY+sy*189, sx*152, sy*40, tocolor(0, 0, 0, 0), true) dxDrawText("SERIAL:", sx*103, banY+sy*189, sx*239, banY+sy*229, tocolor(255, 0, 0, 255), font_size, "default", "left", "center", true, false, true, false, false) dxDrawRectangle(sx*249, banY+sy*189, sx*563, sy*40, tocolor(0, 0, 0, 0), true) dxDrawText(ban.serial, sx*259, banY+sy*189, sx*812, banY+sy*229, tocolor(0, 255, 9, 255), font_size, "default", "left", "center", true, false, true, false, false) dxDrawRectangle(sx*87, banY+sy*249, sx*152, sy*40, tocolor(0, 0, 0, 0), true) dxDrawText("IP:", sx*103, banY+sy*249, sx*239, banY+sy*289, tocolor(255, 0, 0, 255), font_size, "default", "left", "center", true, false, true, false, false) dxDrawRectangle(sx*249, banY+sy*249, sx*563, sy*40, tocolor(0, 0, 0, 0), true) dxDrawText(ban.ip, sx*259, banY+sy*249, sx*812, banY+sy*289, tocolor(0, 255, 9, 255), font_size, "default", "left", "center", true, false, true, false, false) dxDrawRectangle(sx*87, banY+sy*309, sx*152, sy*40, tocolor(0, 0, 0, 0), true) dxDrawText("Acount:", sx*103, banY+sy*309, sx*239, banY+sy*349, tocolor(255, 0, 0, 255), font_size, "default", "left", "center", true, false, true, false, false) dxDrawRectangle(sx*249, banY+sy*309, sx*563, sy*40, tocolor(0, 0, 0, 0), true) dxDrawText(ban.account, sx*259, banY+sy*309, sx*812, banY+sy*349, tocolor(0, 255, 9, 255), font_size, "default", "left", "center", true, false, true, false, false) dxDrawRectangle(sx*87, banY+sy*369, sx*152, sy*40, tocolor(0, 0, 0, 0), true) dxDrawText("BAN Until:", sx*103, banY+sy*369, sx*239, banY+sy*409, tocolor(255, 0, 0, 255), font_size, "default", "left", "center", true, false, true, false, false) dxDrawRectangle(sx*249, banY+sy*369, sx*563, sy*40, tocolor(0, 0, 0, 0), true) dxDrawText(ban.unban, sx*259, banY+sy*369, sx*812, banY+sy*409, tocolor(0, 255, 9, 255), font_size, "default", "left", "center", true, false, true, false, false) dxDrawRectangle(sx*87, banY+sy*429, sx*152, sy*40, tocolor(0, 0, 0, 0), true) dxDrawText("BANED:", sx*103, banY+sy*429, sx*239, banY+sy*469, tocolor(255, 0, 0, 255), font_size, "default", "left", "center", true, false, true, false, false) dxDrawRectangle(sx*249, banY+sy*429, sx*563, sy*40, tocolor(0, 0, 0, 0), true) dxDrawText(ban.banned_on, sx*259, banY+sy*429, sx*812, banY+sy*469, tocolor(0, 255, 9, 255), font_size, "default", "left", "center", true, false, true, false, false) dxDrawRectangle(sx*87, banY+sy*489, sx*152, sy*40, tocolor(0, 0, 0, 0), true) dxDrawText("BAN FOR :", sx*103, banY+sy*489, sx*239, banY+sy*529, tocolor(255, 0, 0, 255), font_size, "default", "left", "center", true, false, true, false, false) dxDrawRectangle(sx*249, banY+sy*489, sx*563, sy*40, tocolor(0, 0, 0, 0), true) dxDrawText(ban.banner, sx*259, banY+sy*489, sx*812, banY+sy*529, tocolor(0, 255, 9, 255), font_size, "default", "left", "center", true, false, true, false, false) dxDrawRectangle(sx*87, banY+sy*549, sx*152, sy*40, tocolor(0, 0, 0, 0), true) dxDrawText("Themes:", sx*103, banY+sy*549, sx*239, banY+sy*589, tocolor(255, 0, 0, 255), font_size, "default", "left", "center", true, false, true, false, false) dxDrawRectangle(sx*249, banY+sy*549, sx*563, sy*40, tocolor(0, 0, 0, 0), true) dxDrawText(ban.reason, sx*259, banY+sy*549, sx*812, banY+sy*589, tocolor(0, 255, 9, 255), font_size, "default", "left", "center", true, false, true, false, false) dxDrawBoarderedText("APPEAL BAN Nerd Gaming.NET", sx*330, banY+sy*609, sx*812, banY+sy*649, tocolor(255, 0, 0, 255), 2, "default", "center", "center", true, false, true, false, false, 0, 0, 0, 2) end addEvent ( "NGBans:OpenClientBanScreen", true ) addEventHandler ( "NGBans:OpenClientBanScreen", root, function ( d ) ban = d if ( tonumber ( ban.unban_month ) and tonumber ( ban.unban_month ) < 10 ) then ban.unban_month = "0"..ban.unban_month end if ( tonumber ( ban.unban_day ) and tonumber ( ban.unban_day ) < 10 ) then ban.unban_day = "0"..ban.unban_day end ban.unban = table.concat ({ tostring(ban.unban_year), tostring(ban.unban_month), tostring(ban.unban_day) }, "-" ) if ( tostring ( ban.unban ):upper() == "NIL" ) then ban.unban = "Forever" end if open then return end open = true addEventHandler ( "onClientPreRender", root, drawBanScreen ) end ) function dxDrawBoarderedText ( text, x, y, endX, endY, color, size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) local text = tostring ( text ) local x = tonumber(x) or 0 local y = tonumber(y) or 0 local endX = tonumber(endX) or x local endY = tonumber(endY) or y local color = color or tocolor ( 255, 255, 255, 255 ) local size = tonumber(size) or 1 local font = font or "default" local alignX = alignX or "left" local alignY = alignY or "top" local clip = clip or false local wordBreak = wordBreak or false local postGUI = postGUI or false local colorCode = colorCode or false local subPixelPos = subPixelPos or false local fRot = tonumber(fRot) or 0 local fRotCX = tonumber(fRotCX) or 0 local fRotCY = tonumber(fRotCy) or 0 local offSet = tonumber(offSet) or 1 local t_g = text:gsub ( "#%x%x%x%x%x%x", "" ) dxDrawText ( t_g, x-offSet, y-offSet, endX, endY, tocolor(0,0,0,255), size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) dxDrawText ( t_g, x-offSet, y, endX, endY, tocolor(0,0,0,255), size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) dxDrawText ( t_g, x, y-offSet, endX, endY, tocolor(0,0,0,255), size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) dxDrawText ( t_g, x+offSet, y+offSet, endX, endY, tocolor(0,0,0,255), size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) dxDrawText ( t_g, x+offSet, y, endX, endY, tocolor(0,0,0,255), size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) dxDrawText ( t_g, x, y+offSet, endX, endY, tocolor(0,0,0,255), size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) return dxDrawText ( text, x, y, endX, endY, color, size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) end Server: local bans = { } -- All bans are saved here, until server save, or this resource stops --[[ bans table format: bans[serial] = { serial = user serial, ip = user ip, account = user account, unban_day = unban day, unban_month = unban month, unban_year = unban year, reason = reason, banner = the person who banned, banned_on = when the user was banned } ]] --executeSQLQuery("DROP TABLE ban_system") executeSQLQuery("CREATE TABLE IF NOT EXISTS ban_system (id INTEGER PRIMARY KEY, serial TEXT, ip TEXT, account TEXT,unban_day TEXT,unban_month TEXT,unban_year TEXT,banner TEXT,reason TEXT,banned_on TEXT)") addEventHandler ( "onResourceStart", resourceRoot, function ( ) --exports.NGSQL:db_exec ( "CREATE TABLE IF NOT EXISTS ban_system ( serial TEXT, ip TEXT, account TEXT, unban_day INT, unban_month INT, unban_year INT, banner TEXT, reason TEXT, banned_on DATE )" ); -- Load the bans local q = executeSQLQuery("SELECT * FROM ban_system") --local q = exports.NGSQL:db_query ( "SELECT * FROM ban_system" ); if ( q and type ( q ) == "table" ) then for i, v in pairs ( q ) do local data = { } for ind, var in pairs ( v ) do data[ind] = var if ( ind == "unban_day" or ind == "unban_month" or ind == "unban_year" ) then data[ind] = tonumber ( var ) end end bans[v.serial] = data isSerialBanned ( v.serial ) end end setTimer ( function ( ) local playerSerials = { } for i, v in pairs ( getElementsByType ( "player" ) ) do playerSerials[getPlayerSerial(v)] = v end for i, v in pairs ( bans ) do if ( playerSerials [ v.serial ] ) then loadBanScreenForPlayer ( playerSerials [ v.serial ] ) end end playerSerials = nil end, 500, 1 ) end ) function banAccount ( acc, ban_day, unban_month, ban_year, reason, banner ) local reason = reason or "Not defined" local banner = banner or "Server" local d = executeSQLQuery("SELECT * FROM accountdata WHERE Username=?", acc) if ( d and type ( d ) == "table" and table.len ( d ) == 1 ) then local d = d [ 1 ] local ser = d['LastSerial'] local ip = d['LastIP'] local ban_day = tonumber ( ban_day ) or 1 local unban_month = tonumber ( unban_month ) or 1 local ban_year = tonumber ( ban_year ) or 2015 bans[ser] = { serial = ser, ip = ip, account = acc, unban_day = ban_day, unban_month = unban_month, unban_year = ban_year, reason = reason, banner = banner, banned_on = exports.NGPlayerFunctions:getToday() } for i, v in pairs ( getElementsByType ( "player" ) ) do local a = getPlayerAccount ( v ) if ( not isGuestAccount ( a ) and getAccountName ( a ) == acc ) then kickPlayer ( v, "Reconectando algo paso" ) break end end end end function isSerialBanned ( serial ) if ( bans [ serial ] ) then local isBanContinuted = false local today = today ( ) local d = bans [ serial ] if ( tostring(d.unban_year):upper() == "NIL" or tostring(d.unban_month):upper() == "NIL" or tostring(d.unban_day):upper() == "NIL" ) then return true end local unbanMeth = "" if ( d.unban_year > today.year ) then isBanContinuted = true unbanMeth = 1 elseif ( d.unban_year == today.year and d.unban_month > today.month ) then isBanContinuted = true unbanMeth = 2 elseif ( d.unban_year == today.year and d.unban_month == today.month and d.unban_day > today.day ) then isBanContinuted = true unbanMeth = 3 end if ( not isBanContinuted ) then bans [ serial ] = nil return false end -- try to detect the player for i, v in pairs ( getElementsByType ( "player" ) ) do if ( getPlayerSerial ( v ) == serial ) then loadBanScreenForPlayer ( v ) break end end return true end end function loadBanScreenForPlayer ( player ) toggleAllControls ( player, false ) showChat ( player, false ) setPlayerHudComponentVisible ( player, 'all', false ) setElementData ( player, "Online", "Banned" ) setElementData ( player, "Zona", "Banned" ) setElementData ( player, "Ocupacion", "Banned" ) setElementData ( player, "Dinero", "Banned" ) setElementData ( player, "Usuario Lvl(Respeto)", "Banned" ) setElementData ( player, "Gang", "Banned" ) local d = bans [ getPlayerSerial ( player ) ] local banInfo = { account = d.account, ip = d.ip, serial = d.serial, reason = d.reason, banner = d.banner, unban_day = d.unban_day, unban_month = d.unban_month, unban_year = d.unban_year, banned_on = d.banned_on } for i, v in pairs ( banInfo ) do banInfo [ i ] = tostring ( v ) end triggerClientEvent ( player, "NGBans:OpenClientBanScreen", player, banInfo ) end addEventHandler ( "onPlayerLogin", root, function ( ) local s = getPlayerSerial ( source ) if ( bans [ s ] ) then kickPlayer ( source, "Ya! Estas Ban." ) end end ) function unbanAccount ( acc ) local rV = false for i, v in pairs ( bans ) do if ( v.account == acc ) then bans[i] = nil rV = true break end end return rV end function saveBans ( ) executeSQLQuery("DELETE FROM ban_system") local c = 0 for i, v in pairs ( bans ) do executeSQLQuery("INSERT INTO ban_system (serial, ip, account, unban_day, unban_month, unban_year, banner, reason, banned_on ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ? )", --exports.NGSQL:db_exec ( "INSERT INTO ban_system ( serial, ip, account, unban_day, unban_month, unban_year, banner, reason, banned_on ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ? )", v.serial, v.ip, v.account, v.unban_day, v.unban_month, v.unban_year, v.banner, v.reason, v.banned_on ) c = c + 1 end return c end addEventHandler ( "onResourceStop", resourceRoot, saveBans ) -- misc functions function today ( ) local d = getRealTime ( ) local day = d.monthday local month = d.month + 1 local year = d.year + 1900 return { year=year, day=day, month=month } end function table.len ( t ) local c = 0; for i, v in pairs ( t ) do c = c + 1 end return c end meta: "xXMADEXx" type="script" version="1.0" name="Nerd Gaming User Banning System" />