If counter-terrostist win then
each counter-terrorist player will receive: coins[id]=coins[id]+100
\\
I would ask for an example script, thanks.
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")
--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
playerlist = player(0,"table")so your code will just bug out at line 18. Just do what KingShadow and Baloon did with the looping.
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