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

Change Sex Doll and Frag Doll

Rethen

New Member
Joined
Apr 16, 2010
Messages
215
Reaction score
2
I wanna have a doll that changes the sex of your gender, if you click it changes...

Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Frag Remover" version="1.1" author="Hermes" contact="otland.net" enabled="yes">
    <action itemid="9969" event="script"><![CDATA[
        local noRemove = {SKULL_WHITE, SKULL_YELLOW}
        local playerSkull = getPlayerSkullType(cid)
        if isInArray(noRemove, playerSkull) then
            doPlayerSendCancel(cid, "You can't remove this type of skull.")
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
            return true
        elseif playerSkull == SKULL_NONE then
            doPlayerSendCancel(cid, "You don't have skull.")
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
            return true
        else
            db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
            doPlayerSendTextMessage(cid, 27, "Your frags & your skull have been removed!")
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
            doSendAnimatedText(getPlayerPosition(cid), "POFF!", 180)
            doCreatureSetSkullType(cid,0)
            doPlayerSetSkullEnd(cid, 0, playerSkull)
            doRemoveItem(item.uid, 1)
        end
        return true
    ]]></action>
</mod>



this is a mod.xml from hermes, but i want it in lua.. like i put in actions...


I also would need a doll that reset your frags, it should reset both black skull and red skull to 0
 
Last edited:
Try
PHP:
function onUse(cid, item, fromPosition, item2, toPosition)
        local noRemove = {SKULL_WHITE, SKULL_YELLOW}
        local playerSkull = getPlayerSkullType(cid)
        if isInArray(noRemove, playerSkull) then
            doPlayerSendCancel(cid, "You can't remove this type of skull.")
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
            return true
        elseif playerSkull == SKULL_NONE then
            doPlayerSendCancel(cid, "You don't have skull.")
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
            return true
        else
            db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
            doPlayerSendTextMessage(cid, 27, "Your frags & your skull have been removed!")
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
            doSendAnimatedText(getPlayerPosition(cid), "POFF!", 180)
            doCreatureSetSkullType(cid,0)
            doPlayerSetSkullEnd(cid, 0, playerSkull)
            doRemoveItem(item.uid, 1)
        end
        return true
end

and

change sex doll
PHP:
function onUse(cid, item, fromPosition, item2, toPosition)
local sexs = {
[1] = {s=1},
[1] = {s=0}
}
local sex = sexs[getPlayerSex(cid)]
	if sex then
		doPlayerSetSex(cid,sex.s)
		doRemoveItem(item.uid,1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Your sex has been changed")
	end
return true
end
 
Last edited:
Back
Top