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

Script Fix

eduardoo.vieira

New Member
Joined
Jun 10, 2011
Messages
21
Reaction score
1
Hey brothers, i'm here today for request a fix in the changegender mod... I want to when the player change your gender, he lost 3 vip days, and if he is not a vip player he cant use this command. I tried to change in the script, getplayerpremdays to vipdays, and removepremdays to vip days(....), and i can't get this, i got errors. If anyone could make this for me i will give rep++ :D
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Change gender command" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes">
	<description>
		This mod will add new command for players - !changender.
		Players will be able to change gender, cost can be configured.
	</description>

	<config name="changender_config"><![CDATA[
		config = {
			costVipDays = 3
		}
	]]></config>
	<talkaction words="!changender" event="buffer"><![CDATA[
		domodlib('changender_config')
		if(getPlayerSex(cid) >= 2) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot change your gender.")
			return
		end

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

		if(getPlayerVipDays(cid) < 65535) then
			doPlayerAddVipDays(cid, -config.costVipDays)
		end

		doPlayerSetSex(cid, getPlayerSex(cid) == PLAYERSEX_FEMALE and PLAYERSEX_MALE or PLAYERSEX_FEMALE)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your gender and lost " .. config.costVipDays .. " days of premium time.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
	]]></talkaction>
</mod>
 
Back
Top