• 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!

Auto namelock

Nightimarez

New Member
Joined
Jul 24, 2008
Messages
287
Reaction score
2
I need a script that when Player steps on a tile, and he will get namelocked. Then when he logs in, he will be an Account Manager and he will be asked to say his new name. If you could think of a better way, that would be awesome.

or just !setname Bob =)

Mine didn't work ;x
Code:
function onSay(cid, words, param, channel)
	if(param == '') then
		return true
	end

	doPlayerSetName(cid, param)
	return true
end
 
Last edited:
Code:
function onSay(cid, words, param, channel)
	if param == '' then
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
	elseif not getPlayerByName(param) and db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(param) .. ";"):getID() == -1 then
		return doPlayerSendCancel(cid, "A player with that name does not exist.")
	elseif isPlayerBanished(param, PLAYERBAN_LOCK) then
		return doPlayerSendCancel(cid, "This player is already namelocked.")
	else
		return doAddPlayerBanishment(param) and doPlayerSendCancel(cid, "This player is now namelocked.")
	end
end
+1

LUA:
function doPlayerSetName(cid, name)
    return db.executeQuery("UPDATE `players` SET `name` = ".. name .." WHERE `id` = ".. getPlayerGUID(cid) ..";")
end
Player would have to be removed first -.-
 
I need a script that when Player steps on a tile, and he will get namelocked. Then when he logs in, he will be an Account Manager and he will be asked to say his new name. If you could think of a better way, that would be awesome.

or just !setname Bob =)

Mine didn't work ;x
Code:
function onSay(cid, words, param, channel)
	if(param == '') then
		return true
	end

	doPlayerSetName(cid, param)
	return true
end

even if it worked, woulden't the result be:
you get namelocked
you go to acc manager and change name
you log back in at the same sqm and gets namelocked again
you go to acc manager and change name
.....
....
..
.
:peace:
 
Code:
function onSay(cid, words, param, channel)
	if param == '' then
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
	elseif not getPlayerByName(param) and db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(param) .. ";"):getID() == -1 then
		return doPlayerSendCancel(cid, "A player with that name does not exist.")
	elseif isPlayerBanished(param, PLAYERBAN_LOCK) then
		return doPlayerSendCancel(cid, "This player is already namelocked.")
	else
		return doAddPlayerBanishment(param) and doPlayerSendCancel(cid, "This player is now namelocked.")
	end
end

Player would have to be removed first -.-

It's suppose to be a player command, so they can change their own name. With battle check would be awesome.
 
Last edited:
Code:
function onSay(cid, words, param, channel)
	return doAddPlayerBanishment(param) and doRemoveCreature(cid)
end
 
Back
Top