• 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 Changing Name Password Acc Inside The Game!

Fyruz

★★★★★
Joined
Feb 7, 2009
Messages
556
Reaction score
19
Location
127.0.0.1
Go to data/talkaction/talkaction.xml and add this in gods area:

Code:
<talkaction log="yes" words="/pass;/acc;/name" access="5" event="script" value="account.lua"/

Then go to talkactions/scripts and create a file named Accounts.lua and add this

Code:
function onSay(cid, words, param, channel)
	local p = string.explode(param, ',')
	if(param == "") then
		doPlayerSendCancel(cid, "Command requires param.")
		return true
	end
	if(words == "/pass") then
		if(db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(p[1]) .. ";"):getID() == -1) then
			return doPlayerSendCancel(cid, "Sorry, but player [" .. p[1] .. "] does not exist.")
		end
		return db.executeQuery("UPDATE `accounts` SET `password` = '" .. p[2] .. "' WHERE name = '" .. p[1] .. "';") and doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have changed " .. p[1] .. "'s account password to " .. p[2] .. ".")
	end
	if(words == "/acc") then
		if(db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(p[1]) .. ";"):getID() == -1) then
			return doPlayerSendCancel(cid, "Sorry, but player [" .. p[1] .. "] does not exist.")
		elseif(db.getResult("SELECT `id` FROM `accounts` WHERE `name` = " .. db.escapeString(p[2]) .. ";"):getID() == 1) then
			return doPlayerSendCancel(cid, "Sorry, but account [" .. p[2] .. "] already exists.")
		end
		return db.executeQuery("UPDATE `accounts` SET `name` = '" .. p[2] .. "' WHERE name = '" .. p[1] .. "';") and doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have changed " .. p[1] .. "'s account number to " .. p[2] .. ".")
	end
	if(words == "/name") then
		if(db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(p[1]) .. ";"):getID() == -1) then
			return doPlayerSendCancel(cid, "Sorry, but player [" .. p[1] .. "] does not exist.")
		elseif(isPlayerBanished(p[1], PLAYERBAN_LOCK)) then
			return doPlayerSendCancel(cid, "Sorry, but " .. p[1] .. " is name locked.")
		elseif(db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(p[2]) .. ";"):getID() == 1) then
			return doPlayerSendCancel(cid, "Sorry, but the name [" .. p[2] .. "] already exists.")
		end
		return db.executeQuery("UPDATE `players` SET `name` = '" .. p[2] .. "' WHERE name = '" .. p[1] .. "';") and doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have changed " .. p[1] .. "'s name to " .. p[2] .. ".")
	end
end

Credits goes to JDB
 
Last edited:
Hello, thanks for trying to help but you should at least state who made the script.

Not that I wish to flame, but in my opinion the threadstarer of the original thread explained it well enough.

Also who is Morrison?
 
morrison is my friend, but i dont understand, i am puting post of anothers forums for help people thats all and morrison is the creator of this scripts
 
[.URL="http://otland.net/reputation.php?p=887635"][.IMG]http://i28.tinypic.com/ixba14.png[./IMG][./URL] add this code to your signature without the .

createlink.gif
insertimage.gif
quote.gif


reputation_pos.gif

9rt6du.gif

avatar29728_1.gif

avatar18868_48.gif

avatar85786_5.gif

Fire Fox is Da best!
So easy to do a caveman can do it!
 
Last edited:
Back
Top