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

!changender cmd

Dekon

Zerenia.net Owner
Joined
Feb 4, 2008
Messages
235
Reaction score
3
Location
Sweden
im looking for a changendeR script instead of taking preem days it takes money anyone know how to make it
/Danne
 
its always been !changender in TFS ;p but erm, would be easy to script when I got home... ill do it when I get out of school. pm me to remind me. along with thread link... if you wanna try ill make some strings up off the top of my head

functions you will need
getPlayerSex(cid)
doRemoveMoney(cid) I think thats the function
getPlayerMoney(cid)
or if you want to use the bank account
getPlayerBalance(cid)
etc...
find all of these in LUA_FUNCTION file. Ill post made version later
 
Sorry lost all my documentation xD including all scripts and I don't know the exact functions out of my head. I hope someone else can help you.(It isn't much lines)
 
Code:
function onSay(cid, words, param)
	if(getPlayerSex(cid) == 2) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot change your gender.")
		return TRUE
	end

	if(getPlayerPremiumDays(cid) > 2) then
		if(getPlayerPremiumDays(cid) < 65535) then
			doPlayerAddPremiumDays(cid, -3)
		end

		if(getPlayerSex(cid) == 0) then
			doPlayerSetSex(cid, 1)
		else
			doPlayerSetSex(cid, 0)
		end

		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your gender and lost three days of premium time.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, not enough premium time- changing gender costs three days.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	end
	return TRUE
end

and it's already in TFSb3
 
Code:
function onSay(cid, words, param)
	if(getPlayerSex(cid) == 2) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot change your gender.")
		return TRUE
	end

	if(getPlayerPremiumDays(cid) > 2) then
		if(getPlayerPremiumDays(cid) < 65535) then
			doPlayerAddPremiumDays(cid, -3)
		end

		if(getPlayerSex(cid) == 0) then
			doPlayerSetSex(cid, 1)
		else
			doPlayerSetSex(cid, 0)
		end

		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your gender and lost three days of premium time.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, not enough premium time- changing gender costs three days.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	end
	return TRUE
end

and it's already in TFSb3

pls hermers u go read again....... he want remove moeny nao premium days oki??????????????
 
Code:
function onSay(cid, words, param)
	if(getPlayerSex(cid) == 2) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot change your gender.")
		return TRUE
	end

	if(getPlayerPremiumDays(cid) > 2) then
		if(getPlayerPremiumDays(cid) < 65535) then
			doPlayerAddPremiumDays(cid, -3)
		end

		if(getPlayerSex(cid) == 0) then
			doPlayerSetSex(cid, 1)
		else
			doPlayerSetSex(cid, 0)
		end

		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your gender and lost three days of premium time.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, not enough premium time- changing gender costs three days.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	end
	return TRUE
end

and it's already in TFSb3

Thanks, but he wanted to remove money.
I used that script to edit it for him:)

Code:
function onSay(cid, words, param)
local costmoney = 10000
	if(getPlayerSex(cid) == 2) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot change your gender.")
		return TRUE
	end

	if doPlayerRemoveMoney(cid, costmoney) == true then

		if(getPlayerSex(cid) == 0) then
			doPlayerSetSex(cid, 1)
		else
			doPlayerSetSex(cid, 0)
		end

		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your gender for "..costmoney.."gp.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, not enough money for changing your gender, this costs "..costmoney.."gp.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	end
	return TRUE
end
 
Thanks, but he wanted to remove money.
I used that script to edit it for him:)

Code:
function onSay(cid, words, param)
local costmoney = 10000
	if(getPlayerSex(cid) == 2) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot change your gender.")
		return TRUE
	end

	if doPlayerRemoveMoney(cid, costmoney) == true then

		if(getPlayerSex(cid) == 0) then
			doPlayerSetSex(cid, 1)
		else
			doPlayerSetSex(cid, 0)
		end

		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your gender for "..costmoney.."gp.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, not enough money for changing your gender, this costs "..costmoney.."gp.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	end
	return TRUE
end
ah thx i will try that :)) damn thx for fast reply

didnt work
it says Sorry, not enough money for changing your gender~
it removes the money but it doesnt give me the new gender
 
Last edited by a moderator:
Code:
function onSay(cid, words, param)
local costmoney = 10000
	if(getPlayerSex(cid) == 2) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot change your gender.")
		return TRUE
		end

	if(getPlayerMoney(cid) >= costmoney) and (getPlayerSex(cid) == 0) then
			doPlayerRemoveMoney(cid, costmoney)
			doPlayerSetSex(cid, 1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your gender to male for "..costmoney.." gold.")
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
	elseif(getPlayerMoney(cid) >= costmoney) and (getPlayerSex(cid) == 1) then
			doPlayerRemoveMoney(cid, costmoney)
			doPlayerSetSex(cid, 0)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your gender to female for "..costmoney.." gold.")
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
	else
			doPlayerSendCancel(cid, "Sorry, you only have "..getPlayerMoney(cid).." gold, it costs "..costmoney.." gold to change."))
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	return TRUE
end

Didn't test or look for errors but should work. Reply if it works, or reply with errors from console.
 
Last edited:
Code:
function onSay(cid, words, param)
local costmoney = 10000
	if(getPlayerSex(cid) == 2) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot change your gender.")
		return TRUE
		end

	if(getPlayerMoney(cid) >= costmoney) and (getPlayerSex(cid) == 0) then
			doPlayerRemoveMoney(cid, costmoney)
			doPlayerSetSex(cid, 1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your gender to male for "..costmoney.." gold.")
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
	elseif(getPlayerMoney(cid) >= costmoney) and (getPlayerSex(cid) == 1) then
			doPlayerRemoveMoney(cid, costmoney)
			doPlayerSetSex(cid, 0)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your gender to female for "..costmoney.." gold.")
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
	else
			doPlayerSendCancel(cid, "Sorry, you only have "..getPlayerMoney(cid).." gold, it costs "..costmoney.." gold to change."))
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	return TRUE
end

Didn't test or look for errors but should work. Reply if it works, or reply with errors from console.

error uhm bla bla near '>'
 
Fixed i think:

PHP:
[PHP]function onSay(cid, words, param)
local costmoney = 10000
	if(getPlayerSex(cid) == 2) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot change your gender.")
		return TRUE
		end

	if(getPlayerMoney(cid) >= costmoney) and (getPlayerSex(cid) == 0) then
			doPlayerRemoveMoney(cid, costmoney)
			doPlayerSetSex(cid, 1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your gender to male for "..costmoney.." gold.")
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
	elseif(getPlayerMoney(cid) >= costmoney) and (getPlayerSex(cid) == 1) then
			doPlayerRemoveMoney(cid, costmoney)
			doPlayerSetSex(cid, 0)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your gender to female for "..costmoney.." gold.")
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
	else
			doPlayerSendCancel(cid, "Sorry, you only have "..getPlayerMoney(cid).." gold, it costs "..costmoney.." gold to change.")
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	return TRUE
end
[/PHP]

If this didnt work please post the full console error(line error)
 
PHP:
function onSay(cid, words, param)
    local cost = 10000

    if doPlayerRemoveMoney(cid, cost) == TRUE then
        if getPlayerSex(cid) == 1 then
            doPlayerSetSex(cid, 0)
        else
            doPlayerSetSex(cid, 1)
        end
        dosendMagicEffect(getCreaturePosition(cid), 13)
        doPlayerSendTextMessage(cid, 24, "You have changed your sex for the amount of " .. cost .. " gps.")
    else
        doSendMagicEffect(getCreaturePosition(cid), 2)
        doPlayerSendCancel(cid, "You do not have enough money.")
    end
    return TRUE
end
 
Back
Top