Forum

> > CS2D > Scripts > How to save hats?
Forums overviewCS2D overview Scripts overviewLog in to reply

English How to save hats?

4 replies
To the start Previous 1 Next To the start

old How to save hats?

tiky
User Off Offline

Quote
Hi all. Im working in a script and I have tried and asked but I couldn´t create a file that can save hats, soo if someone can help me I will be happy. Thanks

old Re: How to save hats?

Cure Pikachu
User Off Offline

Quote
By saving hats what do you mean? Save currently equipped hat or hat inventory?
Also would be great if you can provide the code for your hat script so we can see how the script operates and then work from there.

old Re: How to save hats?

tiky
User Off Offline

Quote
Save the player´s hats. When player join to server, he has his hat without do anything.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
addhook('menu','hat_menu')
function hat_menu(id,title,buton)
	if title=='Hat Menu 1/2' then
		if buton==1 then
   if turehat[id]==1 then
	freeimage(hatimg[id])
end
   hatimg[id] = image('gfx/hats tiky/angel.png', 1, 1, 200 + id)
	elseif buton==2 then
   if turehat[id]==1 then
	freeimage(hatimg[id])
end
   hatimg[id] = image('gfx/hats tiky/devil.png', 1, 1, 200 + id)
	elseif buton==3 then
   if turehat[id]==1 then
	freeimage(hatimg[id])
end
      hatimg[id] = image('gfx/hats tiky/cowboy.png', 1, 1, 200 + id)
	elseif buton==4 then
   if turehat[id]==1 then
	freeimage(hatimg[id])
end
   hatimg[id] = image('gfx/hats tiky/graduate.png', 1, 1, 200 + id)
	elseif buton==5 then
   if turehat[id]==1 then
	freeimage(hatimg[id])
end
   hatimg[id] = image('gfx/hats tiky/scarlet_beret.png', 1, 1, 200 + id)
	elseif buton==6 then
   if turehat[id]==1 then
	freeimage(hatimg[id])
end
   hatimg[id] = image('gfx/hats tiky/pirate.png', 1, 1, 200 + id)
	elseif buton==7 then
   if turehat[id]==1 then
	freeimage(hatimg[id])
end
   hatimg[id] = image('gfx/hats tiky/pumpkin.png', 1, 1, 200 + id)
	elseif buton==8 then
   if turehat[id]==1 then
	freeimage(hatimg[id])
end
   hatimg[id] = image('gfx/hats tiky/santa.png', 1, 1, 200 + id)
	elseif buton==9 then
	    menu(id,'Hat Menu 2/2,Snowman,Black,Phoenix,Skull,Smile,Tyrans,No Hat,Back Page')
end
	if buton~=0 then
		turehat[id]=1
	end
end

old Re: How to save hats?

Cure Pikachu
User Off Offline

Quote
I don't know if you would want this, done from scratch.
More >
edited 2×, last 05.05.21 08:51:59 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview