So in my login script i have a script whom removes all outfits you obtain in real tibia by quests, and adds a storage value to all player whom got all outfits deleted. This is nessecary in Tfs because all players start with all outfits.
This is the script i use
(It has some other stuff in it as well.) This script works fine and removes the correct outfits
Now i tried to add a quest which gives you an outfit depending on your characters sex.
It starts without errors but no outfit is added. You recieve the correct message depending on your sex but the chest is opened as a container and the second time you open it the text "It is empty." won't appear... And no outfit is added to the character!
If anyone know what i might do wrong or has the will / time to correct me then i really appreciate it.
Thanks in advance!
//Massen
This is the script i use
(It has some other stuff in it as well.) This script works fine and removes the correct outfits
Code:
function onLogin(cid)
registerCreatureEvent(cid, "PlayerDeath")
local minute = 10 -- interval in minutes
local minutes = minute * 60 * 1000 -- dont edit
if isPlayer(cid) then
queststatus = getPlayerStorageValue(cid, 25019)
if queststatus == -1 then
if getPlayerSex(cid)==0 then
doPlayerRemOutfit(cid,146,0)
doPlayerRemOutfit(cid,151,0)
doPlayerRemOutfit(cid,152,0)
doPlayerRemOutfit(cid,153,0)
doPlayerRemOutfit(cid,154,0)
doPlayerRemOutfit(cid,251,0)
doPlayerRemOutfit(cid,268,0)
doPlayerRemOutfit(cid,273,0)
doPlayerRemOutfit(cid,278,0)
setPlayerStorageValue(cid,25019,1)
elseif getPlayerSex(cid)==1 then
doPlayerRemOutfit(cid,150,0)
doPlayerRemOutfit(cid,155,0)
doPlayerRemOutfit(cid,156,0)
doPlayerRemOutfit(cid,157,0)
doPlayerRemOutfit(cid,158,0)
doPlayerRemOutfit(cid,252,0)
doPlayerRemOutfit(cid,269,0)
doPlayerRemOutfit(cid,270,0)
doPlayerRemOutfit(cid,279,0)
setPlayerStorageValue(cid,25019,1)
else
doPlayerSendTextMessage(cid,22,"Just a temporary already removed outfits message.")
end
end
end
if(alryInitServSave == 0) then
local eventServ = addEvent(autoSavePlayers, minutes, {})
alryInitServSave = eventServ
end
return 1
end
function autoSavePlayers(parameters)
saveData()
print("Server save...")
local eventServ = addEvent(autoSavePlayers, minutes, parameters)
alryInitServSave = eventServ
end
Code:
function onUse(cid, item, frompos, item2, topos)
if item.uid == 25020 then
queststatus = getPlayerStorageValue(cid,25020)
if queststatus == -1 then
if getPlayerSex(cid)==0 then
doPlayerSendTextMessage(cid,22,"you recieved the female outfit")
doPlayerAddOutfit(cid,150,0)
setPlayerStorageValue(cid,25020,1)
elseif
getPlayerSex(cid)==1 then
doPlayerSendTextMessage(cid,22,"you recieved the male outfit")
doPlayerAddOutfit(cid,146,0)
setPlayerStorageValue(cid,25020,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
end
end
end
If anyone know what i might do wrong or has the will / time to correct me then i really appreciate it.
Thanks in advance!
//Massen