loacal adminszint = Lekérdezed a játékos admin szintjétLocal adandoszint = lekérdezed a parancsban megadott szintetif adminszint <= adandoszint thenOutputChatBox(\"Nincs kellő adminszinted!\", source)end
function makePlayerAdmin(thePlayer, commandName, who, rank)if (exports.global:isSuperAdmin(thePlayer)) thenif not (who) then outputChatBox(\"HASZNÁLD: /\" .. commandName .. \" [iD/NévRészlet] [Rang]\", thePlayer, 255, 194, 14)else local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, who) if (targetPlayer) then local username = getPlayerName(thePlayer) local accountID = getElementData(targetPlayer, \"gameaccountid\") exports[\'anticheat-system\']:changeProtectedElementDataEx(targetPlayer, \"adminlevel\", tonumber(rank)) rank = tonumber(rank) if (rank<1337) then exports[\'anticheat-system\']:changeProtectedElementDataEx(targetPlayer, \"hiddenadmin\", 0) end local query = mysql:query_free(\"UPDATE accounts SET admin=\'\" .. mysql:escape_string(tonumber(rank)) .. \"\', hiddenadmin=\'0\' WHERE id=\'\" .. mysql:escape_string(accountID) .. \"\'\") outputChatBox(\"Beállítottad \" .. targetPlayerName .. \" Admin rangját erre: \" .. rank .. \".\", thePlayer, 0, 255, 0) local hiddenAdmin = getElementData(thePlayer, \"hiddenadmin\") local targetAdminTitle = exports.global:getPlayerAdminTitle(targetPlayer) if (rank>0) or (rank==-999999999) then exports[\'anticheat-system\']:changeProtectedElementDataEx(targetPlayer, \"adminduty\", 1) else exports[\'anticheat-system\']:changeProtectedElementDataEx(targetPlayer, \"adminduty\", 0) end exports[\'anticheat-system\']:changeProtectedElementDataEx(targetPlayer, \"ideiglenes\", 0) mysql:query_free(\"UPDATE accounts SET adminduty=\" .. mysql:escape_string(getElementData(targetPlayer, \"adminduty\")) .. \" WHERE id = \" .. mysql:escape_string(getElementData(targetPlayer, \"gameaccountid\")) ) exports.global:updateNametagColor(targetPlayer) if (hiddenAdmin==0) then local adminTitle = exports.global:getPlayerAdminTitle(thePlayer) outputChatBox(adminTitle .. \" \" .. username .. \" beállította az Admin rangodat erre: \" .. rank .. \".\", targetPlayer, 255, 194, 14) exports.global:sendMessageToAdmins(\"AdmCmd: \" .. tostring(adminTitle) .. \" \" .. username .. \" set \" .. targetPlayerName .. \"\'s admin level to \" .. rank .. \".\") else outputChatBox(\"Egy rejtett Admin beállította az Admin rangodat erre: \" .. rank .. \".\", targetPlayer, 255, 194, 14) end endendendendaddCommandHandler(\"makeadmin\", makePlayerAdmin, false, false)
function makePlayerAdmin(thePlayer, commandName, who, rank)if (exports.global:isSuperAdmin(thePlayer)) thenif not (who) then outputChatBox(\"HASZNÁLD: /\" .. commandName .. \" [iD/NévRészlet] [Rang]\", thePlayer, 255, 194, 14)else local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, who) if (targetPlayer) then local username = getPlayerName(thePlayer) local accountID = getElementData(targetPlayer, \"gameaccountid\") local sAdminSzint = getElementData(thePlayer, \"adminlevel\") local jAdminSzint = getElementData(targetPlayer, \"adminlevel\") if sAdminSzint <= jAdminSzint then outputChatBox(\"Nincs elég rangod \" .. username .. \" adminszintje módosításához!\", thePlayer, 255, 0, 0) return end exports[\'anticheat-system\']:changeProtectedElementDataEx(targetPlayer, \"adminlevel\", tonumber(rank)) rank = tonumber(rank) if (rank<1337) then exports[\'anticheat-system\']:changeProtectedElementDataEx(targetPlayer, \"hiddenadmin\", 0) end local query = mysql:query_free(\"UPDATE accounts SET admin=\'\" .. mysql:escape_string(tonumber(rank)) .. \"\', hiddenadmin=\'0\' WHERE id=\'\" .. mysql:escape_string(accountID) .. \"\'\") outputChatBox(\"Beállítottad \" .. targetPlayerName .. \" Admin rangját erre: \" .. rank .. \".\", thePlayer, 0, 255, 0) local hiddenAdmin = getElementData(thePlayer, \"hiddenadmin\") local targetAdminTitle = exports.global:getPlayerAdminTitle(targetPlayer) if (rank>0) or (rank==-999999999) then exports[\'anticheat-system\']:changeProtectedElementDataEx(targetPlayer, \"adminduty\", 1) else exports[\'anticheat-system\']:changeProtectedElementDataEx(targetPlayer, \"adminduty\", 0) end exports[\'anticheat-system\']:changeProtectedElementDataEx(targetPlayer, \"ideiglenes\", 0) mysql:query_free(\"UPDATE accounts SET adminduty=\" .. mysql:escape_string(getElementData(targetPlayer, \"adminduty\")) .. \" WHERE id = \" .. mysql:escape_string(getElementData(targetPlayer, \"gameaccountid\")) ) exports.global:updateNametagColor(targetPlayer) if (hiddenAdmin==0) then local adminTitle = exports.global:getPlayerAdminTitle(thePlayer) outputChatBox(adminTitle .. \" \" .. username .. \" beállította az Admin rangodat erre: \" .. rank .. \".\", targetPlayer, 255, 194, 14) exports.global:sendMessageToAdmins(\"AdmCmd: \" .. tostring(adminTitle) .. \" \" .. username .. \" set \" .. targetPlayerName .. \"\'s admin level to \" .. rank .. \".\") else outputChatBox(\"Egy rejtett Admin beállította az Admin rangodat erre: \" .. rank .. \".\", targetPlayer, 255, 194, 14) end endendendendaddCommandHandler(\"makeadmin\", makePlayerAdmin, false, false)
local jAdminSzint = getElementData(targetPlayer, \"adminlevel\")
if sAdminSzint <= jAdminSzint then
if sAdminSzint <= tonumber(rank) then
outputChatBox(\"Nincs elég rangod \" .. username .. \" adminszintje módosításához!\", thePlayer, 255, 0, 0)
outputChatBox(\"A saját rangodnál nem tudsz nagyobb rangot adni!\", thePlayer, 255, 0, 0)