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

TFS 1.4 Onuse - Receive addons for outfit.

tago360

Member
Joined
Apr 3, 2008
Messages
49
Reaction score
6
Hello I am not best a scripting but made simple script for others to use aswell.

When you use the chest it will give you either one or two addons, depends what you put after the addon id number. 1 is addon 1 2 is addon 2 and 3 is addon 1 and 2 together. Also added if a staff member you will get a pop up saying that your staff and already have the outfits depends on what staff you give all outfits to. Also gives addon depending on sex.

Use on switch or w/e in my case of testing I used a chest Itemid: 21584 with a unique id of 10000 giving you a stage value of 12050

Lua:
----TAGO360----

function onUse(cid, item, frompos, item2, topos, isHotkey)

if getPlayerGroupId(cid, 2) >=2 then
    doPlayerPopupFYI(cid, "You are a staff member, You already have all outfits!")
    doPlayerSendTextMessage(cid,25,"You already have all outfits.")
    doSendMagicEffect(getCreaturePosition(cid), 3)
elseif item.uid == 10000 then         
if (getPlayerStorageValue(cid,12050) == -1) and getPlayerSex(cid) == 1 then
    doPlayerPopupFYI(cid, "Reward: Full Citizen Outfit.")
    doPlayerSendTextMessage(cid,21,"What a handsom man you are, You now have the Full Citizen Outfit!")
    doPlayerAddOutfit(cid, 128, 3)
    setPlayerStorageValue(cid,12050,1)
    doSendMagicEffect(getCreaturePosition(cid), 49)
    doSendMagicEffect(getCreaturePosition(cid), 50)
else if(getPlayerStorageValue(cid,12050) == -1) and getPlayerSex(cid) == 0 then
    doPlayerPopupFYI(cid, "Reward: Full Citizen Outfit.")
    doPlayerSendTextMessage(cid,21,"What a beautiful woman you are, You now have the Full Citizen Outfit!")
    doPlayerAddOutfit(cid, 136, 3)
    setPlayerStorageValue(cid,12050,1)
    doSendMagicEffect(getCreaturePosition(cid), 49)
    doSendMagicEffect(getCreaturePosition(cid), 50)
else
    doPlayerPopupFYI(cid, "You already have the addons.")
    doPlayerSendTextMessage(cid,25,"You already have the Addons.")
    doSendMagicEffect(getCreaturePosition(cid), 3)
    end
end
        return true
    end
end
 
Last edited:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local player = Player(cid)
if player:getStorageValue(12050) ~= 1 then
doPlayerSendTextMessage(cid,22,"You recived Citizen Addon.")
player:addOutfitAddon(136,3)
player:addOutfitAddon(128,3)
player:setStorageValue(12050, 1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE)
elseif player:getStorageValue(12050) == 1 then
doPlayerSendTextMessage(cid,22,"You have already have this addon.")
end
return true
end
Hello I am not best a scripting but made simple script for others to use aswell.

When you use the chest it will give you either one or two addons, depends what you put after the addon id number. 1 is addon 1 2 is addon 2 and 3 is addon 1 and 2 together. Also added if a staff member you will get a pop up saying that your staff and already have the outfits depends on what staff you give all outfits to. Also gives addon depending on sex.

Use on switch or w/e in my case of testing I used a chest Itemid: 21584 with a unique id of 10000 giving you a stage value of 12050

Lua:
----TAGO360----

function onUse(cid, item, frompos, item2, topos, isHotkey)

if getPlayerGroupId(cid, 2) >=2 then
    doPlayerPopupFYI(cid, "You are a staff member, You already have all outfits!")
    doPlayerSendTextMessage(cid,25,"You already have all outfits.")
    doSendMagicEffect(getCreaturePosition(cid), 3)
elseif item.uid == 10000 then        
if (getPlayerStorageValue(cid,12050) == -1) and getPlayerSex(cid) == 1 then
    doPlayerPopupFYI(cid, "Reward: Full Citizen Outfit.")
    doPlayerSendTextMessage(cid,21,"What a handsom man you are, You now have the Full Citizen Outfit!")
    doPlayerAddOutfit(cid, 128, 3)
    setPlayerStorageValue(cid,12050,1)
    doSendMagicEffect(getCreaturePosition(cid), 49)
    doSendMagicEffect(getCreaturePosition(cid), 50)
else if(getPlayerStorageValue(cid,12050) == -1) and getPlayerSex(cid) == 0 then
    doPlayerPopupFYI(cid, "Reward: Full Citizen Outfit.")
    doPlayerSendTextMessage(cid,21,"What a beautiful woman you are, You now have the Full Citizen Outfit!")
    doPlayerAddOutfit(cid, 136, 3)
    setPlayerStorageValue(cid,12050,1)
    doSendMagicEffect(getCreaturePosition(cid), 49)
    doSendMagicEffect(getCreaturePosition(cid), 50)
else
    doPlayerPopupFYI(cid, "You already have the addons.")
    doPlayerSendTextMessage(cid,25,"You already have the Addons.")
    doSendMagicEffect(getCreaturePosition(cid), 3)
    end
end
        return true
    end
end
Post automatically merged:

function onUse(cid, item, fromPosition, itemEx, toPosition)
local player = Player(cid)
if player:getStorageValue(12050) ~= 1 then
doPlayerSendTextMessage(cid,22,"You recived Citizen Addon.")
player:addOutfitAddon(136,3)
player:addOutfitAddon(128,3)
player:setStorageValue(12050, 1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE)
elseif player:getStorageValue(12050) == 1 then
doPlayerSendTextMessage(cid,22,"You have already have this addon.")
end
return true
end
Hello I am not best a scripting but made simple script for others to use aswell.

When you use the chest it will give you either one or two addons, depends what you put after the addon id number. 1 is addon 1 2 is addon 2 and 3 is addon 1 and 2 together. Also added if a staff member you will get a pop up saying that your staff and already have the outfits depends on what staff you give all outfits to. Also gives addon depending on sex.

Use on switch or w/e in my case of testing I used a chest Itemid: 21584 with a unique id of 10000 giving you a stage value of 12050

Lua:
----TAGO360----

function onUse(cid, item, frompos, item2, topos, isHotkey)

if getPlayerGroupId(cid, 2) >=2 then
    doPlayerPopupFYI(cid, "You are a staff member, You already have all outfits!")
    doPlayerSendTextMessage(cid,25,"You already have all outfits.")
    doSendMagicEffect(getCreaturePosition(cid), 3)
elseif item.uid == 10000 then        
if (getPlayerStorageValue(cid,12050) == -1) and getPlayerSex(cid) == 1 then
    doPlayerPopupFYI(cid, "Reward: Full Citizen Outfit.")
    doPlayerSendTextMessage(cid,21,"What a handsom man you are, You now have the Full Citizen Outfit!")
    doPlayerAddOutfit(cid, 128, 3)
    setPlayerStorageValue(cid,12050,1)
    doSendMagicEffect(getCreaturePosition(cid), 49)
    doSendMagicEffect(getCreaturePosition(cid), 50)
else if(getPlayerStorageValue(cid,12050) == -1) and getPlayerSex(cid) == 0 then
    doPlayerPopupFYI(cid, "Reward: Full Citizen Outfit.")
    doPlayerSendTextMessage(cid,21,"What a beautiful woman you are, You now have the Full Citizen Outfit!")
    doPlayerAddOutfit(cid, 136, 3)
    setPlayerStorageValue(cid,12050,1)
    doSendMagicEffect(getCreaturePosition(cid), 49)
    doSendMagicEffect(getCreaturePosition(cid), 50)
else
    doPlayerPopupFYI(cid, "You already have the addons.")
    doPlayerSendTextMessage(cid,25,"You already have the Addons.")
    doSendMagicEffect(getCreaturePosition(cid), 3)
    end
end
        return true
    end
end
Post automatically merged:

