Wesquel

changender_command

Jan 21st, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <mod name="Change gender command" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="no">
  3. <description>
  4. This mod will add new command for players - !changender.
  5. Players will be able to change gender, cost can be configured.
  6. </description>
  7.  
  8. <config name="changender_config"><![CDATA[
  9. config = {
  10. costPremiumDays = 3
  11. }
  12. ]]></config>
  13. <talkaction words="!changender" event="buffer"><![CDATA[
  14. domodlib('changender_config')
  15. if(getPlayerSex(cid) >= 2) then
  16. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot change your gender.")
  17. return
  18. end
  19.  
  20. if(getPlayerPremiumDays(cid) < config.costPremiumDays) then
  21. doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, not enough premium time - changing gender costs " .. config.costPremiumDays .. " premium days.")
  22. doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
  23. return
  24. end
  25.  
  26. if(getPlayerPremiumDays(cid) < 65535) then
  27. doPlayerAddPremiumDays(cid, -config.costPremiumDays)
  28. end
  29.  
  30. doPlayerSetSex(cid, getPlayerSex(cid) == PLAYERSEX_FEMALE and PLAYERSEX_MALE or PLAYERSEX_FEMALE)
  31. doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your gender and lost " .. config.costPremiumDays .. " days of premium time.")
  32. doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
  33. ]]></talkaction>
  34. </mod>
Advertisement
Add Comment
Please, Sign In to add comment