Sziasztok, mit írhattam el amiért nem kickel senkit a játékból?
function kickAPlayer(thePlayer, commandName, targetPlayer, ...)
if (exports.global:isPlayerAdmin(thePlayer)) then
if not (targetPlayer) or not (...) then
outputChatBox(\"HASZNÁLD: /\" .. commandName .. \" [Névrészlet] [indok]\", thePlayer, 255, 194, 14)
else
local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, targetPlayer)
if targetPlayer then
local thePlayerPower = exports.global:getPlayerAdminLevel(thePlayer)
local targetPlayerPower = exports.global:getPlayerAdminLevel(targetPlayer)
reason = table.concat({...}, \" \")
if (targetPlayerPower <= thePlayerPower) then
local hiddenAdmin = getElementData(thePlayer, \"hiddenadmin\")
local playerName = getPlayerName(thePlayer)
mysql:query_free(\'INSERT INTO adminhistory (user_char, user, admin_char, admin, hiddenadmin, action, duration, reason) VALUES (\"\' .. mysql:escape_string(getPlayerName(targetPlayer)) .. \'\",\' .. mysql:escape_string(tostring(getElementData(targetPlayer, \"gameaccountid\") or 0)) .. \',\"\' .. mysql:escape_string(getPlayerName(thePlayer)) .. \'\",\' .. mysql:escape_string(tostring(getElementData(thePlayer, \"gameaccountid\") or 0)) .. \',\' .. mysql:escape_string(hiddenAdmin) .. \',1,0,\"\' .. mysql:escape_string(reason) .. \'\")\' )
if (hiddenAdmin==0) then
local adminTitle = exports.global:getPlayerAdminTitle(thePlayer)
outputChatBox(\"AdmKick: \" .. adminTitle .. \" \" .. playerName .. \" kickelte \" .. targetPlayerName .. \"-t.\", getRootElement(), 255, 0, 51)
outputChatBox(\"AdmKick: Indok: \" .. reason .. \".\", getRootElement(), 255, 0, 51)
kickPlayer(targetPlayer, thePlayer, reason)
else
outputChatBox(\"AdmKick: Rejtett Admin kickelve \" .. targetPlayerName .. \" által.\", getRootElement(), 255, 0, 51)
outputChatBox(\"AdmKick: Indok: \" .. reason, getRootElement(), 255, 0, 51)
kickPlayer(targetPlayer, getRootElement(), reason)
end
exports.logs:logMessage(\"[/KICK] \" .. getElementData(thePlayer, \"gameaccountusername\") .. \"/\".. getPlayerName(thePlayer) ..\" kicked \".. targetPlayerName ..\" (\".. reason ..\")\" , 4)
else
outputChatBox(\"(( Nagyobb admint akarsz kirúgni? ))\", thePlayer, 255, 0, 0)
outputChatBox(\"(( \".. playerName .. \" kickelni akart. ))\", targetPlayer, 255, 0 ,0)
end
end
end
end
end
addCommandHandler(\"kick\", kickAPlayer, false, false)
Megoldva, zárom.