Hopefully someone knows what is wrong
script is here:
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
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
script=start 	on:getoff{ 		if($notfighter==0){ 			if($narg==0){ 				skipevent; 				msgbox "What do you want to do with this quad tank?"; 				button 0,"Shoot",27,"shoot"; 				if($shooting==0){ 					$foo=currentid(); 					setlocal "unit",$foo,"last",1; 					button 1,"Rapidfire",28,"rapiddd"; 					timer "unit",$foo,150,1,"unlast"; 				} 				elseif($shooting==1){ 					button 1,"Turn off rapidfire",3,"trnof"; 				} 				button 2,"get off",3,"close"; 			} 		} 	} 	on:unlast{ 		$last=0; 	} 	on:trnof{ 		$shooting=0; 		closemenu; 	} 	on:rapiddd{ 		if($last==1){ 			$shooting=1; 			closemenu; 			timer "self",50,1,"rgun"; 		} 	} 	on:rgun{ 		if($shooting==1){ 			if(count_stored("self",79)>0){ 				$randomm=random(25,60); 				projectile 79,getx("self"),(gety("self")+20),getz("self"),3,getpitch("self"),getyaw("self"),150,0,$randomm,100,0; 				freestored "self",79,1; 				timer "self",200,1,"rgun"; 			} 			else{ 				msg "No ammo stored",3; 				$shooting=0; 			} 		} 		else{ 			msg "Rapidfire off"; 		} 	} 	on:close{ 		closemenu; 		$narg=1; 		getoff; 		timer "self",100; 	} 	on:timer{ 		$narg=0; 	} 	on:shoot{ 		closemenu; 		if(count_stored("self",79)>0){ 				projectile 79,getx("self"),(gety("self")+20),getz("self"),3,getpitch("self"),getyaw("self"),150,0,45,100,0; 				freestored "self",79,1; 		} 		else{ 			msg "No ammo stored",3; 		} 	} 	on:use{ 		if ($notfighter==0){ 			msgbox "What do you want to do with this quad tank?"; 			button 0,"Ride",77,"ry"; 			button 1,"Reload",66,"rload"; 		} 		else{ 			$ccid=currentid(); 			ride $ccid; 		} 	} 	on:ry{ 		closemenu; 		$ccid=currentid(); 		ride $ccid; 	} 	on:rload{ 		exchange "self",1,79; 	} script=end
note: I added the currentid script for this purpose, but it didn't work. that is why $ccid exists.
this code is intended for this quad tank, along with others:
edited 2×, last 23.06.20 01:06:13 am