
I found no identical or similar scripts in the F.A. (my bleeding debuff is a crap y'all know) and so there is my vision of debuffs and buffs scripts.
Ladies and gentlemen, welcome:

Description: de'buff(next d'b) script is a kind of imposed effects which might be or good(health regeneration, saving ammo and others) or bad(bleeding, slow down and others). This script is realised with small hud interface that might tell You all needed information about current d'b You has.
I have put some examples in the db.lua already, You can try them by using commands:

db.all(id)- simply imposes all d'b to the player

db.remove(id,'Name')- removes a specific d'b

db.add(id,'Name'[,source])- adds a specific d'b to the player.
'Name' in both commands is uses string.lower() and string.gsub(Name,'_',' ') (since cs2d console is not loving "Space bettween words") so in the console You might type /lua db.add(1,'Ammo_save') and it will work.
^ keep in mind if You want to use new hook for Your d'b, You might firstly add this hook(if not exists) and set options there:
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
db.attack = function(id) 	for k,v in pairs(Players[id].db_table) do 		for key, value in pairs(db.list[k].Hooks) do 			if key == "attack" then 				db.list[k].Hooks[key](id) 			end 		end 	end end addhook("attack","db.attack")


edited 2×, last 23.08.22 09:43:42 am
Approved by Infinite Rain
Download
56 kb, 258 Downloads