Forum

> > Stranded II > Scripts > Car and Tank
Forums overviewStranded II overview Scripts overviewLog in to reply

English Car and Tank

4 replies
To the start Previous 1 Next To the start

old Car and Tank

Sish
User Off Offline

Quote
I got models of a car and a tank. can someone give me scripts?

old Re: Car and Tank

JasJack67
Super User Off Offline

Quote
you can copy the scripts from the boats or any other vehicle...just change the def from Water vehicle to Land vehicle.
Currently, as far as i am aware, land vehicles do not have collision, they drive/ride right through trees, rocks, n structures...needs source code fix.

old Re: Car and Tank

ModJuicer
Super User Off Offline

Quote
it so happens that i have scripts for a tank.

here it is:
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
### Tank
id=143
name=Tank
group=animal
model=gfx\
scale=1
behaviour=vehicle
col=1
colxr=30
colyr=18
health=6000
speed=12
turnspeed=3
mat=metal
maxweight=50000
rideoffset=45
script=start
	on:kill{
		free "self";
	}
	on:getoff{
		if($notfighter==0){
			if($narg==0){
				skipevent;
				msgbox "What do you want to do with this quad tank?";
				button 0,"Shoot Rocket",27,"shoot";
				setlocal "unit",currentid(),"last",1;
				if($shooting==0){
					button 1,"Rapidfire Rockets",28,"rapiddd";
					timer "unit",currentid(),150,1,"unlast";
				}
				elseif($shooting==1){
					button 1,"Turn off rapidfire",3,"trnof";
				}
				button 2,"Shoot Bullet",27,"bshoot";
				if($shootingg==0){
					button 3,"Rapidfire Bullets",28,"rapidddb";
				}
				elseif($shootingg==1){
					button 3,"Turn off rapidfire",3,"trnofb";
				}
				button 4,"get off",3,"close";
			}
		}
	}
	on:unlast{
		$last=0;
	}
	on:trnof{
		if($last==1){
			$shooting=0;
			closemenu;
		}
	}
	on:rapiddd{
		if($last==1){
			setlocal "unit",currentid(),"shooting",1;
			closemenu;
			timer "self",50,1,"rgun";
		}
	}
	on:rapidddb{
		if($last==1){
			setlocal "unit",currentid(),"shootingg",1;
			closemenu;
			timer "self",50,1,"brgun";
		}
	}
	on:trnofb{
		if($last==1){
			$shooting=0;
			closemenu;
		}
	}
	on:rgun{
		if($shooting==1){
			if(count_stored("self",79)>0){
				$randomm=random(25,60);
				projectile 79,getx("self"),(gety("self")+30),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:brgun{
		if($shootingg==1){
			if(count_stored("self",29)>0){
				$randomm=random(25,60);
				projectile 29,getx("self"),(gety("self")+20),getz("self"),3,getpitch("self"),getyaw("self"),150,0,$randomm,100,0;
				freestored "self",29,1;
				timer "self",50,1,"brgun";
			}
			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")+30),getz("self"),3,getpitch("self"),getyaw("self"),150,0,45,100,0;
				freestored "self",79,1;
		}
		else{
			msg "No rockets stored",3;
		}
	}
	on:bshoot{
		closemenu;
		if(count_stored("self",29)>0){
				projectile 29,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";
			setlocal "unit",currentid(),"scn",1;
			timer "self",50,1,"scn";
		}
		else{
			ride;
		}
	}
	on:scn{
		$scn=0;
	}
	on:ry{
		if($scn==1){
			closemenu;
			ride;
		}
	}
	on:rload{
		if($scn==1){
			exchange "self",1,79,29;
		}
	}
script=end

enjoy!

old Re: Car and Tank

JasJack67
Super User Off Offline

Quote
Nice script! . . .it is good practice to put "long" posts in a "more" bracket.
More >


p.s. The "model" path is missing the model name. He will have to add the model's "name" in your script above. model=gfx\YOUR MODEL NAME. I do not think he would know this by reading his posts.
edited 1×, last 28.08.20 03:12:29 am
To the start Previous 1 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview