· 8 years ago · Jul 18, 2018, 11:34 PM
1//==============================================================================
2//------------------------- Server Functions -----------------------------------
3//==============================================================================
4function GetTok(string, separator, n, ...)
5{
6 local m = vargv.len() > 0 ? vargv[0] : n,
7 tokenized = split(string, separator),
8 text = "";
9
10 if (n > tokenized.len() || n < 1) return null;
11 for (; n <= m; n++)
12 {
13 text += text == "" ? tokenized[n-1] : separator + tokenized[n-1];
14 }
15 return text;
16}
17
18function NumTok(string, separator)
19{
20 local tokenized = split(string, separator);
21 return tokenized.len();
22}
23
24function Distance(x1, y1, x2, y2)
25{
26local dist = sqrt(((x2 - x1)*(x2 - x1)) + ((y2 - y1)*(y2 - y1)));
27return dist;
28}
29
30function GetPlayer( plr )
31{
32if ( plr )
33{
34if ( IsNum( plr ) )
35{
36plr = FindPlayer( plr.tointeger() );
37if ( plr ) return plr;
38else return false;
39}
40else
41{
42plr = FindPlayer( plr );
43if ( plr ) return plr;
44else return false;
45}
46}
47else return false;
48}
49
50function GetFullTime()
51{
52local t = date();
53return ::format(@"%.2d/%.2d/%d - %.2d:%.2d:%.2d", t.day, t.month, t.year, t.hour, t.min, t.sec);
54}
55
56function CriarTabelas()
57{
58QuerySQL( db, "CREATE TABLE IF NOT EXISTS Contas ( Nome TEXT, IP VARCHAR(20), UID TEXT, Senha VARCHAR(255), Dinheiro NUMERIC, Banco NUMERIC, Level NUMERIC, Data_Reg TEXT, Data_Join TEXT, Matou NUMERIC, Morreu NUMERIC, warns_staff NUMERIC, Nogoto TEXT, SpawnLoc TEXT, Loc TEXT )" );
59QuerySQL( db, "CREATE TABLE IF NOT EXISTS Bans ( Nome TEXT, UID TEXT, Admin TEXT, Motivo TEXT, Data TEXT )" );
60QuerySQL( db, "CREATE TABLE IF NOT EXISTS Locs ( Nome TEXT, Pos TEXT, Criador TEXT, Data TEXT )" );
61QuerySQL( db, "CREATE TABLE IF NOT EXISTS SpawnWep ( Nome TEXT, Wep1 NUMERIC, Wep2 NUMERIC, Wep3 NUMERIC, Wep4 NUMERIC )" );
62QuerySQL( db, "CREATE TABLE IF NOT EXISTS Carros ( ID NUMERIC, Preco NUMERIC, Dono TEXT, Compart TEXT, Modelo NUMERIC, PX FLOAT, PY FLOAT, PZ FLOAT, Angulo FLOAT, Cor1 NUMERIC, Cor2 NUMERIC )" );
63}
64
65function Reload()
66{
67dofile( "scripts/Main.nut" );
68dofile( "scripts/Functions.nut" );
69dofile( "scripts/Cmds.nut" );
70dofile( "scripts/Echo.nut" );
71StaffMessage( "4[RELOAD]0 Script Recarregado..." );
72EchoMessage( "4[RELOAD]0 Script Recarregado..." );
73Message( "[#FF0000][RELOAD][#FFFFFF] Script Recarregado..." );
74print( "Script Recarregado..." );
75}
76
77function CarregarCarros()
78{
79local i = 0, modelo, x, y, z, angulo, cor1, cor2;
80local q = QuerySQL( db, "SELECT * FROM Carros" );
81
82while ( GetSQLColumnData( q, 0 ) != null )
83{
84modelo = GetSQLColumnData( q, 4 );
85x = GetSQLColumnData( q, 5 );
86y = GetSQLColumnData( q, 6 );
87z = GetSQLColumnData( q, 7 );
88angulo = GetSQLColumnData( q, 8 );
89cor1 = GetSQLColumnData( q, 9 );
90cor2 = GetSQLColumnData( q, 10 );
91CreateVehicle( modelo, 0, Vector( x.tofloat(), y.tofloat(), z.tofloat() ), angulo, cor1, cor2 );
92GetSQLNextRow( q );
93i++;
94}
95FreeSQLQuery( q );
96print( "Veiculos Carregados - " + i );
97}
98
99function IpToCountry( IP )
100{
101local country = geoip_country_name_by_addr( IP );
102if ( IP == "127.0.0.1" ) return "Brazil";
103else if ( country == null ) return "Nao Encontrado";
104else return country;
105}
106
107function PartReason( reason )
108{
109if ( reason == 0 ) return "Timeout";
110else if ( reason == 1 ) return "Quit";
111else if ( reason == 2 ) return "Kickado";
112else if ( reason == 3 ) return "Crash";
113}
114
115function DeathReason( reason )
116{
117if ( reason == 70 ) return "Suicidio";
118else if ( reason == 39 ) return "Acidente de Carro";
119else if ( reason == 31 ) return "Queimado";
120else if ( reason == 14 ) return "Sufocado";
121else if ( reason == 43 ) return "Afogado";
122else if ( reason == 41 ) return "Explosao";
123else if ( reason == 51 ) return "Explosao";
124else if ( reason == 44 ) return "Caiu";
125else return "Motivo Desconhecido";
126}
127
128function GetBP( part )
129{
130local group = "";
131if ( part == 0 ) group = "Body";
132else if ( part == 1 ) group = "Torso";
133else if ( part == 2 ) group = "Left Arm";
134else if ( part == 3 ) group = "Right Arm";
135else if ( part == 4 ) group = "Left Leg";
136else if ( part == 5 ) group = "Right Leg";
137else if ( part == 6 ) group = "Cabeca";
138return group;
139}
140
141function Configuracao()
142{
143SetUseClasses( true );
144SetDeathMessages( false );
145SetKillDelay( 255 );
146SetDrivebyEnabled( false );
147SetDriveOnWater( false );
148SetFlyingCars( false );
149SetFriendlyFire( true );
150SetJoinMessages( false );
151SetShowNametags( true );
152SetShowOnRadar( true );
153SetStuntBike( false );
154SetTaxiBoostJump( true );
155SetServerName( Server.Nome );
156SetSpawnPlayerPos( -1437.89, -820.148, 14.8714 );
157SetSpawnCameraPos( -1437.8, -811.572, 14.8713);
158SetSpawnCameraLook( -1437.84, -815.382, 14.8714 );
159SetGameModeName( "BR v" + Server.Versao );
160SetTime( 12, 00 );
161SetTimeRate( 0 );
162Classes();
163print( Server.Nome + " v" + Server.Versao + " criado por " + Server.Desenvolvedor + " iniciado." );
164}
165
166function Classes()
167{
168//================================= Tommy Team =================================
169AddClass( 0, RGB( 30, 144, 255 ), 0, Vector( -378.557, -541.685, 17.2831 ), -0.00544404, 17, 1000 , 21, 1000, 26, 1000 );
170AddClass( 0, RGB( 30, 144, 255 ), 95, Vector( -378.557, -541.685, 17.2831 ), -0.00544404, 17, 1000 , 21, 1000, 26, 1000 );
171//================================== Cop Team ==================================
172AddClass( 1, RGB( 190, 190, 190 ), 1, Vector( -657.341, 762.188, 11.5999 ), 2.441, 17, 1000 , 21, 1000, 26, 1000 );
173AddClass( 1, RGB( 190, 190, 190 ), 3, Vector( -657.341, 762.188, 11.5999 ), 2.441, 17, 1000 , 21, 1000, 26, 1000 );
174//================================== Army Team =================================
175AddClass( 2, RGB( 255, 0, 0 ), 2, Vector( -1721.48, -226.703, 14.8683 ), -3.12018, 17, 1000 , 21, 1000, 26, 1000 );
176AddClass( 2, RGB( 255, 0, 0 ), 4, Vector( -1721.48, -226.703, 14.8683 ), -3.12018, 17, 1000 , 21, 1000, 26, 1000 );
177//================================== Taxi Team =================================
178AddClass( 3, RGB( 255, 165, 0 ), 28, Vector( -995.355, 185.432, 12.434 ), -0.123521, 17, 1000 , 21, 1000, 26, 1000 );
179AddClass( 3, RGB( 255, 165, 0 ), 74, Vector( -995.355, 185.432, 12.434 ), -0.123521, 17, 1000 , 21, 1000, 26, 1000 );
180//================================== Golf Team =================================
181AddClass( 4, RGB( 250, 128, 114 ), 62, Vector( 100.034, 254.158, 21.7719 ), -2.70758, 17, 1000 , 21, 1000, 26, 1000 );
182AddClass( 4, RGB( 250, 128, 114 ), 64, Vector( 100.034, 254.158, 21.7719 ), -2.70758, 17, 1000 , 21, 1000, 26, 1000 );
183//================================== Biker Team ================================
184AddClass( 5, RGB( 160, 32, 240 ), 93, Vector( -603.613, 634.466, 12.2347 ), -1.47827, 17, 1000 , 21, 1000, 26, 1000 );
185AddClass( 5, RGB( 160, 32, 240 ), 94, Vector( -603.613, 634.466, 12.2347 ), -1.47827, 17, 1000 , 21, 1000, 26, 1000 );
186//================================== Pizza Team ================================
187AddClass( 6, RGB( 255, 255, 0 ), 68, Vector( -907.399, 800.637, 11.3918 ), -1.64542, 17, 1000 , 21, 1000, 26, 1000 );
188AddClass( 6, RGB( 255, 255, 0 ), 132, Vector( -907.399, 800.637, 11.3918 ), -1.64542, 17, 1000 , 21, 1000, 26, 1000 );
189//================================== Thug Team =================================
190AddClass( 7, RGB( 0, 139, 139 ), 154, Vector( 85.0716, 1112.38, 18.7597 ), 3.12136, 17, 1000 , 21, 1000, 26, 1000 );
191AddClass( 7, RGB( 0, 139, 139 ), 148, Vector( 85.0716, 1112.38, 18.7597 ), 3.12136, 17, 1000 , 21, 1000, 26, 1000 );
192//================================ Haitian Team ================================
193AddClass( 8, RGB( 0, 255, 255 ), 85, Vector( -965.356, 148.572, 9.39548 ), -1.53778, 17, 1000 , 21, 1000, 26, 1000 );
194AddClass( 8, RGB( 0, 255, 255 ), 86, Vector( -965.356, 148.572, 9.39548 ), -1.53778, 17, 1000 , 21, 1000, 26, 1000 );
195//================================= Cuban Team =================================
196AddClass( 9, RGB( 255, 192, 203 ), 83, Vector( -1167.03, -614.434, 11.8292 ), 1.78367, 17, 1000 , 21, 1000, 26, 1000 );
197AddClass( 9, RGB( 255, 192, 203 ), 84, Vector( -1167.03, -614.434, 11.8292 ), 1.78367, 17, 1000 , 21, 1000, 26, 1000 );
198//================================ Malibu Team =================================
199AddClass( 10, RGB( 127, 255, 212 ), 186, Vector( 465.706, -53.9011, 15.7038 ), -2.37175, 17, 1000 , 21, 1000, 26, 1000 );
200AddClass( 10, RGB( 127, 255, 212 ), 115, Vector( 465.706, -53.9011, 15.7038 ), -2.37175, 17, 1000 , 21, 1000, 26, 1000 );
201//================================= FBI Team ===================================
202AddClass( 11, RGB( 255, 215, 0 ), 97, Vector( -873.145, -684.57, 11.3023 ), -0.649355, 17, 1000 , 21, 1000, 26, 1000 );
203AddClass( 11, RGB( 255, 215, 0 ), 98, Vector( -873.145, -684.57, 11.3023 ), -0.649355, 17, 1000 , 21, 1000, 26, 1000 );
204//================================= Goku Team ===================================
205 AddClass( 12, RGB( 24, 255, 241 ) ,220, Vector( -378.79, -537.962, 17.2832 ), 140.020, 21, 999 ,1, 1, 25, 255 );
206 AddClass( 12, RGB( 24, 255, 241 ) ,221, Vector( -378.79, -537.962, 17.2832 ), 140.020, 21, 999 ,1, 1, 25, 255 );
207//================================= Naruto Team =================================
208AddClass( 13, RGB( 24, 255, 241 ) ,210, Vector( -378.79, -537.962, 17.2832 ), 140.020, 21, 999 ,1, 1, 25, 255 );
209AddClass( 13, RGB( 24, 255, 241 ) ,216, Vector( -378.79, -537.962, 17.2832 ), 140.020, 21, 999 ,1, 1, 25, 255 );
210}
211
212function GetNameClass( classID )
213{
214local id = classID;
215if ( id == 0 ) return "Tommy's Team";
216else if ( id == 1 ) return "Police Team";
217else if ( id == 2 ) return "Army Team";
218else if ( id == 3 ) return "Taxi Team";
219else if ( id == 4 ) return "Golf Team";
220else if ( id == 5 ) return "Bikers Team";
221else if ( id == 6 ) return "Pizza Team";
222else if ( id == 7 ) return "Thug Team";
223else if ( id == 8 ) return "Haitian Team";
224else if ( id == 9 ) return "Cuban Team";
225else if ( id == 10 ) return "Malibu Team";
226else if ( id == 11 ) return "FBI Team";
227else if ( id == 12 ) return "Goku Team";
228else if ( id == 13 ) return "Naruto Team";
229else return " ";
230}
231
232function S_MSG( text, player ) MessagePlayer( "[#00FF00][SINTAXE][#FFFFFF] " + text, player );
233
234function E_MSG( text, player ) MessagePlayer( "[#FF4500][ERRO][#FF0000] " + text, player );
235
236function I_MSG( text, player ) MessagePlayer( "[#FF00FF][INFO][#FFFFFF] " + text, player );
237
238function A_MSG( text, player )
239{
240MessageAllExcept( "[#FFFFFF]***[#00FFFF] " + text, player );
241EchoMessage( "6***3 " + text );
242}
243
244function MSG( text )
245{
246Message( "[#EEDD82]***[#EEDD82] " + text );
247EchoMessage( "7***7 " + text );
248StaffMessage( "7***7 " + text );
249}
250
251function SalvarTudo()
252{
253for( local i = 0, plr; i < GetMaxPlayers(); i++ )
254{
255plr = FindPlayer( i );
256if ( plr ) SalvarDados( plr );
257}
258}
259
260
261function CreateBox()
262{
263 Box = CreatePickup( 345 , Vector( -403.665, 900.964, 39.2562 ) );
264}
265
266function Agua( user )
267{
268local player = FindPlayer( user );
269if ( player ) player.Pos = Vector( -597.7496, -1858.9531, 28.1291 );
270}
271
272function Drown( admin, player, motivo )
273{
274if ( player.Vehicle ) player.Eject();
275MSG( "Admin " + admin + " afogou " + player.Name + ". Motivo: " + motivo + "." );
276player.Health = 3;
277NewTimer( "Agua", 700, 1, player.ID );
278}
279
280function Ban( admin, player, motivo )
281{
282QuerySQL( db, "INSERT INTO Bans ( Nome, UID, Admin, Motivo, Data ) VALUES ( '" + player.Name + "', '" + player.UniqueID + "', '" + admin + "', '" + motivo + "', '" + GetFullTime() + "' )" );
283MSG( "Admin " + admin + " baniu " + player.Name + ". Motivo: " + motivo + "." );
284KickPlayer( player );
285}
286
287function Kick( admin, player, motivo )
288{
289MSG( "Admin " + admin + " kickou " + player.Name + ". Motivo: " + motivo + "." );
290KickPlayer( player );
291}
292
293function GetVehInfo( veh, opcao )
294{
295local opcao = opcao.tolower();
296if ( veh )
297{
298local q = QuerySQL( db, "SELECT * FROM Carros WHERE ID='" + veh.ID + "'" );
299if ( opcao == "preco" ) return GetSQLColumnData( q, 1 ).tointeger();
300else if ( opcao == "dono" ) return GetSQLColumnData( q, 2 );
301else if ( opcao == "compart" ) return GetSQLColumnData( q, 3 );
302else return "Informacao nao encontrada";
303}
304}
305
306//função pesca
307
308function starttofish( playerID )
309{
310local player = FindPlayer( playerID );
311if ( player )
312{
313local randomoffish = random(1,5)
314if ( randomoffish == 1 )
315{
316 EchoMessage( "11[PESCA]4 " + player.Name + "11 pescou uma piranha." );
317 Message( "[#00FF00][PESCA][#FF0000] " + player.Name + "[#00FF00] pescou uma piranha." );
318 PrivMessage(player,"use /comerpexie para comer e /venderpeixe para vender!")
319 hasfish[player.ID] = true;
320 player.IsFrozen=false;
321fishing[player.ID] = false;
322 player.SetAnim(0,163);
323 player.Disarm();
324}
325
326if ( randomoffish == 2 )
327{
328 EchoMessage( "11[PESCA]4 " + player.Name + "11 pescou um peixe palhaco." );
329 Message( "[#00FF00][PESCA][#FF0000] " + player.Name + "[#00FF00] pescou um peixe palhaco." );
330 PrivMessage(player,"use /comerpexie para comer e /venderpeixe para vender!")
331 hasfish[player.ID] = true;
332 player.IsFrozen=false;
333fishing[player.ID] = false;
334 player.SetAnim(0,163);
335 player.Disarm();
336}
337
338if ( randomoffish == 3 )
339{
340 EchoMessage( "11[PESCA]4 " + player.Name + "11 falhou na pesca nao pegou nada." );
341 Message( "[#00FF00][PESCA][#FF0000] " + player.Name + "[#00FF00] falhou na pesca nao pegou nada." );
342 player.IsFrozen=false;
343fishing[player.ID] = false;
344 player.SetAnim(0,44);
345 player.Disarm();
346}
347
348if ( randomoffish == 5 )
349{
350 EchoMessage( "11[PESCA]4 " + player.Name + "11 pescou bosta." );
351 Message( "[#00FF00][PESCA][#FF0000] " + player.Name + "[#00FF00] pescou bosta." );
352 player.IsFrozen=false;
353fishing[player.ID] = false;
354 player.SetAnim(0,44);
355 player.Disarm();
356}
357
358if ( randomoffish == 4 )
359{
360 EchoMessage( "11[PESCA]4 " + player.Name + "11 pescou um peixe espada." );
361 Message( "[#00FF00][PESCA][#FF0000] " + player.Name + "[#00FF00] pescou um peixe espada." );
362 player.IsFrozen=false;
363 PrivMessage(player,"use /comerpeixe para comer e /venderpeixe para vender!")
364 hasfish[player.ID] = true;
365fishing[player.ID] = false;
366 player.SetAnim(0,163);
367 player.Disarm();
368}
369 }
370}
371
372function random(start, finish)
373{
374 local t = ((rand() % (finish - start)) + start);
375 return t;
376}
377
378function PlayerIsAdmin(player)
379{
380 if(pinfo[player.ID].admin == true) return 1;
381 else return 0;
382}
383
384//loteria
385function StartLottery()
386{
387 if ( LotteryCount >= 2 ) // Lottery starts from three tickets purchased. You chose this...
388 {
389 local ticket = raffle();
390 for ( local i = 0; i <= GetMaxPlayers(); i ++ )
391 {
392 local player = FindPlayer( i );
393 if ( player )
394 {
395 if ( Lottery[ player.ID ] == true )
396 {
397 if ( TicketsPurchased.rawget( player.ID ) == ticket )
398 {
399 LotteryWon = true;
400 Message( "===========LOTERIA===========" );
401 Message( "[#BC8F8F]Ganhador:[#008000] " + player.Name + ".");
402 Message( "[#BC8F8F]Bilhete:[#008000] " + ticket + ".");
403 Message( "[#BC8F8F]Premio:[#008000] " + LotteryPrize + ".");
404 Message( "============================" );
405 IncCash( player, LotteryPrize );
406 }
407 }
408 }
409 }
410 LotteryWon ? ( Message( "[#EEAAEE]Loteria Fechada!!" ), EndLottery() ) : Message( "Lottery: No winners this time, the prize is now " + LotteryPrize );
411 }
412 else
413 {
414 Message( "[#FFFFFF][BCRL] [#444444]Loteria cancelada por falta de bilhetes comprado.." );
415 _Lottery <- NewTimer( "StartLottery", 300000, 1 );
416 }
417}
418
419function EndLottery()
420{
421 for ( local i = 0; i <= GetMaxPlayers(); i ++ )
422 {
423 local player = FindPlayer( i );
424 if ( player )
425 {
426 if ( Lottery[ player.ID ] == true )
427 {
428 TicketsPurchased.rawset( player.ID, 0 );
429 Lottery[ player.ID ] = false;
430 LotteryWon = false;
431 LotteryCount = 0;
432 }
433 }
434 }
435
436 for ( local i = 1; i < 60; i ++ )
437 {
438 Tickets[i] = false;
439 usedTickets.clear();
440 }
441}
442
443function raffle()
444{
445 local rand = rand() % usedTickets.len();
446 return usedTickets[rand];
447}
448//
449
450//skin
451function AddSkin( player, skin )
452{
453if ( ( skin ) && IsNum( skin ) ) skin = skin.tointeger();
454else if ( skin ) skin = GetSkinID( skin );
455QuerySQL( db, "DELETE FROM Skins WHERE Name='" + player.Name + "'" );
456QuerySQL( db, "INSERT INTO Skins ( Nome, Skin ) VALUES ( '" + player.Name + "', '" + skin + "')" );
457}
458
459function Emprego( player, Emprego )
460{
461QuerySQL( db, "DELETE FROM Emprego WHERE Name='" + player.Name + "'" );
462QuerySQL( db, "INSERT INTO Emprego ( Nome, Emprego ) VALUES ( '" + player.Name + "', '" + Emprego + "')" );
463}
464
465function Demissao( player )
466{
467QuerySQL( db, "DELETE FROM Emprego WHERE Nome='" + player.Name + "'" );
468}
469
470function DelSkin( player )
471{
472QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
473}
474
475function skin( player )
476{
477local skin = GetSQLColumnData( QuerySQL( db, "SELECT Skin FROM Skins WHERE Nome='" + player.Name + "'" ), 0 );
478if ( skin ) return skin;
479else return 0;
480}
481
482function checkingstaff( player )
483{
484if ( GetLevel(player) >= 2 ) // Change It if you aren't using GetLevel Function or change the numeric values
485 {
486 local sl = QuerySQL( db, "SELECT * FROM StaffList WHERE Name='" + player.Name + "'" );
487 if ( GetSQLColumnData( sl, 0 ) == null )
488 {
489 QuerySQL(db, "INSERT INTO StaffList (Name, Level, State) VALUES ('"+ player.Name +"', '"+ GetLevel(player) +"', '"+ GetLevelTag(player) +"')");
490 }
491 else
492 {
493 QuerySQL(db, "UPDATE StaffList SET Level='" + GetLevel(player) + "' WHERE Name='" + player.Name + "'");
494 QuerySQL(db, "UPDATE StaffList SET State='" + GetLevelTag(player) + "' WHERE Name='" + player.Name + "'");
495 }
496FreeSQLQuery(sl);
497 }
498 else
499 {
500 QuerySQL(db, "DELETE FROM StaffList WHERE Name='"+player.Name+"'");
501 }
502}
503
504function LoadSkin( player )
505{
506if ( skin(player) == 0 ) player.Skin = 0 ;
507else if ( skin(player) == 1 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
508else if ( skin(player) == 2 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
509else if ( skin(player) == 3 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
510else if ( skin(player) == 4 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
511else if ( skin(player) == 5 ) player.Skin = 5 ;
512else if ( skin(player) == 6 ) player.Skin = 6 ;
513else if ( skin(player) == 7 ) player.Skin = 7 ;
514else if ( skin(player) == 8 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
515else if ( skin(player) == 9 ) player.Skin = 9 ;
516else if ( skin(player) == 10 ) player.Skin = 10 ;
517else if ( skin(player) == 11 ) player.Skin = 11 ;
518else if ( skin(player) == 12 ) player.Skin = 12 ;
519else if ( skin(player) == 13 ) player.Skin = 13 ;
520else if ( skin(player) == 14 ) player.Skin = 14 ;
521else if ( skin(player) == 15 ) player.Skin = 15 ;
522else if ( skin(player) == 16 ) player.Skin = 16 ;
523else if ( skin(player) == 17 ) player.Skin = 17 ;
524else if ( skin(player) == 18 ) player.Skin = 18 ;
525else if ( skin(player) == 19 ) player.Skin = 19 ;
526else if ( skin(player) == 20 ) player.Skin = 20 ;
527else if ( skin(player) == 21 ) player.Skin = 21 ;
528else if ( skin(player) == 22 ) player.Skin = 22 ;
529else if ( skin(player) == 23 ) player.Skin = 23 ;
530else if ( skin(player) == 24 ) player.Skin = 24 ;
531else if ( skin(player) == 25 ) player.Skin = 25 ;
532else if ( skin(player) == 26 ) player.Skin = 26 ;
533else if ( skin(player) == 27 ) player.Skin = 27 ;
534else if ( skin(player) == 28 ) player.Skin = 28 ;
535else if ( skin(player) == 29 ) player.Skin = 29 ;
536else if ( skin(player) == 30 ) player.Skin = 30 ;
537else if ( skin(player) == 31 ) player.Skin = 31 ;
538else if ( skin(player) == 32 ) player.Skin = 32 ;
539else if ( skin(player) == 33 ) player.Skin = 33 ;
540else if ( skin(player) == 34 ) player.Skin = 34 ;
541else if ( skin(player) == 35 ) player.Skin = 35 ;
542else if ( skin(player) == 36 ) player.Skin = 36 ;
543else if ( skin(player) == 37 ) player.Skin = 37 ;
544else if ( skin(player) == 38 ) player.Skin = 38 ;
545else if ( skin(player) == 39 ) player.Skin = 39 ;
546else if ( skin(player) == 40 ) player.Skin = 40 ;
547else if ( skin(player) == 41 ) player.Skin = 41 ;
548else if ( skin(player) == 42 ) player.Skin = 42 ;
549else if ( skin(player) == 43 ) player.Skin = 43 ;
550else if ( skin(player) == 44 ) player.Skin = 44 ;
551else if ( skin(player) == 45 ) player.Skin = 45 ;
552else if ( skin(player) == 46 ) player.Skin = 46 ;
553else if ( skin(player) == 47 ) player.Skin = 47 ;
554else if ( skin(player) == 48 ) player.Skin = 48 ;
555else if ( skin(player) == 49 ) player.Skin = 49 ;
556else if ( skin(player) == 50 ) player.Skin = 50 ;
557else if ( skin(player) == 51 ) player.Skin = 51 ;
558else if ( skin(player) == 52 ) player.Skin = 52 ;
559else if ( skin(player) == 53 ) player.Skin = 53 ;
560else if ( skin(player) == 54 ) player.Skin = 54 ;
561else if ( skin(player) == 55 ) player.Skin = 55 ;
562else if ( skin(player) == 56 ) player.Skin = 56 ;
563else if ( skin(player) == 57 ) player.Skin = 57 ;
564else if ( skin(player) == 58 ) player.Skin = 58 ;
565else if ( skin(player) == 59 ) player.Skin = 59 ;
566else if ( skin(player) == 60 ) player.Skin = 60 ;
567else if ( skin(player) == 61 ) player.Skin = 61 ;
568else if ( skin(player) == 62 ) player.Skin = 62 ;
569else if ( skin(player) == 63 ) player.Skin = 63 ;
570else if ( skin(player) == 64 ) player.Skin = 64 ;
571else if ( skin(player) == 65 ) player.Skin = 65 ;
572else if ( skin(player) == 66 ) player.Skin = 66 ;
573else if ( skin(player) == 67 ) player.Skin = 67 ;
574else if ( skin(player) == 68 ) player.Skin = 68 ;
575else if ( skin(player) == 69 ) player.Skin = 69 ;
576else if ( skin(player) == 70 ) player.Skin = 70 ;
577else if ( skin(player) == 71 ) player.Skin = 71 ;
578else if ( skin(player) == 72 ) player.Skin = 72 ;
579else if ( skin(player) == 73 ) player.Skin = 73 ;
580else if ( skin(player) == 74 ) player.Skin = 74 ;
581else if ( skin(player) == 75 ) player.Skin = 75 ;
582else if ( skin(player) == 76 ) player.Skin = 76 ;
583else if ( skin(player) == 77 ) player.Skin = 77 ;
584else if ( skin(player) == 78 ) player.Skin = 78 ;
585else if ( skin(player) == 79 ) player.Skin = 79 ;
586else if ( skin(player) == 80 ) player.Skin = 80 ;
587else if ( skin(player) == 81 ) player.Skin = 81 ;
588else if ( skin(player) == 82 ) player.Skin = 82 ;
589else if ( skin(player) == 83 ) player.Skin = 83 ;
590else if ( skin(player) == 84 ) player.Skin = 84 ;
591else if ( skin(player) == 85 ) player.Skin = 85 ;
592else if ( skin(player) == 86 ) player.Skin = 86 ;
593else if ( skin(player) == 87 ) player.Skin = 87 ;
594else if ( skin(player) == 88 ) player.Skin = 88 ;
595else if ( skin(player) == 89 ) player.Skin = 89 ;
596else if ( skin(player) == 90 ) player.Skin = 90 ;
597else if ( skin(player) == 91 ) player.Skin = 91 ;
598else if ( skin(player) == 92 ) player.Skin = 92 ;
599else if ( skin(player) == 93 ) player.Skin = 93 ;
600else if ( skin(player) == 94 ) player.Skin = 94 ;
601else if ( skin(player) == 95 ) player.Skin = 95 ;
602else if ( skin(player) == 96 ) player.Skin = 96 ;
603else if ( skin(player) == 97 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
604else if ( skin(player) == 98 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
605else if ( skin(player) == 99 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
606else if ( skin(player) == 100 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
607else if ( skin(player) == 101 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
608else if ( skin(player) == 102 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
609else if ( skin(player) == 103 ) player.Skin = 103 ;
610else if ( skin(player) == 104 ) player.Skin = 104 ;
611else if ( skin(player) == 105 ) player.Skin = 105 ;
612else if ( skin(player) == 106 ) player.Skin = 106 ;
613else if ( skin(player) == 107 ) player.Skin = 107 ;
614else if ( skin(player) == 108 ) player.Skin = 108 ;
615else if ( skin(player) == 109 ) player.Skin = 109 ;
616else if ( skin(player) == 110 ) player.Skin = 110 ;
617else if ( skin(player) == 111 ) player.Skin = 111 ;
618else if ( skin(player) == 112 ) player.Skin = 112 ;
619else if ( skin(player) == 113 ) player.Skin = 113 ;
620else if ( skin(player) == 114 ) player.Skin = 114 ;
621else if ( skin(player) == 115 ) player.Skin = 115 ;
622else if ( skin(player) == 116 ) player.Skin = 116 ;
623else if ( skin(player) == 117 ) player.Skin = 117 ;
624else if ( skin(player) == 118 ) player.Skin = 118 ;
625else if ( skin(player) == 119 ) player.Skin = 119 ;
626else if ( skin(player) == 120 ) player.Skin = 120 ;
627else if ( skin(player) == 121 ) player.Skin = 121 ;
628else if ( skin(player) == 122 ) player.Skin = 122 ;
629else if ( skin(player) == 123 ) player.Skin = 123 ;
630else if ( skin(player) == 124 ) player.Skin = 124 ;
631else if ( skin(player) == 125 ) player.Skin = 125 ;
632else if ( skin(player) == 126 ) player.Skin = 126 ;
633else if ( skin(player) == 127 ) player.Skin = 127 ;
634else if ( skin(player) == 128 ) player.Skin = 128 ;
635else if ( skin(player) == 129 ) player.Skin = 129 ;
636else if ( skin(player) == 130 ) player.Skin = 130 ;
637else if ( skin(player) == 131 ) player.Skin = 131 ;
638else if ( skin(player) == 132 ) player.Skin = 132 ;
639else if ( skin(player) == 133 ) player.Skin = 133 ;
640else if ( skin(player) == 134 ) player.Skin = 134 ;
641else if ( skin(player) == 135 ) player.Skin = 135 ;
642else if ( skin(player) == 136 ) player.Skin = 136 ;
643else if ( skin(player) == 137 ) player.Skin = 137 ;
644else if ( skin(player) == 138 ) player.Skin = 138 ;
645else if ( skin(player) == 139 ) player.Skin = 139 ;
646else if ( skin(player) == 140 ) player.Skin = 140 ;
647else if ( skin(player) == 141 ) player.Skin = 141 ;
648else if ( skin(player) == 142 ) player.Skin = 142 ;
649else if ( skin(player) == 143 ) player.Skin = 143 ;
650else if ( skin(player) == 144 ) player.Skin = 144 ;
651else if ( skin(player) == 145 ) player.Skin = 145 ;
652else if ( skin(player) == 146 ) player.Skin = 146 ;
653else if ( skin(player) == 147 ) player.Skin = 147 ;
654else if ( skin(player) == 148 ) player.Skin = 148 ;
655else if ( skin(player) == 149 ) player.Skin = 149 ;
656else if ( skin(player) == 150 ) player.Skin = 150 ;
657else if ( skin(player) == 151 ) player.Skin = 151 ;
658else if ( skin(player) == 152 ) player.Skin = 152 ;
659else if ( skin(player) == 153 ) player.Skin = 153 ;
660else if ( skin(player) == 154 ) player.Skin = 154 ;
661else if ( skin(player) == 155 ) player.Skin = 155 ;
662else if ( skin(player) == 156 ) player.Skin = 156 ;
663else if ( skin(player) == 157 ) player.Skin = 157 ;
664else if ( skin(player) == 158 ) player.Skin = 158 ;
665else if ( skin(player) == 159 ) player.Skin = 159 ;
666else if ( skin(player) == 160 ) player.Skin = 160 ;
667else if ( skin(player) == 161 ) player.Skin = 161 ;
668else if ( skin(player) == 162 ) player.Skin = 162 ;
669else if ( skin(player) == 163 ) player.Skin = 163 ;
670else if ( skin(player) == 164 ) player.Skin = 164 ;
671else if ( skin(player) == 165 ) player.Skin = 165 ;
672else if ( skin(player) == 166 ) player.Skin = 166 ;
673else if ( skin(player) == 167 ) player.Skin = 167 ;
674else if ( skin(player) == 168 ) player.Skin = 168 ;
675else if ( skin(player) == 169 ) player.Skin = 169 ;
676else if ( skin(player) == 170 ) player.Skin = 170 ;
677else if ( skin(player) == 171 ) player.Skin = 171 ;
678else if ( skin(player) == 172 ) player.Skin = 172 ;
679else if ( skin(player) == 173 ) player.Skin = 173 ;
680else if ( skin(player) == 174 ) player.Skin = 174 ;
681else if ( skin(player) == 175 ) player.Skin = 175 ;
682else if ( skin(player) == 176 ) player.Skin = 176 ;
683else if ( skin(player) == 177 ) player.Skin = 177 ;
684else if ( skin(player) == 178 ) player.Skin = 178 ;
685else if ( skin(player) == 179 ) player.Skin = 179 ;
686else if ( skin(player) == 180 ) player.Skin = 180 ;
687else if ( skin(player) == 181 ) player.Skin = 181 ;
688else if ( skin(player) == 182 ) player.Skin = 182 ;
689else if ( skin(player) == 183 ) player.Skin = 183 ;
690else if ( skin(player) == 184 ) player.Skin = 184 ;
691else if ( skin(player) == 185 ) player.Skin = 185 ;
692else if ( skin(player) == 186 ) player.Skin = 186 ;
693else if ( skin(player) == 187 ) player.Skin = 187 ;
694else if ( skin(player) == 188 ) player.Skin = 188 ;
695else if ( skin(player) == 189 ) player.Skin = 189 ;
696else if ( skin(player) == 190 ) player.Skin = 190 ;
697else if ( skin(player) == 191 ) player.Skin = 191 ;
698else if ( skin(player) == 192 ) player.Skin = 192 ;
699else if ( skin(player) == 193 ) player.Skin = 193 ;
700else if ( skin(player) == 194 ) player.Skin = 194 ;
701else if ( skin(player) == 195 ) player.Skin = 195 ;
702}
703//----------------------------//
704
705
706function DonoCompartVeh( player, veh )
707{
708if ( GetVehInfo( veh, "dono" ) == player.Name || GetVehInfo( veh, "compart" ) == player.Name ) return true;
709else return false;
710}
711
712function VeiculoInfo( player, veh, opcao )
713{
714if ( opcao == 0 )
715{
716I_MSG( "ID: [" + veh.ID + "] | Modelo: [" + GetVehicleNameFromModel( veh.Model ) + "] | Preco: [$ " + GetVehInfo( veh, "preco" ) + "].", player );
717I_MSG( "Dono: [" + GetVehInfo( veh, "dono" ) + "] | Compartilhado com: [" + GetVehInfo( veh, "compart" ) + "].", player );
718}
719else if ( opcao == 1 ) I_MSG( "Voce saiu do veiculo " + GetVehicleNameFromModel( veh.Model ) + ".", player );
720}
721//==============================================================================
722//------------------------- Player Functions -----------------------------------
723//==============================================================================
724function Checar( player, plr )
725{
726if ( plr == null )
727{
728if ( status[ player.ID ].Registrado == false )
729{
730E_MSG( "Seu nick nao esta registrado.", player );
731return true;
732}
733else if ( status[ player.ID ].Registrado == true && status[ player.ID ].Logado == false )
734{
735E_MSG( "Voce nao esta logado.", player );
736return true;
737}
738}
739else if ( plr != null )
740{
741if ( status[ plr.ID ].Registrado == false )
742{
743E_MSG( plr.Name + " nao esta registrado.", player );
744return true;
745}
746else if ( status[ plr.ID ].Registrado == true && status[ plr.ID ].Logado == false )
747{
748E_MSG( plr.Name + " nao esta logado.", player );
749return true;
750}
751}
752else return false;
753}
754
755function GetStats( player )
756{
757local kills = status[ player.ID ].Matou, deaths = status[ player.ID ].Morreu, ratio;
758if ( kills >= 1 && deaths >= 1 ) ratio = format( "%.2f", kills.tofloat() / deaths.tofloat() );
759else ratio = 0;
760Message( "[#00BFFF]* Status de[#FFFFFF] " + player.Name + "[#00BFFF]: Matou:[#FFFFFF] " + kills + "[#00BFFF] | Morreu:[#FFFFFF] " + deaths + "[#00BFFF] | Ratio:[#FFFFFF] " + ratio + "[#00BFFF]." );
761EchoMessage( "12* Status de4 " + player.Name + "12: Matou:4 " + kills + "12 | Morreu:4 " + deaths + "12 | Ratio:4 " + ratio + "12." );
762}
763
764function Registrar( player, senha )
765{
766local pass = e(senha);
767QuerySQL( db, "INSERT INTO Contas ( Nome, IP, UID, Senha, Dinheiro, Banco, Level, Data_Reg, Data_Join, Matou, Morreu, warns_staff, Nogoto, SpawnLoc, Loc ) VALUES ( '" + player.Name +
768"', '" + player.IP + "', '" + player.UniqueID + "', '" + pass + "', 2000, 0, 1, '" + GetFullTime() + "', '" + GetFullTime() + "', 0, 0, 'off', 'off', 0 )" );
769IncCash( player, 2000 );
770status[ player.ID ].Registrado = true;
771status[ player.ID ].Logado = true;
772status[ player.ID ].Level = 1;
773I_MSG( "[#00CED1]Voce registrou seu nick com sucesso.", player );
774I_MSG( "Voce Se registrou no servidor!.", player );
775I_MSG( "[#6495ED]Nao esqueca sua senha: " + senha, player );
776Announce( "~y~Nick Registrado!", player, 3 );
777}
778
779function Login( player )
780{
781CarregarDados( player );
782MessagePlayer( player.Name + " efetuou o login corretamente.", player );
783I_MSG( "[#00CED1]Bem-vindo de Novamente " + player.Name + ".", player );
784I_MSG( "[#EEAAEE]Voce efetuou o login corretamente.", player );
785I_MSG( "[#40E0D0]Level: " + status[ player.ID ].Level + " - Status: " + LevelTag( player ) + ".", player );
786Announce( "~y~Entrou!", player, 3 );
787}
788
789function ChecarConta( player )
790{
791status[ player.ID ] = PlayerStats();
792
793if ( GetLevel( player ) >= 1 )
794{
795if ( player.IP != GetIP( player ) )
796{
797MessagePlayer( "[#40E0D0]Voce esta conectado com um IP diferente.", player );
798MessagePlayer( "[#00CED1]Voce deve efetuar o login. Use /login <senha>", player );
799status[ player.ID ].Registrado = true;
800status[ player.ID ].Logado = false;
801}
802else if ( player.IP == GetIP( player ) )
803{
804CarregarDados( player );
805I_MSG( "[#00CED1]Bem-vindo Novamente " + player.Name + ".", player );
806I_MSG( "[#48D1CC]Voce logou automaticamente.", player );
807I_MSG( "[#40E0D0]Level: " + status[ player.ID ].Level + " - Status: " + LevelTag( player ) + ".", player );
808}
809}
810else
811{
812I_MSG( "[#00CED1]Ola! seja Bem-vindo " + player.Name + ".", player );
813I_MSG( "[#48D1CC]Seu nick nao esta registrado no servidor.", player );
814I_MSG( "[#40E0D0]Para se registrar no servidor use /registrar <senha>.", player );
815}
816ChecarJogador( player );
817}
818
819function CarregarDados( player )
820{
821local q = QuerySQL( db, "SELECT * FROM Contas WHERE Nome='" + player.Name + "'" );
822
823status[ player.ID ].Registrado = true;
824status[ player.ID ].Logado = true;
825status[ player.ID ].Dinheiro = GetSQLColumnData( q, 4 );
826status[ player.ID ].Banco = GetSQLColumnData( q, 5 );
827status[ player.ID ].Level = GetSQLColumnData( q, 6 );
828status[ player.ID ].Matou = GetSQLColumnData( q, 9 );
829status[ player.ID ].Morreu = GetSQLColumnData( q, 10 );
830if ( GetSQLColumnData( q, 11 ) == "on" ) status[ player.ID ].Nogoto = true;
831if ( GetSQLColumnData( q, 12 ) == "on" ) status[ player.ID ].SpawnLoc = true;
832if ( GetSQLColumnData( q, 13 ) != "0" ) status[ player.ID ].Loc = GetSQLColumnData( q, 13 );
833player.Cash = status[ player.ID ].Dinheiro;
834Data_IP( player );
835}
836
837function Data_IP( player )
838{
839QuerySQL( db, "UPDATE Contas SET IP='" + player.IP + "', Data_Join='" + GetFullTime() + "' WHERE Nome='" + player.Name + "'" );
840}
841
842function SalvarDados( player )
843{
844local p = status[ player.ID ], nogoto = "off";
845if ( p.Registrado == true && p.Logado == true )
846{
847if ( p.Nogoto == true ) nogoto = "on";
848QuerySQL( db, "UPDATE Contas SET Dinheiro='" + p.Dinheiro + "', Banco='" + p.Banco + "', Level='" + p.Level +
849"', Matou='" + p.Matou + "', Morreu='" + p.Morreu + "', Nogoto='" + nogoto + "' WHERE Nome='" + player.Name + "'" );
850}
851}
852
853function ChecarJogador( player )
854{
855local q = QuerySQL( db, "SELECT * FROM Bans WHERE UID='" + player.UniqueID + "'" );
856if ( GetSQLColumnData( q, 1 ) == player.UniqueID )
857{
858A_MSG( player.Name + " esta banido do servidor.", player );
859I_MSG( "Voce esta banido do servidor.", player );
860I_MSG( "Admin que baniu: " + GetSQLColumnData( q, 2 ) + " | Data: " + GetSQLColumnData( q, 4 ) + ".", player );
861I_MSG( "Motivo do banimento: " + GetSQLColumnData( q, 3 ) + ".", player );
862KickPlayer( player );
863}
864else if ( player.Name == "Ninguem" ) Kick( "Server", player, "Nick Bloqueado" );
865}
866
867function GiveWeapons( player, vargv )
868{
869local Weapons = "", i;
870for ( i = 0; i < vargv.len(); i++ )
871{
872if( GetWeaponID( vargv[ i ] ) && GetWeaponName( GetWeaponID( vargv[ i ] ) ) != "Unknown" && GetWeaponID( vargv[ i ] ) != 33 )
873{
874local wep = GetWeaponID( vargv[ i ] );
875if ( wep != 33 )
876{
877player.SetWeapon( GetWeaponID( vargv[ i ] ), 1000 );
878if( Weapons == "" ) Weapons = GetWeaponName( GetWeaponID( vargv[ i ] ) ).tostring();
879else Weapons = Weapons + ", " + GetWeaponName( GetWeaponID( vargv[ i ] ) ).tostring();
880}
881}
882}
883I_MSG( Weapons + ".", player );
884}
885
886function JoinMessage( player )
887{
888Message( "[#00BFFF]*** [#FFFAFA]" + player.Name + " [#FFFFF0]entrou no servidor. (" + IpToCountry( player.IP ) + ")" );
889EchoMessage( "10***4 " + player.Name + " 10entrou no servidor. (" + IpToCountry( player.IP ) + ")" );
890}
891
892function QuitMessage( player, motivo )
893{
894Message( "[#00BFFF]*** [#FFFFFF]" + player.Name + " [#00BFFF]saiu do servidor. (" + PartReason( motivo ) + ")" );
895EchoMessage( "10***4 " + player.Name + " 10saiu do servidor. (" + PartReason( motivo ) + ")" );
896}
897
898function LevelTag( player )
899{
900local lvl = status[ player.ID ].Level;
901if ( lvl == 0 ) return "Visitante";
902else if ( lvl == 1 ) return "Membro";
903else if ( lvl == 2 ) return "Helper";
904else if ( lvl == 3 ) return "Moderador";
905else if ( lvl == 4 ) return "Administrador";
906else if ( lvl == 5 ) return "Manager";
907else if ( lvl == 6 ) return "Scripter"
908else if ( lvl >= 7 ) return "Desenvolvedor"
909}
910
911function GetLevel( player )
912{
913local result = GetSQLColumnData( QuerySQL( db, "SELECT Level FROM Contas WHERE Nome='" + player.Name + "'" ), 0 ), lvl;
914if ( result == null ) lvl = GetSQLColumnData( QuerySQL( db, "SELECT Level FROM ContasContas WHERE Nome='" + player.Name + "'" ), 0 );
915else lvl = result;
916if ( lvl ) return lvl;
917else return 0;
918}
919
920function GetIP( player )
921{
922local result = GetSQLColumnData( QuerySQL( db, "SELECT IP FROM Contas WHERE Nome='" + player.Name + "'" ), 0 ), ip;
923if ( result == null ) ip = GetSQLColumnData( QuerySQL( db, "SELECT IP FROM Contas WHERE Nome='" + player.Name + "'" ), 0 );
924else ip = result;
925if ( ip ) return ip;
926else return 0;
927}
928
929function GetSenha( player )
930{
931local result = GetSQLColumnData( QuerySQL( db, "SELECT Senha FROM Contas WHERE Nome='" + player.Name + "'" ), 0 ), pass;
932if ( result == null ) pass = GetSQLColumnData( QuerySQL( db, "SELECT Senha FROM Contas WHERE Nome='" + player.Name + "'" ), 0 );
933else pass = result;
934if ( pass ) return pass;
935else return 0;
936}
937
938function IncCash( player, amount )
939{
940local cash = status[ player.ID ].Dinheiro;
941local add = cash + amount;
942status[ player.ID ].Dinheiro = add;
943player.Cash = add;
944}
945
946function DecCash( player, amount )
947{
948local cash = status[ player.ID ].Dinheiro;
949local det = cash - amount;
950status[ player.ID ].Dinheiro = det;
951player.Cash = det;
952}
953
954function IncBank( player, amount )
955{
956local bank = status[ player.ID ].Banco;
957local add = bank + amount;
958status[ player.ID ].Banco = add;
959}
960
961function DecBank( player, amount )
962{
963local bank = status[ player.ID ].Banco;
964local det = bank - amount;
965status[ player.ID ].Banco = det;
966}
967
968function Timer()
969{
970for( local i = 0, player; i < GetMaxPlayers(); i++ )
971{
972player = FindPlayer( i );
973if ( player )
974{
975if ( SpawnKill[ player.ID ] >= 1 ) SpawnKill[ player.ID ] --;
976if ( Multa[ player.ID ] >= 1 )
977{
978Multa[ player.ID ] --;
979if ( Multa[ player.ID ] == 0 ) UnMute( "Server", player );
980}
981}
982}
983}
984
985function CheckSpam( player, reason )
986{
987local MSNxSEC = 2000, LIMIT_REP_SPAM = 3;
988local spammer = ( GetTickCount() - status[ player.ID ].Count_Msg ) / MSNxSEC;
989status[ player.ID ].Msg_Player += spammer - 1;
990if ( status[ player.ID ].Msg_Player > LIMIT_REP_SPAM ) status[ player.ID ].Msg_Player = LIMIT_REP_SPAM - 1;
991if ( status[ player.ID ].Msg_Player < 0 ) status[ player.ID ].Msg_Player = -1;
992status[ player.ID ].Count_Msg = GetTickCount();
993if ( status[ player.ID ].Msg_Player < 0)
994{
995if ( Multa[ player.ID ] == 0 )
996{
997Multa[ player.ID ] = 30;
998I_MSG( "Voce foi multado por fazer spam.", player );
999A_MSG( "Auto-Mute " + player.Name + ", ID: " + player.ID + ". Motivo:[ " + reason + " ].", player );
1000}
1001}
1002}
1003
1004
1005function CheckSafe( user )
1006{
1007local player = FindPlayer( user );
1008 if ( player )
1009 {
1010local EnterSafe = DistanceFromPoint( player.Pos.x, player.Pos.z, -937.731, 17.8038 );
1011local ExitSafe = DistanceFromPoint( player.Pos.x, player.Pos.z, -937.698, 7.22692 );
1012if ( EnterSafe.tointeger() < 1 )
1013{
1014NewTimer( "ResetFffect", 500, 1, player.ID );
1015player.Pos = Vector( -937.698, -351.819, 7.22692 );
1016player.Widescreen = true;
1017}
1018else if ( ExitSafe.tointeger() < 1 )
1019{
1020NewTimer( "ResetFffect", 500, 1, player.ID );
1021player.Pos = Vector( -937.731, -351.445, 17.8038 );
1022player.Widescreen = true;
1023}
1024}
1025}
1026
1027function ResetFffect( user )
1028{
1029local player = FindPlayer( user );
1030if ( player )
1031{
1032 player.Widescreen = false;
1033}
1034}
1035
1036
1037
1038function UnMute( admin, player )
1039{
1040Multa[ player.ID ] = 0;
1041MSG( "Admin " + admin + " desmultou " + player.Name + "." );
1042}
1043
1044function LoadSpawnLoc( player )
1045{
1046if ( status[ player.ID ].SpawnLoc == true && status[ player.ID ].Loc != null )
1047{
1048local loc = status[ player.ID ].Loc,
1049pos = split( loc, " " ),
1050px = pos[0].tofloat(), py = pos[1].tofloat(), pz = pos[2].tofloat();
1051player.Pos = Vector( px, py, pz );
1052}
1053}
1054
1055
1056function AddSpawnWep( player, wep, wep2, wep3, wep4 )
1057{
1058if ( ( wep ) && IsNum( wep ) ) wep = wep.tointeger();
1059else if ( wep ) wep = GetWeaponID( wep );
1060if ( ( wep2 ) && IsNum( wep2 ) ) wep2 = wep2.tointeger();
1061else if ( wep2 ) wep2 = GetWeaponID( wep2 );
1062if ( ( wep3 ) && IsNum( wep3 ) ) wep3 = wep3.tointeger();
1063else if ( wep3 ) wep3 = GetWeaponID( wep3 );
1064if ( ( wep4 ) && IsNum( wep4 ) ) wep4 = wep4.tointeger();
1065else if ( wep4 ) wep4 = GetWeaponID( wep4 );
1066QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
1067QuerySQL( db, "INSERT INTO SpawnWep ( Nome, Wep1, Wep2, Wep3, Wep4 ) VALUES ( '" + player.Name + "', '" + wep + "', '" + wep2 + "', '" + wep3 + "', '" + wep4 + "')" );
1068I_MSG( "Arma(s) adiciona(s) e carregada(s).", player );
1069}
1070
1071function errorHandling(err)
1072{
1073 local stackInfos = getstackinfos(2);
1074
1075 if (stackInfos)
1076 {
1077 local locals = "";
1078
1079 foreach( index, value in stackInfos.locals )
1080 {
1081 if( index != "this" )
1082 locals = locals + "[" + index + "] " + value + "\n";
1083 }
1084
1085 local callStacks = "";
1086 local level = 2;
1087 do {
1088 callStacks += "*FUNCTION [" + stackInfos.func + "()] " + stackInfos.src + " line [" + stackInfos.line + "]\n";
1089 level++;
1090 } while ((stackInfos = getstackinfos(level)));
1091
1092 local errorMsg = "AN ERROR HAS OCCURRED [" + err + "]\n";
1093 errorMsg += "\nCALLSTACK\n";
1094 errorMsg += callStacks;
1095 errorMsg += "\nLOCALS\n";
1096 errorMsg += locals;
1097
1098 StaffMessage(errorMsg);
1099 }
1100}
1101
1102seterrorhandler(errorHandling);
1103
1104function MudarNick( novo, velho )
1105{
1106//Mudar o nome na tabela de contas
1107QuerySQL( db, "UPDATE Contas SET Nome='" + novo + "' WHERE Nome LIKE '" + velho + "'");
1108
1109//Mudar o nome na tabela de veÃculos
1110QuerySQL( db, "UPDATE Veiculos SET Dono='" + novo + "' WHERE Dono LIKE '" + velho + "'");
1111QuerySQL( db, "UPDATE Veiculos SET Compart='" + novo + "' WHERE Compart LIKE '" + velho + "'");
1112
1113//Mudar o nome na tabela de casas
1114QuerySQL( db, "UPDATE Casas SET Dono='" + novo + "' WHERE Dono LIKE '" + velho + "'");
1115QuerySQL( db, "UPDATE Casas SET Compart='" + novo + "' WHERE Compart LIKE '" + velho + "'");
1116
1117//Mudar o nick do jogador
1118if ( GetPlayerIDFromName( velho ) != -1 )
1119{
1120local player = FindPlayer( GetPlayerIDFromName( velho ) );
1121player.Name = novo;
1122}
1123}
1124
1125function DelSpawnWep( player )
1126{
1127QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
1128I_MSG( "Arma(s) deletada(s) de seu spawn.", player );
1129}
1130
1131function swep( player )
1132{
1133local swep = GetSQLColumnData( QuerySQL( db, "SELECT Wep1 FROM SpawnWep WHERE Nome='" + player.Name + "'" ), 0 );
1134if ( swep ) return swep;
1135else return 0;
1136}
1137
1138function swep2( player )
1139{
1140local swep2 = GetSQLColumnData( QuerySQL( db, "SELECT Wep2 FROM SpawnWep WHERE Nome='" + player.Name + "'" ), 0 );
1141if ( swep2 ) return swep2;
1142else return 0;
1143}
1144
1145function swep3( player )
1146{
1147local swep3 = GetSQLColumnData( QuerySQL( db, "SELECT Wep3 FROM SpawnWep WHERE Nome='" + player.Name + "'" ), 0 );
1148if ( swep3 ) return swep3;
1149else return 0;
1150}
1151function swep4( player )
1152{
1153local swep4 = GetSQLColumnData( QuerySQL( db, "SELECT Wep4 FROM SpawnWep WHERE Nome='" + player.Name + "'" ), 0 );
1154if ( swep4 ) return swep4;
1155else return 0;
1156}
1157
1158function RobbingSystem()
1159{
1160QuerySQL( db, "CREATE TABLE IF NOT EXISTS Robskills( Name TEXT),Robskill NUMERIC )" );
1161}
1162function GetRobskills( player )
1163{
1164 local Robbing = GetSQLColumnData( QuerySQL( db, "SELECT Robskill FROM Robskills WHERE Name='" + player.Name+"'" ), 0 );
1165 if ( Robbing ) return Robbing;
1166 else return 0;
1167}
1168function SetRobskills( player, rob )
1169{
1170 QuerySQL(db, "UPDATE Robskills SET Robskill='" + rob.tointeger() + "' WHERE Name='" + player.Name + "'");
1171}
1172
1173function RobieCopie()
1174 {
1175 QuerySQL( db, "CREATE TABLE IF NOT EXISTS Rob&Cop( Name TEXT),Robskill NUMERIC )" );
1176 }
1177 function GetRob( player )
1178{
1179 local Robie = GetSQLColumnData( QuerySQL( db, "SELECT Robskills FROM Rob&Cop WHERE Name='" + player.Name+"'" ), 0 );
1180 if ( Robie ) return Robie;
1181 else return 0;
1182}
1183function SetRob( player, rob )
1184{
1185 QuerySQL(db, "UPDATE Rob&Cop SET Robskill='" + rob.tointeger() + "' WHERE Name='" + player.Name + "'");
1186}
1187
1188function Loade()
1189{
1190CreatePickup(356, Vector( 59.9425, -1071.8, 10.4633 )); //gasolina
1191CreatePickup(356, Vector( 59.9448, -1078.36, 10.4633 )); //gasolina
1192CreatePickup(366, Vector( 382.086, 752.372, 11.7418 )); //cura
1193CreatePickup(366, Vector( 495.99, 694.904, 12.1033 )); //cura
1194CreatePickup(366, Vector( -113.039, -975.444, 10.4634 )); //cura
1195CreatePickup(366, Vector( -886.254, -457.704, 13.111 )); //cura
1196CreatePickup(366, Vector( -865.798, -82.5387, 11.5558 )); //cura
1197CreatePickup(366, Vector( -840.811, 743.97, 11.2885 )); //cura
1198CreatePickup(366, Vector( -773.21, 1156.29, 12.4111 )); //cura
1199}
1200
1201//nitrous
1202function GetVehicleType( model )
1203{
1204 // by Force
1205 // Returns: Car / Bike / Heli / Plane / Boat / RC
1206 switch ( model ) {
1207 case 136:
1208 case 160:
1209 case 176:
1210 case 182:
1211 case 183:
1212 case 184:
1213 case 190:
1214 case 202:
1215 case 203:
1216 case 214:
1217 case 223:
1218 return "Boat";
1219 case 155:
1220 case 165:
1221 case 217:
1222 case 218:
1223 case 227:
1224 return "Heli";
1225 case 166:
1226 case 178:
1227 case 191:
1228 case 192:
1229 case 193:
1230 case 198:
1231 return "Bike";
1232 case 171:
1233 case 194:
1234 case 195:
1235 case 231:
1236 return "RC";
1237 case 180:
1238 case 181:
1239 return "Plane";
1240 default:
1241 return "Car";
1242 }
1243}
1244
1245function nosEnable( player )
1246{
1247 if( player )
1248 {
1249 local veh = player.Vehicle,
1250 type = GetVehicleType( veh.Model ),
1251 defaultMaxSpeed = veh.GetHandlingData(13),
1252 defaultAcceleration = veh.GetHandlingData(14);
1253
1254 if(type == "Car")
1255 {
1256 if( veh.RelativeSpeed != Vector( 0, 0, 0 ) )
1257 veh.RelativeSpeed *= nosSpeedBoost;
1258
1259 PlaySound( veh.World, 65, veh.Pos );
1260
1261 veh.SetHandlingData(13, defaultMaxSpeed+nosMaxSpeed); // increases MaxSpeed with the value specified for nosMaxSpeed
1262 veh.SetHandlingData(14, defaultAcceleration+nosAcceleration); // increases Acceleration with the value specified for nosAcceleration
1263 veh.Lights=true; // turns on the car's lights because the green of the rear lights can't happen without having lights on
1264 veh.SetHandlingData(30,-6); // makes the rear lights green
1265 }
1266 }
1267}
1268
1269function nosDisable( player )
1270{
1271 if( player )
1272 {
1273 local veh = player.Vehicle,
1274 type = GetVehicleType( veh.Model );
1275
1276 if(type == "Car")
1277 {
1278 veh.ResetHandlingData(13); // resets the MaxSpeed
1279 veh.ResetHandlingData(14); // resets the Acceleration
1280 veh.Lights=false; // turns back the lights off
1281 veh.ResetHandlingData(30); // resets the lights color
1282 }
1283 }
1284}
1285
1286function nosLoadSprites()
1287{
1288 nosBar <- CreateSprite( "NOS_bar.png", nosBarPosX, nosBarPosY, 0, 0, 0, nosBarAlpha );
1289 for( local i = 0; i <= 9; i++ )
1290 {
1291 if(i == 0)
1292 {
1293 nosUnitAlpha[i] = nosUnitAlpha0;
1294 nosUnitPosX[i] = nosBarPosX + 13;
1295 nosUnit[i] = CreateSprite( "NOS_unit.png", nosUnitPosX[i], nosBarPosY, 0, 0, 0, nosUnitAlpha[i] );
1296 }
1297 else
1298 {
1299 nosUnitAlpha[i] = nosUnitAlpha[i-1] + nosUnitAlphaDifference;
1300 nosUnitPosX[i] = nosUnitPosX[i-1] + nosUnitDistance;
1301 nosUnit[i] = CreateSprite( "NOS_unit.png", nosUnitPosX[i], nosBarPosY, 0, 0, 0, nosUnitAlpha[i] );
1302 }
1303 }
1304}
1305
1306function nosShowBar( player )
1307{
1308 if( player )
1309 {
1310 if( nosBar ) nosBar.ShowForPlayer( player );
1311 for( local i = 0; i <= 9; i++ )
1312 if( nosUnit[i] ) nosUnit[i].ShowForPlayer( player );
1313 }
1314}
1315
1316function nosHideBar( player )
1317{
1318 if( player )
1319 {
1320 if( nosBar ) nosBar.HideFromPlayer( player );
1321 for( local i = 0; i <= 9; i++ )
1322 if( nosUnit[i] ) nosUnit[i].HideFromPlayer( player );
1323 }
1324}
1325//====================//
1326
1327//gasolina
1328function DecFuel()
1329{
1330for( local i = 0, player; i < GetMaxPlayers(); i++ )
1331{
1332player = FindPlayer( i );
1333if ( player )
1334{
1335local vehicle = player.Vehicle;
1336if ( vehicle && player.VehicleSlot == 0 )
1337{
1338if ( Fuel[ vehicle.ID ] >= 1 )
1339{
1340Fuel[ vehicle.ID ] --;
1341Announce( "~g~Gasolina: ~w~" + Fuel[ vehicle.ID ], player, 4 );
1342if ( Fuel[ vehicle.ID ] == 0 )
1343{
1344vehicle.Speed = Vector( 0, 0, 0 );
1345if ( vehicle.GetHandlingData( 13 ) != 0 ) vehicle.SetHandlingData( 13, 0 );
1346if ( vehicle.GetHandlingData( 14 ) != 0 ) vehicle.SetHandlingData( 14, 0 );
1347}
1348}
1349}
1350}
1351}
1352}
1353
1354function CheckFuel( player, vehicle, door )
1355{
1356Announce( "~g~Gasolina: ~w~" + Fuel[ vehicle.ID ], player, 4 );
1357if ( Fuel[ vehicle.ID ] == 0 && door == 0 )
1358{
1359vehicle.Speed = Vector( 0, 0, 0 );
1360if ( vehicle.GetHandlingData( 13 ) != 0 ) vehicle.SetHandlingData( 13, 0 );
1361if ( vehicle.GetHandlingData( 14 ) != 0 ) vehicle.SetHandlingData( 14, 0 );
1362}
1363}
1364
1365function topkiller()
1366{
1367local
1368query = "SELECT Nome, Matou FROM Contas ORDER BY Matou DESC LIMIT 5", //Top 5
1369q,
1370Nome1, Nome2, Nome3, Nome4, Nome5,
1371Matou1, Matou2, Matou3, Matou4, Matou5, i = 1;
1372q = QuerySQL( db, query );
1373while( GetSQLColumnData( q, 0 ) )
1374{
1375switch(i)
1376{
1377case 1:
1378Nome1 = GetSQLColumnData( q, 0 );
1379Matou1 = GetSQLColumnData( q, 1 );
1380break;
1381case 2:
1382Nome2 = GetSQLColumnData( q, 0 );
1383Matou2 = GetSQLColumnData( q, 1 );
1384break;
1385case 3:
1386Nome3 = GetSQLColumnData( q, 0 );
1387Matou3 = GetSQLColumnData( q, 1 );
1388break;
1389case 4:
1390Nome4 = GetSQLColumnData( q, 0 );
1391Matou4 = GetSQLColumnData( q, 1 );
1392break;
1393case 5:
1394Nome5 = GetSQLColumnData( q, 0 );
1395Matou5 = GetSQLColumnData( q, 1 );
1396break;
1397}
1398GetSQLNextRow( q );
1399i++;
1400}
1401FreeSQLQuery(q);
1402Message("[#00FFFF]Top 5 Matadores:[#9400D3] " + Nome1 + " Matou : " + Matou1 + ", " + Nome2 + " Matou: " + Matou2 + ", " + Nome3 + " Matou : " + Matou3 + ", " + Nome4 + " Matou : " + Matou4 + ", " + Nome5 + " Matou: " + Matou5 + "");
1403EchoMessage("10Top 5 Matadores:14 " + Nome1 + " Matou : " + Matou1 + ", " + Nome2 + " Matou: " + Matou2 + ", " + Nome3 + " Matou : " + Matou3 + ", " + Nome4 + " Matou : " + Matou4 + ", " + Nome5 + " Matou: " + Matou5 + "");
1404}
1405
1406function toprico()
1407{
1408local
1409query = "SELECT Nome, Banco FROM Contas ORDER BY Banco DESC LIMIT 5", //Top 5
1410q,
1411Nome1, Nome2, Nome3, Nome4, Nome5,
1412Banco1, Banco2, Banco3, Banco4, Banco5, i = 1;
1413q = QuerySQL( db, query );
1414while( GetSQLColumnData( q, 0 ) )
1415{
1416switch(i)
1417{
1418case 1:
1419Nome1 = GetSQLColumnData( q, 0 );
1420Banco1 = GetSQLColumnData( q, 1 );
1421break;
1422case 2:
1423Nome2 = GetSQLColumnData( q, 0 );
1424Banco2 = GetSQLColumnData( q, 1 );
1425break;
1426case 3:
1427Nome3 = GetSQLColumnData( q, 0 );
1428Banco3 = GetSQLColumnData( q, 1 );
1429break;
1430case 4:
1431Nome4 = GetSQLColumnData( q, 0 );
1432Banco4 = GetSQLColumnData( q, 1 );
1433break;
1434case 5:
1435Nome5 = GetSQLColumnData( q, 0 );
1436Banco5 = GetSQLColumnData( q, 1 );
1437break;
1438}
1439GetSQLNextRow( q );
1440i++;
1441}
1442FreeSQLQuery(q);
1443Message("[#00FFFF]Top 5 Rico:[#9400D3] " + Nome1 + " - " + Banco1 + ", " + Nome2 + " - " + Banco2 + ", " + Nome3 + " - " + Banco3 + ", " + Nome4 + " - " + Banco4 + ", " + Nome5 + " - " + Banco5 + "");
1444EchoMessage("10Top 5 Rico:14 " + Nome1 + " - " + Banco1 + ", " + Nome2 + " - " + Banco2 + ", " + Nome3 + " - " + Banco3 + ", " + Nome4 + " - " + Banco4 + ", " + Nome5 + " - " + Banco5 + "");
1445}
1446
1447function arresttime( user )
1448{
1449local player = FindPlayer( user );
1450if (player) {
1451player.Pos = Vector(399.933, -468.463, 11.7419);
1452I_MSG("Voce foi liberado!", player );
1453A_MSG( player.Name + " foi liberado!!", player );
1454}
1455}
1456
1457function RespawnVehicles( rtime = 0 ){
1458//Loop over all the vehicles.
1459for( local veh, i = 1; i <= 1000; i++ ){
1460veh = FindVehicle(i);
1461if( !veh ) continue;
1462if( rtime == 0 ) veh.Respawn();
1463else veh.RespawnTimer = rtime; //Time in ms.
1464}
1465}
1466
1467function LoadPickups()
1468{
1469local q = QuerySQL( db, "SELECT * FROM Pickups" ), i = 0;
1470while( GetSQLColumnData( q, 0 ) )
1471{
1472local
1473ID = GetSQLColumnData( q, 0 ),
1474PX = GetSQLColumnData( q, 2 ),
1475PY = GetSQLColumnData( q, 3 ),
1476PZ = GetSQLColumnData( q, 4 );
1477
1478CreatePickup(ID.tointeger(), Vector(PX.tofloat(), PY.tofloat(), PZ.tofloat()));
1479GetSQLNextRow( q );
1480i++;
1481}
1482print( "Pickups Carregadas - " + i );
1483}
1484
1485function MSG1()
1486{
1487Message("[BCRL] [#E0FFFF]Novos empregos Distribuidor de dinheiro e Caminhoneiro.");
1488EchoMessage("10[BCRL] 5Novos empregos Distribuidor de dinheiro e Caminhoneiro.");
1489}
1490
1491function MSG2()
1492{
1493Message("[BCRL] [#E0FFFF]Caso voce ache algum erro ignore erros sao normais aqui.");
1494EchoMessage("10[BCRL] 5Caso voce ache algum erro ignore erros sao normais aqui.");
1495}
1496
1497function MSG3()
1498{
1499Message("[BCRL] [#E0FFFF]Servidor apenas para testes nao vai se exaltando nao.");
1500EchoMessage("10[BCRL] 5Servidor apenas para testes nao vai se exaltando nao.");
1501}
1502
1503function MSG4()
1504{
1505Message("[BCRL] [#E0FFFF]Caso nao conheca os comandos use /cmds..");
1506EchoMessage("10[BCRL] 5Caso nao conheca os comandos use /cmds.");
1507}
1508
1509function MSG5()
1510{
1511Message("[BCRL] [#E0FFFF]Voce pode roubar em varios locais em vice city.");
1512EchoMessage("10[BCRL] 5Voce pode roubar em varios locais em vice city");
1513}
1514
1515function MSG6()
1516{
1517Message("[BCRL] [#E0FFFF]Voce presenciou algum tipo de abuser ou hack use /report.");
1518EchoMessage("10[BCRL] 5Voce presenciou algum tipo de abuser ou hack use /report");
1519}
1520
1521function TagEmpregos( player )
1522{
1523if ( ( status[ player.ID ].Policia < 1 ) && ( status[ player.ID ].Emprego < 1 ) ) return "Desempregado"
1524else if ( status[ player.ID ].Policia >= 1 ) return "Policial"
1525else if( status[ player.ID ].Emprego == 1 ) return "Traficante";
1526else if( status[ player.ID ].Emprego == 2 ) return "Mecanico";
1527else if( status[ player.ID ].Emprego == 3 ) return "Medico";
1528else if( status[ player.ID ].Emprego == 4 ) return "Seguranca De Banco";
1529else if( status[ player.ID ].Emprego == 5 ) return "Sorveteiro";
1530else if( status[ player.ID ].Emprego == 6 ) return "Investigador";
1531else if( status[ player.ID ].Emprego == 7 ) return "Distribuidor De Drogas";
1532else if( status[ player.ID ].Emprego == 8 ) return "Caminhoneiro";
1533else if( status[ player.ID ].Emprego == 9 ) return "Pizza-Boy";
1534else if( status[ player.ID ].Emprego == 10 ) return "Frentista";
1535else if( status[ player.ID ].Emprego == 11 ) return "Lixeiro";
1536else if( status[ player.ID ].Emprego == 12 ) return "Entregador de dinheiro";
1537//VOCE QUE VAI ESCOLHER QUAIS VÃO SER OS EMPREGOS, DEPOIS QUE ESCOLHER E SO ME CONTACTAR E ME DIZER QUE EU FAÇO ALGUM SISTEMA PARA ELES!
1538}
1539
1540function Caminhoneiro2( player )
1541{
1542player = FindPlayer( player );
1543if ( player )
1544{
1545if ( player.Vehicle && player.Vehicle.Model == 213 )
1546{
1547player.Eject();
1548AntiBugSphere[ player.ID ] = 5;
1549//player.Frozen = false;
1550Carregado[ player.ID ] = false;
1551I_MSG("Voce concluiu a entrega!!",player);
1552IncCash( player, 50000 );
1553Message("[#FF0000][[#7CFC00]Trabalho[#FF0000]] [#40E0D0]Caminhoneiro " + player.Name + " Concluiu uma entrega!!");
1554EchoMessage("9[7Trabalho9] 10Caminhoneiro " + player.Name + " Concluiu uma entrega!!");
1555}
1556}
1557}
1558
1559function Entrega2( player )
1560{
1561player = FindPlayer( player );
1562if ( player )
1563{
1564if ( player.Vehicle && player.Vehicle.Model == 228 )
1565{
1566player.Eject();
1567AntiBugSphere[ player.ID ] = 5;
1568//player.Frozen = false;
1569Carregado[ player.ID ] = false;
1570I_MSG("Voce concluiu a entrega!!",player);
1571IncCash( player, 50000 );
1572if ( player.WantedLevel < 6 ) player.WantedLevel ++;
1573Message("[#FF0000][[#7CFC00]Trabalho[#FF0000]] [#40E0D0]Distribuidor De Drogas " + player.Name + " Concluiu uma entrega de drogas!!");
1574EchoMessage("9[7Trabalho9] 10Distribuidor De Drogas " + player.Name + " Concluiu uma entrega de drogas!!");
1575}
1576}
1577}
1578
1579function Lixeiro2( player )
1580{
1581player = FindPlayer( player );
1582if ( player )
1583{
1584if ( player.Vehicle && player.Vehicle.Model == 138 )
1585{
1586player.Eject();
1587AntiBugSphere[ player.ID ] = 5;
1588//player.Frozen = false;
1589Carregado[ player.ID ] = false;
1590I_MSG("Voce concluiu a entrega!!",player);
1591IncCash( player, 50000 );
1592Message("[#FF0000][[#7CFC00]Trabalho[#FF0000]] [#40E0D0]Lixeiro " + player.Name + " Recolheu o lixo na Mansao de Vice City!");
1593EchoMessage("9[7Trabalho9] 10Lixeiro " + player.Name + " Recolheu o lixo na mansao de Vice city!");
1594}
1595}
1596}
1597
1598function Caminhoneiro( player )
1599{
1600player = FindPlayer( player );
1601if ( player )
1602{
1603if ( player.Vehicle && player.Vehicle.Model == 213 )
1604{
1605AntiBugSphere[ player.ID ] = 5;
1606player.RestoreCamera();
1607Carregado[ player.ID ] = true;
1608player.Frozen = false;
1609CreateMarker(player.UniqueWorld, Vector( -703.648, -1292.38, 11.0715 ), 1, RGB(000 ,000 ,000), 0 );
1610//I_MSG("Voce foi selecionado para o trabalho !!",player);
1611}
1612}
1613}
1614
1615function Lixeiro( player )
1616{
1617player = FindPlayer( player );
1618if ( player )
1619{
1620if ( player.Vehicle && player.Vehicle.Model == 138 )
1621{
1622AntiBugSphere[ player.ID ] = 5;
1623player.RestoreCamera();
1624Carregado[ player.ID ] = true;
1625player.Frozen = false;
1626CreateMarker(player.UniqueWorld, Vector( 1276.32, 77.324, 11.4534 ), 1, RGB(000 ,000 ,000), 0 );
1627//I_MSG("Voce foi selecionado para o trabalho !!",player);
1628}
1629}
1630}
1631
1632function Temporizador()
1633{
1634for( local i = 0, player; i < GetMaxPlayers(); i++ )
1635{
1636player = FindPlayer( i );
1637if ( player )
1638{
1639if ( AntiBugSphere[ player.ID ] >= 1 ) AntiBugSphere[ player.ID ] --;
1640}
1641}
1642}
1643
1644function Entrega( player )
1645{
1646player = FindPlayer( player );
1647if ( player )
1648{
1649if ( player.Vehicle && player.Vehicle.Model == 228 )
1650{
1651AntiBugSphere[ player.ID ] = 5;
1652player.RestoreCamera();
1653Carregado[ player.ID ] = true;
1654player.Frozen = false;
1655CreateMarker(player.UniqueWorld, Vector( 79.8685, 1080.55, 16.2623 ), 1, RGB(000 ,000 ,000), 0 );
1656//I_MSG("Seu Caminhao Agora Esta Carregado Com Drogas!!",player);
1657}
1658}
1659}
1660
1661function DinheiroF1 ( player )
1662{
1663player = FindPlayer( player );
1664if ( player )
1665{
1666if ( player.Vehicle && player.Vehicle.Model == 144 )
1667{
1668AntiBugSphere[ player.ID ] = 5;
1669player.RestoreCamera();
1670Carregado[ player.ID ] = true;
1671player.Frozen = false;
1672CreateMarker(player.UniqueWorld, Vector( 1276.32, 77.324, 11.4534 ), 1, RGB(000 ,000 ,000), 0 );
1673//I_MSG("Voce foi selecionado para o trabalho !!",player);
1674}
1675}
1676}
1677
1678function DinheiroF2( player )
1679{
1680player = FindPlayer( player );
1681if ( player )
1682{
1683if ( player.Vehicle && player.Vehicle.Model == 144 )
1684{
1685player.Eject();
1686AntiBugSphere[ player.ID ] = 5;
1687//player.Frozen = false;
1688Carregado[ player.ID ] = false;
1689I_MSG("Voce concluiu a entrega!!",player);
1690IncCash( player, 50000 );
1691Message("[#FF0000][[#7CFC00]Trabalho[#FF0000]] [#40E0D0]Distribuidor de dinheiro falso " + player.Name + " Concluiu uma entrega!!");
1692EchoMessage("9[7Trabalho9] 10Distribuidor de dinheiro falso" + player.Name + " Concluiu uma entrega!!");
1693}
1694}
1695}
1696
1697function LoadSpawnWep( player )
1698{
1699if ( swep(player) == 0 );
1700else if ( swep(player) == 1 ) player.SetWeapon( 1, 300 );
1701else if ( swep(player) == 2 ) player.SetWeapon( 2, 300 );
1702else if ( swep(player) == 3 ) player.SetWeapon( 3, 300 );
1703else if ( swep(player) == 4 ) player.SetWeapon( 4, 300 );
1704else if ( swep(player) == 5 ) player.SetWeapon( 5, 300 );
1705else if ( swep(player) == 6 ) player.SetWeapon( 6, 300 );
1706else if ( swep(player) == 7 ) player.SetWeapon( 7, 300 );
1707else if ( swep(player) == 8 ) player.SetWeapon( 8, 300 );
1708else if ( swep(player) == 9 ) player.SetWeapon( 9, 300 );
1709else if ( swep(player) == 10 ) player.SetWeapon( 10, 300 );
1710else if ( swep(player) == 11 ) player.SetWeapon( 11, 300 );
1711else if ( swep(player) == 12 ) player.SetWeapon( 12, 300 );
1712else if ( swep(player) == 13 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
1713else if ( swep(player) == 14 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
1714else if ( swep(player) == 15 ) player.SetWeapon( 15, 300 );
1715else if ( swep(player) == 16 ) player.SetWeapon( 16, 300 );
1716else if ( swep(player) == 17 ) player.SetWeapon( 17, 300 );
1717else if ( swep(player) == 18 ) player.SetWeapon( 18, 300 );
1718else if ( swep(player) == 19 ) player.SetWeapon( 19, 300 );
1719else if ( swep(player) == 20 ) player.SetWeapon( 20, 300 );
1720else if ( swep(player) == 21 ) player.SetWeapon( 21, 300 );
1721else if ( swep(player) == 22 ) player.SetWeapon( 22, 300 );
1722else if ( swep(player) == 23 ) player.SetWeapon( 23, 300 );
1723else if ( swep(player) == 24 ) player.SetWeapon( 24, 300 );
1724else if ( swep(player) == 25 ) player.SetWeapon( 25, 300 );
1725else if ( swep(player) == 26 ) player.SetWeapon( 26, 300 );
1726else if ( swep(player) == 27 ) player.SetWeapon( 27, 300 );
1727else if ( swep(player) == 28 ) player.SetWeapon( 28, 300 );
1728else if ( swep(player) == 29 ) player.SetWeapon( 29, 300 );
1729else if ( swep(player) == 30 ) player.SetWeapon( 30, 300 );
1730else if ( swep(player) == 31 ) player.SetWeapon( 31, 300 );
1731else if ( swep(player) == 32 ) player.SetWeapon( 32, 300 );
1732else if ( swep(player) == 33 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
1733
1734if ( swep2(player) == 0 );
1735else if ( swep2(player) == 1 ) player.SetWeapon( 1, 300 );
1736else if ( swep2(player) == 2 ) player.SetWeapon( 2, 300 );
1737else if ( swep2(player) == 3 ) player.SetWeapon( 3, 300 );
1738else if ( swep2(player) == 4 ) player.SetWeapon( 4, 300 );
1739else if ( swep2(player) == 5 ) player.SetWeapon( 5, 300 );
1740else if ( swep2(player) == 6 ) player.SetWeapon( 6, 300 );
1741else if ( swep2(player) == 7 ) player.SetWeapon( 7, 300 );
1742else if ( swep2(player) == 8 ) player.SetWeapon( 8, 300 );
1743else if ( swep2(player) == 9 ) player.SetWeapon( 9, 300 );
1744else if ( swep2(player) == 10 ) player.SetWeapon( 10, 300 );
1745else if ( swep2(player) == 11 ) player.SetWeapon( 11, 300 );
1746else if ( swep2(player) == 12 ) player.SetWeapon( 12, 300 );
1747else if ( swep2(player) == 13 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
1748else if ( swep2(player) == 14 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
1749else if ( swep2(player) == 15 ) player.SetWeapon( 15, 300 );
1750else if ( swep2(player) == 16 ) player.SetWeapon( 16, 300 );
1751else if ( swep2(player) == 17 ) player.SetWeapon( 17, 300 );
1752else if ( swep2(player) == 18 ) player.SetWeapon( 18, 300 );
1753else if ( swep2(player) == 19 ) player.SetWeapon( 19, 300 );
1754else if ( swep2(player) == 20 ) player.SetWeapon( 20, 300 );
1755else if ( swep2(player) == 21 ) player.SetWeapon( 21, 300 );
1756else if ( swep2(player) == 22 ) player.SetWeapon( 22, 300 );
1757else if ( swep2(player) == 23 ) player.SetWeapon( 23, 300 );
1758else if ( swep2(player) == 24 ) player.SetWeapon( 24, 300 );
1759else if ( swep2(player) == 25 ) player.SetWeapon( 25, 300 );
1760else if ( swep2(player) == 26 ) player.SetWeapon( 26, 300 );
1761else if ( swep2(player) == 27 ) player.SetWeapon( 27, 300 );
1762else if ( swep2(player) == 28 ) player.SetWeapon( 28, 300 );
1763else if ( swep2(player) == 29 ) player.SetWeapon( 29, 300 );
1764else if ( swep2(player) == 30 ) player.SetWeapon( 30, 300 );
1765else if ( swep2(player) == 31 ) player.SetWeapon( 31, 300 );
1766else if ( swep2(player) == 32 ) player.SetWeapon( 32, 300 );
1767else if ( swep2(player) == 33 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
1768
1769if ( swep3(player) == 0 );
1770else if ( swep3(player) == 1 ) player.SetWeapon( 1, 300 );
1771else if ( swep3(player) == 2 ) player.SetWeapon( 2, 300 );
1772else if ( swep3(player) == 3 ) player.SetWeapon( 3, 300 );
1773else if ( swep3(player) == 4 ) player.SetWeapon( 4, 300 );
1774else if ( swep3(player) == 5 ) player.SetWeapon( 5, 300 );
1775else if ( swep3(player) == 6 ) player.SetWeapon( 6, 300 );
1776else if ( swep3(player) == 7 ) player.SetWeapon( 7, 300 );
1777else if ( swep3(player) == 8 ) player.SetWeapon( 8, 300 );
1778else if ( swep3(player) == 9 ) player.SetWeapon( 9, 300 );
1779else if ( swep3(player) == 10 ) player.SetWeapon( 10, 300 );
1780else if ( swep3(player) == 11 ) player.SetWeapon( 11, 300 );
1781else if ( swep3(player) == 12 ) player.SetWeapon( 12, 300 );
1782else if ( swep3(player) == 13 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
1783else if ( swep3(player) == 14 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
1784else if ( swep3(player) == 15 ) player.SetWeapon( 15, 300 );
1785else if ( swep3(player) == 16 ) player.SetWeapon( 16, 300 );
1786else if ( swep3(player) == 17 ) player.SetWeapon( 17, 300 );
1787else if ( swep3(player) == 18 ) player.SetWeapon( 18, 300 );
1788else if ( swep3(player) == 19 ) player.SetWeapon( 19, 300 );
1789else if ( swep3(player) == 20 ) player.SetWeapon( 20, 300 );
1790else if ( swep3(player) == 21 ) player.SetWeapon( 21, 300 );
1791else if ( swep3(player) == 22 ) player.SetWeapon( 22, 300 );
1792else if ( swep3(player) == 23 ) player.SetWeapon( 23, 300 );
1793else if ( swep3(player) == 24 ) player.SetWeapon( 24, 300 );
1794else if ( swep3(player) == 25 ) player.SetWeapon( 25, 300 );
1795else if ( swep3(player) == 26 ) player.SetWeapon( 26, 300 );
1796else if ( swep3(player) == 27 ) player.SetWeapon( 27, 300 );
1797else if ( swep3(player) == 28 ) player.SetWeapon( 28, 300 );
1798else if ( swep3(player) == 29 ) player.SetWeapon( 29, 300 );
1799else if ( swep3(player) == 30 ) player.SetWeapon( 30, 300 );
1800else if ( swep3(player) == 31 ) player.SetWeapon( 31, 300 );
1801else if ( swep3(player) == 32 ) player.SetWeapon( 32, 300 );
1802else if ( swep3(player) == 33 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
1803
1804if ( swep4(player) == 0 );
1805else if ( swep4(player) == 1 ) player.SetWeapon( 1, 300 );
1806else if ( swep4(player) == 2 ) player.SetWeapon( 2, 300 );
1807else if ( swep4(player) == 3 ) player.SetWeapon( 3, 300 );
1808else if ( swep4(player) == 4 ) player.SetWeapon( 4, 300 );
1809else if ( swep4(player) == 5 ) player.SetWeapon( 5, 300 );
1810else if ( swep4(player) == 6 ) player.SetWeapon( 6, 300 );
1811else if ( swep4(player) == 7 ) player.SetWeapon( 7, 300 );
1812else if ( swep4(player) == 8 ) player.SetWeapon( 8, 300 );
1813else if ( swep4(player) == 9 ) player.SetWeapon( 9, 300 );
1814else if ( swep4(player) == 10 ) player.SetWeapon( 10, 300 );
1815else if ( swep4(player) == 11 ) player.SetWeapon( 11, 300 );
1816else if ( swep4(player) == 12 ) player.SetWeapon( 12, 300 );
1817else if ( swep4(player) == 13 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
1818else if ( swep4(player) == 14 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
1819else if ( swep4(player) == 15 ) player.SetWeapon( 15, 300 );
1820else if ( swep4(player) == 16 ) player.SetWeapon( 16, 300 );
1821else if ( swep4(player) == 17 ) player.SetWeapon( 17, 300 );
1822else if ( swep4(player) == 18 ) player.SetWeapon( 18, 300 );
1823else if ( swep4(player) == 19 ) player.SetWeapon( 19, 300 );
1824else if ( swep4(player) == 20 ) player.SetWeapon( 20, 300 );
1825else if ( swep4(player) == 21 ) player.SetWeapon( 21, 300 );
1826else if ( swep4(player) == 22 ) player.SetWeapon( 22, 300 );
1827else if ( swep4(player) == 23 ) player.SetWeapon( 23, 300 );
1828else if ( swep4(player) == 24 ) player.SetWeapon( 24, 300 );
1829else if ( swep4(player) == 25 ) player.SetWeapon( 25, 300 );
1830else if ( swep4(player) == 26 ) player.SetWeapon( 26, 300 );
1831else if ( swep4(player) == 27 ) player.SetWeapon( 27, 300 );
1832else if ( swep4(player) == 28 ) player.SetWeapon( 28, 300 );
1833else if ( swep4(player) == 29 ) player.SetWeapon( 29, 300 );
1834else if ( swep4(player) == 30 ) player.SetWeapon( 30, 300 );
1835else if ( swep4(player) == 31 ) player.SetWeapon( 31, 300 );
1836else if ( swep4(player) == 32 ) player.SetWeapon( 32, 300 );
1837else if ( swep4(player) == 33 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
1838}
1839//==============================================================================
1840//----------------------------- Criptografia -----------------------------------
1841//==============================================================================
1842function rotateRight(val, sbits)
1843{
1844 return (val >> sbits) | (val << (0x20 - sbits));
1845}
1846
1847function e( string )
1848{
1849 local hp = [
1850 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
1851 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
1852 ];
1853
1854 local k = [
1855 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
1856 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
1857 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
1858 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
1859 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
1860 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
1861 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
1862 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
1863 ];
1864
1865 local
1866 w = array( 64 ),
1867 i = 0,
1868 s = 0,
1869 len = string.len( ),
1870 word_array = array( 0 );
1871
1872 for( i = 0; i < len - 3; i += 4 )
1873 {
1874 word_array.push( string[i] << 0x18 | string[i + 1] << 0x10 | string[i + 2] << 0x08 | string[i + 3] );
1875 }
1876
1877 switch( len % 4 )
1878 {
1879 case 0:
1880 i = 0x80000000;
1881 break;
1882 case 1:
1883 i = string[len - 1] << 0x18 | 0x80000000;
1884 break;
1885 case 2:
1886 i = string[len - 2] << 0x18 | string[len - 1] << 0x10 | 0x08000;
1887 break;
1888 case 3:
1889 i = string[len - 3] << 0x18 | string[len - 2] << 0x10 | string[len - 1] << 0x08 | 0x80;
1890 break;
1891 }
1892 word_array.push( i );
1893
1894 while( ( word_array.len() % 0x10 ) != 0x0E )
1895 word_array.push( 0 );
1896
1897 word_array.push( len >> 0x10 );
1898 word_array.push( ( len << 0x03 ) & 0xFFFFFFFF );
1899
1900 local s0, s1;
1901 for( s = 0; s < word_array.len(); s += 0x10 )
1902 {
1903 for( i = 0x00; i < 0x10; i++ )
1904 w[i] = word_array[s + i];
1905
1906 for( i = 0x10; i < 0x40; i++ )
1907 {
1908 s0 = rotateRight( w[i - 15], 7 ) ^ rotateRight( w[i - 15], 18 ) ^ ( w[i - 15] >> 3 );
1909 s1 = rotateRight( w[i - 2], 17 ) ^ rotateRight( w[i - 2], 19 ) ^ ( w[i - 2] >> 10 );
1910 w[i] = w[i - 0x10] + s0 + w[i - 7] + s1;
1911 }
1912
1913 local a = hp[0],
1914 b = hp[1],
1915 c = hp[2],
1916 d = hp[3],
1917 e = hp[4],
1918 f = hp[5],
1919 g = hp[6],
1920 h = hp[7];
1921
1922 for( i = 0x00; i < 0x40; i++ )
1923 {
1924 s0 = ( rotateRight( a, 2 ) ^ rotateRight( a, 13 ) ^ rotateRight( a, 22 ) );
1925 local maj = ( ( a & b ) ^ ( a & c ) ^ ( b & c ) );
1926 local t2 = ( s0 + maj );
1927 s1 = ( rotateRight( e, 6 ) ^ rotateRight( e, 11) ^ rotateRight( e, 25 ) );
1928 local ch = ( ( e & f ) ^ ( ( ~e ) & g ) );
1929 local t1 = ( h + s1 + ch + k[i] + w[i] );
1930
1931 h = g;
1932 g = f;
1933 f = e;
1934 e = d + t1;
1935 d = c;
1936 c = b;
1937 b = a;
1938 a = t1 + t2;
1939 }
1940
1941 hp[0] += a;
1942 hp[1] += b;
1943 hp[2] += c;
1944 hp[3] += d;
1945 hp[4] += e;
1946 hp[5] += f;
1947 hp[6] += g;
1948 hp[7] += h;
1949 }
1950
1951 local hash = format(
1952 "%08x%08x%08x%08x%08x%08x%08x%08x",
1953 hp[0],
1954 hp[1],
1955 hp[2],
1956 hp[3],
1957 hp[4],
1958 hp[5],
1959 hp[6],
1960 hp[7]
1961 );
1962
1963 return hash;
1964}