function adminnick ( thePlayer, commandName, who, rank )if (exports.global:isPlayerSuperAdmin(thePlayer)) then if not (who) then outputChatBox(\"Használat:#e7d9b0 /setanick [iD] [admin név]\", thePlayer, 0, 206, 209,true) else local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, who) if (targetPlayer) then local getAccuratePlayerName = getPlayerName(thePlayer) rank = rank setElementData ( targetPlayer, \"adminnick\", rank )outputChatBox(\"Beállítottad \" .. targetPlayerName .. \" admin nevét erre: \" .. rank .. \".\", thePlayer, 244, 115, 33,true)dbPoll ( dbQuery( abKapcsolat, \"UPDATE characters SET adminnick = \' WHERE id =\'?\'\", getElementData( targetPlayer, \"dbid\" )) ) local targetAdminTitle = exports.global:getPlayerAdminTitle(targetPlayer) end end end endaddCommandHandler ( \"setanick\", adminnick )
function adminDuty(thePlayer, commandName)if exports.global:isPlayerAdmin(thePlayer) thenlocal adminduty = getElementData(thePlayer, \"adminduty\")local username = getPlayerName(thePlayer)local anicks = getElementData(thePlayer, \"anick\")local name = getPlayerName(thePlayer)setElementData(thePlayer, \" eredetinev\", name)local nev = getElementData(thePlayer, \"eredetinev\") if (adminduty==0) then setPlayerName(thePlayer, anicks) exports[\'anticheat-system\']:changeProtectedElementDataEx(thePlayer, \"adminduty\", 1) exports.infodoboz:showFelsoBox(getRootElement(), \'aszoli\', \"\".. anicks ..\" adminszolgálatba lépett.\");elseif (adminduty==1) thensetPlayerName(thePlayer, nev) exports[\'anticheat-system\']:changeProtectedElementDataEx(thePlayer, \"adminduty\", 0) exports.infodoboz:showFelsoBox(getRootElement(), \'aszoli2\', \"\".. anicks ..\" kilépett adminszolgálatból. Ha bármi segítség kell írj /report-ba.\");enddbPoll ( dbQuery( abKapcsolat, \"UPDATE accounts SET adminduty=\'?\' WHERE id=\'?\'\", getElementData(thePlayer, \"adminduty\"), getElementData(thePlayer, \"gameaccountid\")), -1 )exports.global:updateNametagColor(thePlayer)endendaddCommandHandler(\"adminduty\", adminDuty, false, false)
Miért kész vissza értéket a queryből? És egyáltalán miért dbQuery-vel próbálod? Az ilyenekre ott a dbExec
function adminDuty(thePlayer, commandName) if exports.global:isPlayerAdmin(thePlayer) then local adminduty = getElementData(thePlayer, \"adminduty\") local getAccuratePlayerName = getPlayerName(thePlayer) -- local adminrang = exports.global:getPlayerAdminTitle(thePlayer) local playerName = getPlayerName(thePlayer) local pmid = getElementData(thePlayer, \"playerid\") if (adminduty==0) then local eredetinev = getPlayerName(thePlayer) setElementData(thePlayer, \"eredetineve\", eredetinev) local anicks = getElementData(thePlayer, \"anick\") local anick = table.concat({anicks}, \"_\") exports[\'anticheat-system\']:changeProtectedElementDataEx(thePlayer, \"legitnamechange\", 1) setPlayerName(thePlayer, anicks) exports.infodoboz:showFelsoBox(getRootElement(), \'aszoli\', \"\".. anicks ..\" adminszolgálatba lépett. Ha bármi problémád van /pm\" .. pmid ..\".\"); setPlayerNametagColor ( thePlayer, 0, 100, 255 ) exports[\'anticheat-system\']:changeProtectedElementDataEx(thePlayer, \"adminduty\", 1)endexports[\'anticheat-system\']:changeProtectedElementDataEx(thePlayer, \"legitnamechange\", 0) if (adminduty==1) thenexports[\'anticheat-system\']:changeProtectedElementDataEx(thePlayer, \"legitnamechange\", 0)local ernev = getElementData(thePlayer, \"karinev\")local anicks = getElementData(thePlayer, \"anick\")--local szoveg = \"Szolgálatban. [OOC van jelen!]\" exports[\'anticheat-system\']:changeProtectedElementDataEx(thePlayer, \"legitnamechange\", 1) exports[\'anticheat-system\']:changeProtectedElementDataEx(thePlayer, \"adminduty\", 0) exports.infodoboz:showFelsoBox(getRootElement(), \'aszoli2\', \"\".. anicks ..\" kilépett adminszolgálatból. Ha bármi segítség kell írj /report-ba.\"); setPlayerName(thePlayer, ernev) enddbPoll ( dbQuery( abKapcsolat, \"UPDATE accounts SET adminduty=\'?\' WHERE id=\'?\'\", getElementData(thePlayer, \"adminduty\"), getElementData(thePlayer, \"gameaccountid\")), -1 ) exports.global:updateNametagColor(thePlayer) endendaddCommandHandler(\"adminduty\", adminDuty, false, false)addCommandHandler(\"aduty\", adminDuty, false, false)
local ernev = getElementData(thePlayer, \"karinev\")
local ernev = getElementData(thePlayer, \"eredetineve\")