Forum

> > CS2D > Scripts > Super Armor GFX
Forums overviewCS2D overview Scripts overviewLog in to reply

English Super Armor GFX

7 replies
To the start Previous 1 Next To the start

old Re: Super Armor GFX

Apache uwu
User Off Offline

Quote
I believe you can change it via:

*/gfx/weapons/superarmor_d.bmp
*/gfx/weapons/superarmor.bmp

However if you want to change it server-sided--that's a bit difficult.

Potentially what you want to achieve is an image following the player and rotating.

cs2d lua hook collect or cs2d lua hook walkover and cs2d lua cmd image

You just need to place an image when the player picks up super-armor (83).

The image has 4 parameters.

> Image Location, just place your "custom" image in /gfx for organization

> Set X to 1, so the image will rotate with the player

> Set Y to 0, so the image won't show up on other players' screens on FOW

> Set mode to id+200 to draw over the player

When your script is done make sure to add your custom image into "sys/servertransfer.cfg".

Good Luck √

old Re: Super Armor GFX

EngiN33R
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
armorimg={}
for i=1,32 do
armorimg[i]=0
end

addhook("ms100","checkforarmor")
function checkforarmor()
for _,i in ipairs(player(0,"tableliving")) do
if (player(i,"armor")==205 and armorimg[i]==0) then
armorimg[i]=image("whateveryourimageis",1,0,200+i)
else
if (armorimg[i]~=0) then
freeimage(armorimg[i])
armorimg[i]=0
end
end
end
end

Eh. There shouldn't be any bugs but if there are, tell me.

I used the ms100 hook to be certain that a player has the super armor, and to account for the setarmor function. It can be done via collect/walkover hooks too.

old Re: Super Armor GFX

EngiN33R
Moderator Off Offline

Quote
Holy shit, 4 months.

Yes, you will put the image of the armor in that table, as I showed here:

user EngiN33R has written
1
armorimg[i]=image("whateveryourimageis",1,0,200+i)
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview