Hi again!
I have done a script of "PayDay" for a team, but it doesn't work
Someone can help me?
(The team isn't the problem, it is created correctly in the same resource and works in the game)
It's strange but I used this strcture because I saw it in a resource
addEventHandler("onResourceStart", function genPayDay(player) if getPlayerTeam(player, "gen") then
outputChatBox ( "*------------ payday ------------", value, 0, 255, 0)
outputChatBox ( "*text1", value, 0, 255, 0)
outputChatBox ( "*text2", value, 0, 255, 0)
outputChatBox ( "*text3", value, 0, 255, 0)
for i, v in ipairs(getElementsByType("player")) do
givePlayerMoney ( value, 500 )
setTimer ( genPayDay, 10000, 0 )
end
else
end
end
)
(the timer is 10s only for test it, when it works i will put 24 minutes)
I've test 100000 ways of code that looks better than this thing before -.- anyone has worked..
If someone can fix it or give another suggestion I'd be so pleased
console:
Problem here:
addEventHandler("onResourceStart", function genPayDay(player) if getPlayerTeam(player, "gen") then
(But I have seen this in a resource that works correctly._.)
Thanks!
(sorry for my english and if the script looks made by a baby )