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

changesex for money

experienced

Intermediate OT User
Joined
Jan 13, 2011
Messages
418
Reaction score
102
Location
Poland
hey
i need script !changesex but not for premium days but for money for example 20cc :P maybe rewrite this or new
Code:
local config = {
	costPremiumDays = 3 
}

function onSay(cid, words, param, channel)
	if(getPlayerSex(cid) >= 2) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot change your gender.")
		return TRUE
	end

	if(getPlayerPremiumDays(cid) < config.costPremiumDays) then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, not enough premium time- changing gender costs " .. config.costPremiumDays .. " days.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		return TRUE
	end

	if(getPlayerPremiumDays(cid) < 65535) then
		doPlayerAddPremiumDays(cid, -config.costPremiumDays)
	end

	if(getPlayerSex(cid) == PLAYERSEX_FEMALE) then
		doPlayerSetSex(cid, PLAYERSEX_MALE)
	else
		doPlayerSetSex(cid, PLAYERSEX_FEMALE)
	end

	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your gender and lost " .. config.costPremiumDays .. " days of premium time.")
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
	return TRUE
end
 
LUA:
local config = {
	costMoney = 200000 
}

function onSay(cid, words, param, channel)
	if(getPlayerSex(cid) >= 2) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot change your gender.")
		return TRUE
	end

	if(getPlayerMoney(cid) < config.costMoney) then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, not enough money - changing gender costs " .. config.costMoney .. ".")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		return TRUE
	end

	if(getPlayerMoney(cid) >= config.costMoney) then
		doPlayerRemoveMoney(cid, config.costMoney)
	end

	if(getPlayerSex(cid) == PLAYERSEX_FEMALE) then
		doPlayerSetSex(cid, PLAYERSEX_MALE)
	else
		doPlayerSetSex(cid, PLAYERSEX_FEMALE)
	end

	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your gender and paid " .. config.costMoney .. " money.")
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
	return TRUE
end
Should work.
 

Similar threads

Back
Top