waqmaz
Member
- Joined
- Jun 17, 2015
- Messages
- 203
- Reaction score
- 11
TFS 0.3.6
How can I reset storages of all players and still display message from a loop?
How can I reset storages of all players and still display message from a loop?
Code:
function onKill(cid, target)
if isMonster(target) and isPlayer(cid) then
local tmp = bossHighestDmg[getCreatureName(target):lower()]
local players = {}
if tmp then
for i = 1, #tmp, 1 do
for _, pid in pairs(getPlayersOnline()) do
-- this is the message I want to be displayed before setting storage to -1
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, getPlayerName(pid)..': '..getCreatureStorage(pid, 11005))
end
-- this does not work, message displays for one player correct storages but for second player -1 storages
doCreatureSetStorage(cid, 11005, -1)
end
end
end
return true
end
Last edited: