• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Change Password by TALKACTION

GeKirAh

Banned User
Joined
Feb 14, 2009
Messages
163
Reaction score
0
Location
Brazil !!!
!changepass "newpasshere
Exclusive to OTLand/OTLua
This Script will let players change there password in-game!

You must get permission to post this at other OpenTibia Forums.


PHP Code:
Code:
function onSay(cid, words, param)
    if(param == "") then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
        return TRUE
    end
    
 dofile("./config.lua")
 
    local env = assert(luasql.mysql())
    local con = assert(env:connect(mysqlDatabase, mysqlUser, mysqlPass, mysqlHost, mysqlPort))
    
    local cur = assert(con:execute("UPDATE accounts AS a INNER JOIN players AS p ON p.id="..getPlayerGUID(cid).." SET a.password="..param..";"))
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "KEEP NOTE! Your new password is : "..param.." ")
    end
    
    cur:close()
    con:close()
    env:close()
    
end
PHP Code:
Code:
<talkaction words="!changepass" script="password.lua"/>
Nothing Special. Just its not been done before Credits to Nitro and Colandus
 
Last edited by a moderator:
Back
Top