warriorfrog
Active Member
- Joined
- Jul 29, 2015
- Messages
- 334
- Reaction score
- 35
Is anybody know how to send a Global MSG according to the player storage?
I've tried this, but not work:
I've tried this, but not work:
Code:
local txtENG = {
"ENG 1",
"ENG 2",
"ENG 3"
}
local txtPT = {
"PT 1",
"PT 2",
"PT 3"
}
local txtESP = {
"ESP 1",
"ESP 2",
"ESP 3"
}
local idiomstorage = 8971
local i = 0
function onThink(interval, lastExecution)
local message
if getPlayerStorageValue(cid, idiomstorage) <= 1 then
message = txtENG[(i % #txtENG) + 1]
elseif getPlayerStorageValue(cid, idiomstorage) == 2 then
message = txtPT[(i % #txtPT) + 1]
elseif getPlayerStorageValue(cid, idiomstorage) == 3 then
message = txtESP[(i % #txtESP) + 1]
end
for _, pid in ipairs(getPlayersOnline()) do
doPlayerSendTextMessage(pid, 20, " [MSG]: ".. message ..". ")
i = i + 1
end
return TRUE
end