View difference between Paste ID: 8mGrq9nE and eqFvVqNm
SHOW: | | - or go back to the newest paste.
1
/*
2
 			Sistema Feito Toltalmente Por AmericanStyle'™
3
          Não Foram Detectados Bugs Ou Anormalias do Mesmo
4
          Espero Que Gostem e que faça do Proveito do Mesmo.
5
          Baixado da www.total-samp.com.br
6
          Maior Blog de Samp
7
8
*/
9
10
11
12
13
14
15
16
17
18
#include 		<a_samp>
19
20
21
22
23
new Float:Pos[4], spe;
24
new Velo;
25
26
new Text:Velocidade0[MAX_PLAYERS];
27
new Text:Velocidade1[MAX_PLAYERS];
28
new Text:Velocidade2[MAX_PLAYERS];
29
new Text:Velocidade3[MAX_PLAYERS];
30
new Text:Velocidade4[MAX_PLAYERS];
31
new Text:Velocidade5[MAX_PLAYERS];
32
new Text:Velocidade6[MAX_PLAYERS];
33
new Text:Velocidade7[MAX_PLAYERS];
34
new Text:Velocidade8[MAX_PLAYERS];
35
new Text:Velocidade9[MAX_PLAYERS];
36
new Text:Velocidade10[MAX_PLAYERS];
37
new Text:Velocidade11[MAX_PLAYERS];
38
new Text:Velocidade12[MAX_PLAYERS];
39
new Text:Velocidade18[MAX_PLAYERS];
40
41
42
#define Loop(%0,%1) for(new %0; %0 < %1; ++%0)
43
44
45
forward Velocimetro();
46
47
new	Veiculos[][] =
48
{
49
        "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel",
50
        "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus",
51
        "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam",
52
        "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection",
53
        "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus",
54
        "Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie",
55
        "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral",
56
        "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder",
57
        "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", "Berkley's RC Van",
58
        "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale",
59
        "Oceanic","Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy",
60
        "Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX",
61
        "Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper",
62
        "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking",
63
        "Blista Compact", "Police Maverick", "Boxvillde", "Benson", "Mesa", "RC Goblin",
64
        "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT",
65
        "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stunt",
66
        "Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra",
67
        "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune",
68
        "Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer",
69
        "Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent",
70
        "Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo",
71
        "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite",
72
        "Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratium",
73
        "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",
74
        "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper",
75
        "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400",
76
        "News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
77
        "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car",
78
        "Police Car", "Police Car", "Police Ranger", "Picador", "S.W.A.T", "Alpha",
79
        "Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville",
80
        "Tiller", "Utility Trailer"
81
};
82
83
public OnFilterScriptInit()
84
{
85
86
	print("Velocimetro AmericanStyle'");
87
	print("Velocimetro AmericanStyle'");
88
	print("Velocimetro AmericanStyle'");
89
	print("Use e Abuse");
90
	
91
	Velo = SetTimer("Velocimetro",100,true);
92
	
93
	Loop(i,MAX_PLAYERS)
94
	{
95
		Velocidade0[i] = TextDrawCreate(250.000000, 412.000000, "~g~lll");
96
		TextDrawBackgroundColor(Velocidade0[i], 255);
97
		TextDrawFont(Velocidade0[i], 1);
98
		TextDrawLetterSize(Velocidade0[i], 0.240000, 2.999999);
99
		TextDrawColor(Velocidade0[i], -1);
100
		TextDrawSetOutline(Velocidade0[i], 1);
101
		TextDrawSetProportional(Velocidade0[i], 1);
102
103
		Velocidade1[i] = TextDrawCreate(258.000000, 412.000000, "~g~lll");
104
		TextDrawBackgroundColor(Velocidade1[i], 255);
105
		TextDrawFont(Velocidade1[i], 1);
106
		TextDrawLetterSize(Velocidade1[i], 0.240000, 2.999999);
107
		TextDrawColor(Velocidade1[i], -1);
108
		TextDrawSetOutline(Velocidade1[i], 1);
109
		TextDrawSetProportional(Velocidade1[i], 1);
110
111
		Velocidade2[i] = TextDrawCreate(266.000000, 412.000000, "~g~lll");
112
		TextDrawBackgroundColor(Velocidade2[i], 255);
113
		TextDrawFont(Velocidade2[i], 1);
114
		TextDrawLetterSize(Velocidade2[i], 0.240000, 2.999999);
115
		TextDrawColor(Velocidade2[i], -1);
116
		TextDrawSetOutline(Velocidade2[i], 1);
117
		TextDrawSetProportional(Velocidade2[i], 1);
118
119
		Velocidade3[i] = TextDrawCreate(274.000000, 412.000000, "~g~lll");
120
		TextDrawBackgroundColor(Velocidade3[i], 255);
121
		TextDrawFont(Velocidade3[i], 1);
122
		TextDrawLetterSize(Velocidade3[i], 0.240000, 2.999999);
123
		TextDrawColor(Velocidade3[i], -1);
124
		TextDrawSetOutline(Velocidade3[i], 1);
125
		TextDrawSetProportional(Velocidade3[i], 1);
126
127
		Velocidade4[i] = TextDrawCreate(282.000000, 412.000000, "~y~lll");
128
		TextDrawBackgroundColor(Velocidade4[i], 255);
129
		TextDrawFont(Velocidade4[i], 1);
130
		TextDrawLetterSize(Velocidade4[i], 0.240000, 2.999999);
131
		TextDrawColor(Velocidade4[i], -1);
132
		TextDrawSetOutline(Velocidade4[i], 1);
133
		TextDrawSetProportional(Velocidade4[i], 1);
134
135
		Velocidade5[i] = TextDrawCreate(290.000000, 412.000000, "~y~lll");
136
		TextDrawBackgroundColor(Velocidade5[i], 255);
137
		TextDrawFont(Velocidade5[i], 1);
138
		TextDrawLetterSize(Velocidade5[i], 0.240000, 2.999999);
139
		TextDrawColor(Velocidade5[i], -1);
140
		TextDrawSetOutline(Velocidade5[i], 1);
141
		TextDrawSetProportional(Velocidade5[i], 1);
142
143
		Velocidade6[i] = TextDrawCreate(298.000000, 412.000000, "~y~lll");
144
		TextDrawBackgroundColor(Velocidade6[i], 255);
145
		TextDrawFont(Velocidade6[i], 1);
146
		TextDrawLetterSize(Velocidade6[i], 0.240000, 2.999999);
147
		TextDrawColor(Velocidade6[i], -1);
148
		TextDrawSetOutline(Velocidade6[i], 1);
149
		TextDrawSetProportional(Velocidade6[i], 1);
150
151
		Velocidade7[i] = TextDrawCreate(306.000000, 412.000000, "~y~lll");
152
		TextDrawBackgroundColor(Velocidade7[i], 255);
153
		TextDrawFont(Velocidade7[i], 1);
154
		TextDrawLetterSize(Velocidade7[i], 0.240000, 2.999999);
155
		TextDrawColor(Velocidade7[i], -1);
156
		TextDrawSetOutline(Velocidade7[i], 1);
157
		TextDrawSetProportional(Velocidade7[i], 1);
158
159
		Velocidade8[i] = TextDrawCreate(314.000000, 412.000000, "~r~lll");
160
		TextDrawBackgroundColor(Velocidade8[i], 255);
161
		TextDrawFont(Velocidade8[i], 1);
162
		TextDrawLetterSize(Velocidade8[i], 0.240000, 2.999999);
163
		TextDrawColor(Velocidade8[i], -1);
164
		TextDrawSetOutline(Velocidade8[i], 1);
165
		TextDrawSetProportional(Velocidade8[i], 1);
166
167
		Velocidade9[i] = TextDrawCreate(322.000000, 412.000000, "~r~lll");
168
		TextDrawBackgroundColor(Velocidade9[i], 255);
169
		TextDrawFont(Velocidade9[i], 1);
170
		TextDrawLetterSize(Velocidade9[i], 0.240000, 2.999999);
171
		TextDrawColor(Velocidade9[i], -1);
172
		TextDrawSetOutline(Velocidade9[i], 1);
173
		TextDrawSetProportional(Velocidade9[i], 1);
174
175
		Velocidade10[i] = TextDrawCreate(338.000000, 412.000000, "~r~lll");
176
		TextDrawBackgroundColor(Velocidade10[i], 255);
177
		TextDrawFont(Velocidade10[i], 1);
178
		TextDrawLetterSize(Velocidade10[i], 0.240000, 2.999999);
179
		TextDrawColor(Velocidade10[i], -1);
180
		TextDrawSetOutline(Velocidade10[i], 1);
181
		TextDrawSetProportional(Velocidade10[i], 1);
182
183
		Velocidade11[i] = TextDrawCreate(330.000000, 412.000000, "~r~lll");
184
		TextDrawBackgroundColor(Velocidade11[i], 255);
185
		TextDrawFont(Velocidade11[i], 1);
186
		TextDrawLetterSize(Velocidade11[i], 0.240000, 2.999999);
187
		TextDrawColor(Velocidade11[i], -1);
188
		TextDrawSetOutline(Velocidade11[i], 1);
189
		TextDrawSetProportional(Velocidade11[i], 1);
190
191
		Velocidade18[i] = TextDrawCreate(298.000000, 391.000000, "Veiculo");
192
		TextDrawAlignment(Velocidade18[i], 2);
193
		TextDrawBackgroundColor(Velocidade18[i], 6655);
194
		TextDrawFont(Velocidade18[i], 1);
195
		TextDrawLetterSize(Velocidade18[i], 0.240000, 2.999999);
196
		TextDrawColor(Velocidade18[i], -1);
197
		TextDrawSetOutline(Velocidade18[i], 1);
198
		TextDrawSetProportional(Velocidade18[i], 1);
199
	}
200
	return 1;
201
}
202
203
public OnFilterScriptExit()
204
{
205
	KillTimer(Velo);
206
	Loop(i,MAX_PLAYERS)
207
	{
208
		TextDrawHideForAll(Velocidade0[i]);
209
		TextDrawDestroy(Velocidade0[i]);
210
		TextDrawHideForAll(Velocidade1[i]);
211
		TextDrawDestroy(Velocidade1[i]);
212
		TextDrawHideForAll(Velocidade2[i]);
213
		TextDrawDestroy(Velocidade2[i]);
214
		TextDrawHideForAll(Velocidade3[i]);
215
		TextDrawDestroy(Velocidade3[i]);
216
		TextDrawHideForAll(Velocidade4[i]);
217
		TextDrawDestroy(Velocidade4[i]);
218
		TextDrawHideForAll(Velocidade5[i]);
219
		TextDrawDestroy(Velocidade5[i]);
220
		TextDrawHideForAll(Velocidade6[i]);
221
		TextDrawDestroy(Velocidade6[i]);
222
		TextDrawHideForAll(Velocidade7[i]);
223
		TextDrawDestroy(Velocidade7[i]);
224
		TextDrawHideForAll(Velocidade8[i]);
225
		TextDrawDestroy(Velocidade8[i]);
226
		TextDrawHideForAll(Velocidade9[i]);
227
		TextDrawDestroy(Velocidade9[i]);
228
		TextDrawHideForAll(Velocidade10[i]);
229
		TextDrawDestroy(Velocidade10[i]);
230
		TextDrawHideForAll(Velocidade11[i]);
231
		TextDrawDestroy(Velocidade11[i]);
232
		TextDrawHideForAll(Velocidade12[i]);
233
		TextDrawDestroy(Velocidade12[i]);
234
		TextDrawHideForAll(Velocidade18[i]);
235
		TextDrawDestroy(Velocidade18[i]);
236
	}
237
	return 1;
238
}
239
public Velocimetro()
240
{
241
	Loop(i,MAX_PLAYERS)
242
	{
243
	    if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
244
	    {
245
	    
246
	        new str[15];
247
	    	format(str,sizeof(str),"%s", Veiculos[GetVehicleModel(GetPlayerVehicleID(i))-400]);
248
            TextDrawSetString(Velocidade18[i], str);
249
            TextDrawShowForPlayer(i, Velocidade18[i]);
250
	    
251
			if(Velocidade(i) == 40 || Velocidade(i) <= 50)
252
			{
253
				TextDrawShowForPlayer(i, Velocidade0[i]);
254
				TextDrawHideForPlayer(i, Velocidade1[i]);
255
			}
256
			else if(Velocidade(i) == 51 || Velocidade(i) <= 70)
257
			{
258
				TextDrawShowForPlayer(i, Velocidade0[i]);
259
				TextDrawShowForPlayer(i, Velocidade1[i]);
260
				TextDrawHideForPlayer(i, Velocidade2[i]);
261
			}
262
			else if(Velocidade(i) == 71 || Velocidade(i) <= 90)
263
			{
264
				TextDrawShowForPlayer(i, Velocidade0[i]);
265
				TextDrawShowForPlayer(i, Velocidade1[i]);
266
				TextDrawShowForPlayer(i, Velocidade2[i]);
267
				TextDrawHideForPlayer(i, Velocidade3[i]);
268
			}
269
			else if(Velocidade(i) == 91 || Velocidade(i) <= 120)
270
			{
271
			    TextDrawShowForPlayer(i, Velocidade0[i]);
272
				TextDrawShowForPlayer(i, Velocidade1[i]);
273
				TextDrawShowForPlayer(i, Velocidade2[i]);
274
				TextDrawShowForPlayer(i, Velocidade3[i]);
275
				TextDrawHideForPlayer(i, Velocidade4[i]);
276
			}
277
			else if(Velocidade(i) == 121 || Velocidade(i) <= 140)
278
			{
279
			    TextDrawShowForPlayer(i, Velocidade0[i]);
280
				TextDrawShowForPlayer(i, Velocidade1[i]);
281
				TextDrawShowForPlayer(i, Velocidade2[i]);
282
				TextDrawShowForPlayer(i, Velocidade3[i]);
283
				TextDrawShowForPlayer(i, Velocidade4[i]);
284
				TextDrawHideForPlayer(i, Velocidade5[i]);
285
			}
286
			else if(Velocidade(i) == 141 || Velocidade(i) <= 160)
287
			{
288
			    TextDrawShowForPlayer(i, Velocidade0[i]);
289
				TextDrawShowForPlayer(i, Velocidade1[i]);
290
				TextDrawShowForPlayer(i, Velocidade2[i]);
291
				TextDrawShowForPlayer(i, Velocidade3[i]);
292
				TextDrawShowForPlayer(i, Velocidade4[i]);
293
				TextDrawShowForPlayer(i, Velocidade5[i]);
294
				TextDrawHideForPlayer(i, Velocidade6[i]);
295
			}
296
			else if(Velocidade(i) == 161 || Velocidade(i) <= 180)
297
			{
298
			    TextDrawShowForPlayer(i, Velocidade0[i]);
299
				TextDrawShowForPlayer(i, Velocidade1[i]);
300
				TextDrawShowForPlayer(i, Velocidade2[i]);
301
				TextDrawShowForPlayer(i, Velocidade3[i]);
302
				TextDrawShowForPlayer(i, Velocidade4[i]);
303
				TextDrawShowForPlayer(i, Velocidade5[i]);
304
				TextDrawShowForPlayer(i, Velocidade6[i]);
305
				TextDrawHideForPlayer(i, Velocidade7[i]);
306
			}
307
			else if(Velocidade(i) == 181 || Velocidade(i) <= 200)
308
			{
309
			    TextDrawShowForPlayer(i, Velocidade0[i]);
310
				TextDrawShowForPlayer(i, Velocidade1[i]);
311
				TextDrawShowForPlayer(i, Velocidade2[i]);
312
				TextDrawShowForPlayer(i, Velocidade3[i]);
313
				TextDrawShowForPlayer(i, Velocidade4[i]);
314
				TextDrawShowForPlayer(i, Velocidade5[i]);
315
				TextDrawShowForPlayer(i, Velocidade6[i]);
316
				TextDrawShowForPlayer(i, Velocidade7[i]);
317
				TextDrawHideForPlayer(i, Velocidade8[i]);
318
			}
319
			else if(Velocidade(i) == 201 || Velocidade(i) <= 210)
320
			{
321
			    TextDrawShowForPlayer(i, Velocidade0[i]);
322
				TextDrawShowForPlayer(i, Velocidade1[i]);
323
				TextDrawShowForPlayer(i, Velocidade2[i]);
324
				TextDrawShowForPlayer(i, Velocidade3[i]);
325
				TextDrawShowForPlayer(i, Velocidade4[i]);
326
				TextDrawShowForPlayer(i, Velocidade5[i]);
327
				TextDrawShowForPlayer(i, Velocidade6[i]);
328
				TextDrawShowForPlayer(i, Velocidade7[i]);
329
				TextDrawShowForPlayer(i, Velocidade8[i]);
330
				TextDrawHideForPlayer(i, Velocidade9[i]);
331
			}
332
			else if(Velocidade(i) == 211 || Velocidade(i) <= 220)
333
			{
334
			    TextDrawShowForPlayer(i, Velocidade0[i]);
335
				TextDrawShowForPlayer(i, Velocidade1[i]);
336
				TextDrawShowForPlayer(i, Velocidade2[i]);
337
				TextDrawShowForPlayer(i, Velocidade3[i]);
338
				TextDrawShowForPlayer(i, Velocidade4[i]);
339
				TextDrawShowForPlayer(i, Velocidade5[i]);
340
				TextDrawShowForPlayer(i, Velocidade6[i]);
341
				TextDrawShowForPlayer(i, Velocidade7[i]);
342
				TextDrawShowForPlayer(i, Velocidade8[i]);
343
				TextDrawShowForPlayer(i, Velocidade9[i]);
344
				TextDrawHideForPlayer(i, Velocidade11[i]);
345
			}
346
			else if(Velocidade(i) == 221 || Velocidade(i) <= 230)
347
			{
348
			    TextDrawShowForPlayer(i, Velocidade0[i]);
349
				TextDrawShowForPlayer(i, Velocidade1[i]);
350
				TextDrawShowForPlayer(i, Velocidade2[i]);
351
				TextDrawShowForPlayer(i, Velocidade3[i]);
352
				TextDrawShowForPlayer(i, Velocidade4[i]);
353
				TextDrawShowForPlayer(i, Velocidade5[i]);
354
				TextDrawShowForPlayer(i, Velocidade6[i]);
355
				TextDrawShowForPlayer(i, Velocidade7[i]);
356
				TextDrawShowForPlayer(i, Velocidade8[i]);
357
				TextDrawShowForPlayer(i, Velocidade9[i]);
358
				TextDrawShowForPlayer(i, Velocidade11[i]);
359
				TextDrawHideForPlayer(i, Velocidade10[i]);
360
			}
361
			else if(Velocidade(i) == 231 || Velocidade(i) <= 270)
362
			{
363
			    TextDrawShowForPlayer(i, Velocidade0[i]);
364
				TextDrawShowForPlayer(i, Velocidade1[i]);
365
				TextDrawShowForPlayer(i, Velocidade2[i]);
366
				TextDrawShowForPlayer(i, Velocidade3[i]);
367
				TextDrawShowForPlayer(i, Velocidade4[i]);
368
				TextDrawShowForPlayer(i, Velocidade5[i]);
369
				TextDrawShowForPlayer(i, Velocidade6[i]);
370
				TextDrawShowForPlayer(i, Velocidade7[i]);
371
				TextDrawShowForPlayer(i, Velocidade8[i]);
372
				TextDrawShowForPlayer(i, Velocidade9[i]);
373
				TextDrawShowForPlayer(i, Velocidade11[i]);
374
				TextDrawShowForPlayer(i, Velocidade10[i]);
375
			}
376
		}
377
	}
378
	return 1;
379
}
380
	
