Edited Speed-O-Meter

  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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
{$CLEO}
0000:
0662: "by legend2360"
0662: "BlastHack - cheating is art"
while not SAMP.Available()
wait 400
end
30@ = Render.CreateFont("Helvetica", 12, 12)
31@ = Render.FontDrawHeight(30@)
alloc 29@ 96
28@ = Render.CreateFont("Trebuchet MS", 9, 12)
const
// array
vSpeed = 0
vFuel = 1
vDamage = 2
vDoorS = 3
vSpeedL = 4
vFuelS = 5
vEngineS = 6
vLightS = 7
end
while true
wait 50
if Actor.Driving($PLAYER_ACTOR)
then
0@ = Actor.CurrentCar($PLAYER_ACTOR)
046C: 1@ = car 0@ driver
if 003c: $PLAYER_ACTOR == 1@
then
for 1@ = 1 to 2047 step 1
call @get_td_pool_by_id 2 id 1@ offset 0x0 retr_to 2@
if 2@ == true
then
call @get_td_pool_by_id 2 id 1@ offset 0x2400 retr_to 2@
0A8D: 3@ = read_memory 2@ size 1 virtual_protect 0
if and
3@ <> 0x0
0C18: 3@ = strstr string1 2@ string2 "km/h__~h~Fuel"
then break
end
end
end
if 2@ <> 0
then
0C0D: struct 2@ offset 2403 size 4 = 0.0
0C0D: struct 2@ offset 2417 size 1 = 0
alloc 3@ 32
memset 3@ 0 32
while Actor.Driving($PLAYER_ACTOR)
wait 0
0B60: convert_game_screen_coords 130.0 400.0 to_window_screen_coords 4@ 5@
0B6A: render draw_box_with_border_pos 4@ 5@ size 600 105 color 0xaaeaeaea border_size 2 border_color 0xab323232
// -- MAIN
4@ += 5
5@ += 4
call @getAllValues 2 str 2@ to_array 3@
// Speed
0C0E: 6@ = array 3@ element vSpeed
if and
6@ >= 0
6@ <= 34
then 7@ = 0xffcc3333
else
if and
6@ > 34
6@ <= 87
then 7@ = 0xffffd000
else 7@ = 0xff49d039
end
end
Render.DrawText(30@, "Скорость", 4@, 5@, 0xff00a5ff)
8@ = Render.FontDrawLength(30@, "Скорость")
8@ += 10
005a: 4@ += 8@
5@ += 3
call @draw_bar 9 pos_xy 4@ 5@ size_xy 100 15 value 6@ max_value 130 color 7@ bg_color 0xff323232 draw_value 1
// NUMBER
format 29@ = "%d" 6@
9@ = Render.FontDrawLength(30@, 29@)
9@ /= 2
0A8F: 9@ = 50 - 9@
005a: 9@ += 4@
5@--
call @draw_label 5 pos_xy 9@ 5@ font 28@ color -1 text 29@
5@++
// --
0062: 4@ -= 8@
// ------------------------------
005a: 5@ += 31@
// Fuel
0C0E: 6@ = array 3@ element vFuel
if and
6@ >= 0
6@ <= 15
then 7@ = 0xffcc3333
else
if and
6@ > 15
6@ <= 75
then 7@ = 0xffffd000
else 7@ = 0xff49d039
end
end
Render.DrawText(30@, "Бензин", 4@, 5@, 0xff00a5ff)
8@ = Render.FontDrawLength(30@, "Бензин")
8@ += 10
005a: 4@ += 8@
5@ += 3
call @draw_bar 9 pos_xy 4@ 5@ size_xy 100 15 value 6@ max_value 150 color 7@ bg_color 0xff323232 draw_value 1
// NUMBER
format 29@ = "%d" 6@
9@ = Render.FontDrawLength(30@, 29@)
9@ /= 2
0A8F: 9@ = 50 - 9@
005a: 9@ += 4@
5@--
call @draw_label 5 pos_xy 9@ 5@ font 28@ color -1 text 29@
5@++
// --
0062: 4@ -= 8@
// ------------------------------
005a: 5@ += 31@
// Damage status
0C0E: 6@ = array 3@ element vDamage
6@ /= 10
if and
6@ >= 0
6@ <= 39
then 7@ = 0xffcc3333
else
if and
6@ > 39
6@ <= 65
then 7@ = 0xffffd000
else 7@ = 0xff49d039
end
end
Render.DrawText(30@, "Состояние авто", 4@, 5@, 0xff00a5ff)
8@ = Render.FontDrawLength(30@, "Состояние авто")
8@ += 10
005a: 4@ += 8@
5@ += 3
call @draw_bar 9 pos_xy 4@ 5@ size_xy 100 15 value 6@ max_value 100 color 7@ bg_color 0xff323232 draw_value 1
// NUMBER
format 29@ = "%d" 6@
9@ = Render.FontDrawLength(30@, 29@)
9@ /= 2
0A8F: 9@ = 50 - 9@
005a: 9@ += 4@
5@--
call @draw_label 5 pos_xy 9@ 5@ font 28@ color -1 text 29@
5@++
// --
0062: 4@ -= 8@
// ------------------------------
0062: 5@ -= 31@
0062: 5@ -= 31@
5@ -= 11
4@ += 300
call @render_sep 4 s_xy 4@ 5@ e_xy 0 102
// --
4@ += 5
if call @checkValue 3 array 3@ el vDoorS value 0
then Render.DrawText(30@, "Автомобиль закрыт", 4@, 5@, 0xff49d039)
else Render.DrawText(30@, "Автомобиль открыт", 4@, 5@, 0xffcc3333)
end
005a: 5@ += 31@
if call @checkValue 3 array 3@ el vSpeedL value 1
then Render.DrawText(30@, "Ограничитель включен", 4@, 5@, 0xffcc3333)
else Render.DrawText(30@, "Ограничитель выключен", 4@, 5@, 0xff49d039)
end
005a: 5@ += 31@
if call @checkValue 3 array 3@ el vFuelS value 1
then Render.DrawText(30@, "В бензопаке мало топлива", 4@, 5@, 0xffcc3333)
else Render.DrawText(30@, "В бензопаке достаточно топлива", 4@, 5@, 0xff49d039)
end
005a: 5@ += 31@
if call @checkValue 3 array 3@ el vEngineS value 1
then Render.DrawText(30@, "Двигатель заведён", 4@, 5@, 0xff49d039)
else Render.DrawText(30@, "Двигатель не заведён", 4@, 5@, 0xffcc3333)
end
005a: 5@ += 31@
if call @checkValue 3 array 3@ el vLightS value 1
then Render.DrawText(30@, "Свет включен", 4@, 5@, 0xff49d039)
else Render.DrawText(30@, "Свет выключен", 4@, 5@, 0xffcc3333)
end
// ------------------------------
end
free 3@
end
end
end
end
:render_sep
0A8E: 4@ = 0@ + 2@
0A8E: 5@ = 1@ + 3@
0B68: render draw_line_point1 0@ 1@ point2 4@ 5@ width 2 color 0xff323232
ret 0
:getAllValues
// call @getAllValues 2 str 0@ to_array 1@
0AD4: 2@ = scan_string 0@ format "%d_km/h__~h~Fuel_%d__~b~%d" 3@ 4@ 5@
0C0F: array 1@ element vSpeed = 3@
0C0F: array 1@ element vFuel = 4@
0C0F: array 1@ element vDamage = 5@
if 0C18: 2@ = strstr string1 0@ string2 "~g~~h~Open" // door status
then 0C0F: array 1@ element vDoorS = 1 // open
else 0C0F: array 1@ element vDoorS = 0 // close
end
if 0C18: 2@ = strstr string1 0@ string2 "~w~max" // speed limit.
then 0C0F: array 1@ element vSpeedL = 0 // no
else 0C0F: array 1@ element vSpeedL = 1 // yes
end
if 0C18: 2@ = strstr string1 0@ string2 "~w~E" // fuel status
then 0C0F: array 1@ element vFuelS = 0 // full
else 0C0F: array 1@ element vFuelS = 1 // empty
end
if 0C18: 2@ = strstr string1 0@ string2 "~w~M" // Engine status
then 0C0F: array 1@ element vEngineS = 0 // don't work
else 0C0F: array 1@ element vEngineS = 1 // work
end
if 0C18: 2@ = strstr string1 0@ string2 "~w~L" // light
then 0C0F: array 1@ element vLightS = 0 // off
else 0C0F: array 1@ element vLightS = 1 // on
end
ret 0
:checkValue
// call @checkValue 3 array 0@ el 1@ value 2@
0C0E: 3@ = array 0@ element 1@
if 003b: 3@ == 2@
then ret 0 1
end
ret 0
:draw_bar
// call @draw_bar 9 pos_xy 0@ 1@ size_xy 2@ 3@ value 4@ max_value 5@ color 6@ bg_color 7@ draw_value 8@
if 9@ < 0
then
lo 9@ 9@
0A8D: 9@ = read_memory 9@ size 4 virtual_protect 0
end
0085: 10@ = 2@
0073: 10@ /= 5@
006b: 10@ *= 4@
if 001d: 10@ > 2@
then 0085: 10@ = 2@
end
0B6A: render draw_box_with_border_pos 0@ 1@ size 2@ 3@ color 7@ border_size 1 border_color 0xff000000
0B6A: render draw_box_with_border_pos 0@ 1@ size 10@ 3@ color 6@ border_size 1 border_color 0x00000000
ret 0
:draw_label
// call @draw_label 5 pos_xy 0@ 1@ font 2@ color 3@ text 4@
if 4@ < 0
then lo 4@ 4@
end
Render.DrawText(2@, 4@, 0@, 1@, 3@)
ret 0
:get_td_pool_by_id
var
0@ : int // id
1@ : int // offset
2@ : int
end
2@ = SAMP.Base()
2@ += 0x212A80
0A8D: 2@ = read_memory 2@ size 4 virtual_protect 0
2@ += 0x3D9
0A8D: 2@ = read_memory 2@ size 4 virtual_protect 0
0A8D: 2@ = read_memory 2@ size 4 virtual_protect 0
0@ *= 4
1@ += 0@
2@ += 1@
0A8D: 2@ = read_memory 2@ size 4 virtual_protect 0
ret 1 2@