function onUse(cid, item, fromPosition, itemEx, toPosition)
local player = Player(cid)
if player:getStorageValue(12050) ~= 1 then
doPlayerSendTextMessage(cid,22,"You recived Citizen Addon.")
player:addOutfitAddon(136,3)
player:addOutfitAddon(128,3)
player:setStorageValue(12050, 1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE)
elseif player:getStorageValue(12050) == 1 then
doPlayerSendTextMessage(cid,22,"You have already have this addon.")
end
return true
end

Post automatically merged:

function onUse(cid, item, fromPosition, itemEx, toPosition)
local player = Player(cid)
if player:getStorageValue(12050) ~= 1 then
doPlayerSendTextMessage(cid,22,"You recived Citizen Addon.")
player:addOutfitAddon(136,3)
player:addOutfitAddon(128,3)
player:setStorageValue(12050, 1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE)
elseif player:getStorageValue(12050) == 1 then
doPlayerSendTextMessage(cid,22,"You have already have this addon.")
end
return true
end
try it with hero statue
<action actionid="32545" script="addon system/Citizen.lua" />
 
XML:
<action uniqueid="10000" script="addon system/Citizen.lua" />

Lua:
local outfits = {
    [10000] = {name = "Citizen", storage = 12050, male = 128, female = 136, addons = 3
        maleMsg = "What a handsom man you are, You now have the Full Citizen Outfit!",
        femaleMsg = "What a beautiful woman you are, You now have the Full Citizen Outfit!",
    }
    -- Add more outfits here --
}

function onUse(cid, item, frompos, item2, topos, isHotkey)
    local OUTFIT = outfits[item.uid]
    if not OUTFIT then return true end
   
    local pPos = getCreaturePosition(cid)
   
    if getPlayerGroupId(cid) >= 2 then
        doPlayerPopupFYI(cid, "You are a staff member, You already have all outfits!")
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You already have all outfits.")
        doSendMagicEffect(pPos, CONST_ME_POFF)
        return true
    end

    if getPlayerStorageValue(cid, OUTFIT.storage) ~= -1 then
        doPlayerPopupFYI(cid, "You already have the addons.")
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You already have the "..OUTFIT.name.." addons.")
        doSendMagicEffect(pPos, CONST_ME_POFF)
        return true
    end

    if getPlayerSex(cid) == 0 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, OUTFIT.femaleMsg)
        doPlayerAddOutfit(cid, OUTFIT.female, OUTFIT.addons)
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, OUTFIT.maleMsg)
        doPlayerAddOutfit(cid, OUTFIT.male, OUTFIT.addons)
    end

    doPlayerPopupFYI(cid, "Reward: Full "..OUTFIT.name.." Outfit.")
    setPlayerStorageValue(cid, OUTFIT.storage, 1)
    doSendMagicEffect(pPos, CONST_ME_YELLOWENERGY)
    doSendMagicEffect(pPos, CONST_ME_HOLYAREA)
    return true
end
 
Last edited:
XML:
<action uniqueid="10000" script="addon system/Citizen.lua" />

Lua:
local outfits = {
    [10000] = {name = "Citizen", storage = 12050, male = 128, female = 136, addons = 3
        maleMsg = "What a handsom man you are, You now have the Full Citizen Outfit!",
        femaleMsg = "What a beautiful woman you are, You now have the Full Citizen Outfit!",
    }
    -- Add more outfits here --
}

function onUse(cid, item, frompos, item2, topos, isHotkey)
    local OUTFIT = outfits[item.uid]
    if not OUTFIT then return true end
  
    local pPos = getCreaturePosition(cid)
  
    if getPlayerGroupId(cid) >= 2 then
        doPlayerPopupFYI(cid, "You are a staff member, You already have all outfits!")
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You already have all outfits.")
        doSendMagicEffect(pPos, CONST_ME_POFF)
        return true
    end

    if getPlayerStorageValue(cid, OUTFIT.storage) ~= -1 then
        doPlayerPopupFYI(cid, "You already have the addons.")
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You already have the "..OUTFIT.name.." addons.")
        doSendMagicEffect(pPos, CONST_ME_POFF)
        return true
    end

    if getPlayerSex(cid) == 0 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, OUTFIT.femaleMsg)
        doPlayerAddOutfit(cid, OUTFIT.female, OUTFIT.addons)
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, OUTFIT.maleMsg)
        doPlayerAddOutfit(cid, OUTFIT.male, OUTFIT.addons)
    end

    doPlayerPopupFYI(cid, "Reward: Full "..OUTFIT.name.." Outfit.")
    setPlayerStorageValue(cid, OUTFIT.storage, 1)
    doSendMagicEffect(pPos, CONST_ME_YELLOWENERGY)
    doSendMagicEffect(pPos, CONST_ME_HOLYAREA)
    return true
end
Thanks Itutorial for the more organized way ill learn off this script :)
 
What errors and if its 1.4 it shouldn't be coded the way it is at all.
1.4
Lua:
local outfits = {
    [10000] = {name = "Citizen", storage = 12050, male = 128, female = 136, addons = 3
        maleMsg = "What a handsom man you are, You now have the Full Citizen Outfit!",
        femaleMsg = "What a beautiful woman you are, You now have the Full Citizen Outfit!",
    }
    -- Add more outfits here --
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local OUTFIT = outfits[item.uid]
    if not OUTFIT then return true end
   
    if player:getGroup():getAccess() and player:getAccountType() >= ACCOUNT_TYPE_GAMEMASTER then
        player:popupFYI("You are a staff member, You already have all outfits!")
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
        return player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "You already have all outfits.")
    end

    if player:getStorageValue(OUTFIT.storage) ~= -1 then
        player:popupFYI("You already have the addons.")
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
        return player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "You already have the "..OUTFIT.name.." addons.")
    end

    if player:getSex() == 0 then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, OUTFIT.femaleMsg)
        player:addOutfit(OUTFIT.female, OUTFIT.addons)
    else
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, OUTFIT.maleMsg)
        player:addOutfit(OUTFIT.male, OUTFIT.addons)
    end

    player:setStorageValue(OUTFIT.storage, 1)
    player:getPosition():sendMagicEffect(CONST_ME_YELLOWENERGY)
    player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)
    return player:popupFYI("Reward: Full "..OUTFIT.name.." Outfit.")
end
 
Last edited:
What errors and if its 1.4 it shouldn't be coded the way it is at all.
1.4
Lua:
local outfits = {
    [10000] = {name = "Citizen", storage = 12050, male = 128, female = 136, addons = 3
        maleMsg = "What a handsom man you are, You now have the Full Citizen Outfit!",
        femaleMsg = "What a beautiful woman you are, You now have the Full Citizen Outfit!",
    }
    -- Add more outfits here --
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local OUTFIT = outfits[item.uid]
    if not OUTFIT then return true end
  
    if player:getGroup():getAccess() and player:getAccountType() >= ACCOUNT_TYPE_GAMEMASTER then
        player:popupFYI("You are a staff member, You already have all outfits!")
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
        return player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "You already have all outfits.")
    end

    if player:getStorageValue(OUTFIT.storage) ~= -1 then
        player:popupFYI("You already have the addons.")
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
        return player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "You already have the "..OUTFIT.name.." addons.")
    end

    if player:getSex() == 0 then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, OUTFIT.femaleMsg)
        player:addOutfit(OUTFIT.female, OUTFIT.addons)
    else
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, OUTFIT.maleMsg)
        player:addOutfit(OUTFIT.male, OUTFIT.addons)
    end

    player:setStorageValue(OUTFIT.storage, 1)
    player:getPosition():sendMagicEffect(CONST_ME_YELLOWENERGY)
    player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)
    return player:popupFYI("Reward: Full "..OUTFIT.name.." Outfit.")
end
What can I do if in my tfs 1.4 sources these functions are commented to grant permanent outfit to the player?
 
Back
Top