381
382
public OnPlayerStateChange(playerid, newstate, oldstate)
383
{
384
	if(oldstate == PLAYER_STATE_DRIVER)
385
	{
386
		TextDrawHideForPlayer(playerid, Velocidade0[playerid]);
387
		TextDrawHideForPlayer(playerid, Velocidade1[playerid]);
388
		TextDrawHideForPlayer(playerid, Velocidade2[playerid]);
389
		TextDrawHideForPlayer(playerid, Velocidade3[playerid]);
390
		TextDrawHideForPlayer(playerid, Velocidade4[playerid]);
391
		TextDrawHideForPlayer(playerid, Velocidade5[playerid]);
392
		TextDrawHideForPlayer(playerid, Velocidade6[playerid]);
393
		TextDrawHideForPlayer(playerid, Velocidade7[playerid]);
394
		TextDrawHideForPlayer(playerid, Velocidade8[playerid]);
395
		TextDrawHideForPlayer(playerid, Velocidade9[playerid]);
396
		TextDrawHideForPlayer(playerid, Velocidade10[playerid]);
397
		TextDrawHideForPlayer(playerid, Velocidade11[playerid]);
398
		TextDrawHideForPlayer(playerid, Velocidade12[playerid]);
399
		TextDrawHideForPlayer(playerid, Velocidade18[playerid]);
400
	}
401
	return 1;
402
}
403
404
stock Velocidade(playerid)
405
{
406
        if(IsPlayerInAnyVehicle(playerid))
407
        {
408
                GetVehicleVelocity(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
409
                Pos[3] = floatmul(floatsqroot(floatadd(floatadd(floatpower(Pos[0], 2), floatpower(Pos[1], 2)),  floatpower(Pos[2], 2))), 170.0);
410
                spe = floatround(Pos[3] * 1);
411
        }
412
        else
413
			return false;
414
        return spe;
415
}