Witam ,nie przed?u?aj?c :
Bany nie dzia?aj? tzn wszystko si? zapisuje w tabeli i duty jest podpi?t pod acl tylko mo?na po??czy? si? z serwerem pomimo bana ,kod
function banPlayerCommand ( theClient, commandName, bannedName, reason ) -- Give the player a nice error if he doesn't have rights
if ( hasObjectPermissionTo ( theClient, "function.banPlayer" ) ) then --Get player element from the name
local bannedPlayer = getPlayerFromName ( bannedName ) --Ban the player
banPlayer ( bannedPlayer, theClient, reason )
outputChatBox ( "ban: " .. bannedName .. " successfully banned", theClient )
else
outputChatBox ( "ban: You don't have enough permissions", theClient )
end
end
addCommandHandler ( "ban", banPlayerCommand )
addEventHandler("onPlayerConnect", root, function(playerNick)
if string.find(playerNick, "#") ~= nil or string.find(playerNick, "?") ~= nil or string.find(playerNick, "!") ~= nil then
cancelEvent(true,"Tw?j nick zawiera jeden z niedozwolonych znak?w(#,?,!), zmie? go.")
end
end)
addEventHandler ("onPlayerJoin", root,function()
local query=string.format("SELECT * FROM ogrpg_ban WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","ban", getPlayerSerial(source))
local result=exports["ogrpg-db"]:pobierzWyniki(query)
if (result) then
outputConsole("***********************",source)
outputConsole(string.format("Zostales zbanowany na serwerze! "),source)
outputConsole(string.format("Posiadasz Bana do "..result["time"]),source)
outputConsole(string.format("Posiadasz Bana za: "..result["reason"]),source)
outputConsole("***********************",source)
kickPlayer(source,string.format("Kliknij f8 aby zobaczyc wiecej informacji!"))
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_ban WHERE type=? AND active=1 AND serial=?", "ban", getPlayerSerial(source))
end
end)
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach