Forum

> > CS2D > Scripts > Hat Menu Error
Forums overviewCS2D overview Scripts overviewLog in to reply

English Hat Menu Error

4 replies
To the start Previous 1 Next To the start

old Hat Menu Error

DrL
User Off Offline

Quote
Hi Guys , Can you help me with something?
It's because i'm a nub at scripts so can you please Fix it?
When i finished doin' it it Showed "EXCEPTION_ACCESS_VIOLATION" Thingy Please help me here's the Code,
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
----------Menu Open with F2-------
addhook("serveraction","Hats")
function Hats(id,actionbutton)
       if (actionbutton==1) then
      getaction1(id)
end
end
---------------------------
function getaction1(id)
    menu(id,"Hats and Stuff,Angel|Hat,Blue Roof|Costume,Devil|
Hat,Fan|Hat,Hero|Costume,Santa|Hat,Umbrella Blue|Hat,Umbrella 

Red|Hat")
end
---------------------------
addhook("menu","menuaction")
function menuaction(id,m,b)
       if m=="Hats and Stuff" then
       
       ------Angel--------
if b==1 then
  ---Add Function's Here---
id=image("gfx/creslic/Angel.png",1,1,200+id) 
          	imagescale(id1,1,1) 
          	imageblend(id1,0) 
          	imagealpha(id1,1.0)
  --------------------------------------
end
------Blue Roof--------
if b==2 then
  ---Add Function's Here---
	id=image("gfx/creslic/Blue Roof.bmp",1,1,200+id) 
          	imagescale(id1,1,1) 
          	imageblend(id1,0) 
          	imagealpha(id1,1.0)
  --------------------------------------
end
------Devil--------
if b==3 then
  ---Add Function's Here---
	id=image("gfx/creslic/Devil.png",1,1,200+id) 
          	imagescale(id1,1,1) 
          	imageblend(id1,0) 
          	imagealpha(id1,1.0)
  --------------------------------------
end
------Fan--------
if b==4 then
  ---Add Function's Here---
	id=image("gfx/creslic/Fanspng",1,1,200+id) 
          	imagescale(id1,1,1) 
          	imageblend(id1,0) 
          	imagealpha(id1,1.0)
  --------------------------------------
end
------Santa--------
if b==5 then
  ---Add Function's Here---
	id=image("gfx/creslic/Santa_hat.png",1,1,200+id) 
          	imagescale(id1,1,1) 
          	imageblend(id1,0) 
          	imagealpha(id1,1.0)
  --------------------------------------
------Umbrella Blue--------
if b==6 then
  ---Add Function's Here---
	id=image("gfx/creslic/Umbrella.png",1,1,200+id) 
          	imagescale(id1,1,1) 
          	imageblend(id1,0) 
          	imagealpha(id1,1.0)
  --------------------------------------
------Umbrella Red--------
if b==7 then
  ---Add Function's Here---
	id=image("gfx/creslic/Umbrella_t.png",1,1,200+id) 
          	imagescale(id1,1,1) 
          	imageblend(id1,0) 
          	imagealpha(id1,1.0)
  --------------------------------------
------Remove Hat--------
if b==8 then
  ---Add Function's Here---
	freeimage(id)
  --------------------------------------
         end

addhook("minute","ads.minute")
function ads.minute()
	msg("©000255000 Hats Mod Alpha State By Creslic Were 

---------------------------------------------------------
©000000000Made at CS2D Lua Maker 
© WereR Creslic File")
       end
    end
end
And i don't F-ing care if you insult me for using a nub program like CS2D Lua maker

old Re: Hat Menu Error

EngiN33R
Moderator Off Offline

Quote
Sorry, but that is the absolute worst tabbing and commenting I've seen.

Your mistakes:
1. You've set the variable 'id' to the image ID, but then operated with the variable 'id1' - they're different.
2. You forgot two ends - after buttons 5, 6 and 7.
3. If that is the whole script, you also don't have an 'ads' table into which you insert the ads.minute function.

It wouldn't work correctly anyway - you overwrite the id parameter of the function with the image id, and then free the image with the index same as the ID of the player who pressed the button - the hat belonging to player 1 doesn't necessarily have an image ID of 1. I corrected the indentation, the errors and improved it.

More >

old Re: Hat Menu Error

Avo
User Off Offline

Quote
Only one thing I would add:

@user DrL: If you want to create new "fabulous hats script" and upload it here, just surrender - there are a lots of hats scripts. If you don't want to upload; just for yourself/your server - it will be ok.

old Re: Hat Menu Error

Avo
User Off Offline

Quote
@user DrL: It's ok. I just said that here is so much crappy hats scripts, don't be angry, but I can't see at stolen,reuploaded or just edited lame hats. Best are in admin scripts.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview