Forum

> > CS2D > Scripts > Reload Script
Forums overviewCS2D overview Scripts overviewLog in to reply

English Reload Script

6 replies
To the start Previous 1 Next To the start

old Reload Script

Baofu92
User Off Offline

Quote
I need to do this simple script (i think )

At reload start the script create a gfx on the ground that disappeard after 30 sec (for all playing players).

old Re: Reload Script

Kurumi
User Off Offline

Quote
1
2
3
addhook("reload","clip.drop")					function reload(id,1)
image("weapons/clip_d.bmp",x<=0,y>0,id+100,0)	
end

Maybe can someone fix this?

(Sorry my TAB key doesnt work)

old Re: Reload Script

Surplus
User Off Offline

Quote
Genesis i can tell you that your function is wrong. It supposed to be clip.drop

old Re: Reload Script

TimeQuesT
User Off Offline

Quote
Genesis.. you selected the wrong "mode"

image("weapons/clip_d.bmp",x<=0,y>0,id+100,0) <-- now the image will follow and rotating with the player.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
clip = {}
clipcounter = {}
counter = 0

addhook("reload","reloadimg")                
function reloadimg(id,1)
counter = counter + 1
clip[counter] = image("weapons/clip_d.bmp",player(id,"x"),player(id,"y"),0) 
timer(100,"dissapear",counter,-1)
end

function dissapear(counter)
clipcounter[counter] = clipcounter[counter] + 1
if (clipcounter[counter]==100) then
clipcounter[counter] = 0
freeimage(clip[counter])
freetimer("dissapear",counter)
end
end

this should work...

old Re: Reload Script

Baofu92
User Off Offline

Quote
Don't work!!
Can anybody help me?
The image must stay on the ground not following the player!

old Re: Reload Script

Banaan
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
clip = {}
clipcounter = {}
counter = 0

addhook("reload","reloadimg")
function reloadimg(id,1)
counter = counter + 1
clip[counter] = image("weapons/clip_d.bmp",0,1,0)
imagepos(clip[counter],player(id,"x"),player(id,"y"),player(id,"rot")
timer(100,"dissapear",counter,-1)
end

function dissapear(counter)
clipcounter[counter] = clipcounter[counter] + 1
if (clipcounter[counter]==100) then
clipcounter[counter] = 0
freeimage(clip[counter])
freetimer("dissapear",counter)
end
end

old Re: Reload Script

Baofu92
User Off Offline

Quote
Banaan it's the same of TimeQuesT and i sad that it don't work!!

I repeat my question:

When reload START create a gfx (loading it from this directory: gfx/weapon/clip/example.bmp so include this in the script) ON THE GROUND that disappeard after 30 sec.
If it's possible i'd like a gfx for each weapon, for example if you grab M4A1 and you reload it load another gfx (for example in this case clip_m4a1.bmp).
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview