If counter-terrostist win then
each counter-terrorist player will receive: coins[id]=coins[id]+100
\\
I would ask for an example script, thanks.
Scripts
Reward for end
Reward for end
1

endround addhook('endround','endround_hook')
function endround_hook(mode)
if mode==2 then
for _, id in ipairs(player(0, "team2")) do
coins[id]=coins[id]+100
end
end
end
function end_hook(mode)
if mode==2 then
for k,id in ipairs(player(0,"team2")) do
coins[id]=coins[id]+100
end
end
end
addhook("endround","end_hook")
KingShadow: What is that? You do not know how to code, so try to not help at things which you don't know.
Masea: what is your problem with me ? i just writing too fast so i made that :v also i forgot to add id in ipairs
KingShadow: His issue is that your code doesn't do what the person asked and that's very annoying. Please don't do that. If you don't fully understand the request, don't post. If you want to understand the request, ask.
Yates has written
KingShadow: His issue is that your code doesn't do what the person asked and that's very annoying. Please don't do that. If you don't fully understand the request, don't post. If you want to understand the request, ask.
KingShadow has written
KingShadow has written
tos12345678 wants anyway.--HOOK--
addhook("endround","end_hook")
addhook("join","join_hook")
--TABLES--
coins = {}
--FUNCTIONS--
function join_hook(id)
coins[id] = 0
end
function end_hook(mode)
if mode == 2 then
for _,id in pairs(playerlist) do
if player(id, 'team') == 2 then
coins[id] = coins[id] + 100
end
end
end
end
princeofpersia: You did not call anything like playerlist = player(0,"table")so your code will just bug out at line 18. Just do what
KingShadow and
Baloon did with the looping.
endround). If you want to factor that, try this:addhook("endround","end_hook")
function end_hook(mode)
	if mode == 2 or mode == 22 or (mode%10 == 1 and mode > 1) then
		for _, id in pairs(player(0,"team2")) do
			coins[id] = coins[id] + 100
		end
	end
end
1
