Forum

> > CS2D > Scripts > Free Image CMD Possibilities?
Forums overviewCS2D overview Scripts overviewLog in to reply

English Free Image CMD Possibilities?

11 replies
To the start Previous 1 Next To the start

old Free Image CMD Possibilities?

Alistaire
User Off Offline

Quote
Is it possible to make something like this?

- When you equip knife, gfx/modname/skin1.png is free image over player

- When you equip AWP, gfx/modname/skin2.png is free image over player

- When you shoot AWP, it will shoot a sprite from your muzzle too

- When you scope or reload the AWP, there will also be custom free images

old Re: Free Image CMD Possibilities?

if
User Off Offline

Quote
I have seen a mod like this before, the sprite changes when you swap gun but it can't always completely cover player.

old Re: Free Image CMD Possibilities?

Bowlinghead
User Off Offline

Quote
Try to use
1
freeimage(id)

Example:
With the knife
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function equip_knife_get_img(id)
	parse("equip "..id.." 50")
	image("modname/skin1.png",1,1,200)
end
addhook("serveraction","lol")
function lol(id,b)
	if b==1 then
		menu(id,"Hello,Knife?|Get4free")
	end
end
addhook("menu","lol2")
function lol2(id,t,b)
	if t=="Hello" then
		if b==1 then
			equip_knife_get_img(id)
		end
	end
end
-- untestet

old Re: Free Image CMD Possibilities?

Alistaire
User Off Offline

Quote
I mean more of this;

1
2
3
4
5
6
7
8
9
function equipimg(id)
	if weapon = knife then
		freeimage(id)
		id = image("Loldirectory/Lolpath/Lolimg.png")
	elseif weapon = AWP then
		freeimage(id)
		id = image("Loldirectory/Lolpath/Lolimg2.png")
	end
end

old Re: Free Image CMD Possibilities?

Bowlinghead
User Off Offline

Quote
Oh...
Your key is
1
player(id,"weapontype")


Maybe this? (I never made something like that)

1
2
3
4
5
6
7
8
9
10
11
12
13
-- Untestet
addhook("ms100","checkpl")
function checkpl()
	for _, id in ipairs(player(0,"tabeliving")) do -- Death people have no weapons! :D
		if player(id,"weapontype")==50 then
			 freeimage(id)
          			id = image("Loldirectory/Lolpath/Lolimg.png")
		elseif player(id,"weapontype")==<AWP-ID (I forgot)> then
			 freeimage(id)
        			  id = image("Loldirectory/Lolpath/Lolimg2.png")
		end
	end
end

If there are tab-fails then
Made on this page sry!

old Re: Free Image CMD Possibilities?

Alistaire
User Off Offline

Quote
Do you possibly have one for the weapon state too?

Like

1
2
3
4
5
6
7
8
9
10
11
12
13
if playerweapon = 50 then
	if playerweapon.weaponstate = 1 then
		freeimage(id)
		id = image("lolshitetc.png")
	elseif playerweapon.weaponstate = 2 then
		freeimage(id)
		id = image("secondlolshitetc.png")
	end
elseif playerweapon = 35 then
	if shit
elseif playerweapon = over 9000 then
	if shit
end

old Re: Free Image CMD Possibilities?

Alistaire
User Off Offline

Quote
user Apache uwu has written
Ability to set weapon ammo counts.

EX.

1
2
equip 1 23
ammoset 1 23 0

ammoset <player> <weaponid> <ammo count>

As well as setting attack2

example...

1
2
equip 1 1
wpnstate 1 1 0

wpnstate <player> <weapon> <state>

State is like laser color, silencer, etc.


Like that. If wpnstate (id,35,1) means like player X has an AWP, non-scoped. If wpnstate (id,35,2) then it's scoped once.

Is that possible?

old Re: Free Image CMD Possibilities?

EngiN33R
Moderator Off Offline

Quote
There's a hook called select(id,type,mode), which is triggered on weapon switch. id - player ID, type - weapon type, mode - weapon mode. Try and devise something using that hook.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview