Thank you in advance
Edit ;
For who did not understand I want a script like this, prohibit buy 1 round and another not the AWP gun.
edited 1×, last 17.02.17 05:06:59 pm
round = 1 addhook("endround", "e_endround") function e_endround() round = round + 1 end addhook("buy", "e_buy") function e_buy(id, wp) if (wp == 35 and round%2 == 0) then return 1 end end
then. Besides, I can shorten your code to this:
addhook("buy","e_buy") function e_buy(id,wp) 	if wp == 35 and (tonumber(game("round"))%2 == 0) then 		return 1 	end end
awpcooldown = 2 -- How many rounds to wait before you can buy another AWP awplocked = {} awplockround = {} addhook("join","e_join") function e_join(id) 	awplocked[id] = false 	awplockround[id] = 0 end addhook("leave","e_leave") function e_leave(id) 	awplocked[id] = nil 	awplockround[id] = nil end addhook("endround","e_endround") function e_endround() 	for _, id in ipairs(player(0,"table")) do 		if awplocked[id] then 			awplockround[id] = awplockround[id] + 1 			if awplockround[id] == awpcooldown then 				awplocked[id] = false 				awplockround[id] = 0 			end 		end 	end end addhook("buy","e_buy") function e_buy(id,wp) 	if wp == 35 then 		if awplocked[id] then 			msg2(id,"\169255000000You can't buy another AWP until "..(awpcooldown-awplockround[id]).." round(s) later!") 			return 1 		else 			awplocked[id] = true 		end 	end end
niljust to get that tiny bit of performance improvement, if it is even noticeable.