· 8 years ago · May 19, 2018, 02:54 PM
1MAIN.nut
2
3enum Server
4{
5IP = "185.30.146.202:5192"
6Forum = "Dont have yet"
7Nome = "[0.4]Extreme City RPG"
8Versao = 1.3
9Desenvolvedor = "Florenco"
10Creditos = "No Credits"
11}
12
13class PropStats
14{
15ID = 0;
16Nome = null;
17Preco = 0;
18Dono = null;
19Compart = null;
20}
21
22function ForceSpawn(player)
23{
24 // Forced spawning
25 //player.Spawn();
26 // Forced character selection
27 //player.Select();
28}
29
30
31
32/*
33[Smoother] Nitrous Oxide System for VC:MP 0.4 !
34All credits goes to Seby. (aka sseebbyy)
35
36This system boost your car's speed and acceleration when you press ALT KEY. :)
37When a player uses NOS on car, the rear lights of car will become green !
38*/
39
40nosSpeedBoost <- 1.2; // the speed boost applied when NOS is enabled
41nosAcceleration <- 10; // how much will NOS increase the acceleration of car
42nosMaxSpeed <- 13; // how much will NOS increase the max speed of car
43
44nosUnit <- array( 10, null );
45nosUnitPosX <- array( 10, null );
46nosUnitAlpha <- array( 10, null );
47
48nosBarPosX <- -340; // nos bar pos X - you can change it however you want, all nos sprites will move too.
49nosBarPosY <- 230; // nos bar pos Y - you can change it however you want, all nos sprites will move too.
50nosBarAlpha <- 150; // it's the alpha of emty nos bar
51nosUnitDistance <- 25; // the distance between units
52nosUnitAlpha0 <- 50; // the unit's alpha 0, the one from left.
53nosUnitAlphaDifference <- 15; // how much alpha will take the next unit in plus
54
55class PlayerStats
56{
57Registrado = false;
58Logado = false;
59Nogoto = false;
60SpawnLoc = false;
61Count_Msg = 0;
62Msg_Player = 0;
63Loc = null;
64Emprego = 0;
65Level = 0;
66Dinheiro = 0;
67Banco = 0;
68Matou = 0;
69Morreu = 0;
70Warn_Login = 0;
71gettedbomb = false;
72}
73
74//Deathlist Settings
75
76MaxLines <- 5; //Max Lines it shows in Deathlist
77LineGap <- 30; //How much space between the Names
78PosX <- -245; //PosX for first part (Do not change unless you know what you are doing)
79PosY <- 504; //PosY for first part (Do not change unless you know what you are doing)
80PosX2 <- -190; //PosX for second part (Do not change unless you know what you are doing)
81PosY3 <- 502; //PosY for second part (Do not change unless you know what you are doing)
82
83function update() {
84
85}
86
87function LoadAlias()
88{
89local q = QuerySQL( adb, "SELECT * FROM Alias" ), i = 0;
90while ( GetSQLColumnData( q, 0 ) != null )
91{
92Alias.push( { Nick = GetSQLColumnData( q, 0 ), IP = GetSQLColumnData( q, 1 ), UID = GetSQLColumnData( q, 2 ) } );
93i ++;
94GetSQLNextRow( q );
95}
96FreeSQLQuery( q );
97print( "[Loaded] Alias - " + i );
98}
99
100function onScriptLoad()
101{
102Alias <- [];
103adb <- ConnectSQL( "Alias.db" );
104QuerySQL( adb , "CREATE TABLE IF NOT EXISTS Alias ( Name TEXT, IP VARCHAR(20), UID TEXT )" );
105LoadAlias();
106 Stats <- array( GetMaxPlayers(), null );
107pAway <- {};
108oldname <- array( GetMaxPlayers(), null );
109 LoadMarks();
110Radio();
111{
112db <- ConnectSQL( "DataBase.db" );
113dbcountry <- ConnectSQL( "scripts/IpToCountry.db" );
114
115 print("[Real] Nitrous Oxide System - by Seby - was loaded.");
116
117 nosLoadSprites();
118
119// Entregador Drogas
120CreateSphere( null, 1, Vector( -688.188, -1556.63, 12.4997 ), RGB( 000 000 139 ), 1.5 );//pegar entrega De drogas0
121CreateSphere( null, 1, Vector( 79.8685, 1080.55, 16.2623 ), RGB( 000 000 139 ), 1.5 );//Entregar drogas1
122CreateSphere( null, 1, Vector( -695.395, -1582.89, 12.5309 ), RGB( 000,255,000 ), 1.5 );//2
123//Seguranca
124CreateSphere( null, 1, Vector( -906.975, -330.937, 13.3802 ), RGB( 000,255,00 ), 1.5);//seguranca de banco
125// Lixeiro
126CreateSphere( null, 1, Vector( -1300.48, 174.036, 11.4534 ), RGB( 000,255,00 ), 1.5);// Emprego de lixeiro
127CreateSphere( null, 1, Vector( -1276.23, 77.2545, 11.4534 ), RGB( 000, 000, 139 ), 2 );//pegar entrega De lixeiro
128CreateSphere( null, 1, Vector( -289.777, -491.324, 11.2086 ), RGB( 000, 000, 139 ), 1.5 );
129//Caminhoneiro
130CreateSphere( null, 1, Vector( 294.613, -297.674, 11.9591 ), RGB( 000,255,00 ), 1.5);// Emprego de caminhoneiro
131CreateSphere( null, 1, Vector( 309.361, -302.185, 11.9591 ), RGB( 000, 000, 139 ), 2 );//pegar entrega De caminhoneiro
132CreateSphere( null, 1, Vector( -703.747, -1292.45, 11.0715 ), RGB( 000, 000, 139 ), 1.5 );
133//Policial
134CreateSphere( null, 1, Vector( 404.392, -490.57, 12.3432 ), RGB( 000,255,00 ), 1.5);// Emprego de Policial
135
136ALT_KEY <- BindKey(true, 0x12, 0, 0);
137
138
139function onScriptLoad()
140{
141 LoadMarks();
142 Radio();
143}
144
145
146function GetMarkCount() return Marks.len();
147
148
149dofile( "scripts/Functions.nut" );
150dofile( "scripts/Cmds.nut" );
151dofile( "scripts/Echo.nut" );
152
153TextLengh <- array(MaxLines);
154TextInfo <- array(MaxLines);
155TextInfo2 <- array(MaxLines);
156SpriteInfo <- array(MaxLines)
157
158Map <- array( GetMaxPlayers(), null );
159i_1PortaoPos <- array( GetMaxPlayers(), null );
160i_1PortaoRot <- array( GetMaxPlayers(), null );
161i_2PortaoPos <- array( GetMaxPlayers(), null );
162i_2PortaoRot <- array( GetMaxPlayers(), null );
163BoxActive <- false;
164Box <- null;
165
166P <- BindKey( true, 0x50, 0, 0 );
167
168
169NewTimer("Velocimetro" , 500, 0 );
170
171createpickupss();
172
173
174CarregarObjetos();
175NewTimer( "Temporizador", 1000, 0 );
176ALT_KEY <- BindKey(true, 0x12, 0, 0);
177L <- BindKey(true, 0x4C,0,0);
178P <- BindKey(true, 0x50,0,0);
179I <- BindKey(true, 0x49, 0, 0);
180
181NewTimer( "Timer", 1000, 0 );
182
183status <- array( GetMaxPlayers(), null );
184Multa <- array( GetMaxPlayers(), 0 );
185Carregado <- array( GetMaxPlayers(), false );
186}
187
188NewTimer("MSG2" , 300000, 0 );//Info: 1000 = 1 segundo.
189
190Casa <- array( 1001, null );
191
192Portao <- [];
193
194Map <- array( GetMaxPlayers(), null );
195i_1PortaoPos <- array( GetMaxPlayers(), null );
196i_1PortaoRot <- array( GetMaxPlayers(), null );
197i_2PortaoPos <- array( GetMaxPlayers(), null );
198i_2PortaoRot <- array( GetMaxPlayers(), null );
199
200NewTimer( "SalvarTudo", 300000, 0 );//Essa Função ficara salvando os dados dos players a cada 5 minutos.
201NewTimer( "MSG1" , 200000, 0 );//Info: 1000 = 1 segundo.
202NewTimer( "MSG2" , 100000, 0 );//Info: 1000 = 1 segundo.
203NewTimer( "MSG3" , 150000, 0 );//Info: 1000 = 1 segundo.
204NewTimer( "MSG4" , 210000, 0 );//Info: 1000 = 1 segundo.
205NewTimer( "MSG5" , 170000, 0 );//Info: 1000 = 1 segundo.
206NewTimer( "MSG6" , 140000, 0 );//Info: 1000 = 1 segundo.
207Configuracao();
208AntiBugSphere <- array( GetMaxPlayers(), 0 );
209LoadPickups();
210CarregarCasas();
211CriarTabelas();
212ActivateEcho();
213CarregarCarros();
214CarregarPortoes();
215RawHideMapObject(2403,-4998,-4677,116);
216RawHideMapObject(4139,4501,6383,116);
217RawHideMapObject(2372,-3726,-4633,113);
218RawHideMapObject(2420,-3781,-3359,118);
219RawHideMapObject(2522,-2354,-5091,126);
220CreateObject(2587,0,Vector(-375.49,-1322.31,9.8),255);
221CreateObject(2590,0,Vector(-375.49,-1322.31,9.8),255);
222CreateObject(2586,0,Vector(-375.49,-1322.31,9.8),255);
223CreateObject(2588,0,Vector(-375.49,-1322.31,9.8),255);
224CreateObject(2592,0,Vector(-375.49,-1322.31,9.8),255);
225CreateObject(2585,0,Vector(-375.49,-1322.31,9.8),255);
226CreateObject(2593,0,Vector(-375.49,-1322.31,9.8),255);
227
228RawHideMapObject(474,-2601,-5188,99);
229/* hehe */
230
231L_KEY <- BindKey(true, 0x4C, 0, 0); // L key
232g1 <- CreateObject(4139, 0, 450.136, 638.368, 11.602,255);
233g1.RotateToEuler(Vector(0, 0, 0),0);
234open1 <- false;
235//==================== checkpoints para casas =========================================//
236
237spree <- array( 100, null );
238
239class SpreeSys
240{
241 player = null;
242 spree = 0;
243
244 constructor( player )
245 {
246 if( typeof player != "instance" ) return;
247 this.player = player;
248 this.spree = 0;
249 }
250 function Get()
251 {
252 return [ this.spree, this.player ];
253 }
254 function Inc( amount = 1 )
255 {
256 this.spree += amount;
257 local s = this.spree;
258 if( s >= 5 && s%5 == 0 ) Start();
259 }
260 function Dec( amount )
261 {
262 this.spree -= amount;
263 }
264 function Start()
265 {
266 local s = this.spree, reward = s*100;
267 ::Message( format( "%s is on a killing spree of %i kills in a row. Reward: %i.", this.player.Name, s, reward ) );
268 this.player.Cash += reward;
269 }
270 function End( victim = null )
271 {
272 local spree = this.spree;
273 if( spree >= 5 )
274 {
275 if( victim != null ) ::Message( format("%s has ended %s killing spree of %i kills in a row.", victim.Name, this.player.Name, spree ) );
276 else ::Message( format("%s has ended their own killing spree of %i kills in a row.", this.player.Name, spree ) );
277 this.spree = 0;
278 }
279 else this.spree = 0;
280 }
281
282}
283
284}
285
286
287function onScriptUnload()
288{
289DisconnectSQL( adb );
290 print("ERROR - Nitrous Oxide System - by Seby - was not loaded !!");
291DisconnectSQL( db );
292DisconnectBots();
293local I, player, mp = GetMaxPlayers();
294for(I = 0; I < mp; ++I ){ // place it in first line
295player = FindPlayer( I )
296if (pAway.rawin(oldname[player.ID]))
297{
298player.Name = ""+oldname[player.ID]+"";
299pAway.rawdelete( player.Name );
300oldname[player.ID] = null;
301}
302}
303}
304
305function onPlayerRequestSpawn( player )
306{
307if ( status[ player.ID ].Registrado == true && status[ player.ID ].Logado == false )
308{
309E_MSG( "You must use /login", player );
310return 0;
311}
312return 1;
313}
314
315function onPlayerRequestClass( player, pclass, pteam, pskin )
316{
317Announce( "~t~" + GetNameClass( pteam ), player, 1 );
318player.SetAnim( 147 );
319PlaySound( player.UniqueWorld , 356 , player.Pos );
320return 1;
321}
322
323function onPlayerJoin( player )
324{
325if ( player.Name == "Ninguem") { KickPlayer(player); }
326AddAlias( player );
327PlaySound( player.UniqueWorld , 50006 , player.Pos );
328JoinMessage( player );
329ChecarConta( player );
330 spree[ player.ID ] = SpreeSys( player );
331 Stats[player.ID] = PlayerStats();
332 if(pAway.rawin(player.Name))
333{
334Message("Kicked "+player.Name+", Reason: A player with same nick already exist");
335 player.Kick();
336}
337}
338
339function onPlayerHealthChange( player, oldhp, newhp )
340{
341
342}
343
344function onPlayerPart( player, reason )
345{
346QuitMessage( player, reason );
347SalvarDados( player );
348if ( Multa[ player.ID ] >= 1 ) Multa[ player.ID ] = 0;
349status[ player.ID ] = null;
350 if (pAway.rawin(oldname[player.ID])) // place it in first line
351{
352player.Name = ""+oldname[player.ID]+"";
353pAway.rawdelete( player.Name );
354oldname[player.ID] = null;
355}
356}
357
358function Radio()
359{
360CreateRadioStream( 18, "English 4", "http://19353.live.streamtheworld.com/977_HITS.mp3", true );
361CreateRadioStream( 15, "English 1", "http://strm112.1.fm/top40_mobile_mp3", true)
362CreateRadioStream( 16, "English 2", "http://jamfm.hoerradar.de/jamfm-mp3-128?sABC=5nr2s7o5%230%23875r45529s1o57o842593681r18q1598%23enqvbQR&amsparams=playerid:radioDE;skey:1524823989", true)
363CreateRadioStream( 17, "English 3", "http://94.130.133.39/top100station.mp3", true)
364CreateRadioStream( 19, "Arabic 1", "http://204.9.190.93:9302/;", true );
365CreateRadioStream( 20, "Arabic 2", "http://icecast.omroep.nl/funx-arab-bb-mp3", true)
366CreateRadioStream( 21, "Indian 1", "http://19013.live.streamtheworld.com/ARNCITY_SC", true)
367CreateRadioStream( 22, "Indian 2", "http://162.244.80.118:3058/stream/1/", true );
368CreateRadioStream( 23, "UK 1", "http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_q", true)
369CreateRadioStream( 24, "ISIS", "https://www117.zippyshare.com/d/Q1NgigKc/5181/%2853%29%20%d8%a3%d9%86%d8%b4%d9%88%d8%af%d8%a9%20%d9%82%d8%af%20%d8%a2%d9%86%20%d8%b2%d9%88%d8%a7%d9%84%d9%83%20%d9%82%d8%af%20%d8%a2%d9%86%20-%20YouTube.mp3", true)
370CreateRadioStream( 25, "latina 1", "http://19213.live.streamtheworld.com/VIBRA_SC", true );
371CreateRadioStream( 26, "america 1", "http://20853.live.streamtheworld.com/RADIO538_SC", true)
372CreateRadioStream( 27, "justin", "https://www33.zippyshare.com/d/cS5HT9St/30426/Best%20Songs%20Of%20Justin%20Bieber%20-%20Justin%20Bieber%20Greatest%20Hits%202018%20-%20YouTube.mp3", true)
373}
374
375function onPlayerEnteringVehicle( player, vehicle, door )
376{
377
378if (( vehicle.Model == 228 ) && status[ player.ID ].Emprego != 7 && door == 0 )
379{
380E_MSG( "Only Drug Distributors can enter here.", player );
381return 0;
382}
383if (( vehicle.Model == 138 ) && status[ player.ID ].Emprego != 11 && door == 0 )
384{
385E_MSG( "Only Garbageman can enter here.", player );
386return 0;
387}
388if (( vehicle.Model == 213 ) && status[ player.ID ].Emprego != 8 && door == 0 )
389{
390E_MSG( "Only Truck Drivers can enter here.", player );
391return 0;
392}
393
394return 1;
395}
396
397function onPlayerSpawn( player )
398{
399SP( player );
400LoadSkin(player);
401LoadSpawnWep( player );
402
403if ( status[player.ID].Emprego == 1 )
404{
405player.Skin = 231;
406}
407if ( status[player.ID].Emprego == 7 )
408{
409player.Skin = 113;
410}
411if ( status[player.ID].Emprego == 4 )
412{
413player.skin = 91;
414}
415if ( status[player.ID].Emprego == 11 )
416{
417player.skin = 150;
418}
419if ( status[player.ID].Emprego == 8 )
420{
421player.skin = 163;
422}
423
424SP( player );
425Announce( "Welcome Back!", player, 1 );
426player.Team = player.Class;
427LoadSpawnWep( player );
428LoadSkin(player);
429PlaySound( player.UniqueWorld , 369 , player.Pos );
430}
431
432function onSphereEntered(player, sphere)
433{
434if ( sphere.ID == 0 )
435{
436if ( player.Vehicle && player.Vehicle.Model == 228 )
437{
438if ( Carregado[ player.ID ] == true ) return E_MSG( "Your truck is already loaded.", player );//status[player.ID].Mapper = true
439player.SetCameraPos( Vector( 70.714, 1044.87, 30.5054 ), Vector( 73.6166, 1068.65, 26.4887 ) );
440Announce("Deliver the drug safely into the yellow house!!", player, 1);
441player.Frozen = true;
442AntiBugSphere[ player.ID ] = 5;
443NewTimer( "Entrega", 5000, 1 , player.ID );
444}
445}
446
447else if ( sphere.ID == 1 )
448{
449if ( player.Vehicle && player.Vehicle.Model == 228 )
450{
451if ( Carregado[ player.ID ] == false ) return E_MSG( "Your truck is not loaded.", player );
452//Entrega2();
453Announce("Unloading Truck...", player, 0);
454//player.Frozen = true;
455AntiBugSphere[ player.ID ] = 5;
456
457NewTimer( "Entrega2", 1000, 1 , player.ID );
458}
459}
460else if ( sphere.ID == 2 )
461{if ( status[ player.ID ].Emprego == 7 ) return E_MSG("You are already a drug distributor.",player)
462status[ player.ID ].Emprego = 7;
463player.Skin = 155;
464MSG("Player " + player.Name + " is now working as a drug distributor.");
465}
466//Seguranca
467else if ( sphere.ID == 3 )
468{if ( status[ player.ID ].Emprego == 4 ) return E_MSG("You already working on bank security.",player)
469status[ player.ID ].Emprego = 4;
470player.Skin = 91;
471MSG("Player " + player.Name + " is now working as a Bank Security.");
472}
473//Lixeiro
474else if ( sphere.ID == 4 )
475{
476 if ( status[ player.ID ].Emprego == 11 ) return E_MSG("You already working as a garbageman.",player)
477 status[ player.ID ].Emprego = 11;
478 player.Skin = 150;
479 MSG("Player " + player.Name + " is now working as a garbageman.");
480}
481
482
483else if ( sphere.ID == 5 )
484{
485if ( player.Vehicle && player.Vehicle.Model == 138 )
486{
487if ( Carregado[ player.ID ] == true ) return E_MSG( "Your truck is already loaded.", player );//status[player.ID].Mapper = true
488player.SetCameraPos( Vector( -292.433, -478.198, 17.1812), Vector( -292.433, -478.198, 17.1812 ) );
489Announce("Collect trash in the Mansao!!", player, 1);
490player.Frozen = true;
491AntiBugSphere[ player.ID ] = 5;
492NewTimer( "Lixeiro", 5000, 1 , player.ID );
493}
494}
495
496else if ( sphere.ID == 6 )
497{
498if ( player.Vehicle && player.Vehicle.Model == 138 )
499{
500if ( Carregado[ player.ID ] == false ) return E_MSG( "Your truck is not loaded..", player );
501//Lixeiro2();
502Announce("Unloading Truck...", player, 0);
503//player.Frozen = true;
504AntiBugSphere[ player.ID ] = 5;
505
506NewTimer( "Lixeiro2", 1000, 1 , player.ID );
507}
508}
509//Caminhoneiro
510else if ( sphere.ID == 7 )
511{
512 if ( status[ player.ID ].Emprego == 8 ) return E_MSG("You already working as a truck driver.",player)
513 status[ player.ID ].Emprego = 8;
514 player.Skin = 163;
515 MSG("Player " + player.Name + " is working as a truck driver.");
516}
517
518
519else if ( sphere.ID == 8 )
520{
521if ( player.Vehicle && player.Vehicle.Model == 213 )
522{
523if ( Carregado[ player.ID ] == true ) return E_MSG( "Your truck is already loaded.", player );//status[player.ID].Mapper = true
524player.SetCameraPos( Vector( -728.987, -1300.46, 21.6002), Vector( -702.15, -1312.37, 11.0734 ) );
525Announce("Transport the packs here", player, 1);
526player.Frozen = true;
527AntiBugSphere[ player.ID ] = 5;
528NewTimer( "Caminhoneiro", 5000, 1 , player.ID );
529}
530}
531
532else if ( sphere.ID == 9 )
533{
534if ( player.Vehicle && player.Vehicle.Model == 213 )
535{
536if ( Carregado[ player.ID ] == false ) return E_MSG( "Your truck is not loaded..", player );
537//Caminhoneiro2();
538Announce("Unloading Truck.", player, 0);
539//player.Frozen = true;
540AntiBugSphere[ player.ID ] = 5;
541
542NewTimer( "Caminhoneiro2", 1000, 1 , player.ID );
543}
544}
545else if ( sphere.ID == 10 )
546{if ( status[ player.ID ].Emprego == 1 ) return E_MSG("You are already a police officer.",player)
547status[ player.ID ].Emprego = 1;
548player.Skin = 1;
549MSG("Player " + player.Name + " is working as a police officer.");
550}
551}
552
553function onPlayerDeath( player, reason )
554{
555if (GetPlayerSpree(player) >= 1) DecPlayerSpree(player,GetPlayerSpree(player)); // spree system
556UpdateText(player);
557player.Score == 0;
558Message( "[#00ffff] " + player.Name + " [#ff0000]Dead. (" + DeathReason( reason ) + ") <<" );
559EchoMessage( "4 " + player.Name + " Dead. (" + DeathReason( reason ) + ") <<" );
560 spree[ player.ID ].End();
561 ForceSpawn(player);
562LoadSpawnWep( player );
563if ( status[ player.ID ].Level >= 1 )
564{
565status[ player.ID ].Morreu ++;
566if ( status[ player.ID ].Dinheiro >= 250 ) DecCash( player, 250 );
567}
568}
569
570function onPlayerTeamKill( killer, player, reason, bodypart )
571{
572 onPlayerKill( killer, player, reason, bodypart );
573 ForceSpawn(player);
574LoadSpawnWep( player );
575}
576
577function onPlayerChat( player, text ) {
578 EchoMessage( "4[" + player.ID + "]" + player.Name + ":1 " + text );
579 local msg
580 if ( text ) msg = text.tolower();
581 {
582 if ( text )
583 {
584 if ( text.slice( 0, 1 ) == "!" )
585 {
586 local i = NumTok( text, " " ), xp = null;
587
588 if ( i == 1 ) MessagePlayer("[#EE3B3B]>> Error - [#FFFFFE]The server uses / prefix for commands. Try [#00EEEE]/"+ text.slice( 1 ) ,player);
589 }
590 }
591 }
592 return 1;
593
594 function NumTok(string, separator)
595{
596 local tokenized = split(string, separator);
597 return tokenized.len();
598 local s = split(string, separator);
599 return s.len();
600}
601 if ( !player.IsSpawned ){
602 MessagePlayer( "[#FF0000][ERROR] - [#F7FE2E]You have to be spawned.", player );
603 return 0;
604
605 }
606 else print( player.Name + ": " + text );
607 EchoMessage( player.Name + ": " + text );
608 return 1;
609 if ( text == "afk" || text == "AFK" )
610{
611if (pAway.rawin(oldname[player.ID])) MessagePlayer("Failure - You Have Already Used AFK, try BACK Instead",player);
612else{
613Message(player+" Is Now AFK!");
614EchoMessage(player+" Is Now AFK!");
615oldname[player.ID]= player.Name;
616pAway.rawset(player.Name, "afk");
617player.Name = ""+player.Name+"(AFK)";
618}
619}
620else if ( text == "back" || text == "BACK" )
621{
622if (!pAway.rawin(oldname[player.ID])) MessagePlayer("Failure - You Haven't Used AFK",player);
623else{
624Message(""+oldname[player.ID]+" Is Now Back!");
625EchoMessage(""+oldname[player.ID]+" Is Now Back!");
626player.Name = ""+oldname[player.ID]+"";
627pAway.rawdelete( player.Name );
628oldname[player.ID] = null;
629}
630}
631return 1;
632}
633
634function onPlayerPM( player, playerTo, text )
635{
636if ( Multa[ player.ID ] >= 1 )
637{
638E_MSG( "Usted esta muteado del chat.", player );
639return 0;
640}
641CheckSpam( player, "Spam" );
642return 1;
643}
644
645function onVehicleExplode( vehicle )
646{
647}
648
649function onVehicleRespawn( vehicle )
650{
651}
652
653function onPlayerEnterVehicle( player, vehicle, door )
654{
655VeiculoInfo( player, vehicle, 0 );
656}
657
658function onPlayerExitVehicle( player, vehicle )
659{
660VeiculoInfo( player, vehicle, 1 );
661Announce( " ", player, 5 );
662}
663function onKeyUp( player, key )
664{
665 switch(key)
666 {
667 case ALT_KEY:
668 if(player.Vehicle)
669 nosDisable( player );
670 break;
671
672 default: break;
673 }
674}
675/*
676{
677
678 if(key==L_KEY)
679{
680
681
682
683local mgar1 = InPoly( player.Pos.x, player.Pos.y, 447.2, 638.898, 449.136, 618.368, 438.136, 638.368, 440.136, 628.368, 420.136, 618.368 );
684 if (mgar1)
685{
686if(open1==false) MoveGate1(player,g1.ID,"open");
687else MoveGate1(player,g1.ID,"close");
688}
689 else MessagePlayer("voce deve estar na casa",player);
690}
691
692 switch(key)
693 {
694 case ALT_KEY:
695 if(player.Vehicle)
696 nosDisable( player );
697 break;
698
699 default: break;
700 }
701
702}
703
704*/
705function onKeyDown( player, key )
706{
707 switch(key)
708 {
709 case ALT_KEY:
710 if(player.Vehicle)
711 nosEnable( player );
712 break;
713
714 default: break;
715 }
716 if ( key == P )
717{
718MoverPortao( player );
719}
720}
721
722function GetVehicleType( model )
723{
724 // by Force
725 // Returns: Car / Bike / Heli / Plane / Boat / RC
726 switch ( model ) {
727 case 136:
728 case 160:
729 case 176:
730 case 182:
731 case 183:
732 case 184:
733 case 190:
734 case 202:
735 case 203:
736 case 214:
737 case 223:
738 return "Boat";
739 case 155:
740 case 165:
741 case 217:
742 case 218:
743 case 227:
744 return "Heli";
745 case 166:
746 case 178:
747 case 191:
748 case 192:
749 case 193:
750 case 198:
751 return "Bike";
752 case 171:
753 case 194:
754 case 195:
755 case 231:
756 return "RC";
757 case 180:
758 case 181:
759 return "Plane";
760 default:
761 return "Car";
762 }
763}
764
765function nosEnable( player )
766{
767 if( player )
768 {
769 local veh = player.Vehicle,
770 type = GetVehicleType( veh.Model ),
771 defaultMaxSpeed = veh.GetHandlingData(13),
772 defaultAcceleration = veh.GetHandlingData(14);
773
774 if(type == "Car")
775 {
776 if( veh.RelativeSpeed != Vector( 0, 0, 0 ) )
777 veh.RelativeSpeed *= nosSpeedBoost;
778
779 PlaySound( veh.World, 65, veh.Pos );
780
781 veh.SetHandlingData(13, defaultMaxSpeed+nosMaxSpeed); // increases MaxSpeed with the value specified for nosMaxSpeed
782 veh.SetHandlingData(14, defaultAcceleration+nosAcceleration); // increases Acceleration with the value specified for nosAcceleration
783 veh.Lights=true; // turns on the car's lights because the green of the rear lights can't happen without having lights on
784 veh.SetHandlingData(30,-7); // makes the rear lights green
785 }
786 }
787}
788
789function nosDisable( player )
790{
791 if( player )
792 {
793 local veh = player.Vehicle,
794 type = GetVehicleType( veh.Model );
795
796 if(type == "Car")
797 {
798 veh.ResetHandlingData(13); // resets the MaxSpeed
799 veh.ResetHandlingData(14); // resets the Acceleration
800 veh.Lights=false; // turns back the lights off
801 veh.ResetHandlingData(30); // resets the lights color
802 }
803 }
804}
805
806function nosLoadSprites()
807{
808 nosBar <- CreateSprite( "NOS_bar.png", nosBarPosX, nosBarPosY, 0, 0, 0, nosBarAlpha );
809 for( local i = 0; i <= 9; i++ )
810 {
811 if(i == 0)
812 {
813 nosUnitAlpha[i] = nosUnitAlpha0;
814 nosUnitPosX[i] = nosBarPosX + 13;
815 nosUnit[i] = CreateSprite( "NOS_unit.png", nosUnitPosX[i], nosBarPosY, 0, 0, 0, nosUnitAlpha[i] );
816 }
817 else
818 {
819 nosUnitAlpha[i] = nosUnitAlpha[i-1] + nosUnitAlphaDifference;
820 nosUnitPosX[i] = nosUnitPosX[i-1] + nosUnitDistance;
821 nosUnit[i] = CreateSprite( "NOS_unit.png", nosUnitPosX[i], nosBarPosY, 0, 0, 0, nosUnitAlpha[i] );
822 }
823 }
824}
825
826function nosShowBar( player )
827{
828 if( player )
829 {
830 if( nosBar ) nosBar.ShowForPlayer( player );
831 for( local i = 0; i <= 9; i++ )
832 if( nosUnit[i] ) nosUnit[i].ShowForPlayer( player );
833 }
834}
835
836function nosHideBar( player )
837{
838 if( player )
839 {
840 if( nosBar ) nosBar.HideFromPlayer( player );
841 for( local i = 0; i <= 9; i++ )
842 if( nosUnit[i] ) nosUnit[i].HideFromPlayer( player );
843 }
844}
845
846Marks <- [
847[ Vector( 496.2365, -84.4060, 10.0303 ), 13 ],
848[ Vector( -378.1886, -541.0148, 17.2831 ), 29 ],
849[ Vector( -636.5052, -1486.2062, 13.6366 ), 12 ],
850[ Vector( -865.0884, -569.6799, 11.1080 ), 21 ],
851[ Vector( -1004.1774, 198.2034, 11.4103 ), 22 ],
852[ Vector( -884.3292, 1053.2415, 13.1551 ), 23 ],
853[ Vector( -1022.6064, -856.6926, 13.0927 ), 26 ],
854[ Vector( -46.8305, 953.1503, 10.9403 ), 15 ],
855[ Vector( -596.642, 642.104, 11.6765 ), 5 ],
856[ Vector( -680.864, 1202.67, 11.1098 ), 16 ],
857[ Vector( -62.7244, -1481.67, 10.4879 ), 16 ],
858[ Vector( 199.832, -474.905, 11.0699 ), 18 ]
859];
860
861
862function LoadMarks( ) for(local i = 0; i < Marks.len(); i++ ) CreateMarker( 1, Marks[ i ][ 0 ], 5, RGB(10, 10, 10), Marks[ i ][ 1 ] );
863
864function GetMarkCount() return Marks.len();
865
866
867
868
869
870
871
872/// Functions.nut
873//==============================================================================
874//------------------------- Server Functions -----------------------------------
875//==============================================================================
876/*
877 Server: Extreme City
878 Coding by: Florenco
879*/
880
881// One equals first biggest Island/ Two equals all center Islands/ Three equals other big Island
882Player_Island <- array( GetMaxPlayers(), 0 );
883// North and South/one/two
884Player_Locator <- array( GetMaxPlayers(), 0 );
885
886// Death Spawn
887Hospital_Spawn <- array( GetMaxPlayers(), false );
888HospitalSpawnLocations <- [ Vector( -886.074,-470.278,13.1109 ), Vector( -783.051,1141.83,12.4111), Vector( 467.763,697.68,11.7033 ), Vector( -135.137,-981.579,10.4634 ) ];
889Hospital_Locator <- array( GetMaxPlayers() );
890
891District_ID <- array(120, 0);
892District_Name <- array(120, "");
893
894SetKillDelay( 255)
895
896function LoadAlias()
897{
898local q = QuerySQL( adb, "SELECT * FROM Alias" ), i = 0;
899while ( GetSQLColumnData( q, 0 ) != null )
900{
901Alias.push( { Nick = GetSQLColumnData( q, 0 ), IP = GetSQLColumnData( q, 1 ), UID = GetSQLColumnData( q, 2 ) } );
902i ++;
903GetSQLNextRow( q );
904}
905FreeSQLQuery( q );
906print( "[Loaded] Alias - " + i );
907}
908
909function AddAlias( player )
910{
911local q = QuerySQL( adb, "SELECT * FROM Alias WHERE Name='" + player.Name + "'" );
912if ( !GetSQLColumnData( q, 0 ) )
913{
914QuerySQL( adb, "INSERT INTO Alias ( Name, IP, UID ) VALUES ( '" + player.Name + "', '" + player.IP + "', '" + player.UniqueID + "' )" );
915Alias.push( { Nick = player.Name, IP = player.IP, UID = player.UniqueID } );
916}
917else
918{
919if ( GetSQLColumnData( q, 1 ) != player.IP )
920{
921QuerySQL( adb, "UPDATE Alias SET IP='" + player.IP + "' WHERE Name='" + player.Name + "'" );
922UpdateAlias( player, "ip" );
923}
924if ( GetSQLColumnData( q, 2 ) != player.UniqueID )
925{
926QuerySQL( adb, "UPDATE Alias SET UID='" + player.UniqueID + "' WHERE Name='" + player.Name + "'" );
927UpdateAlias( player, "uid" );
928}
929}
930}
931
932function UpdateAlias( player, option )
933{
934for ( local i = 0; i < Alias.len(); i++ )
935{
936if ( Alias[i].Nick == player.Name )
937{
938if ( option == "ip" ) Alias[i].IP = player.IP;
939if ( option == "uid" ) Alias[i].UID = player.UniqueID;
940}
941}
942}
943
944function ShowAlias( player, plr, option )
945{
946if ( option == "ip" )
947{
948local i = 0, a = Alias.len(), b;
949while( i < a )
950{
951if ( plr.IP == Alias[i].IP && plr.Name != Alias[i].Nick )
952{
953if ( b ) b = b + ", " + Alias[i].Nick;
954else b = Alias[i].Nick;
955}
956i ++;
957}
958if ( !b ) MessagePlayer( plr.Name + " [#ffffff]has no IP alias.", player );
959else MessagePlayer( plr.Name + "'s [#ffffff] IP alias: " + b + ".", player );
960}
961else if ( option == "subnet" )
962{
963local i = 0, a = Alias.len(), b;
964local getsub_1 = split( player.IP, "." ),
965sub_1 = getsub_1[0] + getsub_1[1];
966while( i < a )
967{
968local getsub_2 = split( Alias[i].IP, "." ),
969sub_2 = getsub_2[0] + getsub_2[1];
970if ( sub_1 == sub_2 && plr.Name != Alias[i].Nick )
971{
972if ( b ) b = b + ", " + Alias[i].Nick;
973else b = Alias[i].Nick;
974}
975i ++;
976}
977if ( !b ) MessagePlayer( plr.Name + " [#ffffff]has no Subnet alias.", player );
978else MessagePlayer( plr.Name + "'s [#ffffff]Subnet alias: " + b + ".", player );
979}
980else if ( option == "uid" )
981{
982local i = 0, a = Alias.len(), b;
983while( i < a )
984{
985if ( plr.UniqueID == Alias[i].UID && plr.Name != Alias[i].Nick )
986{
987if ( b ) b = b + ", " + Alias[i].Nick;
988else b = Alias[i].Nick;
989}
990i ++;
991}
992if ( !b ) MessagePlayer( plr.Name + " [#ffffff]has no UID alias.", player );
993else MessagePlayer( plr.Name + "'s [#ffffff]UID alias: " + b + ".", player );
994}
995}
996
997function GetPlayer( plr )
998{
999if ( plr )
1000{
1001if ( IsNum( plr ) )
1002{
1003plr = FindPlayer( plr.tointeger() );
1004if ( plr ) return plr;
1005else return false;
1006}
1007else
1008{
1009plr = FindPlayer( plr );
1010if ( plr ) return plr;
1011else return false;
1012}
1013}
1014else return false;
1015}
1016
1017oldGetVehicleNameFromModel <- GetVehicleNameFromModel;
1018function GetVehicleNameFromModel( modelID )
1019{
1020 switch( modelID )
1021 {
1022 case 6400:
1023 {
1024 return "SRT8";
1025 }
1026 break;
1027 case 6401:
1028 {
1029 return "Lancer";
1030 }
1031 break;
1032 case 6402:
1033 {
1034 return "BMW";
1035 }
1036 break;
1037 case 6403:
1038 {
1039 return "Charger Cop";
1040 }
1041 break;
1042 case 6404:
1043 {
1044 return "Countach";
1045 }
1046 break;
1047 case 6405:
1048 {
1049 return "Shamal";
1050 }
1051 break;
1052 case 6406:
1053 {
1054 return "Sultan";
1055 }
1056 break;
1057 case 6407:
1058 {
1059 return "Camaro";
1060 }
1061 break;
1062 case 6408:
1063 {
1064 return "DC";
1065 }
1066 break;
1067 case 6409:
1068 {
1069 return "GT 500";
1070 }
1071 break;
1072 case 6410:
1073 {
1074 return "Ambulance";
1075 }
1076 break;
1077 case 6411:
1078 {
1079 return "Suzuki 1000RR";
1080 }
1081 break; case 6412:
1082 {
1083 return "Turbo Charge";
1084 }
1085 break;
1086 case 6413:
1087 {
1088 return "Cove Cop";
1089 }
1090 break;
1091 case 6414:
1092 {
1093 return "GTR";
1094 }
1095 break;
1096 case 6416:
1097 {
1098 return "Monster";
1099 }
1100 break;
1101
1102 default:
1103 {
1104 return oldGetVehicleNameFromModel( modelID );
1105 }
1106 break;
1107 };
1108};
1109
1110//-----------------------------------------------------------------------------------------
1111
1112function SetPlayersDistrict(Name, player) {
1113 switch(Name) {
1114 /* First Island */
1115 case "Vice Point": return District_ID[player.ID] = 1;
1116 case "Ocean Beach": return District_ID[player.ID] = 2;
1117 case "Washington Beach": return District_ID[player.ID] = 3;
1118
1119 /* Center Shit */
1120 case "Leaf Links": return District_ID[player.ID] = 4;
1121 case "Starfish Island": return District_ID[player.ID] = 5;
1122 case "Prawn Island": return District_ID[player.ID] = 6;
1123
1124 /* Third Island */
1125 case "Escobar International Airport": return District_ID[player.ID] = 7;
1126 case "Downtown Vice City": return District_ID[player.ID] = 8;
1127 case "Junkyard": return District_ID[player.ID] = 9;
1128 case "Little Haiti": return District_ID[player.ID] = 10;
1129 case "Little Havana": return District_ID[player.ID] = 11;
1130 case "Little Haiti": return District_ID[player.ID] = 12;
1131
1132 case "Viceport": return District_ID[player.ID] = 13;
1133 case "Vice City": return District_ID[player.ID] = 14;
1134 default: return District_ID[player.ID] = 0;
1135 }
1136}
1137
1138//-----------------------------------------------------------------------------------------
1139
1140function GetPlayerIsland(player) {
1141 if ( ( District_ID[player.ID] >= 1 ) && ( District_ID[player.ID] <= 3 ) ) {
1142 if (NearestHospital(player.Pos) == 1 ) {
1143 Player_Island[player.ID] = 1;
1144 Player_Locator[player.ID] = 1;
1145 }
1146 if (NearestHospital(player.Pos) == 2 ) {
1147 Player_Island[player.ID] = 1;
1148 Player_Locator[player.ID] = 2;
1149 }
1150 }
1151
1152 if ( ( District_ID[player.ID] >= 4 ) && ( District_ID[player.ID] <= 6 ) ) {
1153 if (NearestHospital(player.Pos) == 1 ) {
1154 Player_Island[player.ID] = 2;
1155 Player_Locator[player.ID] = 1;
1156 }
1157 if (NearestHospital(player.Pos) == 2 ) {
1158 Player_Island[player.ID] = 2;
1159 Player_Locator[player.ID] = 2;
1160 }
1161 }
1162
1163 if ( ( District_ID[player.ID] >= 7 ) && ( District_ID[player.ID] <= 12 ) ) {
1164 if (NearestHospital(player.Pos) == 1 ) {
1165 Player_Island[player.ID] = 3;
1166 Player_Locator[player.ID] = 1;
1167 }
1168 if (NearestHospital(player.Pos) == 2 ) {
1169 Player_Island[player.ID] = 3;
1170 Player_Locator[player.ID] = 2;
1171 }
1172 }
1173
1174 if ( ( District_ID[player.ID] == 13 ) || ( District_ID[player.ID] == 0 ) || ( District_ID[player.ID] == 14 )) {
1175 if ((GetIsland(player.Pos) == 1 ) && ( NearestHospital(player.Pos) == 1 )) {
1176 Player_Island[player.ID] = 1;
1177 Player_Locator[player.ID] = 1;
1178 }
1179 if ((GetIsland(player.Pos) == 1 ) && ( NearestHospital(player.Pos) == 2 )) {
1180 Player_Island[player.ID] = 1;
1181 Player_Locator[player.ID] = 2;
1182 }
1183 if ((GetIsland(player.Pos) == 2 ) && ( NearestHospital(player.Pos) == 1 )) {
1184 Player_Island[player.ID] = 2;
1185 Player_Locator[player.ID] = 1;
1186 }
1187 if ((GetIsland(player.Pos) == 2 ) && ( NearestHospital(player.Pos) == 2 )) {
1188 if (player.Pos.x < -500 ) {
1189 Player_Island[player.ID] = 3;
1190 Player_Locator[player.ID] = 2;
1191 }
1192 else{
1193 Player_Island[player.ID] = 2;
1194 Player_Locator[player.ID] = 2;
1195 }
1196 }
1197 if ((GetIsland(player.Pos) == 3 ) && ( NearestHospital(player.Pos) == 1 )) {
1198 Player_Island[player.ID] = 3;
1199 Player_Locator[player.ID] = 1;
1200 }
1201 if ((GetIsland(player.Pos) == 3 ) && ( NearestHospital(player.Pos) == 2 )) {
1202 Player_Island[player.ID] = 3;
1203 Player_Locator[player.ID] = 2;
1204 }
1205 }
1206}
1207
1208//-----------------------------------------------------------------------------------------
1209
1210function GetNearestHospital(player) {
1211 Hospital_Spawn[player.ID] = true;
1212 Hospital_Locator[player.ID] = player.Pos;
1213
1214 District_Name[player.ID] = GetDistrictName(player.Pos.x, player.Pos.y);
1215
1216 SetPlayersDistrict(District_Name[player.ID], player); //Do not remove player, LOL..
1217
1218 GetPlayerIsland(player);
1219 if ( Player_Island[player.ID] == 1 ) {
1220 local
1221 pos = player.Pos,
1222 first_check = GetDistance(HospitalSpawnLocations[2], pos).tointeger(),
1223 second_check = GetDistance(HospitalSpawnLocations[3], pos).tointeger();
1224
1225 if (first_check <= second_check ) Hospital_Locator[player.ID] = HospitalSpawnLocations[2];
1226 else if (second_check <= first_check ) Hospital_Locator[player.ID] = HospitalSpawnLocations[3];
1227 }
1228
1229 if ( Player_Island[player.ID] == 3 ) {
1230 local
1231 pos = player.Pos,
1232 first_check = GetDistance(HospitalSpawnLocations[0], pos).tointeger(),
1233 second_check = GetDistance(HospitalSpawnLocations[1], pos).tointeger();
1234
1235 if (first_check <= second_check ) Hospital_Locator[player.ID] = HospitalSpawnLocations[0];
1236 else if (second_check <= first_check ) Hospital_Locator[player.ID] = HospitalSpawnLocations[1];
1237 }
1238
1239 if ( Player_Island[player.ID] == 2 ) {
1240 if (Player_Locator[player.ID] == 1 ) {
1241 local
1242 pos = player.Pos,
1243 first_check = GetDistance(HospitalSpawnLocations[1], pos).tointeger(),
1244 second_check = GetDistance(HospitalSpawnLocations[2], pos).tointeger();
1245
1246 if (first_check <= second_check ) Hospital_Locator[player.ID] = HospitalSpawnLocations[1];
1247 else if (second_check <= first_check ) Hospital_Locator[player.ID] = HospitalSpawnLocations[2];
1248 }
1249
1250 if (Player_Locator[player.ID] == 2 ) {
1251 local
1252 pos = player.Pos,
1253 first_check = GetDistance(HospitalSpawnLocations[0], pos).tointeger(),
1254 second_check = GetDistance(HospitalSpawnLocations[3], pos).tointeger();
1255
1256 if (first_check <= second_check ) Hospital_Locator[player.ID] = HospitalSpawnLocations[0];
1257 else if (second_check <= first_check ) Hospital_Locator[player.ID] = HospitalSpawnLocations[3];
1258 }
1259 }
1260}
1261//-----------------------------------------------------------------------------------------
1262function GetIsland(pos) {
1263
1264 // First Island
1265 if (pos.x > -170) return 1;
1266 // Third Island
1267 if (pos.x < -716) return 3;
1268
1269 // Center island BS
1270 return 2;
1271}
1272
1273function NearestHospital(pos) {
1274 if (pos.y >= 0) return 1; // north hospitals
1275 if (pos.y <= 0) return 2; // south hospitals
1276}
1277//-----------------------------------------------------------------------------------------
1278function onPlayerRequestClass( player, classID, team, skin ) {
1279 if (Hospital_Spawn[player.ID] == true) { player.Spawn(); }
1280LoadSpawnWep( player );
1281}
1282
1283function onPlayerSpawn(player) {
1284 // Spawn data
1285 if (Hospital_Spawn[player.ID] == true) { player.Pos = Hospital_Locator[player.ID]; Hospital_Spawn[player.ID] = false; }
1286 LoadSkin(player);
1287LoadSpawnWep( player );
1288}
1289
1290function onPlayerKill( killer, killed, reason, bodypart ) {
1291 GetNearestHospital(killed);
1292}
1293function onPlayerDeath( player, reason ) {
1294 GetNearestHospital(player);
1295LoadSpawnWep( player );
1296}
1297
1298function GetDistance(pos1, pos2)
1299{
1300 return sqrt(pow(pos1.x - pos2.x, 2) + pow(pos1.y - pos2.y, 2) + pow(pos1.z - pos2.z, 2));
1301}
1302
1303function onPlayerPart(player, reason) {
1304QuitMessage( player, reason );
1305 SalvarTudo();
1306 Player_Island[player.ID] = 0;
1307 Player_Locator[player.ID] = 0;
1308 Hospital_Spawn[player.ID] = false;
1309 Hospital_Locator[player.ID] = null;
1310
1311 District_ID[player.ID] = 0;
1312 District_Name[player.ID] = "";
1313}
1314
1315//-----------------------------------------------------------------------------------------
1316HideMapObject(1587,-1074.912964,-276.7081299,11.05003262); //pw_presrommshad - Print Works
1317HideMapObject( 379, -1721.86,-293.002, 15.1086 )
1318HideMapObject( 813, -832.981,-1484.41, 12.9336 )
1319HideMapObject( 832, -844.324,-1496.67, 12.7424 )
1320HideMapObject( 474, -879.05,-362.036, 11.3873 )
1321HideMapObject( 449, -891.555,-356.085, 11.1887 )
1322HideMapObject( 474, -890.837,-349.622, 12.0561)
1323HideMapObject( 474, -890.875,-361.886, 12.0561)
1324HideMapObject( 474, -879.072,-350.381, 11.3873)
1325HideMapObject( 474, -890.189,-331.894, 12.0561)
1326HideMapObject( 474, -878.258,-330.723, 11.2693)
1327HideMapObject( 449, -890.156,-325.002, 11.1887)
1328HideMapObject( 474, -877.137,-318.868, 11.2693)
1329HideMapObject( 474, -889.261,-317.071, 12.0561)
1330HideMapObject( 474, -854.112,-321.801, 9.27197)
1331HideMapObject( 474, -855.012,-351.864, 9.27197)
1332HideMapObject( 474, -855.972,-388.961, 9.27197)
1333HideMapObject( 474, -854.957,-436.886, 9.27197)
1334HideMapObject(1573,-874.696,-116.696,11.9875);
1335HideMapObject(2548,-357.619,-539.746,14.975);
1336HideMapObject( 379, -1188.15,-948.134, 15.1086 );
1337HideMapObject(1259,-880.552, -575.726, 11.3371);
1338CreateObject(1259, 0, Vector(-879.757, -576.008, 11.3371), 255).RotateTo( Quaternion(0, 0, 0.5, -0.866025), 0 );
1339CreateObject(6074, 0, Vector(423.4, -1095.6, 1035), 255).RotateTo( Quaternion(0, 0, 0.0871556693173, 0.996194704516), 0 );
1340CreateObject(6075, 0, Vector(423.4, -1095.6, 1035), 255).RotateTo( Quaternion(0, 0, 0.0871556693173, 0.996194704516), 0 );
1341CreateObject(6074, 0, Vector(505.521, -1052.57, 1053.2), 255).RotateTo( Quaternion(0, 0, 0.0871556693173, 0.996194704516), 0 );
1342CreateObject(6075, 0, Vector(505.521, -1052.57, 1053.2), 255).RotateTo( Quaternion(0, 0, 0.0871556693173, 0.996194704516), 0 );
1343CreateObject(6074, 0, Vector(588.374, -1126.88, 1025), 255).RotateTo( Quaternion(0, 0, 0.0871556693173, 0.996194704516), 0 );
1344CreateObject(6075, 0, Vector(588.374, -1126.88, 1025), 255).RotateTo( Quaternion(0, 0, 0.0871556693173, 0.996194704516), 0 );
1345CreateObject(6073, 0, Vector(422.443, -1227.45, 1020.5727), 255);
1346CreateObject(6073, 0, Vector(562.443, -1227.45, 1020.5727), 255);
1347CreateObject(311, 0, Vector(498.503, -1138.6, 1011.64), 255);
1348CreateObject(311, 0, Vector(500.003, -1138.9, 1011.64), 255).RotateTo( Quaternion(0, 0, 0.019200079287, -0.999815661487), 0 );
1349CreateObject(6004,1,Vector(214.623, -664.008, 13.1426),255).RotateToEuler(Vector(0, 0, 1.45),1)
1350CreateObject(6000,1,Vector(-333.577, -768.451, 27.7217),255).RotateToEuler(Vector(0, 0, 0),1)
1351
1352function LoadPickups()
1353{
1354local q = QuerySQL( db, "SELECT * FROM Pickups" ), i = 0;
1355while( GetSQLColumnData( q, 0 ) )
1356{
1357local
1358ID = GetSQLColumnData( q, 0 ),
1359PX = GetSQLColumnData( q, 2 ),
1360PY = GetSQLColumnData( q, 3 ),
1361PZ = GetSQLColumnData( q, 4 );
1362
1363CreatePickup(ID.tointeger(), Vector(PX.tofloat(), PY.tofloat(), PZ.tofloat()));
1364GetSQLNextRow( q );
1365i++;
1366}
1367print( "Pickups Cargados - " + i );
1368}
1369
1370function TagEmpregos( player )
1371{
1372if ( ( status[ player.ID ].Policia < 1 ) && ( status[ player.ID ].Emprego < 1 ) ) return "Desempregado"
1373else if ( status[ player.ID ].Policia >= 1 ) return "Policial"
1374else if( status[ player.ID ].Emprego == 1 ) return "Traficante";
1375else if( status[ player.ID ].Emprego == 2 ) return "Mecanico";
1376else if( status[ player.ID ].Emprego == 3 ) return "Medico";
1377else if( status[ player.ID ].Emprego == 4 ) return "Seguranca De Banco";
1378else if( status[ player.ID ].Emprego == 5 ) return "Sorveteiro";
1379else if( status[ player.ID ].Emprego == 6 ) return "Investigador";
1380else if( status[ player.ID ].Emprego == 7 ) return "Distribuidor De Drogas";
1381else if( status[ player.ID ].Emprego == 8 ) return "Caminhoneiro";
1382else if( status[ player.ID ].Emprego == 9 ) return "Pizza-Boy";
1383else if( status[ player.ID ].Emprego == 10 ) return "Frentista";
1384else if( status[ player.ID ].Emprego == 11 ) return "Lixeiro";
1385//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!
1386}
1387
1388function ForceSpawn(player)
1389{
1390 // Forced spawning
1391 //player.Spawn();
1392 // Forced character selection
1393 //player.Select();
1394}
1395
1396function Caminhoneiro2( player )
1397{
1398player = FindPlayer( player );
1399if ( player )
1400{
1401if ( player.Vehicle && player.Vehicle.Model == 213 )
1402{
1403player.Eject();
1404AntiBugSphere[ player.ID ] = 5;
1405//player.Frozen = false;
1406Carregado[ player.ID ] = false;
1407I_MSG("You completed the delivery and earned 50k!!",player);
1408IncCash( player, 50000 );
1409Message("[#FF0000][[#7CFC00]Job[#FF0000]] [#40E0D0]Truck Driver " + player.Name + " Completed a delivery!!");
1410EchoMessage("9[7Job9] 10Truck Driver " + player.Name + " Completed a delivery!!");
1411}
1412}
1413}
1414
1415function Entrega2( player )
1416{
1417player = FindPlayer( player );
1418if ( player )
1419{
1420if ( player.Vehicle && player.Vehicle.Model == 228 )
1421{
1422player.Eject();
1423AntiBugSphere[ player.ID ] = 5;
1424//player.Frozen = false;
1425Carregado[ player.ID ] = false;
1426I_MSG("You completed the delivery and earned 50k!!",player);
1427IncCash( player, 50000 );
1428if ( player.WantedLevel < 6 ) player.WantedLevel ++;
1429Message("[#FF0000][[#7CFC00]Job[#FF0000]] [#40E0D0]Drug Distributor " + player.Name + " Completed a drug delivery!!");
1430EchoMessage("9[7Job9] 10Drug Distributor " + player.Name + " Completed a drug delivery!!");
1431}
1432}
1433}
1434
1435function Lixeiro2( player )
1436{
1437player = FindPlayer( player );
1438if ( player )
1439{
1440if ( player.Vehicle && player.Vehicle.Model == 138 )
1441{
1442player.Eject();
1443AntiBugSphere[ player.ID ] = 5;
1444//player.Frozen = false;
1445Carregado[ player.ID ] = false;
1446I_MSG("You completed the delivery and earned 50k!!",player);
1447IncCash( player, 50000 );
1448Message("[#FF0000][[#7CFC00]Job[#FF0000]] [#40E0D0]Garbageman " + player.Name + " Collected garbage in the Vice City!");
1449EchoMessage("9[7Job9] 10Garbageman " + player.Name + " Collected garbage in the Vice City!");
1450}
1451}
1452}
1453
1454
1455function Temporizador()
1456{
1457for( local i = 0, player; i < GetMaxPlayers(); i++ )
1458{
1459player = FindPlayer( i );
1460if ( player )
1461{
1462if ( AntiBugSphere[ player.ID ] >= 1 ) AntiBugSphere[ player.ID ] --;
1463}
1464}
1465}
1466
1467function Entrega( player )
1468{
1469player = FindPlayer( player );
1470if ( player )
1471{
1472if ( player.Vehicle && player.Vehicle.Model == 228 )
1473{
1474AntiBugSphere[ player.ID ] = 5;
1475player.RestoreCamera();
1476Carregado[ player.ID ] = true;
1477player.Frozen = false;
1478CreateMarker(player.UniqueWorld, Vector( 79.8685, 1080.55, 16.2623 ), 1, RGB(000 ,000 ,000), 0 );
1479//I_MSG("Your Truck Is Now Loaded With Drugs!!",player);
1480}
1481}
1482}
1483
1484function Lixeiro( player )
1485{
1486player = FindPlayer( player );
1487if ( player )
1488{
1489if ( player.Vehicle && player.Vehicle.Model == 138 )
1490{
1491AntiBugSphere[ player.ID ] = 5;
1492player.RestoreCamera();
1493Carregado[ player.ID ] = true;
1494player.Frozen = false;
1495CreateMarker(player.UniqueWorld, Vector( 1276.32, 77.324, 11.4534 ), 1, RGB(000 ,000 ,000), 0 );
1496//I_MSG("You selected the job. !!",player);
1497}
1498}
1499}
1500
1501function Caminhoneiro( player )
1502{
1503player = FindPlayer( player );
1504if ( player )
1505{
1506if ( player.Vehicle && player.Vehicle.Model == 213 )
1507{
1508AntiBugSphere[ player.ID ] = 5;
1509player.RestoreCamera();
1510Carregado[ player.ID ] = true;
1511player.Frozen = false;
1512CreateMarker(player.UniqueWorld, Vector( 309.361, -302.185, 11.9591 ), 1, RGB(000 ,000 ,000), 0 );
1513//I_MSG("You selected the job!!",player);
1514}
1515}
1516}
1517
1518function CarregarCasas()
1519{
1520local i = 0, id, nome, preco, dono, compart, x, y, z;
1521local q = QuerySQL( db, "SELECT * FROM Casas" );
1522while ( GetSQLColumnData( q, 0 ) != null )
1523{
1524nome = GetSQLColumnData( q, 1 );
1525preco = GetSQLColumnData( q, 2 );
1526dono = GetSQLColumnData( q, 3 );
1527compart = GetSQLColumnData( q, 4 );
1528x = GetSQLColumnData( q, 5 );
1529y = GetSQLColumnData( q, 6 );
1530z = GetSQLColumnData( q, 7 );
1531id = CreatePickup( 407, 1, 1, x, y, z, 255, true ).ID;
1532Casa[ id ] = PropStats();
1533Casa[ id ].ID = GetSQLColumnData( q, 0 );
1534Casa[ id ].Nome = nome;
1535Casa[ id ].Preco = preco;
1536Casa[ id ].Dono = dono;
1537Casa[ id ].Compart = compart;
1538GetSQLNextRow( q );
1539i++;
1540}
1541FreeSQLQuery( q );
1542print( "[Cargado] Casas del servidor - " + i );
1543}
1544
1545function CountProps()
1546{
1547local c = 0;
1548for( local i = 0, pickup; i < GetPickupCount(); i++ )
1549{
1550pickup = FindPickup( i );
1551if ( pickup && pickup.Model == 407 ) c ++;
1552}
1553return c;
1554}
1555
1556function PropNameExist( nome )
1557{
1558local result = false;
1559for( local i = 0, pickup; i < GetPickupCount(); i++ )
1560{
1561pickup = FindPickup( i );
1562if ( pickup && Casa[ pickup.ID ] != null )
1563{
1564if ( Casa[ pickup.ID ].Nome == nome ) result = true;
1565}
1566}
1567return result;
1568}
1569
1570function FindProp( id )
1571{
1572if ( id < 0 ) return false;
1573else if ( id > 1000 ) return false;
1574else if ( Casa[ id ] == null ) return false;
1575else return true;
1576}
1577
1578function CarregarObjetos()
1579{
1580local i = 0, obj, modelo, world, pos, alpha, rot;
1581local q = QuerySQL( db, "SELECT * FROM Objectss" );
1582while ( GetSQLColumnData( q, 0 ) != null )
1583{
1584modelo = GetSQLColumnData( q, 0 );
1585world = GetSQLColumnData( q, 1 );
1586pos = Vector( GetSQLColumnData( q, 2 ), GetSQLColumnData( q, 3 ), GetSQLColumnData( q, 4 ) );
1587alpha = GetSQLColumnData( q, 5 );
1588rot = Vector( GetSQLColumnData( q, 6 ), GetSQLColumnData( q, 7 ), GetSQLColumnData( q, 8 ) );
1589obj = CreateObject( modelo, world, pos, alpha );
1590obj.RotateToEuler( rot, 0 );
1591GetSQLNextRow( q );
1592i++;
1593}
1594FreeSQLQuery( q );
1595print( "Cargados objetos: "+ CountObjectss() );
1596}
1597
1598function GetVehicleType( model )
1599{
1600 // by Force
1601 // Returns: Car / Bike / Heli / Plane / Boat / RC
1602 switch ( model ) {
1603 case 136:
1604 case 160:
1605 case 176:
1606 case 182:
1607 case 183:
1608 case 184:
1609 case 190:
1610 case 202:
1611 case 203:
1612 case 214:
1613 case 223:
1614 return "Boat";
1615 case 155:
1616 case 165:
1617 case 217:
1618 case 218:
1619 case 227:
1620 return "Heli";
1621 case 166:
1622 case 178:
1623 case 191:
1624 case 192:
1625 case 193:
1626 case 198:
1627 return "Bike";
1628 case 171:
1629 case 194:
1630 case 195:
1631 case 231:
1632 return "RC";
1633 case 180:
1634 case 181:
1635 return "Plane";
1636 default:
1637 return "Car";
1638 }
1639}
1640
1641function nosEnable( player )
1642{
1643 if ( player.Vehicle.Driver.Name != player.Name ) { return; }
1644 if( player )
1645 {
1646 local veh = player.Vehicle,
1647 type = GetVehicleType( veh.Model ),
1648 defaultMaxSpeed = veh.GetHandlingData(13),
1649 defaultAcceleration = veh.GetHandlingData(14);
1650
1651 if(type == "Car")
1652 {
1653 if( veh.RelativeSpeed != Vector( 0, 0, 0 ) )
1654 veh.RelativeSpeed *= nosSpeedBoost;
1655
1656 PlaySound( veh.World, 65, veh.Pos );
1657
1658 veh.SetHandlingData(13, defaultMaxSpeed+nosMaxSpeed); // increases MaxSpeed with the value specified for nosMaxSpeed
1659 veh.SetHandlingData(14, defaultAcceleration+nosAcceleration); // increases Acceleration with the value specified for nosAcceleration
1660 veh.Lights=true; // turns on the car's lights because the green of the rear lights can't happen without having lights on
1661 veh.SetHandlingData(30,-7); // makes the rear lights green
1662 }
1663 }
1664}
1665
1666function nosDisable( player )
1667{
1668 if( player )
1669 {
1670 local veh = player.Vehicle,
1671 type = GetVehicleType( veh.Model );
1672
1673 if(type == "Car")
1674 {
1675 veh.ResetHandlingData(13); // resets the MaxSpeed
1676 veh.ResetHandlingData(14); // resets the Acceleration
1677 veh.Lights=false; // turns back the lights off
1678 veh.ResetHandlingData(30); // resets the lights color
1679 }
1680 }
1681}
1682
1683function nosLoadSprites()
1684{
1685 nosBar <- CreateSprite( "NOS_bar.png", nosBarPosX, nosBarPosY, 0, 0, 0, nosBarAlpha );
1686 for( local i = 0; i <= 9; i++ )
1687 {
1688 if(i == 0)
1689 {
1690 nosUnitAlpha[i] = nosUnitAlpha0;
1691 nosUnitPosX[i] = nosBarPosX + 13;
1692 nosUnit[i] = CreateSprite( "NOS_unit.png", nosUnitPosX[i], nosBarPosY, 0, 0, 0, nosUnitAlpha[i] );
1693 }
1694 else
1695 {
1696 nosUnitAlpha[i] = nosUnitAlpha[i-1] + nosUnitAlphaDifference;
1697 nosUnitPosX[i] = nosUnitPosX[i-1] + nosUnitDistance;
1698 nosUnit[i] = CreateSprite( "NOS_unit.png", nosUnitPosX[i], nosBarPosY, 0, 0, 0, nosUnitAlpha[i] );
1699 }
1700 }
1701}
1702
1703function nosShowBar( player )
1704{
1705 if( player )
1706 {
1707 if( nosBar ) nosBar.ShowForPlayer( player );
1708 for( local i = 0; i <= 9; i++ )
1709 if( nosUnit[i] ) nosUnit[i].ShowForPlayer( player );
1710 }
1711}
1712
1713function nosHideBar( player )
1714{
1715 if( player )
1716 {
1717 if( nosBar ) nosBar.HideFromPlayer( player );
1718 for( local i = 0; i <= 9; i++ )
1719 if( nosUnit[i] ) nosUnit[i].HideFromPlayer( player );
1720 }
1721}
1722
1723function IsInRangeOfPoint( a, range, x, y, z )
1724{
1725local px = a.Pos.x, py = a.Pos.y, pz = a.Pos.z;
1726px -= x, py -= y, pz -= z;
1727return ( ( px * px ) + ( py * py ) + ( pz * pz ) ) < ( range * range );
1728}
1729
1730function IsFloat( value )
1731{
1732if ( typeof value == "float" ) return true;
1733try
1734{
1735if ( value.find( "." ) != null )
1736{
1737value = value.tofloat();
1738return true;
1739}
1740else return false;
1741}
1742catch(e) return false;
1743}
1744
1745function MoverPortao( player )
1746{
1747if ( player.IsSpawned )
1748{
1749for ( local i = 0; i < Portao.len(); i++ )
1750{
1751local portao = Portao[i].Objeto;
1752if ( IsInRangeOfPoint( player, 10, Portao[i].Pos1.x, Portao[i].Pos1.y, Portao[i].Pos1.z ) )
1753{
1754if ( Casa[ Portao[i].ID ].Dono == player.Name || Casa[ Portao[i].ID ].Compart == player.Name )
1755{
1756if ( Portao[i].Trancado == true )
1757{
1758PlaySound( player.World, 145, player.Pos );
1759portao.MoveTo( Portao[i].Pos2, 2800 );
1760portao.RotateToEuler( Portao[i].Rot2, 2800 );
1761Portao[i].Trancado = false;
1762}
1763else if ( Portao[i].Trancado == false )
1764{
1765PlaySound( player.World, 145, player.Pos );
1766portao.MoveTo( Portao[i].Pos1, 2800 );
1767portao.RotateToEuler( Portao[i].Rot1, 2800 );
1768Portao[i].Trancado = true;
1769}
1770}
1771}
1772}
1773}
1774}
1775
1776function CarregarPortoes()
1777{
1778local i = 0, obj, id, modelo, pos1, rot1, pos2, rot2;
1779local q = QuerySQL( db, "SELECT * FROM Portoes" );
1780while ( GetSQLColumnData( q, 0 ) != null )
1781{
1782id = GetSQLColumnData( q, 0 );
1783modelo = GetSQLColumnData( q, 1 );
1784pos1 = split( GetSQLColumnData( q, 2 ), " " );
1785rot1 = split( GetSQLColumnData( q, 3 ), " " );
1786pos2 = split( GetSQLColumnData( q, 4 ), " " );
1787rot2 = split( GetSQLColumnData( q, 5 ), " " );
1788obj = CreateObject( modelo, 1, Vector( pos1[0].tofloat(), pos1[1].tofloat(), pos1[2].tofloat() ), 255 );
1789obj.RotateToEuler( Vector( rot1[0].tofloat(), rot1[1].tofloat(), rot1[2].tofloat() ), 0 );
1790Portao.push({
1791Objeto = obj,
1792ID = id,
1793Pos1 = Vector( pos1[0].tofloat(), pos1[1].tofloat(), pos1[2].tofloat() ),
1794Rot1 = Vector( rot1[0].tofloat(), rot1[1].tofloat(), rot1[2].tofloat() ),
1795Pos2 = Vector( pos2[0].tofloat(), pos2[1].tofloat(), pos2[2].tofloat() ),
1796Rot2 = Vector( rot2[0].tofloat(), rot2[1].tofloat(), rot2[2].tofloat() ),
1797Trancado = true
1798});
1799GetSQLNextRow( q );
1800i++;
1801}
1802FreeSQLQuery( q );
1803print( "[Cargados] Portones del servidor - " + i );
1804}
1805
1806function rotateRight(val, sbits)
1807{
1808 return (val >> sbits) | (val << (0x20 - sbits));
1809}
1810
1811function Radio()
1812{
1813CreateRadioStream( 18, "English 4", "http://19353.live.streamtheworld.com/977_HITS.mp3", true );
1814CreateRadioStream( 15, "English 1", "http://strm112.1.fm/top40_mobile_mp3", true)
1815CreateRadioStream( 16, "English 2", "http://jamfm.hoerradar.de/jamfm-mp3-128?sABC=5nr2s7o5%230%23875r45529s1o57o842593681r18q1598%23enqvbQR&amsparams=playerid:radioDE;skey:1524823989", true)
1816CreateRadioStream( 17, "English 3", "http://94.130.133.39/top100station.mp3", true)
1817CreateRadioStream( 19, "Arabic 1", "http://204.9.190.93:9302/;", true );
1818CreateRadioStream( 20, "Arabic 2", "http://icecast.omroep.nl/funx-arab-bb-mp3", true)
1819CreateRadioStream( 21, "Indian 1", "http://19013.live.streamtheworld.com/ARNCITY_SC", true)
1820CreateRadioStream( 22, "Indian 2", "http://162.244.80.118:3058/stream/1/", true );
1821CreateRadioStream( 23, "UK 1", "http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_q", true)
1822CreateRadioStream( 24, "ISIS", "https://www117.zippyshare.com/d/Q1NgigKc/5181/%2853%29%20%d8%a3%d9%86%d8%b4%d9%88%d8%af%d8%a9%20%d9%82%d8%af%20%d8%a2%d9%86%20%d8%b2%d9%88%d8%a7%d9%84%d9%83%20%d9%82%d8%af%20%d8%a2%d9%86%20-%20YouTube.mp3", true)
1823CreateRadioStream( 25, "latina 1", "http://19213.live.streamtheworld.com/VIBRA_SC", true );
1824CreateRadioStream( 26, "america 1", "http://20853.live.streamtheworld.com/RADIO538_SC", true)
1825CreateRadioStream( 27, "justin", "https://www33.zippyshare.com/d/cS5HT9St/30426/Best%20Songs%20Of%20Justin%20Bieber%20-%20Justin%20Bieber%20Greatest%20Hits%202018%20-%20YouTube.mp3", true)
1826}
1827
1828function GetDistance(pos1, pos2)
1829{
1830 return sqrt(pow(pos1.x - pos2.x, 2) + pow(pos1.y - pos2.y, 2) + pow(pos1.z - pos2.z, 2));
1831}
1832
1833function Arrest(player,target)
1834{
1835 if (!target) {
1836 MessagePlayer("Unknown Player",player)
1837 return false;
1838 }
1839 if (target.WantedLevel <0) {
1840 I_MSG("Player is not wanted",player)
1841 return false;
1842 }
1843 if (target.WantedLevel > 0) {
1844 local distance = GetDistance(player.Pos,target.Pos)
1845 if ( distance < 5 ) {
1846 I_MSG("[#ffffff]Arrested "+target+" , Reward: $5000",player)
1847 player.Cash += 5000;
1848 target.Pos = Vector(384.157, -506.481, 9.39822);
1849 target.WantedLevel = 0
1850 Message("[#000099]Policia[#ffffff] "+player+ " [#00ffff]ha arrestado a[#ff0000] "+plr)
1851 }
1852 }
1853}
1854
1855function arresttime(p)
1856{
1857local player = FindPlayer(p);
1858if (plr)
1859plr.Pos = Vector(394.654, -495.409, 10.8694);
1860MessagePlayer( "**You have been released from jail",plr );
1861}
1862
1863function Velocimetro()
1864{
1865if ( GetPlayers() >= 1 )
1866{
1867 for ( local i = 0; i < GetMaxPlayers(); i++ )
1868 {
1869 local player = FindPlayer( i );
1870 if ( player )
1871 {
1872 if ( player.IsSpawned && player.Vehicle )
1873 {
1874 local vehicle = player.Vehicle;
1875 local Speed = sqrt(vehicle.Speed.x*vehicle.Speed.x + vehicle.Speed.y * vehicle.Speed.y + vehicle.Speed.z * vehicle.Speed.z) * 50 * 3.6;
1876 local output = round(Speed, 0);
1877 Announce("\x10 \x10 \x10 \x20 \x20 \x20 \x20 \x20 \x20 \x20 \x20 ~w~Kph: ~o~" + output, player, 1 );
1878}
1879}
1880}
1881}
1882}
1883
1884function round(value, precision) {
1885 local factor = pow(10.0, precision);
1886 return floor(value * factor + 0.5) / factor;
1887}
1888/*
1889
1890function onKeyDown(player,key)
1891{
1892if ( key == L )
1893{
1894I_MSG("[#FF9933]Ahorita no hay un evento de esquivar creado.",player);
1895}
1896else if ( key == P )
1897{
1898MoverPortao( player );
1899}
1900else if ( key == I )
1901{
1902I_MSG("[#FF9933]Ahorita no hay un evento de agilidad creado.",player);
1903}
1904}
1905*/
1906function AddSkin( player, skin )
1907{
1908if ( ( skin ) && IsNum( skin ) ) skin = skin.tointeger();
1909else if ( skin ) skin = GetSkinID( skin );
1910QuerySQL( db, "DELETE FROM Skins WHERE Name='" + player.Name + "'" );
1911QuerySQL( db, "INSERT INTO Skins ( Nome, Skin ) VALUES ( '" + player.Name + "', '" + skin + "')" );
1912}
1913
1914function DelSkin( player )
1915{
1916QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
1917}
1918
1919function skin( player )
1920{
1921local skin = GetSQLColumnData( QuerySQL( db, "SELECT Skin FROM Skins WHERE Nome='" + player.Name + "'" ), 0 );
1922if ( skin ) return skin;
1923else return 0;
1924}
1925
1926function LoadSkin( player )
1927{
1928if ( skin(player) == 0 ) player.Skin = 0 ;
1929else if ( skin(player) == 1 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
1930else if ( skin(player) == 2 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
1931else if ( skin(player) == 3 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
1932else if ( skin(player) == 4 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
1933else if ( skin(player) == 5 ) player.Skin = 5 ;
1934else if ( skin(player) == 6 ) player.Skin = 6 ;
1935else if ( skin(player) == 7 ) player.Skin = 7 ;
1936else if ( skin(player) == 8 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
1937else if ( skin(player) == 9 ) player.Skin = 9 ;
1938else if ( skin(player) == 10 ) player.Skin = 10 ;
1939else if ( skin(player) == 11 ) player.Skin = 11 ;
1940else if ( skin(player) == 12 ) player.Skin = 12 ;
1941else if ( skin(player) == 13 ) player.Skin = 13 ;
1942else if ( skin(player) == 14 ) player.Skin = 14 ;
1943else if ( skin(player) == 15 ) player.Skin = 15 ;
1944else if ( skin(player) == 16 ) player.Skin = 16 ;
1945else if ( skin(player) == 17 ) player.Skin = 17 ;
1946else if ( skin(player) == 18 ) player.Skin = 18 ;
1947else if ( skin(player) == 19 ) player.Skin = 19 ;
1948else if ( skin(player) == 20 ) player.Skin = 20 ;
1949else if ( skin(player) == 21 ) player.Skin = 21 ;
1950else if ( skin(player) == 22 ) player.Skin = 22 ;
1951else if ( skin(player) == 23 ) player.Skin = 23 ;
1952else if ( skin(player) == 24 ) player.Skin = 24 ;
1953else if ( skin(player) == 25 ) player.Skin = 25 ;
1954else if ( skin(player) == 26 ) player.Skin = 26 ;
1955else if ( skin(player) == 27 ) player.Skin = 27 ;
1956else if ( skin(player) == 28 ) player.Skin = 28 ;
1957else if ( skin(player) == 29 ) player.Skin = 29 ;
1958else if ( skin(player) == 30 ) player.Skin = 30 ;
1959else if ( skin(player) == 31 ) player.Skin = 31 ;
1960else if ( skin(player) == 32 ) player.Skin = 32 ;
1961else if ( skin(player) == 33 ) player.Skin = 33 ;
1962else if ( skin(player) == 34 ) player.Skin = 34 ;
1963else if ( skin(player) == 35 ) player.Skin = 35 ;
1964else if ( skin(player) == 36 ) player.Skin = 36 ;
1965else if ( skin(player) == 37 ) player.Skin = 37 ;
1966else if ( skin(player) == 38 ) player.Skin = 38 ;
1967else if ( skin(player) == 39 ) player.Skin = 39 ;
1968else if ( skin(player) == 40 ) player.Skin = 40 ;
1969else if ( skin(player) == 41 ) player.Skin = 41 ;
1970else if ( skin(player) == 42 ) player.Skin = 42 ;
1971else if ( skin(player) == 43 ) player.Skin = 43 ;
1972else if ( skin(player) == 44 ) player.Skin = 44 ;
1973else if ( skin(player) == 45 ) player.Skin = 45 ;
1974else if ( skin(player) == 46 ) player.Skin = 46 ;
1975else if ( skin(player) == 47 ) player.Skin = 47 ;
1976else if ( skin(player) == 48 ) player.Skin = 48 ;
1977else if ( skin(player) == 49 ) player.Skin = 49 ;
1978else if ( skin(player) == 50 ) player.Skin = 50 ;
1979else if ( skin(player) == 51 ) player.Skin = 51 ;
1980else if ( skin(player) == 52 ) player.Skin = 52 ;
1981else if ( skin(player) == 53 ) player.Skin = 53 ;
1982else if ( skin(player) == 54 ) player.Skin = 54 ;
1983else if ( skin(player) == 55 ) player.Skin = 55 ;
1984else if ( skin(player) == 56 ) player.Skin = 56 ;
1985else if ( skin(player) == 57 ) player.Skin = 57 ;
1986else if ( skin(player) == 58 ) player.Skin = 58 ;
1987else if ( skin(player) == 59 ) player.Skin = 59 ;
1988else if ( skin(player) == 60 ) player.Skin = 60 ;
1989else if ( skin(player) == 61 ) player.Skin = 61 ;
1990else if ( skin(player) == 62 ) player.Skin = 62 ;
1991else if ( skin(player) == 63 ) player.Skin = 63 ;
1992else if ( skin(player) == 64 ) player.Skin = 64 ;
1993else if ( skin(player) == 65 ) player.Skin = 65 ;
1994else if ( skin(player) == 66 ) player.Skin = 66 ;
1995else if ( skin(player) == 67 ) player.Skin = 67 ;
1996else if ( skin(player) == 68 ) player.Skin = 68 ;
1997else if ( skin(player) == 69 ) player.Skin = 69 ;
1998else if ( skin(player) == 70 ) player.Skin = 70 ;
1999else if ( skin(player) == 71 ) player.Skin = 71 ;
2000else if ( skin(player) == 72 ) player.Skin = 72 ;
2001else if ( skin(player) == 73 ) player.Skin = 73 ;
2002else if ( skin(player) == 74 ) player.Skin = 74 ;
2003else if ( skin(player) == 75 ) player.Skin = 75 ;
2004else if ( skin(player) == 76 ) player.Skin = 76 ;
2005else if ( skin(player) == 77 ) player.Skin = 77 ;
2006else if ( skin(player) == 78 ) player.Skin = 78 ;
2007else if ( skin(player) == 79 ) player.Skin = 79 ;
2008else if ( skin(player) == 80 ) player.Skin = 80 ;
2009else if ( skin(player) == 81 ) player.Skin = 81 ;
2010else if ( skin(player) == 82 ) player.Skin = 82 ;
2011else if ( skin(player) == 83 ) player.Skin = 83 ;
2012else if ( skin(player) == 84 ) player.Skin = 84 ;
2013else if ( skin(player) == 85 ) player.Skin = 85 ;
2014else if ( skin(player) == 86 ) player.Skin = 86 ;
2015else if ( skin(player) == 87 ) player.Skin = 87 ;
2016else if ( skin(player) == 88 ) player.Skin = 88 ;
2017else if ( skin(player) == 89 ) player.Skin = 89 ;
2018else if ( skin(player) == 90 ) player.Skin = 90 ;
2019else if ( skin(player) == 91 ) player.Skin = 91 ;
2020else if ( skin(player) == 92 ) player.Skin = 92 ;
2021else if ( skin(player) == 93 ) player.Skin = 93 ;
2022else if ( skin(player) == 94 ) player.Skin = 94 ;
2023else if ( skin(player) == 95 ) player.Skin = 95 ;
2024else if ( skin(player) == 96 ) player.Skin = 96 ;
2025else if ( skin(player) == 97 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
2026else if ( skin(player) == 98 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
2027else if ( skin(player) == 99 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
2028else if ( skin(player) == 100 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
2029else if ( skin(player) == 101 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
2030else if ( skin(player) == 102 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
2031else if ( skin(player) == 103 ) player.Skin = 103 ;
2032else if ( skin(player) == 104 ) player.Skin = 104 ;
2033else if ( skin(player) == 105 ) player.Skin = 105 ;
2034else if ( skin(player) == 106 ) player.Skin = 106 ;
2035else if ( skin(player) == 107 ) player.Skin = 107 ;
2036else if ( skin(player) == 108 ) player.Skin = 108 ;
2037else if ( skin(player) == 109 ) player.Skin = 109 ;
2038else if ( skin(player) == 110 ) player.Skin = 110 ;
2039else if ( skin(player) == 111 ) player.Skin = 111 ;
2040else if ( skin(player) == 112 ) player.Skin = 112 ;
2041else if ( skin(player) == 113 ) player.Skin = 113 ;
2042else if ( skin(player) == 114 ) player.Skin = 114 ;
2043else if ( skin(player) == 115 ) player.Skin = 115 ;
2044else if ( skin(player) == 116 ) player.Skin = 116 ;
2045else if ( skin(player) == 117 ) player.Skin = 117 ;
2046else if ( skin(player) == 118 ) player.Skin = 118 ;
2047else if ( skin(player) == 119 ) player.Skin = 119 ;
2048else if ( skin(player) == 120 ) player.Skin = 120 ;
2049else if ( skin(player) == 121 ) player.Skin = 121 ;
2050else if ( skin(player) == 122 ) player.Skin = 122 ;
2051else if ( skin(player) == 123 ) player.Skin = 123 ;
2052else if ( skin(player) == 124 ) player.Skin = 124 ;
2053else if ( skin(player) == 125 ) player.Skin = 125 ;
2054else if ( skin(player) == 126 ) player.Skin = 126 ;
2055else if ( skin(player) == 127 ) player.Skin = 127 ;
2056else if ( skin(player) == 128 ) player.Skin = 128 ;
2057else if ( skin(player) == 129 ) player.Skin = 129 ;
2058else if ( skin(player) == 130 ) player.Skin = 130 ;
2059else if ( skin(player) == 131 ) player.Skin = 131 ;
2060else if ( skin(player) == 132 ) player.Skin = 132 ;
2061else if ( skin(player) == 133 ) player.Skin = 133 ;
2062else if ( skin(player) == 134 ) player.Skin = 134 ;
2063else if ( skin(player) == 135 ) player.Skin = 135 ;
2064else if ( skin(player) == 136 ) player.Skin = 136 ;
2065else if ( skin(player) == 137 ) player.Skin = 137 ;
2066else if ( skin(player) == 138 ) player.Skin = 138 ;
2067else if ( skin(player) == 139 ) player.Skin = 139 ;
2068else if ( skin(player) == 140 ) player.Skin = 140 ;
2069else if ( skin(player) == 141 ) player.Skin = 141 ;
2070else if ( skin(player) == 142 ) player.Skin = 142 ;
2071else if ( skin(player) == 143 ) player.Skin = 143 ;
2072else if ( skin(player) == 144 ) player.Skin = 144 ;
2073else if ( skin(player) == 145 ) player.Skin = 145 ;
2074else if ( skin(player) == 146 ) player.Skin = 146 ;
2075else if ( skin(player) == 147 ) player.Skin = 147 ;
2076else if ( skin(player) == 148 ) player.Skin = 148 ;
2077else if ( skin(player) == 149 ) player.Skin = 149 ;
2078else if ( skin(player) == 150 ) player.Skin = 150 ;
2079else if ( skin(player) == 151 ) player.Skin = 151 ;
2080else if ( skin(player) == 152 ) player.Skin = 152 ;
2081else if ( skin(player) == 153 ) player.Skin = 153 ;
2082else if ( skin(player) == 154 ) player.Skin = 154 ;
2083else if ( skin(player) == 155 ) player.Skin = 155 ;
2084else if ( skin(player) == 156 ) player.Skin = 156 ;
2085else if ( skin(player) == 157 ) player.Skin = 157 ;
2086else if ( skin(player) == 158 ) player.Skin = 158 ;
2087else if ( skin(player) == 159 ) player.Skin = 159 ;
2088else if ( skin(player) == 160 ) player.Skin = 160 ;
2089else if ( skin(player) == 161 ) player.Skin = 161 ;
2090else if ( skin(player) == 162 ) player.Skin = 162 ;
2091else if ( skin(player) == 163 ) player.Skin = 163 ;
2092else if ( skin(player) == 164 ) player.Skin = 164 ;
2093else if ( skin(player) == 165 ) player.Skin = 165 ;
2094else if ( skin(player) == 166 ) player.Skin = 166 ;
2095else if ( skin(player) == 167 ) player.Skin = 167 ;
2096else if ( skin(player) == 168 ) player.Skin = 168 ;
2097else if ( skin(player) == 169 ) player.Skin = 169 ;
2098else if ( skin(player) == 170 ) player.Skin = 170 ;
2099else if ( skin(player) == 171 ) player.Skin = 171 ;
2100else if ( skin(player) == 172 ) player.Skin = 172 ;
2101else if ( skin(player) == 173 ) player.Skin = 173 ;
2102else if ( skin(player) == 174 ) player.Skin = 174 ;
2103else if ( skin(player) == 175 ) player.Skin = 175 ;
2104else if ( skin(player) == 176 ) player.Skin = 176 ;
2105else if ( skin(player) == 177 ) player.Skin = 177 ;
2106else if ( skin(player) == 178 ) player.Skin = 178 ;
2107else if ( skin(player) == 179 ) player.Skin = 179 ;
2108else if ( skin(player) == 180 ) player.Skin = 180 ;
2109else if ( skin(player) == 181 ) player.Skin = 181 ;
2110else if ( skin(player) == 182 ) player.Skin = 182 ;
2111else if ( skin(player) == 183 ) player.Skin = 183 ;
2112else if ( skin(player) == 184 ) player.Skin = 184 ;
2113else if ( skin(player) == 185 ) player.Skin = 185 ;
2114else if ( skin(player) == 186 ) player.Skin = 186 ;
2115else if ( skin(player) == 187 ) player.Skin = 187 ;
2116else if ( skin(player) == 188 ) player.Skin = 188 ;
2117else if ( skin(player) == 189 ) player.Skin = 189 ;
2118else if ( skin(player) == 190 ) player.Skin = 190 ;
2119else if ( skin(player) == 191 ) player.Skin = 191 ;
2120else if ( skin(player) == 192 ) player.Skin = 192 ;
2121else if ( skin(player) == 193 ) player.Skin = 193 ;
2122else if ( skin(player) == 194 ) player.Skin = 194 ;
2123else if ( skin(player) == 195 ) player.Skin = 195 ;
2124else if ( skin(player) == 196 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
2125else if ( skin(player) == 197 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
2126else if ( skin(player) == 198 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
2127else if ( skin(player) == 199 ) QuerySQL( db, "DELETE FROM Skins WHERE Nome='" + player.Name + "'" );
2128else if ( skin(player) == 200 ) player.Skin = 200 ;
2129else if ( skin(player) == 201 ) player.Skin = 201 ;
2130else if ( skin(player) == 202 ) player.Skin = 202 ;
2131else if ( skin(player) == 203 ) player.Skin = 203 ;
2132else if ( skin(player) == 204 ) player.Skin = 204 ;
2133else if ( skin(player) == 205 ) player.Skin = 205 ;
2134else if ( skin(player) == 206 ) player.Skin = 206 ;
2135else if ( skin(player) == 207 ) player.Skin = 207 ;
2136else if ( skin(player) == 208 ) player.Skin = 208 ;
2137else if ( skin(player) == 209 ) player.Skin = 209 ;
2138else if ( skin(player) == 210 ) player.Skin = 210 ;
2139else if ( skin(player) == 211 ) player.Skin = 211 ;
2140else if ( skin(player) == 212 ) player.Skin = 212 ;
2141else if ( skin(player) == 213 ) player.Skin = 213 ;
2142else if ( skin(player) == 214 ) player.Skin = 214 ;
2143else if ( skin(player) == 215 ) player.Skin = 215 ;
2144else if ( skin(player) == 216 ) player.Skin = 216 ;
2145else if ( skin(player) == 217 ) player.Skin = 217 ;
2146else if ( skin(player) == 218 ) player.Skin = 218 ;
2147}
2148
2149function CountObjectss()
2150{
2151try
2152 {
2153 local a = 0, q = QuerySQL( db, "SELECT * FROM Objectss" );
2154 while ( GetSQLColumnData( q, 0 ) )
2155 {
2156 a ++;
2157 GetSQLNextRow( q );
2158 }
2159 return a;
2160 FreeSQLQuery( q );
2161 }
2162 catch(e) print( "[Error] CountObjects - " + e );
2163}
2164
2165function RespawnVehicles( rtime = 0 ){
2166//Loop over all the vehicles.
2167for( local veh, i = 1; i <= 1000; i++ ){
2168veh = FindVehicle(i);
2169if( !veh ) continue;
2170if( rtime == 0 ) veh.Respawn();
2171else veh.RespawnTimer = rtime; //Time in ms.
2172}
2173}
2174
2175function onPickupPickedUp( player, pickup )
2176{
2177 if ( !player.Vehicle && pickup.Model == 407 )
2178 {
2179 if ( Casa[ pickup.ID ] != null )
2180 {
2181 pickup.Timer = 3000;
2182 MessagePlayer( "[#EEC900]Name of Prop: [#00FFFF]" + Casa[ pickup.ID ].Nome + "[#EEC900] - ID: [#00FFFF]" + pickup.ID + "[#EEC900] - Owner: [#00FFFF]" + Casa[ pickup.ID ].Dono + "[#EEC900].", player );
2183 MessagePlayer( "[#EEC900]Price: [#00FFFF]$" + Casa[ pickup.ID ].Preco + "[#EEC900] - Shared with: [#00FFFF]" + Casa[ pickup.ID ].Compart + "[#EEC900].", player );
2184 }
2185 }
2186 if ( pickup.Model == 345 )
2187 {
2188 MSG( player.Name + " found the surprise box! Reward: $1000000!" );
2189 IncCash( player, 10000000 );
2190 pickup.Remove();
2191 BoxActive = false;
2192 }
2193if ( pickup.Model == 407 )
2194{
2195if ( Casa[ pickup.ID ] != null )
2196{
2197pickup.Timer = 3000;
2198
2199}
2200}
2201else if ( pickup.Model == 408 )
2202{
2203local robbedcash = random( 2000, 4000);
2204Message("[#ff0000]"+ player.Name +" [#00ffff]robbed [#cccccc]$" + robbedcash + " [#cc00cc]on[#00cc00] "+ GetDistrictName( player.Pos.x, player.Pos.y ) +"");
2205EchoMessage("4"+ player.Name +" 12robbed 14$" + robbedcash + " 6on9 "+ GetDistrictName( player.Pos.x, player.Pos.y ) +"");
2206IncCash( player, robbedcash );
2207player.WantedLevel++;
2208pickup.RespawnTime = 20000;
2209}
2210else if ( pickup.Model == 356 )
2211{
2212local vehicle = player.Vehicle;
2213if ( !vehicle ) I_MSG( "You need to be in your vehicle.", player );
2214else if ( Fuel[ vehicle.ID ] >= 51 ) I_MSG( "The vehicle does not need gas.", player );
2215else if ( player.Cash <= 2000 ) E_MSG( "You need 10,000.", player );
2216else
2217{
2218Fuel[ vehicle.ID ] = 100;
2219player.Cash -= 10000;
2220I_MSG( "Recharged petrol!", player );
2221if ( vehicle.GetHandlingData( 13 ) == 0 ) vehicle.ResetHandlingData( 13 );
2222if ( vehicle.GetHandlingData( 14 ) == 0 ) vehicle.ResetHandlingData( 14 );
2223Announce("\x10 \x10 \x10 \x20 \x20 \x20 \x20 \x20 \x20 \x20 \x20 ~w~Gasolina: ~w~" + Fuel[ vehicle.ID ], player, 5 );
2224pickup.RespawnTime = 10000;
2225}
2226}
2227else if ( pickup.Model == 406 )
2228{
2229player.Pos = Vector( -713.673 1298.67 11.7673 );
2230I_MSG( "Para salir interior use /casa <ID>", player );
2231}
2232else if ( pickup.Model == 409 )
2233{
2234I_MSG("Now you work as a police officer." player );
2235player.Skin = ( 1 );
2236}
2237}
2238
2239function random(start, finish)
2240{
2241local t = ((rand() % (finish - start)) + start);
2242return t;
2243}
2244
2245function createpickupss()
2246{
2247CreatePickup(408, Vector( 207.214, -470.93, 11.0699 )); // bunchoftools
2248CreatePickup(408, Vector( 467.072, -53.9059, 11.4837 )); // malibu
2249CreatePickup(408, Vector( 418.765, 91.317, 11.2808 )); // pizzavc
2250CreatePickup(408, Vector( 491.143, 701.207, 12.1033 )); // hospitalvc
2251CreatePickup(408, Vector( 450.729, 782.371, 12.954 )); // storevc
2252CreatePickup(408, Vector( 472.171, 1009.33, 19.1462 )); // tarbrush1
2253CreatePickup(408, Vector( 471.983, 1014.02, 20.0473 )); // tarbrush2
2254CreatePickup(408, Vector( 421.842, 1026.69, 25.2993 )); // gash
2255CreatePickup(408, Vector( 364.444, 1052.46, 19.213 )); // ammunationmall
2256CreatePickup(408, Vector( 363.719, 1074.71, 19.0613 )); // tooledup
2257CreatePickup(408, Vector( 351.45, 1111.41, 25.3879 )); // musicshop
2258CreatePickup(408, Vector( 469.438, 1206.76, 19.0103 )); // jewelry
2259CreatePickup(408, Vector( 2.39992, 956.954, 11.1667 )); // film
2260CreatePickup(408, Vector( -680.664, 1204.1, 11.1093 )); // ammudowntown
2261CreatePickup(408, Vector( -822.855, 1138.59, 12.4111 )); // hospitaldt
2262CreatePickup(408, Vector( -853.756, 850.456, 11.3846 )); // jewelrydt
2263CreatePickup(408, Vector( -905.961, 799.732, 11.4661 )); // pizzadt
2264CreatePickup(408, Vector( -830.144, 742.221, 11.2885 )); // medicaldt
2265CreatePickup(408, Vector( -594.15, 643.695, 11.6765 )); // bikers
2266CreatePickup(408, Vector( -846.475, -71.8574, 11.5403 )); // medicallh
2267CreatePickup(408, Vector( -1079.9, -275.156, 12.0882 )); // printworks
2268CreatePickup(408, Vector( -1038.02, 80.8385, 11.6263 )); // pizzalh
2269CreatePickup(408, Vector( -997.021, 186.33, 12.434 )); // kaufman
2270CreatePickup(408, Vector( -887.722, -474.079, 13.1115 )); // hospitallh
2271CreatePickup(408, Vector( -867.464, -584.271, 11.2155 )); // cherrypopper
2272CreatePickup(408, Vector( -855.472, -631.404, 11.3756 )); // donuts
2273CreatePickup(408, Vector( -1166.79, -620.55, 11.8279 )); // cubaan
2274CreatePickup(408, Vector( -1031.45, -850.113, 13.5224 )); // sunshine
2275CreatePickup(408, Vector( -665.544, -1484.63, 13.8016 )); // boatyard
2276CreatePickup(408, Vector( -112.599, -975.639, 10.4634 )); // hospitalvc
2277CreatePickup(408, Vector( -63.8908, -1485.23, 10.505 )); // ammuvc
2278CreatePickup(408, Vector( 90.5438, -1454.35, 10.5655 )); // poleposition
2279CreatePickup(356, Vector( 59.9425, -1071.8, 10.4633 ));
2280CreatePickup(356, Vector( 59.9448, -1078.36, 10.4633 ));
2281CreatePickup(408, Vector( -714.307, -1265.8, 11.0715 ));
2282}
2283
2284function random( min, max )
2285{
2286 if ( min < max )
2287 return rand() % (max - min + 1) + min.tointeger();
2288 else if ( min > max )
2289 return rand() % (min - max + 1) + max.tointeger();
2290 else if ( min == max )
2291 return min.tointeger();
2292}
2293
2294function MSG1()
2295{
2296MSG("Press ALT for nos.");
2297}
2298
2299function MSG2()
2300{
2301MSG("There are some jobs which u can earn money, go work.");
2302}
2303
2304function MSG3()
2305{
2306MSG("Want to race? Use /race.");
2307}
2308
2309function MSG4()
2310{
2311MSG("Use /carshop to see cars if you want to buy.");
2312}
2313
2314function MSG5()
2315{
2316MSG("Use /cmds to learn faster the commands.");
2317}
2318
2319function MSG6()
2320{
2321MSG("Something illegal? /report.");
2322}
2323
2324function GetTok(string, separator, n, ...)
2325{
2326 local m = vargv.len() > 0 ? vargv[0] : n,
2327 tokenized = split(string, separator),
2328 text = "";
2329
2330 if (n > tokenized.len() || n < 1) return null;
2331 for (; n <= m; n++)
2332 {
2333 text += text == "" ? tokenized[n-1] : separator + tokenized[n-1];
2334 }
2335 return text;
2336}
2337
2338function NumTok(string, separator)
2339{
2340 local tokenized = split(string, separator);
2341 return tokenized.len();
2342}
2343
2344function Distance(x3, y6, x3, y6)
2345{
2346local dist = sqrt(((x2 - x1)*(x2 - x1)) + ((y2 - y1)*(y2 - y1)));
2347return dist;
2348}
2349
2350function GetPlayer( plr )
2351{
2352if ( plr )
2353{
2354if ( IsNum( plr ) )
2355{
2356plr = FindPlayer( plr.tointeger() );
2357if ( plr ) return plr;
2358else return false;
2359}
2360else
2361{
2362plr = FindPlayer( plr );
2363if ( plr ) return plr;
2364else return false;
2365}
2366}
2367else return false;
2368}
2369
2370function GetFullTime()
2371{
2372local t = date();
2373return ::format(@"%.2d/%.2d/%d - %.2d:%.2d:%.2d", t.day, t.month, t.year, t.hour, t.min, t.sec);
2374}
2375
2376function CriarTabelas()
2377{
2378QuerySQL( 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, Nogoto TEXT, SpawnLoc TEXT, Loc TEXT )" );
2379QuerySQL( db, "CREATE TABLE IF NOT EXISTS Bans ( Nome TEXT, UID TEXT, Admin TEXT, Motivo TEXT, Data TEXT )" );
2380QuerySQL( db, "CREATE TABLE IF NOT EXISTS Locs ( Nome TEXT, Pos TEXT, Criador TEXT, Data TEXT )" );
2381QuerySQL( db, "CREATE TABLE IF NOT EXISTS SpawnWep ( Nome TEXT, Wep1 NUMERIC, Wep2 NUMERIC, Wep3 NUMERIC, Wep4 NUMERIC )" );
2382QuerySQL( 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 )" );
2383QuerySQL( db, "CREATE TABLE IF NOT EXISTS Skins ( Nome TEXT, Skin NUMERIC )" );
2384QuerySQL( db, "CREATE TABLE IF NOT EXISTS Portoes ( CasaID NUMERIC, Model NUMERIC, Pos1 TEXT, Rot1 TEXT, Pos2 TEXT, Rot2 TEXT )" );
2385QuerySQL( db, "CREATE TABLE IF NOT EXISTS Objectss ( Model NUMERIC, World NUMERIC, PX FLOAT, PY FLOAT, PZ FLOAT, Alpha NUMERIC, RX FLOAT, RT FLOAT, RZ FLOAT, Creator TEXT )" );
2386QuerySQL( db, "CREATE TABLE IF NOT EXISTS Casas ( ID NUMERIC, Nome TEXT, Preco NUMERIC, Dono TEXT, Compart TEXT, PX FLOAT, PY FLOAT, PZ FLOAT )" );
2387QuerySQL( db, "CREATE TABLE IF NOT EXISTS Pickups(ID TEXT, Creator VARCHAR(32), X NUMERIC, Y NUMERIC, Z NUMERIC, PickupID TEXT, World NUMERIC )" );
2388QuerySQL( db, "CREATE TABLE IF NOT EXISTS Report(Player TEXT, Reporter TEXT, Reason TEXT, Date_Of_Report TEXT )" );
2389}
2390
2391function Reload()
2392{
2393dofile( "scripts/Main.nut" );
2394dofile( "scripts/Functions.nut" );
2395dofile( "scripts/Cmds.nut" );
2396dofile( "scripts/Echo.nut" );
2397MSG( "Script Reloaded" );
2398print( "Script Reloaded" );
2399}
2400
2401function CarregarCarros()
2402{
2403local i = 0, modelo, x, y, z, angulo, cor1, cor2;
2404local q = QuerySQL( db, "SELECT * FROM Carros" );
2405
2406while ( GetSQLColumnData( q, 0 ) != null )
2407{
2408modelo = GetSQLColumnData( q, 4 );
2409x = GetSQLColumnData( q, 5 );
2410y = GetSQLColumnData( q, 6 );
2411z = GetSQLColumnData( q, 7 );
2412angulo = GetSQLColumnData( q, 8 );
2413cor1 = GetSQLColumnData( q, 9 );
2414cor2 = GetSQLColumnData( q, 10 );
2415CreateVehicle( modelo, 0, Vector( x.tofloat(), y.tofloat(), z.tofloat() ), angulo, cor1, cor2 );
2416GetSQLNextRow( q );
2417i++;
2418}
2419FreeSQLQuery( q );
2420print( "Vehiculos Cargados - " + i );
2421}
2422
2423function IpToCountry( IP )
2424{
2425local country = geoip_country_name_by_addr( IP );
2426if ( IP == "127.0.0.1" ) return "Local-Host";
2427else if ( country == null ) return "Nao Encontrado";
2428else return country;
2429}
2430
2431function PartReason( reason )
2432{
2433if ( reason == 0 ) return "Timeout";
2434else if ( reason == 1 ) return "Quit";
2435else if ( reason == 2 ) return "Kickado";
2436else if ( reason == 3 ) return "Crash";
2437}
2438
2439function DeathReason( reason )
2440{
2441if ( reason == 70 ) return "Suicidio";
2442else if ( reason == 39 ) return "Car Accident";
2443else if ( reason == 31 ) return "Burned";
2444else if ( reason == 14 ) return "Suffocated";
2445else if ( reason == 43 ) return "Drowned";
2446else if ( reason == 41 ) return "Exploded";
2447else if ( reason == 51 ) return "Exploded";
2448else if ( reason == 44 ) return "Fell";
2449else return "Motivo Desconocido";
2450}
2451
2452function GetBP( part )
2453{
2454local group = "";
2455if ( part == 0 ) group = "Body";
2456else if ( part == 1 ) group = "Torso";
2457else if ( part == 2 ) group = "Left Arm";
2458else if ( part == 3 ) group = "Right Arm";
2459else if ( part == 4 ) group = "Left Leg";
2460else if ( part == 5 ) group = "Right Leg";
2461else if ( part == 6 ) group = "Head";
2462return group;
2463}
2464
2465function Configuracao()
2466{
2467SetUseClasses( false );
2468SetDeathMessages( false );
2469SetDrivebyEnabled( true );
2470SetDriveOnWater( false );
2471SetFlyingCars( false );
2472SetFriendlyFire( false );
2473SetJoinMessages( false );
2474SetShowNametags( true );
2475SetShowOnRadar( true );
2476SetStuntBike( false );
2477SetTaxiBoostJump( true );
2478SetServerName( Server.Nome );
2479SetSpawnPlayerPos( 472.344, -70.1221, 10.4836 );
2480SetSpawnCameraPos( 479.021, -63.4232, 9.98375 );
2481SetSpawnCameraLook( 475.172, -67.5395, 9.98375 );
2482SetGameModeName( " v" + Server.Versao );
2483SetTime( 12, 00 );
2484SetTimeRate( 0 );
2485print( Server.Nome + " v" + Server.Versao + " creado por " + Server.Desenvolvedor + " iniciado." );
2486}
2487
2488function Classes()
2489{
2490//================================= Tommy Team =================================
2491AddClass( 0, RGB( 30, 144, 255 ), 0, Vector( -378.557, -541.685, 17.2831 ), -0.00544404, 17, 1000 , 21, 1000, 26, 1000 );
2492AddClass( 0, RGB( 30, 144, 255 ), 95, Vector( -378.557, -541.685, 17.2831 ), -0.00544404, 17, 1000 , 21, 1000, 26, 1000 );
2493}
2494
2495function GetNameClass( classID )
2496{
2497local id = classID;
2498if ( id == 0 ) return "Tommy's Team";
2499else return " ";
2500}
2501
2502function onPlayerActionChange( player, oldAction, newAction )
2503{
2504 if ( newAction == 12 ) // it will check if the player goes in new action.
2505 {
2506 if ( player.Weapon == 27 || player.Weapon == 26)
2507 {
2508 player.Skin = player.Skin;
2509 }
2510 }
2511}
2512
2513function S_MSG( text, player ) MessagePlayer( "[#00cc00]|SINTAX|[#FFFFFF] " + text, player );
2514
2515function E_MSG( text, player ) MessagePlayer( "[#ff0000]|ERROR|[#FFFFFF] " + text, player );
2516
2517function I_MSG( text, player ) MessagePlayer( "[#0066ff]|INFO|[#FFFFFF] " + text, player );
2518
2519function A_MSG( text, player )
2520{
2521MessageAllExcept( "[#FFFFFF]***[#0099e6][EXT][#66ffff] " + text, player );
2522EchoMessage( "6*** 10[EXT]7" + text );
2523}
2524
2525function MSG( text )
2526{
2527Message( "[#FFFFFF]***[#0099e6][EXT][#66ffff] " + text );
2528EchoMessage( "6*** 10[EXT]7" + text );
2529}
2530
2531function SalvarTudo()
2532{
2533for( local i = 0, plr; i < GetMaxPlayers(); i++ )
2534{
2535plr = FindPlayer( i );
2536if ( plr ) SalvarDados( plr );
2537}
2538}
2539
2540function CreateBox()
2541{
2542 Box = CreatePickup( 345 , Vector( -403.665, 900.964, 39.2562 ) );
2543}
2544
2545function Agua( user )
2546{
2547local player = FindPlayer( user );
2548if ( player ) player.Pos = Vector( -597.7496, -1858.9531, 28.1291 );
2549}
2550
2551function Drown( admin, player, motivo )
2552{
2553if ( player.Vehicle ) player.Eject();
2554MSG( "Admin " + admin + " drowned " + player.Name + ". Reason: " + motivo + "." );
2555player.Health = 3;
2556NewTimer( "Agua", 700, 1, player.ID );
2557}
2558
2559function Ban( admin, player, motivo )
2560{
2561QuerySQL( db, "INSERT INTO Bans ( Nome, UID, Admin, Motivo, Data ) VALUES ( '" + player.Name + "', '" + player.UniqueID + "', '" + admin + "', '" + motivo + "', '" + GetFullTime() + "' )" );
2562MSG( "Admin " + admin + " banned " + player.Name + ". Reason: " + motivo + "." );
2563KickPlayer( player );
2564}
2565
2566function Kick( admin, player, motivo )
2567{
2568MSG( "Admin " + admin + " kicked " + player.Name + ". Reason: " + motivo + "." );
2569KickPlayer( player );
2570}
2571
2572function GetVehInfo( veh, opcao )
2573{
2574local opcao = opcao.tolower();
2575if ( veh )
2576{
2577local q = QuerySQL( db, "SELECT * FROM Carros WHERE ID='" + veh.ID + "'" );
2578if ( opcao == "preco" ) return GetSQLColumnData( q, 1 ).tointeger();
2579else if ( opcao == "dono" ) return GetSQLColumnData( q, 2 );
2580else if ( opcao == "compart" ) return GetSQLColumnData( q, 3 );
2581else return "Informacion no encontrada";
2582}
2583}
2584
2585function DonoCompartVeh( player, veh )
2586{
2587if ( GetVehInfo( veh, "dono" ) == player.Name || GetVehInfo( veh, "compart" ) == player.Name ) return true;
2588else return false;
2589}
2590
2591function VeiculoInfo( player, veh, opcao )
2592{
2593if ( opcao == 0 )
2594{
2595I_MSG( "ID: [" + veh.ID + "] | Price: [$ " + GetVehInfo( veh, "preco" ) + "].", player );
2596I_MSG( "Owner: [" + GetVehInfo( veh, "dono" ) + "] | Shared with: [" + GetVehInfo( veh, "compart" ) + "].", player );
2597}
2598else if ( opcao == 1 ) I_MSG( "You have left the vehicle. " + "", player );
2599}
2600
2601function IsVehForSale( id )
2602{
2603local q = QuerySQL( Vehicles, "SELECT * FROM Sale WHERE ID='"+id+"'" );
2604local own = GetSQLColumnData( q, 2 );
2605if ( own == "Unowned" ) return 1;
2606else return 0;
2607}
2608function IsOwnerOrSharer( veh, player )
2609{
2610local q = QuerySQL( Vehicles, "SELECT * FROM Sale WHERE ID='"+veh.ID+"'" );
2611local owner = GetSQLColumnData( q, 2 );
2612local sha = GetSQLColumnData( q, 3 );
2613local sha2 = GetSQLColumnData( q, 4 );
2614if ( ( owner == player.Name ) || ( sha == player.Name ) || ( sha2 == player.Name ) ) return 1;
2615else return 0;
2616}
2617function IsVehicleOwner( veh, player )
2618{
2619local q = QuerySQL( Vehicles, "SELECT * FROM Sale WHERE ID='"+veh.ID+"'" );
2620local owner = GetSQLColumnData( q, 2 );
2621if ( owner == player.Name ) return 1;
2622else return 0;
2623}
2624//==============================================================================
2625//------------------------- Player Functions -----------------------------------
2626//==============================================================================
2627function Checar( player, plr )
2628{
2629if ( plr == null )
2630{
2631if ( status[ player.ID ].Registrado == false )
2632{
2633I_MSG( "[#cccccc]Your name is not registered on the server.", player );
2634I_MSG( "[#cccccc]Please use /register <password>.", player );
2635return true;
2636}
2637else if ( status[ player.ID ].Registrado == true && status[ player.ID ].Logado == false )
2638{
2639E_MSG( "[#cccccc]You are not loged in.", player );
2640return true;
2641}
2642}
2643else if ( plr != null )
2644{
2645if ( status[ plr.ID ].Registrado == false )
2646{
2647E_MSG( plr.Name + " [#cccccc]it's not registered.", player );
2648return true;
2649}
2650else if ( status[ plr.ID ].Registrado == true && status[ plr.ID ].Logado == false )
2651{
2652E_MSG( plr.Name + " [#cccccc]not loged in.", player );
2653return true;
2654}
2655}
2656else return false;
2657}
2658
2659function Registrar( player, senha )
2660{
2661local pass = e(senha);
2662QuerySQL( db, "INSERT INTO Contas ( Nome, IP, UID, Senha, Dinheiro, Banco, Level, Data_Reg, Data_Join, Matou, Morreu, Nogoto, SpawnLoc, Loc ) VALUES ( '" + player.Name +
2663"', '" + player.IP + "', '" + player.UniqueID + "', '" + pass + "', 2000, 0, 1, '" + GetFullTime() + "', '" + GetFullTime() + "', 0, 0, 'off', 'off', 0 )" );
2664IncCash( player, 10000 );
2665status[ player.ID ].Registrado = true;
2666status[ player.ID ].Logado = true;
2667status[ player.ID ].Level = 1;
2668A_MSG( player.Name + " was successfully registered.", player );
2669I_MSG( "You are successfully registered.", player );
2670I_MSG( "Do not forget your password: " + senha, player );
2671Announce( "~y~Name Registred!", player, 3 );
2672}
2673
2674function Login( player )
2675{
2676CarregarDados( player );
2677A_MSG( player.Name + " has successfully loged in.", player );
2678I_MSG( "[#ff0000]Welcome back [#ff0000]" + player.Name + ".", player );
2679I_MSG( "[#cccccc]You have entered correctly.", player );
2680I_MSG( "Level: " + status[ player.ID ].Level + " - Status: " + LevelTag( player ) + ".", player );
2681Announce( "~y~Loged in!", player, 3 );
2682}
2683
2684function ChecarConta( player )
2685{
2686status[ player.ID ] = PlayerStats();
2687
2688if ( GetLevel( player ) >= 1 )
2689{
2690if ( player.IP != GetIP( player ) )
2691{
2692I_MSG( "[#cccccc]You are connected with a different IP.", player );
2693I_MSG( "[#cccccc]Please use /login <password>", player );
2694status[ player.ID ].Registrado = true;
2695status[ player.ID ].Logado = false;
2696}
2697else if ( player.IP == GetIP( player ) )
2698{
2699CarregarDados( player );
2700I_MSG( "[#cccccc]Welcome back [#cccccc]" + player.Name + ".", player );
2701I_MSG( "[#cccccc]You have loged in automatically.", player );
2702I_MSG( "Level: " + status[ player.ID ].Level + " - Status: " + LevelTag( player ) + ".", player );
2703}
2704}
2705else
2706{
2707I_MSG( "[#cccccc]Welcome back [#cccccc]" + player.Name + ".", player );
2708I_MSG( "[#cccccc]Your name is not registered on the server.", player );
2709I_MSG( "[#cccccc]Please use /register <password>.", player );
2710}
2711ChecarJogador( player );
2712}
2713
2714function CarregarDados( player )
2715{
2716local q = QuerySQL( db, "SELECT * FROM Contas WHERE Nome='" + player.Name + "'" );
2717
2718status[ player.ID ].Registrado = true;
2719status[ player.ID ].Logado = true;
2720status[ player.ID ].Dinheiro = GetSQLColumnData( q, 4 );
2721status[ player.ID ].Banco = GetSQLColumnData( q, 5 );
2722status[ player.ID ].Level = GetSQLColumnData( q, 6 );
2723status[ player.ID ].Matou = GetSQLColumnData( q, 9 );
2724status[ player.ID ].Morreu = GetSQLColumnData( q, 10 );
2725if ( GetSQLColumnData( q, 11 ) == "on" ) status[ player.ID ].Nogoto = true;
2726if ( GetSQLColumnData( q, 12 ) == "on" ) status[ player.ID ].SpawnLoc = true;
2727if ( GetSQLColumnData( q, 13 ) != "0" ) status[ player.ID ].Loc = GetSQLColumnData( q, 13 );
2728player.Cash = status[ player.ID ].Dinheiro;
2729Data_IP( player );
2730}
2731
2732function Data_IP( player )
2733{
2734QuerySQL( db, "UPDATE Contas SET IP='" + player.IP + "', Data_Join='" + GetFullTime() + "' WHERE Nome='" + player.Name + "'" );
2735}
2736
2737function SalvarDados( player )
2738{
2739local p = status[ player.ID ], nogoto = "off";
2740if ( p.Registrado == true && p.Logado == true )
2741{
2742if ( p.Nogoto == true ) nogoto = "on";
2743QuerySQL( db, "UPDATE Contas SET Dinheiro='" + p.Dinheiro + "', Banco='" + p.Banco + "', Level='" + p.Level +
2744"', Matou='" + p.Matou + "', Morreu='" + p.Morreu + "', Nogoto='" + nogoto + "' WHERE Nome='" + player.Name + "'" );
2745}
2746}
2747
2748function ChecarJogador( player )
2749{
2750local q = QuerySQL( db, "SELECT * FROM Bans WHERE UID='" + player.UniqueID + "'" );
2751if ( GetSQLColumnData( q, 1 ) == player.UniqueID )
2752{
2753A_MSG( player.Name + " esta baneado.", player );
2754I_MSG( "Usted esta baneado del server.", player );
2755I_MSG( "Admin que te baneo: " + GetSQLColumnData( q, 2 ) + " | Data: " + GetSQLColumnData( q, 4 ) + ".", player );
2756I_MSG( "Motivo de banimento: " + GetSQLColumnData( q, 3 ) + ".", player );
2757KickPlayer( player );
2758}
2759else if ( player.Name == "Ninguem" ) Kick( "Server", player, "Nick Bloqueado" );
2760}
2761
2762function Heal( user )
2763{
2764local player = FindPlayer( user );
2765if ( player )
2766{
2767if ( player.IsSpawned && player.Health >= 1 )
2768{
2769player.IsFrozen = false;
2770DecCash( player, 250 );
2771player.Health = 100;
2772I_MSG( "[#cccccc]Usted se ha curado. Precio $250.", player );
2773}
2774else
2775{
2776player.IsFrozen = false;
2777E_MSG( "Usted no puede curarse en este momento.", player );
2778}
2779}
2780}
2781
2782function Goto( user, user2 )
2783{
2784local player = FindPlayer( user ), plr = FindPlayer( user2 );
2785if ( player && plr )
2786{
2787player.Pos = plr.Pos;
2788player.IsFrozen = false;
2789I_MSG( "You have teleported to " + plr.Name + ".", player );
2790I_MSG( player.Name + " teleported to you.", plr );
2791}
2792if ( !plr )
2793{
2794player.IsFrozen = false;
2795I_MSG( "Jugador desconocido.", player );
2796}
2797}
2798
2799function Gotoloc( user, loc )
2800{
2801local player = FindPlayer( user );
2802if ( player )
2803{
2804local q = QuerySQL( db, "SELECT * FROM Locs WHERE Nome='" + loc + "'" ),
2805pos = split( GetSQLColumnData( q, 1 ), " " );
2806player.Pos = Vector( pos[0].tofloat(), pos[1].tofloat(), pos[2].tofloat() );
2807I_MSG( "Teleported to the location: " + loc + " | Created by: " + GetSQLColumnData( q, 2 ) + " | Date: " + GetSQLColumnData( q, 3 ) + ".", player );
2808player.IsFrozen = false;
2809}
2810}
2811
2812function GiveWeapons( player, vargv )
2813{
2814local Weapons = "", i;
2815for ( i = 0; i < vargv.len(); i++ )
2816{
2817if( GetWeaponID( vargv[ i ] ) && GetWeaponName( GetWeaponID( vargv[ i ] ) ) != "Unknown" && GetWeaponID( vargv[ i ] ) != 33 )
2818{
2819local wep = GetWeaponID( vargv[ i ] );
2820if ( wep != 33 )
2821{
2822player.SetWeapon( GetWeaponID( vargv[ i ] ), 9999 );
2823if( Weapons == "" ) Weapons = GetWeaponName( GetWeaponID( vargv[ i ] ) ).tostring();
2824else Weapons = Weapons + ", " + GetWeaponName( GetWeaponID( vargv[ i ] ) ).tostring();
2825}
2826}
2827}
2828I_MSG( Weapons + ".", player );
2829}
2830
2831function JoinMessage( player )
2832{
2833Message( "[#00BFFF]*** [#FFFFFF]" + player.Name + " [#00ffff]entered on the server. (" + IpToCountry( player.IP ) + ")" );
2834EchoMessage( "10***4 " + player.Name + " 10entered on the server. (" + IpToCountry( player.IP ) + ")" );
2835}
2836
2837function QuitMessage( player, motivo )
2838{
2839Message( "[#00BFFF]***[#FFFFFF]" + player.Name + " [#00BFFF]left the server. (" + PartReason( motivo ) + ")" );
2840EchoMessage( "10***4" + player.Name + " 10left the server. (" + PartReason( motivo ) + ")" );
2841}
2842
2843function LevelTag( player )
2844{
2845local lvl = status[ player.ID ].Level;
2846if ( lvl == 0 ) return "Visitante";
2847else if ( lvl == 1 ) return "Member";
2848else if ( lvl == 2 ) return "VIP";
2849else if ( lvl == 3 ) return "Admin";
2850else if ( lvl == 4 ) return "Administrador";
2851else if ( lvl == 5 ) return "Co Moderador";
2852else if ( lvl == 6 ) return "Moderador";
2853else if ( lvl == 7 ) return "Advanced Administrator";
2854else if ( lvl == 8 ) return "Master Administrator";
2855else if ( lvl == 9 ) return "Manager";
2856else if ( lvl >= 10 ) return "Developer";
2857}
2858
2859function GetLevel( player )
2860{
2861local result = GetSQLColumnData( QuerySQL( db, "SELECT Level FROM Contas WHERE Nome='" + player.Name + "'" ), 0 ), lvl;
2862if ( result == null ) lvl = GetSQLColumnData( QuerySQL( db, "SELECT Level FROM Contas WHERE Nome='" + player.Name + "'" ), 0 );
2863else lvl = result;
2864if ( lvl ) return lvl;
2865else return 0;
2866}
2867
2868function GetIP( player )
2869{
2870local result = GetSQLColumnData( QuerySQL( db, "SELECT IP FROM Contas WHERE Nome='" + player.Name + "'" ), 0 ), ip;
2871if ( result == null ) ip = GetSQLColumnData( QuerySQL( db, "SELECT IP FROM Contas WHERE Nome='" + player.Name + "'" ), 0 );
2872else ip = result;
2873if ( ip ) return ip;
2874else return 0;
2875}
2876
2877function GetSenha( player )
2878{
2879local result = GetSQLColumnData( QuerySQL( db, "SELECT Senha FROM Contas WHERE Nome='" + player.Name + "'" ), 0 ), pass;
2880if ( result == null ) pass = GetSQLColumnData( QuerySQL( db, "SELECT Senha FROM Contas WHERE Nome='" + player.Name + "'" ), 0 );
2881else pass = result;
2882if ( pass ) return pass;
2883else return 0;
2884}
2885
2886function IncCash( player, amount )
2887{
2888local cash = status[ player.ID ].Dinheiro;
2889local add = cash + amount;
2890status[ player.ID ].Dinheiro = add;
2891player.Cash = add;
2892}
2893
2894function DecCash( player, amount )
2895{
2896local cash = status[ player.ID ].Dinheiro;
2897local det = cash - amount;
2898status[ player.ID ].Dinheiro = det;
2899player.Cash = det;
2900}
2901
2902function IncBank( player, amount )
2903{
2904local bank = status[ player.ID ].Banco;
2905local add = bank + amount;
2906status[ player.ID ].Banco = add;
2907}
2908
2909function DecBank( player, amount )
2910{
2911local bank = status[ player.ID ].Banco;
2912local det = bank - amount;
2913status[ player.ID ].Banco = det;
2914}
2915
2916function Timer()
2917{
2918for( local i = 0, player; i < GetMaxPlayers(); i++ )
2919{
2920player = FindPlayer( i );
2921if ( player )
2922{
2923if ( Multa[ player.ID ] >= 1 )
2924{
2925Multa[ player.ID ] --;
2926if ( Multa[ player.ID ] == 0 ) UnMute( "Server", player );
2927}
2928}
2929}
2930}
2931
2932function AddSpawnWep( player, wep, wep2, wep3, wep4 )
2933{
2934if ( ( wep ) && IsNum( wep ) ) wep = wep.tointeger();
2935else if ( wep ) wep = GetWeaponID( wep );
2936if ( ( wep2 ) && IsNum( wep2 ) ) wep2 = wep2.tointeger();
2937else if ( wep2 ) wep2 = GetWeaponID( wep2 );
2938if ( ( wep3 ) && IsNum( wep3 ) ) wep3 = wep3.tointeger();
2939else if ( wep3 ) wep3 = GetWeaponID( wep3 );
2940if ( ( wep4 ) && IsNum( wep4 ) ) wep4 = wep4.tointeger();
2941else if ( wep4 ) wep4 = GetWeaponID( wep4 );
2942QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
2943QuerySQL( db, "INSERT INTO SpawnWep ( Nome, Wep1, Wep2, Wep3, Wep4 ) VALUES ( '" + player.Name + "', '" + wep + "', '" + wep2 + "', '" + wep3 + "', '" + wep4 + "')" );
2944I_MSG( "Weapon's added as spawnwep.", player );
2945}
2946
2947function DelSpawnWep( player )
2948{
2949QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
2950I_MSG( "Spawnwep deleted.", player );
2951}
2952
2953function swep( player )
2954{
2955local swep = GetSQLColumnData( QuerySQL( db, "SELECT Wep1 FROM SpawnWep WHERE Nome='" + player.Name + "'" ), 0 );
2956if ( swep ) return swep;
2957else return 0;
2958}
2959
2960function swep2( player )
2961{
2962local swep2 = GetSQLColumnData( QuerySQL( db, "SELECT Wep2 FROM SpawnWep WHERE Nome='" + player.Name + "'" ), 0 );
2963if ( swep2 ) return swep2;
2964else return 0;
2965}
2966
2967function swep3( player )
2968{
2969local swep3 = GetSQLColumnData( QuerySQL( db, "SELECT Wep3 FROM SpawnWep WHERE Nome='" + player.Name + "'" ), 0 );
2970if ( swep3 ) return swep3;
2971else return 0;
2972}
2973function swep4( player )
2974{
2975local swep4 = GetSQLColumnData( QuerySQL( db, "SELECT Wep4 FROM SpawnWep WHERE Nome='" + player.Name + "'" ), 0 );
2976if ( swep4 ) return swep4;
2977else return 0;
2978}
2979
2980function LoadSpawnWep( player )
2981{
2982if ( swep(player) == 0 );
2983else if ( swep(player) == 1 ) player.SetWeapon( 1, 300 );
2984else if ( swep(player) == 2 ) player.SetWeapon( 2, 300 );
2985else if ( swep(player) == 3 ) player.SetWeapon( 3, 300 );
2986else if ( swep(player) == 4 ) player.SetWeapon( 4, 300 );
2987else if ( swep(player) == 5 ) player.SetWeapon( 5, 300 );
2988else if ( swep(player) == 6 ) player.SetWeapon( 6, 300 );
2989else if ( swep(player) == 7 ) player.SetWeapon( 7, 300 );
2990else if ( swep(player) == 8 ) player.SetWeapon( 8, 300 );
2991else if ( swep(player) == 9 ) player.SetWeapon( 9, 300 );
2992else if ( swep(player) == 10 ) player.SetWeapon( 10, 300 );
2993else if ( swep(player) == 11 ) player.SetWeapon( 11, 300 );
2994else if ( swep(player) == 12 ) player.SetWeapon( 12, 300 );
2995else if ( swep(player) == 13 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
2996else if ( swep(player) == 14 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
2997else if ( swep(player) == 15 ) player.SetWeapon( 15, 300 );
2998else if ( swep(player) == 16 ) player.SetWeapon( 16, 300 );
2999else if ( swep(player) == 17 ) player.SetWeapon( 17, 300 );
3000else if ( swep(player) == 18 ) player.SetWeapon( 18, 300 );
3001else if ( swep(player) == 19 ) player.SetWeapon( 19, 300 );
3002else if ( swep(player) == 20 ) player.SetWeapon( 20, 300 );
3003else if ( swep(player) == 21 ) player.SetWeapon( 21, 300 );
3004else if ( swep(player) == 22 ) player.SetWeapon( 22, 300 );
3005else if ( swep(player) == 23 ) player.SetWeapon( 23, 300 );
3006else if ( swep(player) == 24 ) player.SetWeapon( 24, 300 );
3007else if ( swep(player) == 25 ) player.SetWeapon( 25, 300 );
3008else if ( swep(player) == 26 ) player.SetWeapon( 26, 300 );
3009else if ( swep(player) == 27 ) player.SetWeapon( 27, 300 );
3010else if ( swep(player) == 28 ) player.SetWeapon( 28, 300 );
3011else if ( swep(player) == 29 ) player.SetWeapon( 29, 300 );
3012else if ( swep(player) == 30 ) player.SetWeapon( 30, 300 );
3013else if ( swep(player) == 31 ) player.SetWeapon( 31, 300 );
3014else if ( swep(player) == 32 ) player.SetWeapon( 32, 300 );
3015else if ( swep(player) == 33 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
3016
3017if ( swep2(player) == 0 );
3018else if ( swep2(player) == 1 ) player.SetWeapon( 1, 300 );
3019else if ( swep2(player) == 2 ) player.SetWeapon( 2, 300 );
3020else if ( swep2(player) == 3 ) player.SetWeapon( 3, 300 );
3021else if ( swep2(player) == 4 ) player.SetWeapon( 4, 300 );
3022else if ( swep2(player) == 5 ) player.SetWeapon( 5, 300 );
3023else if ( swep2(player) == 6 ) player.SetWeapon( 6, 300 );
3024else if ( swep2(player) == 7 ) player.SetWeapon( 7, 300 );
3025else if ( swep2(player) == 8 ) player.SetWeapon( 8, 300 );
3026else if ( swep2(player) == 9 ) player.SetWeapon( 9, 300 );
3027else if ( swep2(player) == 10 ) player.SetWeapon( 10, 300 );
3028else if ( swep2(player) == 11 ) player.SetWeapon( 11, 300 );
3029else if ( swep2(player) == 12 ) player.SetWeapon( 12, 300 );
3030else if ( swep2(player) == 13 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
3031else if ( swep2(player) == 14 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
3032else if ( swep2(player) == 15 ) player.SetWeapon( 15, 300 );
3033else if ( swep2(player) == 16 ) player.SetWeapon( 16, 300 );
3034else if ( swep2(player) == 17 ) player.SetWeapon( 17, 300 );
3035else if ( swep2(player) == 18 ) player.SetWeapon( 18, 300 );
3036else if ( swep2(player) == 19 ) player.SetWeapon( 19, 300 );
3037else if ( swep2(player) == 20 ) player.SetWeapon( 20, 300 );
3038else if ( swep2(player) == 21 ) player.SetWeapon( 21, 300 );
3039else if ( swep2(player) == 22 ) player.SetWeapon( 22, 300 );
3040else if ( swep2(player) == 23 ) player.SetWeapon( 23, 300 );
3041else if ( swep2(player) == 24 ) player.SetWeapon( 24, 300 );
3042else if ( swep2(player) == 25 ) player.SetWeapon( 25, 300 );
3043else if ( swep2(player) == 26 ) player.SetWeapon( 26, 300 );
3044else if ( swep2(player) == 27 ) player.SetWeapon( 27, 300 );
3045else if ( swep2(player) == 28 ) player.SetWeapon( 28, 300 );
3046else if ( swep2(player) == 29 ) player.SetWeapon( 29, 300 );
3047else if ( swep2(player) == 30 ) player.SetWeapon( 30, 300 );
3048else if ( swep2(player) == 31 ) player.SetWeapon( 31, 300 );
3049else if ( swep2(player) == 32 ) player.SetWeapon( 32, 300 );
3050else if ( swep2(player) == 33 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
3051
3052if ( swep3(player) == 0 );
3053else if ( swep3(player) == 1 ) player.SetWeapon( 1, 300 );
3054else if ( swep3(player) == 2 ) player.SetWeapon( 2, 300 );
3055else if ( swep3(player) == 3 ) player.SetWeapon( 3, 300 );
3056else if ( swep3(player) == 4 ) player.SetWeapon( 4, 300 );
3057else if ( swep3(player) == 5 ) player.SetWeapon( 5, 300 );
3058else if ( swep3(player) == 6 ) player.SetWeapon( 6, 300 );
3059else if ( swep3(player) == 7 ) player.SetWeapon( 7, 300 );
3060else if ( swep3(player) == 8 ) player.SetWeapon( 8, 300 );
3061else if ( swep3(player) == 9 ) player.SetWeapon( 9, 300 );
3062else if ( swep3(player) == 10 ) player.SetWeapon( 10, 300 );
3063else if ( swep3(player) == 11 ) player.SetWeapon( 11, 300 );
3064else if ( swep3(player) == 12 ) player.SetWeapon( 12, 300 );
3065else if ( swep3(player) == 13 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
3066else if ( swep3(player) == 14 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
3067else if ( swep3(player) == 15 ) player.SetWeapon( 15, 300 );
3068else if ( swep3(player) == 16 ) player.SetWeapon( 16, 300 );
3069else if ( swep3(player) == 17 ) player.SetWeapon( 17, 300 );
3070else if ( swep3(player) == 18 ) player.SetWeapon( 18, 300 );
3071else if ( swep3(player) == 19 ) player.SetWeapon( 19, 300 );
3072else if ( swep3(player) == 20 ) player.SetWeapon( 20, 300 );
3073else if ( swep3(player) == 21 ) player.SetWeapon( 21, 300 );
3074else if ( swep3(player) == 22 ) player.SetWeapon( 22, 300 );
3075else if ( swep3(player) == 23 ) player.SetWeapon( 23, 300 );
3076else if ( swep3(player) == 24 ) player.SetWeapon( 24, 300 );
3077else if ( swep3(player) == 25 ) player.SetWeapon( 25, 300 );
3078else if ( swep3(player) == 26 ) player.SetWeapon( 26, 300 );
3079else if ( swep3(player) == 27 ) player.SetWeapon( 27, 300 );
3080else if ( swep3(player) == 28 ) player.SetWeapon( 28, 300 );
3081else if ( swep3(player) == 29 ) player.SetWeapon( 29, 300 );
3082else if ( swep3(player) == 30 ) player.SetWeapon( 30, 300 );
3083else if ( swep3(player) == 31 ) player.SetWeapon( 31, 300 );
3084else if ( swep3(player) == 32 ) player.SetWeapon( 32, 300 );
3085else if ( swep3(player) == 33 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
3086
3087if ( swep4(player) == 0 );
3088else if ( swep4(player) == 1 ) player.SetWeapon( 1, 300 );
3089else if ( swep4(player) == 2 ) player.SetWeapon( 2, 300 );
3090else if ( swep4(player) == 3 ) player.SetWeapon( 3, 300 );
3091else if ( swep4(player) == 4 ) player.SetWeapon( 4, 300 );
3092else if ( swep4(player) == 5 ) player.SetWeapon( 5, 300 );
3093else if ( swep4(player) == 6 ) player.SetWeapon( 6, 300 );
3094else if ( swep4(player) == 7 ) player.SetWeapon( 7, 300 );
3095else if ( swep4(player) == 8 ) player.SetWeapon( 8, 300 );
3096else if ( swep4(player) == 9 ) player.SetWeapon( 9, 300 );
3097else if ( swep4(player) == 10 ) player.SetWeapon( 10, 300 );
3098else if ( swep4(player) == 11 ) player.SetWeapon( 11, 300 );
3099else if ( swep4(player) == 12 ) player.SetWeapon( 12, 300 );
3100else if ( swep4(player) == 13 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
3101else if ( swep4(player) == 14 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
3102else if ( swep4(player) == 15 ) player.SetWeapon( 15, 300 );
3103else if ( swep4(player) == 16 ) player.SetWeapon( 16, 300 );
3104else if ( swep4(player) == 17 ) player.SetWeapon( 17, 300 );
3105else if ( swep4(player) == 18 ) player.SetWeapon( 18, 300 );
3106else if ( swep4(player) == 19 ) player.SetWeapon( 19, 300 );
3107else if ( swep4(player) == 20 ) player.SetWeapon( 20, 300 );
3108else if ( swep4(player) == 21 ) player.SetWeapon( 21, 300 );
3109else if ( swep4(player) == 22 ) player.SetWeapon( 22, 300 );
3110else if ( swep4(player) == 23 ) player.SetWeapon( 23, 300 );
3111else if ( swep4(player) == 24 ) player.SetWeapon( 24, 300 );
3112else if ( swep4(player) == 25 ) player.SetWeapon( 25, 300 );
3113else if ( swep4(player) == 26 ) player.SetWeapon( 26, 300 );
3114else if ( swep4(player) == 27 ) player.SetWeapon( 27, 300 );
3115else if ( swep4(player) == 28 ) player.SetWeapon( 28, 300 );
3116else if ( swep4(player) == 29 ) player.SetWeapon( 29, 300 );
3117else if ( swep4(player) == 30 ) player.SetWeapon( 30, 300 );
3118else if ( swep4(player) == 31 ) player.SetWeapon( 31, 300 );
3119else if ( swep4(player) == 32 ) player.SetWeapon( 32, 300 );
3120else if ( swep4(player) == 33 ) QuerySQL( db, "DELETE FROM SpawnWep WHERE Nome='" + player.Name + "'" );
3121}
3122
3123function onPlayerBeginTyping( player )
3124{
3125}
3126
3127function onPlayerEndTyping( player )
3128{
3129}
3130//==============================================================================
3131//----------------------------- Criptografia -----------------------------------
3132//==============================================================================
3133function rotateRight(val, sbits)
3134{
3135 return (val >> sbits) | (val << (0x20 - sbits));
3136}
3137
3138function e( string )
3139{
3140 local hp = [
3141 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
3142 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
3143 ];
3144
3145 local k = [
3146 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
3147 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
3148 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
3149 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
3150 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
3151 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
3152 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
3153 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
3154 ];
3155
3156 local
3157 w = array( 64 ),
3158 i = 0,
3159 s = 0,
3160 len = string.len( ),
3161 word_array = array( 0 );
3162
3163 for( i = 0; i < len - 3; i += 4 )
3164 {
3165 word_array.push( string[i] << 0x18 | string[i + 1] << 0x10 | string[i + 2] << 0x08 | string[i + 3] );
3166 }
3167
3168 switch( len % 4 )
3169 {
3170 case 0:
3171 i = 0x80000000;
3172 break;
3173 case 1:
3174 i = string[len - 1] << 0x18 | 0x80000000;
3175 break;
3176 case 2:
3177 i = string[len - 2] << 0x18 | string[len - 1] << 0x10 | 0x08000;
3178 break;
3179 case 3:
3180 i = string[len - 3] << 0x18 | string[len - 2] << 0x10 | string[len - 1] << 0x08 | 0x80;
3181 break;
3182 }
3183 word_array.push( i );
3184
3185 while( ( word_array.len() % 0x10 ) != 0x0E )
3186 word_array.push( 0 );
3187
3188 word_array.push( len >> 0x10 );
3189 word_array.push( ( len << 0x03 ) & 0xFFFFFFFF );
3190
3191 local s0, s1;
3192 for( s = 0; s < word_array.len(); s += 0x10 )
3193 {
3194 for( i = 0x00; i < 0x10; i++ )
3195 w[i] = word_array[s + i];
3196
3197 for( i = 0x10; i < 0x40; i++ )
3198 {
3199 s0 = rotateRight( w[i - 15], 7 ) ^ rotateRight( w[i - 15], 18 ) ^ ( w[i - 15] >> 3 );
3200 s1 = rotateRight( w[i - 2], 17 ) ^ rotateRight( w[i - 2], 19 ) ^ ( w[i - 2] >> 10 );
3201 w[i] = w[i - 0x10] + s0 + w[i - 7] + s1;
3202 }
3203
3204 local a = hp[0],
3205 b = hp[1],
3206 c = hp[2],
3207 d = hp[3],
3208 e = hp[4],
3209 f = hp[5],
3210 g = hp[6],
3211 h = hp[7];
3212
3213 for( i = 0x00; i < 0x40; i++ )
3214 {
3215 s0 = ( rotateRight( a, 2 ) ^ rotateRight( a, 13 ) ^ rotateRight( a, 22 ) );
3216 local maj = ( ( a & b ) ^ ( a & c ) ^ ( b & c ) );
3217 local t2 = ( s0 + maj );
3218 s1 = ( rotateRight( e, 6 ) ^ rotateRight( e, 11) ^ rotateRight( e, 25 ) );
3219 local ch = ( ( e & f ) ^ ( ( ~e ) & g ) );
3220 local t1 = ( h + s1 + ch + k[i] + w[i] );
3221
3222 h = g;
3223 g = f;
3224 f = e;
3225 e = d + t1;
3226 d = c;
3227 c = b;
3228 b = a;
3229 a = t1 + t2;
3230 }
3231
3232 hp[0] += a;
3233 hp[1] += b;
3234 hp[2] += c;
3235 hp[3] += d;
3236 hp[4] += e;
3237 hp[5] += f;
3238 hp[6] += g;
3239 hp[7] += h;
3240 }
3241
3242 local hash = format(
3243 "%08x%08x%08x%08x%08x%08x%08x%08x",
3244 hp[0],
3245 hp[1],
3246 hp[2],
3247 hp[3],
3248 hp[4],
3249 hp[5],
3250 hp[6],
3251 hp[7]
3252 );
3253
3254 return hash;
3255}
3256
3257
3258
3259////
3260CMDS
3261function onPlayerCommand( player, cmd, text )
3262{
3263local cmd = cmd.tolower(), sintaxe = "/", level = status[ player.ID ].Level;
3264
3265if ( cmd == "ipalias" )
3266{
3267if ( !text ) MessagePlayer( "[#ffa31a][Syntax] [#ffffff]/" + cmd + " <Nick/ID>", player );
3268else
3269{
3270local plr = GetPlayer( text );
3271if ( !plr ) MessagePlayer( "Unknown Player.", player );
3272else ShowAlias( player, plr, "ip" );
3273}
3274}
3275
3276else if ( cmd == "subnetalias" )
3277{
3278if ( !text ) MessagePlayer( "[#ffa31a][Syntax] [#ffffff]/" + cmd + " <Nick/ID>", player );
3279else
3280{
3281local plr = GetPlayer( text );
3282if ( !plr ) MessagePlayer( "Unknown Player.", player );
3283else ShowAlias( player, plr, "subnet" );
3284}
3285}
3286
3287else if ( cmd == "uidalias" )
3288{
3289if ( !text ) MessagePlayer( "[#ffa31a][Syntax] [#ffffff]/" + cmd + " <Nick/ID>", player );
3290else
3291{
3292local plr = GetPlayer( text );
3293if ( !plr ) MessagePlayer( "Unknown Player.", player );
3294else ShowAlias( player, plr, "uid" );
3295}
3296}
3297 if ( cmd == "spawn" )
3298 {
3299 if ( level < 4 ) E_MSG( "You do not have access to this command.", player );
3300else
3301 if ( !text ) PrivMessage( player, "Type /spawn ID" );
3302 local veh = FindVehicle( text.tointeger() );
3303 if ( !veh ) PrivMessage( player, "Error: Wrong ID of the vehicle." );
3304 else {
3305 PrivMessage( player, "The car is spawned" );
3306 veh.Pos = Vector( player.Pos.x + 1, player.Pos.y + 2, player.Pos.z );
3307 }
3308 }
3309
3310if ( cmd == "disarm" )
3311{
3312PrivMessage( player, "You've been disarmed");
3313player.Disarm();
3314}
3315 if(cmd == "driver")
3316 {
3317 if(!text) MessagePlayer("Use: /driver <vehicle ID>", player);
3318 else if(!IsNum(text)) MessagePlayer("Error - ID must be integer", player);
3319 else
3320 {
3321 local veh = FindVehicle(text.tointeger());
3322 if(!veh) MessagePlayer("Unknown Vehicle", player);
3323 else if(!veh.Driver) MessagePlayer("There is no driver in the vehicle", player);
3324 else if(veh.Driver == player.Name) MessagePlayer("You are the driver", player);
3325 else
3326 {
3327 MessagePlayer(veh.Driver + " is driving the vehicle", player);
3328 }
3329 }
3330 }
3331
3332if ( cmd == "register" )
3333{
3334if ( status[ player.ID ].Registrado == true ) E_MSG( "[#ff0000]Your name is now registered.", player );
3335else if ( !text ) S_MSG( sintaxe + cmd + " <password>", player );
3336else if ( text.len() < 5 || text.len() > 15 ) E_MSG( "[#cccccc]Your password must have 5 to 15 characters.", player );
3337else Registrar( player, text );
3338}
3339
3340else if ( cmd == "login" )
3341{
3342if ( status[ player.ID ].Logado == true ) E_MSG( "[#ff0000]You are already loged in.", player );
3343else if ( status[ player.ID ].Registrado == false ) E_MSG( "[#cccccc]Your name is not registered. Use /register [password]", player );
3344else if ( !text ) S_MSG( sintaxe + cmd + " <password>", player );
3345else if ( e(text) != GetSenha( player ) )
3346{
3347status[ player.ID ].Warn_Login ++;
3348E_MSG( "[#ff0000]Password Incorrect. [" + status[ player.ID ].Warn_Login + "/5]", player );
3349if ( status[ player.ID ].Warn_Login == 5 ) Kick( "Server", player, "Falla de ingreso" );
3350}
3351else Login( player );
3352}
3353
3354else if ( cmd == "cmds" || cmd == "commands" )
3355{
3356if ( Checar( player, null ) ) return 0;
3357else
3358{
3359I_MSG( "[#000099]======== Commands ========", player );
3360I_MSG( "[#ff0000]playercmds, servercmds, carcmds, propcmds, clothescmds", player );
3361}
3362}
3363
3364else if ( cmd == "playercmds" )
3365{
3366if ( Checar( player, null ) ) return 0;
3367else
3368{
3369I_MSG( "[#ff00ff]======== Player Cmds ========", player );
3370I_MSG( "[#ff6600]changepass, a, policmds, driver, disarm, fps , ping, afk, ", player );
3371I_MSG( "[#ff6600]baninfo, pay, deposit, withdraw, race, race2, respawn.", player );
3372I_MSG( "[#ff6600]heal, cash, spawnwep, wep, loc, hp, duel, healplayer, heal.", player );
3373}
3374}
3375
3376else if ( cmd == "servercmds" )
3377{
3378if ( Checar( player, null ) ) return 0;
3379else
3380{
3381I_MSG( "[#00ffff]======== Server Cmds ========", player );
3382I_MSG( "[#00cc00]rules, level, ping, msg, fps", player );
3383I_MSG( "[#00cc00]credits, forum. ", player );
3384}
3385}
3386
3387else if ( cmd == "carcmds" )
3388{
3389if ( Checar( player, null ) ) return 0;
3390else
3391{
3392I_MSG( "[#000099]======== Car Cmds ========", player );
3393I_MSG( "[#ff00ff]buycar, sellcar, getcar, repair, lights, lightsoff, carcolors, sharecar, carshop.", player );
3394I_MSG( "[#ff00ff]delsharecar, mycars, mysharedcars, carcolor, opencar, lockcar, park, driver.", player );
3395}
3396}
3397else if ( cmd == "propcmds" )
3398{
3399if ( Checar( player, null ) ) return 0;
3400else
3401{
3402I_MSG( "[#000099]======== Prop Cmds ========", player );
3403I_MSG( "[#ff00ff]props, myprops, sellprop, buyprop, enterhouse.", player );
3404I_MSG( "[#ff00ff]myshareprops, shareprop, delshareprop.", player );
3405}
3406}
3407
3408else if ( cmd == "report" )
3409{
3410if ( status[ player.ID ].Registrado == false ) I_MSG("You need to be registered first!", player );
3411else if ( status[ player.ID ].Logado == false ) I_MSG("You need to be loged in first.", player );
3412else if ( !text ) S_MSG("/reportar [Nick/ID] [Razon].", player );
3413else {
3414local plr = GetPlayer( GetTok( text, " ", 1 ) ), reason = GetTok( text, " ", 2, NumTok( text, " " ) );
3415if ( !plr ) E_MSG("Jugador desconocido.", player );
3416else if ( plr.ID == player.ID ) I_MSG("You can not report yourself.", player );
3417else if ( reason == null ) S_MSG("/reportar [Nick/ID] [Reason].", player );
3418else {
3419I_MSG("[#ff0000]Report successfully sent to administrators!", player );
3420local a = 0, b = GetMaxPlayers(), c = 0, d = GetPlayers(), nick, plrlevel;
3421while ( ( a < b ) && ( c < d ) )
3422{
3423nick = FindPlayer( a );
3424if ( nick )
3425{
3426plrlevel = GetLevel( nick );
3427Message("[#ff0000]** >> Jugador:[#FFFFFF][ "+player.Name+" ] [#FF6600]Reported[#FFFFFF]:[ "+plr.Name+" ] [#FFFF00]Reason:[#ff0000][ "+reason+" ]." );
3428local now = date();
3429local q = QuerySQL( db,"INSERT INTO Report ( Player, Reporter, Reason, Date_Of_Report ) VALUES ( '"+plr.Name+"', '"+player.Name+"', '"+reason+"', '"+now.day+"/"+now.month+"/"+now.year+" "+now.hour+":"+now.min+":"+now.sec+"')" );
3430c ++;
3431}
3432a ++;
3433for ( local i = 0; i < FBS_NICKS.len(); i++ )
3434{
3435local NickInfo = FindNick( i ), level, tLevel;
3436if ( NickInfo ) level = NickInfo.Level.tointeger();
3437if ( ( NickInfo ) && ( level > 3 ) ) FBS_BOT.Send("NOTICE " + NickInfo + " Player " + player.Name + " Report player " + plr.Name + ", Reason " + reason + " \n");
3438}
3439}
3440}
3441}
3442}
3443
3444else if (cmd == "wanted")
3445{
3446if ( !text ) S_MSG( "Use /wanted <Name/ID> <Reason>", player );
3447else if ( split(text, " ").len() < 2 ) S_MSG( "Use /wanted <Name/ID> <Reason>", player);
3448else {
3449local plr = GetPlayer( split(text, " ")[0] );
3450if( !plr )E_MSG( "Player not found", player );
3451else if ( plr.ID == player.ID ) E_MSG( "You can not use /wanted on yourself.", player );
3452else if ( plr.Skin == 1 ) I_MSG( "Police can not be wantd.", player );
3453else {
3454plr.WantedLevel++;
3455Message( player.Name +" added wanted level to "+ plr.Name +" Reason:"+ text.slice( split(text, " ")[0].len() ) +" ");
3456}
3457}
3458}
3459
3460else if ( cmd == "clothescmds" )
3461{
3462if ( Checar( player, null ) ) return 0;
3463else
3464{
3465I_MSG( "[#00ffff]========Clothes Cmds========", player );
3466I_MSG( "[#00cc00]buyclothes, use clothes, clothes, sellclothes", player );
3467}
3468}
3469
3470else if ( cmd == "objcmds" )
3471{
3472if ( Checar( player, null ) ) return 0;
3473else
3474{
3475I_MSG( "[#00ffff]========Objects Cmds ========", player );
3476I_MSG( "[#00cc00]obj, mov, rot, save, del.", player );
3477}
3478}
3479
3480else if ( cmd == "policmds" )
3481{
3482if ( Checar( player, null ) ) return 0;
3483else
3484{
3485I_MSG( "[#000099]========Police Cmds========", player );
3486I_MSG( "[#cccccc]arrest, wanted.", player );
3487}
3488}
3489
3490else if (cmd == "arrestNULL") {
3491 if( !text ) MessagePlayer("[#ff0000][Error] Use /"+cmd+" <Name/ID>", player );
3492 else if ( (player.Skin == 1) || ( player.Skin ==225 ) ) {
3493 local plr = text != "" ? IsNum( text ) ? FindPlayer( text.tointeger() ) : FindPlayer( text ) : player;
3494 if( !plr )MessagePlayer("Error - Unknown player", player );
3495 else if ( plr.WantedLevel == 0 ) MessagePlayer( " This Player is Not Wanted",player );
3496 else if ( DistanceFromPoint( player.Pos.x, player.Pos.y , plr.Pos.x, plr.Pos.y ) < 5 ) { //DistanceFromPoint( float x1, float y1, float x2, float y2 )
3497 plr.Pos = Vector( 392.96, -506.26, 9.39 );
3498 NewTimer( "arresttime", 30000, 1, plr.ID );;
3499 MessagePlayer( "You will be released from jail in thirty seconds",plr );
3500 Message( "Police "+player.Name" has Arrested "+plr.Name );
3501 }
3502 else MessagePlayer(""+ plr.Name +" is far away.", player );
3503 }
3504 else MessagePlayer( " You need to be a cop",player );
3505 }
3506
3507else if (cmd == "unarrestNULL")
3508{
3509if ( (player.Skin == 1) || ( player.Skin ==225 ) )
3510{
3511if( !text ) MessagePlayer(" [#00ff00] Error - /"+cmd+" Name/id", player );
3512 local plr = text != "" ? IsNum( text ) ? FindPlayer( text.tointeger() ) : FindPlayer( text ) : player;
3513 if( !plr )MessagePlayer("Error - Unknown player", player );
3514plr.Pos = Vector(384.157, -506.481, 9.39822); Message(" [#ff0000]VCPD " + player.Name + " Relaised " + plr.Name + " From Jail");
3515}
3516else MessagePlayer(" [#00ff00] You need be in cop to use this cmd ", player);
3517}
3518
3519
3520else if (cmd == "susNULL")
3521{
3522if ( (player.Skin == 1) || ( player.Skin ==225 ) )
3523{
3524if( !text ) MessagePlayer(" [#00ff00] Error - /"+cmd+" Name/id", player );
3525 local plr = text != "" ? IsNum( text ) ? FindPlayer( text.tointeger() ) : FindPlayer( text ) : player;
3526 if( !plr )MessagePlayer("Error - Unknown player", player );
3527 else if ( DistanceFromPoint( player.Pos.x, player.Pos.y , plr.Pos.x, plr.Pos.y ) < 250 ) { //DistanceFromPoint( float x1, float y1, float x2, float y2 )
3528 Message(" [#00ffff] VCPD " + player.Name + " Suspected " + plr.Name + " ");
3529 Message(" (megaphone) [#0000ff] " + plr.Name + " surrender & we will open fire on you ");
3530 gate2.MoveTo(Vector(384.108, -505.87, 9.65089), 2500 );
3531 }
3532 else MessagePlayer(""+ plr.Name +" is far away.", player );
3533 }
3534 else MessagePlayer(" [#00ff00] You need be in cop to use this cmd ", player);
3535}
3536
3537
3538else if ( cmd == "surNULL")
3539{
3540 player.IsFrozen = true;
3541 player.SetAnim(0,161);
3542Message(" [#0000ff] " + player.Name + " is surrender ");
3543}
3544
3545else if ( cmd == "aheal" )
3546 {
3547 if ( !text ) MessagePlayer( player, "Use /aheal <Nick/ID>" );
3548 local plr = FindPlayer( GetTok( text, " ", 1 ) );
3549 if ( !plr ) MessagePlayer( player, "Unknown Player.." );
3550 else if ( plr.Health == 100 ) PrivMessage( player, " " + plr.Name + " Dont need to be healed" );
3551 else if ( player.Cash < 250 ) PrivMessage( player, "You need $250 to heal " + plr.Name + "." );
3552 else {
3553 plr.Health = 100;
3554 PrivMessage( plr, "Healed by " + player.Name + "." );
3555 Message( " " + player.Name + " has healed " + plr.Name + "." );
3556 player.Cash -= 250;
3557 }
3558 }
3559
3560else if ( ( cmd == "afklist" ) || ( cmd == "afks" ) )
3561 {
3562 local plr, b;
3563 for( local i = 0; i <= GetMaxPlayers(); i++ )
3564 {
3565 plr = FindPlayer( i );
3566 if ( ( plr ) && ( plr.Away ) )
3567 {
3568 if ( b ) b = b + ", " + plr.Name + ""
3569 else b = plr.Name + ""
3570 }
3571 }
3572 Message( "[#009900][AFK] [#ffffff]Afk list Requested BY [#fffccc]" + player.Name );
3573 if ( b ) Message( "[#009900][AFK][#FFFFFF]: " + b + "" );
3574 else Message( "[#009900][AFK][#ffffff] None " );
3575
3576}
3577
3578else if(cmd == "a")
3579 {
3580 if(!text)
3581 {
3582 MessagePlayer("[#6666FF]Anims' list: [#FFFF81](/a) stop, watcha, lean, talk, wave, die^, fall^, fallback^, :o, apply, bu!, arg^, carwback, wback, elbow^, rollback, boss, crawling, rollinfront, falling, roll, beware, idk, look, dumb, aim^, drown, handsup, wut, fu, phone, sit, stand, sell, hm?, onfoot, db^, heal, lay, bored, riot, dance, drunk",player);
3583 MessagePlayer("[#6666FF]READ ME -> The symbol ^ means the anim has more options. Example: /a dance, /a dance 2, /a dance 3.",player);
3584 }
3585 else
3586 {
3587 switch(text)
3588 {
3589 case "stop":
3590 player.SetAnim(0,29);
3591 break;
3592 case "watcha":
3593 player.SetAnim(0,7);
3594 break;
3595 case "lean":
3596 player.SetAnim(0,9);
3597 break;
3598 case "talk":
3599 player.SetAnim(0,11);
3600 break;
3601 case "wave":
3602 player.SetAnim(0,12);
3603 break;
3604 case "die":
3605 player.SetAnim(0,17);
3606 break;
3607 case "die 2":
3608 player.SetAnim(0,13);
3609 break;
3610 case "fall":
3611 player.SetAnim(0,25);
3612 break;
3613 case "fall 2":
3614 player.SetAnim(0,37);
3615 break;
3616 case "fallback":
3617 player.SetAnim(0,27);
3618 break;
3619 case "fallback 2":
3620 player.SetAnim(0,43);
3621 break;
3622 case "oo":
3623 player.SetAnim(0,44);
3624 break;
3625 case "apply":
3626 player.SetAnim(0,62);
3627 break;
3628 case "bu!":
3629 player.SetAnim(0,67);
3630 break;
3631 case "arg":
3632 player.SetAnim(0,112);
3633 break;
3634 case "arg 2":
3635 player.SetAnim(0,113);
3636 break;
3637 case "carwback":
3638 player.SetAnim(0,114);
3639 break;
3640 case "wback":
3641 player.SetAnim(0,118);
3642 break;
3643 case "elbow":
3644 player.SetAnim(0,123);
3645 break;
3646 case "elbow 2":
3647 player.SetAnim(0,124);
3648 break;
3649 case "rollback":
3650 player.SetAnim(0,126);
3651 break;
3652 case "boss":
3653 player.SetAnim(0,130);
3654 break;
3655 case "crawling":
3656 player.SetAnim(0,133);
3657 break;
3658 case "rollinfront":
3659 player.SetAnim(0,135);
3660 break;
3661 case "falling":
3662 player.SetAnim(0,144);
3663 break;
3664 case "roll":
3665 player.SetAnim(0,147);
3666 break;
3667 case "beware":
3668 player.SetAnim(0,151);
3669 break;
3670 case "idk":
3671 player.SetAnim(0,152);
3672 break;
3673 case "look":
3674 player.SetAnim(0,153);
3675 break;
3676 case "dumb":
3677 player.SetAnim(0,154);
3678 break;
3679 case "aim":
3680 player.SetAnim(0,155);
3681 break;
3682 case "aim 2":
3683 player.SetAnim(0,157);
3684 break;
3685 case "aim 3":
3686 player.SetAnim(0,160);
3687 break;
3688 case "drown":
3689 player.SetAnim(0,156);
3690 break;
3691 case "handsup":
3692 player.SetAnim(0,161);
3693 break;
3694 case "wut":
3695 player.SetAnim(0,162);
3696 break;
3697 case "fu":
3698 player.SetAnim(0,163);
3699 break;
3700 case "phone":
3701 player.SetAnim(0,166);
3702 break;
3703 case "sit":
3704 player.SetAnim(0,169);
3705 break;
3706 case "stand":
3707 player.SetAnim(0,168);
3708 break;
3709 case "sell":
3710 player.SetAnim(0,171);
3711 break;
3712 case "hm?":
3713 player.SetAnim(0,172);
3714 break;
3715 case "onfoot":
3716 player.SetAnim(3,192);
3717 break;
3718 case "db":
3719 player.SetAnim(3,201);
3720 break;
3721 case "db 2":
3722 player.SetAnim(3,202);
3723 break;
3724 case "db 3":
3725 player.SetAnim(3,203);
3726 break;
3727 case "heal":
3728 player.SetAnim(24,214);
3729 break;
3730 case "lay":
3731 player.SetAnim(25,210);
3732 break;
3733 case "bored":
3734 player.SetAnim(26,215);
3735 break;
3736 case "bored 2":
3737 player.SetAnim(26,216);
3738 break;
3739 case "bored 3":
3740 player.SetAnim(26,217);
3741 break;
3742 case "bored 4":
3743 player.SetAnim(26,218);
3744 break;
3745 case "riot":
3746 player.SetAnim(27,219);
3747 break;
3748 case "riot 2":
3749 player.SetAnim(27,220);
3750 break;
3751 case "riot 3":
3752 player.SetAnim(27,221);
3753 break;
3754 case "riot 4":
3755 player.SetAnim(27,222);
3756 break;
3757 case "riot 5":
3758 player.SetAnim(27,223);
3759 break;
3760 case "riot 6":
3761 player.SetAnim(27,224);
3762 break;
3763 case "riot 7":
3764 player.SetAnim(27,225);
3765 break;
3766 case "dance":
3767 player.SetAnim(28,226);
3768 break;
3769 case "dance 2":
3770 player.SetAnim(28,227);
3771 break;
3772 case "dance 3":
3773 player.SetAnim(28,228);
3774 break;
3775 case "dance 4":
3776 player.SetAnim(28,229);
3777 break;
3778 case "dance 5":
3779 player.SetAnim(28,230);
3780 break;
3781 case "dance 6":
3782 player.SetAnim(28,231);
3783 break;
3784 case "dance 7":
3785 player.SetAnim(28,232);
3786 break;
3787 case "drunk":
3788 player.SetAnim(29,210);
3789 break;
3790 default:
3791 MessagePlayer(">> [#FF3636]This animation doesn't exist. Type '/a' to see the list !",player);
3792 }
3793 }
3794 }
3795
3796else if ( cmd == "clothes" )
3797{
3798if ( Checar( player, null ) ) return 0;
3799else
3800{
3801I_MSG( "200: Duke nukem", player );
3802I_MSG( "201: PGA", player );
3803I_MSG( "202: PGB", player );
3804I_MSG( "203: Avery Carrington", player );
3805I_MSG( "204: Auntie Poulet", player );
3806I_MSG( "205: Pastor Richards", player );
3807I_MSG( "206: Mitch Baker", player );
3808I_MSG( "207: BJ Smith", player );
3809I_MSG( "208: SpiderMan", player );
3810I_MSG( "209: CJ", player );
3811I_MSG( "210: Naruto", player );
3812I_MSG( "211: Kusanagi", player );
3813I_MSG( "212: IronMan", player );
3814I_MSG( "213: Batman", player );
3815I_MSG( "214: Nemesis", player );
3816I_MSG( "215: Joker", player );
3817I_MSG( "216: Sasuke", player );
3818I_MSG( "217: Leon Mafia", player );
3819I_MSG( "218: Leon Jacket", player );
3820}
3821}
3822
3823else if ( cmd == "repair" )
3824{
3825 local veh = player.Vehicle,
3826 Pos = player.Pos,
3827 checkpoly = InPoly( Pos.x, Pos.y, -873.015, -113.933, -875.922, -119.653, -885.54, -114.763, -882.625, -109.037);
3828
3829 if ( !veh ) MessagePlayer( "[#cccccc]You do not have a vehicle!", player );
3830 else
3831 {
3832 if( !checkpoly ) I_MSG( "You need to be in Pay'n'Spray in Little Haiti.", player );
3833 else if ( player.Cash <= 2000 ) E_MSG( "You need 2000.", player );
3834 else
3835 {
3836 I_MSG( "Your vehicle has been repaired.", player );
3837 I_MSG( "Costed: 2000$.", player );
3838 player.Cash -= 2000;
3839 veh.Fix();
3840 }
3841 }
3842}
3843
3844 if ( cmd == "pos" ) print( player.Pos.x + ", " + player.Pos.y )
3845
3846else if ( cmd == "buyclothes" )
3847{
3848local Pos = player.Pos, checkpoly;
3849checkpoly = InPoly( Pos.x, Pos.y, 424.555, 1017.27, 424.379, 1040.05, 403.933, 1040.42, 403.947, 1017.15);
3850if( !checkpoly ) I_MSG( "You need to be in the clothing store downtown.", player );
3851else if ( !text ) S_MSG( "/ "+ cmd + " <ID>", player );
3852else if ( player.Cash <= 500000 ) E_MSG( "You need 500000.", player );
3853else
3854{
3855local skin = GetTok( text, " ", 1);
3856if ( skin.tointeger() == 1 || skin.tointeger() == 2 || skin.tointeger() == 3 || skin.tointeger() == 4 || skin.tointeger() == 97 || skin.tointeger() == 98 || skin.tointeger() == 99 || skin.tointeger() == 100 || skin.tointeger() == 101 || skin.tointeger() == 102 || skin.tointeger() == 156 ) MessagePlayer(" Esta roupa esta bloqueada .", player );
3857else if ( skin.tointeger() < 1 || skin.tointeger() > 218 ) I_MSG( "Use numeros de 1-218 para ropas.", player );
3858else
3859{
3860I_MSG( "Clothing purchased!, price: $500000.", player );
3861I_MSG( "Use /useclothes to use it, and to sell it use /sellclothes.", player );
3862player.Cash -= 500000;
3863AddSkin( player, skin );
3864LoadSkin(player);
3865}
3866}
3867}
3868
3869else if ( cmd == "useclothes" )
3870{
3871if ( !player.IsSpawned ) E_MSG("Choose a skin to use this command.", player );
3872else if ( skin(player) == 0 ) E_MSG("You do not have clothes.", player );
3873else
3874{
3875I_MSG("Clothes used.", player );
3876LoadSkin(player);
3877}
3878}
3879
3880else if ( cmd == "sellclothes" )
3881{
3882if ( !player.IsSpawned ) E_MSG("Choose a skin to use this command.", player );
3883else if ( player.Vehicle ) I_MSG(" You can not use this command inside a vehicle.", player );
3884else if ( skin(player) == 0 ) E_MSG("You do not have clothes to sell.", player );
3885else
3886{
3887I_MSG( "Clothes Sold, price $250000.", player );
3888player.Cash += 250000;
3889DelSkin( player );
3890player.Skin = 0
3891}
3892}
3893
3894 if ( cmd == "spectate" )
3895 {
3896 local plr = FindPlayer( text );
3897
3898 if ( !plr ) MessagePlayer( "Player is not online.", player );
3899 else player.SpectateTarget = plr;
3900 }
3901
3902else if ( cmd == "race" )
3903{
3904player.Pos = Vector( -757.767 , -1272.74 , 10.9259 );
3905I_MSG( "You have entered the race zone, get a car and use /cd . The first who go to ammunation wins!.", player );
3906}
3907
3908else if ( cmd == "enterhouse" )
3909{
3910player.Pos = Vector( 330.179 , 948.162 , 1.63597 );
3911I_MSG( "You have entered on your house.", player );
3912}
3913
3914else if ( cmd == "respawn" )
3915{
3916player.Pos = Vector( -378.38 , -539.427 , 17.2837 );
3917I_MSG( "You have respawned.", player );
3918}
3919
3920else if ( cmd == "egypt" )
3921{
3922player.Pos = Vector(581.081, -1288.08, 1012);
3923I_MSG( "Welcome in Egypt.", player );
3924}
3925
3926else if ( cmd == "carshop" )
3927{
3928player.Pos = Vector( -1705.43 , -667.974 , 897.335 );
3929I_MSG( "You have entered the car shop place.", player );
3930}
3931
3932else if ( cmd == "opencar" )
3933{
3934if ( !player.IsSpawned ) MessagePlayer( "** [DNUS-Error]: >> First Spawned And Then Use It.", player );
3935else if ( !text ) MessagePlayer( "Usage: /"+cmd+" [Vehicle/ID]", player );
3936else if ( !IsNum( text ) ) MessagePlayer( "[DNUS-Error]: >> Vehicle/ID Must Be Numbers.", player );
3937else {
3938local veh = FindVehicle( text.tointeger() );
3939if ( !veh ) MessagePlayer( "Invalid Vehicle/ID.", player );
3940else {
3941MessagePlayer( "Usted ha abierto el auto [ " + GetVehicleNameFromModel( veh.Model ) + " ]." , player )
3942veh.Locked = false;
3943}
3944}
3945}
3946
3947else if ( cmd == "lockcar" )
3948{
3949if ( !player.IsSpawned ) MessagePlayer( "** [DNUS-Error]: >> First Spawned And Then Use It.", player );
3950else if ( !text ) MessagePlayer( "Usage: /"+cmd+" [Vehicle/ID]", player );
3951else if ( !IsNum( text ) ) MessagePlayer( "[DNUS-Error]: >> Vehicle/ID Must Be Numbers.", player );
3952else {
3953local veh = FindVehicle( text.tointeger() );
3954if ( !veh ) MessagePlayer( "Invalid Vehicle/ID.", player );
3955else {
3956MessagePlayer( "Usted ha cerrado el auto [ " + GetVehicleNameFromModel( veh.Model ) + " ]." , player )
3957veh.Locked = true;
3958}
3959}
3960}
3961
3962else if ( cmd == "addrob" )
3963{
3964if ( level < 9 ) Message( "[#ffffff]You do not have access to this command ", player );
3965else{
3966CreatePickup( 408, 1, 1, player.Pos.x, player.Pos.y, player.Pos.z, 255, true ).ID;
3967}
3968}
3969
3970
3971else if( cmd == "restore" )
3972{
3973if ( level < 9 ) Message( "[#FF0000]You do not have access to this command ", player );
3974I_MSG( "You have restored the vehicles.", player );
3975RespawnVehicles();
3976Message( "[#00FF00]Admin " + player.Name + " respawned all cars. ");
3977}
3978
3979else if ( cmd == "add10m" )
3980{
3981if ( level < 10 ) Message( "[#ffffff]You do not have access to this command ", player );
3982else{
3983IncCash( player, 10000000 );
3984}
3985}
3986
3987else if ( cmd == "sound" )
3988{
3989PlaySound( player.UniqueWorld , 50000 , player.Pos );
3990}
3991
3992else if ( cmd == "sound1" )
3993{
3994PlaySound( player.UniqueWorld , 50001 , player.Pos );
3995}
3996
3997else if ( cmd == "sound2" )
3998{
3999PlaySound( player.UniqueWorld , 50002 , player.Pos );
4000}
4001
4002else if ( cmd == "sound3" )
4003{
4004PlaySound( player.UniqueWorld , 50003 , player.Pos );
4005}
4006
4007else if ( cmd == "sound4" )
4008{
4009PlaySound( player.UniqueWorld , 50004 , player.Pos );
4010}
4011
4012else if ( cmd == "sound5" )
4013{
4014PlaySound( player.UniqueWorld , 50005 , player.Pos );
4015}
4016
4017else if ( cmd == "sound6" )
4018{
4019PlaySound( player.UniqueWorld , 50006 , player.Pos );
4020}
4021
4022else if ( cmd == "arepair" )
4023{
4024if ( level < 10 ) E_MSG( "You do not have access to this command.", player );
4025local veh = player.Vehicle;
4026if ( veh )
4027{
4028MessagePlayer( "[#cccccc]You'r vehicle has been repaired.", player );
4029veh.Fix();
4030}
4031}
4032
4033else if ( cmd == "forum" )
4034{
4035if ( Checar( player, null ) ) return 0;
4036else
4037{
4038I_MSG( "[#ff0000]Forum: [#00ffff]http://extreme-city-server.boards.net/", player );
4039}
4040}
4041 else if ( cmd == "apark" )
4042{
4043local veh = player.Vehicle;
4044if ( Checar( player, null ) ) return 0;
4045else if ( level < 6 ) E_MSG( "You do not have access to this command.", player );
4046else if ( !player.IsSpawned ) E_MSG("Choose a skin to use this command.", player );
4047else if ( !veh ) E_MSG( "You must be inside a vehicle.", player );
4048else
4049{
4050QuerySQL( db, "UPDATE Carros SET PX='" + veh.Pos.x + "', PY='" + veh.Pos.y + "', PZ='" + veh.Pos.z + "', Angulo='" + veh.EulerAngle.z + "' WHERE ID='" + veh.ID + "'" );
4051veh.SpawnPos = Vector( veh.Pos.x, veh.Pos.y, veh.Pos.z );
4052veh.SpawnAngle = veh.Angle;
4053I_MSG( "Vehicle parked in this place.", player );
4054}
4055}
4056else if ( cmd == "drunk" )
4057{
4058player.SetDrunkLevel( 100, 100 );
4059}
4060
4061else if ( cmd == "overflow" )
4062{
4063player.SetDrunkLevel( 0, 0 );
4064}
4065
4066else if ( cmd == "changepass" )
4067{
4068if ( Checar( player, null ) ) return 0;
4069else if ( !text ) S_MSG( sintaxe + cmd + " <new password>", player );
4070else if ( text.len() < 5 || text.len() > 15 ) E_MSG( "[#ff0000]Your password must be 5 to 15 characters.", player );
4071else
4072{
4073local pass = e(text);
4074QuerySQL( db, "UPDATE Contas SET Senha='" + pass + "' WHERE Nome='" + player.Name + "'" );
4075I_MSG( "[#cccccc]You changed your password to: " + text, player );
4076}
4077}
4078
4079else if ( cmd == "eat" )
4080{
4081player.SetAnim( 11 );
4082}
4083
4084else if ( cmd == "apuntar" )
4085{
4086player.SetAnim( 155 );
4087}
4088
4089else if ( cmd == "wasted" )
4090{
4091player.SetAnim( 164 );
4092}
4093
4094else if ( cmd == "give" )
4095{
4096player.SetAnim( 171 );
4097}
4098
4099else if ( cmd == "falls" )
4100{
4101if ( Checar( player, null ) ) return 0;
4102else
4103{
4104I_MSG( "[#cccccc]Use /fall[1/2/3/4/5/6/7/8/9]", player );
4105}
4106}
4107
4108else if ( cmd == "fall1" )
4109{
4110player.SetAnim( 141 );
4111}
4112
4113else if ( cmd == "fall2" )
4114{
4115player.SetAnim( 142 );
4116}
4117
4118else if ( cmd == "fall3" )
4119{
4120player.SetAnim( 143 );
4121}
4122
4123else if ( cmd == "fall4" )
4124{
4125player.SetAnim( 144 );
4126}
4127
4128else if ( cmd == "fall5" )
4129{
4130player.SetAnim( 145 );
4131}
4132
4133else if ( cmd == "fall6" )
4134{
4135player.SetAnim( 146 );
4136}
4137
4138else if ( cmd == "roll" )
4139{
4140player.SetAnim( 147 );
4141}
4142
4143else if ( cmd == "fall8" )
4144{
4145player.SetAnim( 148 );
4146}
4147
4148else if ( cmd == "fall9" )
4149{
4150player.SetAnim( 149 );
4151}
4152
4153else if ( cmd == "fall10" )
4154{
4155player.SetAnim( 150 );
4156}
4157
4158else if ( cmd == "what" )
4159{
4160player.SetAnim( 163 );
4161}
4162
4163else if ( cmd == "surrender" )
4164{
4165player.SetAnim( 161 );
4166}
4167
4168else if ( cmd == "credits" )
4169{
4170if ( Checar( player, null ) ) return 0;
4171else
4172{
4173I_MSG( "[#ff0000]Credits: [#cccccc]Fabio^.", player );
4174
4175}
4176}
4177
4178else if ( cmd == "rules" )
4179{
4180if ( Checar( player, null ) ) return 0;
4181else
4182{
4183I_MSG( "[#ff0000]========Rules========", player );
4184I_MSG( "[#cccccc]Do not be rude to players.", player );
4185I_MSG( "[#cccccc]Do not buy more than 10 vehicles.", player );
4186I_MSG( "[#cccccc]Do not use hacks.", player );
4187I_MSG( "[#cccccc]Do not evade of any kind.", player );
4188I_MSG( "[#cccccc]Do not do spawnkill.", player );
4189}
4190}
4191
4192else if ( cmd == "wep" || cmd == "we" )
4193{
4194if ( Checar( player, null ) ) return 0;
4195else if ( !player.IsSpawned ) E_MSG("[#ff0000]Choose a skin to use this command.", player );
4196else if ( !text ) S_MSG( sintaxe + cmd + " <Wep>", player );
4197else GiveWeapons( player, split(text, " ") );
4198}
4199
4200else if ( cmd == "spawnwep" || cmd == "spawnwe" )
4201{
4202if ( Checar( player, null ) ) return 0;
4203else if ( text == "del" ) DelSpawnWep( player );
4204else if ( !text ) S_MSG( sintaxe + cmd + " <Wep/del>", player );
4205else
4206{
4207local wep = GetTok( text, " ", 1);
4208local wep2 = GetTok( text, " ", 2);
4209local wep3 = GetTok( text, " ", 3);
4210local wep4 = GetTok( text, " ", 4);
4211if ( wep == null ) E_MSG("[#cccccc]Slot 1 empty.", player );
4212else
4213{
4214AddSpawnWep( player, wep, wep2, wep3, wep4 );
4215LoadSpawnWep(player);
4216}
4217}
4218}
4219
4220else if ( cmd == "pay" )
4221{
4222local cash = status[ player.ID ].Dinheiro;
4223if ( Checar( player, null ) ) return 0;
4224else if ( !player.IsSpawned ) E_MSG("Choose a skin to use this command.", player );
4225else if ( cash == 0 ) E_MSG( "You do not have any money.", player );
4226else if ( !text ) S_MSG( sintaxe + cmd + " <Nick/ID> <anmount/all>", player );
4227else
4228{
4229local plr = GetPlayer( GetTok( text, " ", 1 ) );
4230if ( !plr ) E_MSG( "Jugador desconocido.", player );
4231else if ( Checar( player, plr ) ) return 0;
4232else if ( plr.ID == player.ID ) E_MSG( "You can not pay for yourself.", player );
4233else
4234{
4235local valor = GetTok( text, " ", 2 );
4236if ( !valor ) S_MSG( sintaxe + cmd + " <Nick/ID> <anmount/all>", player );
4237else if ( valor == "all" )
4238{
4239I_MSG( "You paid $" + cash + " to " + plr.Name + ".", player );
4240I_MSG( player.Name + " paid $" + cash + " to you.", plr );
4241DecCash( player, cash );
4242IncCash( plr, cash );
4243}
4244else if ( !IsNum( valor ) ) E_MSG( "Use numbers or use'all'.", player );
4245else if ( valor.tointeger() < 1 ) E_MSG( "Invalid Anmount.", player );
4246else
4247{
4248if ( valor.tointeger() > cash ) E_MSG( "You do not have this amount of money.", player );
4249else
4250{
4251I_MSG( "You paid $" + valor + " to " + plr.Name + ".", player );
4252I_MSG( player.Name + " paid $" + valor + " to you.", plr );
4253DecCash( player, valor.tointeger() );
4254IncCash( plr, valor.tointeger() );
4255}
4256}
4257}
4258}
4259}
4260
4261else if ( cmd == "deposit" )
4262{
4263local Pos = player.Pos, checkpoly, cash;
4264checkpoly = InPoly( Pos.x, Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 );
4265cash = status[ player.ID ].Dinheiro;
4266if ( Checar( player, null ) ) return 0;
4267else if ( !player.IsSpawned ) E_MSG("Escoja un skin para usar este comando.", player );
4268else if( !checkpoly ) E_MSG( "Usted debe estar en el banco.", player );
4269else if ( cash == 0 ) E_MSG( "Usted no tiene dinero en la mano.", player );
4270else if ( !text ) S_MSG( sintaxe + cmd + " <anmount/all>", player );
4271else if ( text == "all" )
4272{
4273I_MSG( "Usted deposito: $" + cash + ".", player );
4274DecCash( player, cash );
4275IncBank( player, cash );
4276I_MSG( "Nuevo saldo bancario: $" + status[ player.ID ].Banco + ".", player );
4277}
4278else if ( !IsNum( text ) ) E_MSG( "Use numbers or use 'all'.", player );
4279else if ( text.tointeger() < 1 ) E_MSG( "Invalid Amount.", player );
4280else
4281{
4282if ( text.tointeger() > cash ) E_MSG( "Usted no posee esta cantidad de dinero.", player );
4283else
4284{
4285DecCash( player, text.tointeger() );
4286IncBank( player, text.tointeger() );
4287I_MSG( "Usted deposito: $" + text + ".", player );
4288I_MSG( "Nuevo saldo bancario: $" + status[ player.ID ].Banco + ".", player );
4289}
4290}
4291}
4292
4293else if ( cmd == "withdraw" )
4294{
4295local Pos = player.Pos, checkpoly, bank;
4296checkpoly = InPoly( Pos.x, Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 );
4297bank = status[ player.ID ].Banco;
4298if ( Checar( player, null ) ) return 0;
4299else if ( !player.IsSpawned ) E_MSG("Choose a skin to use this command.", player );
4300else if( !checkpoly ) E_MSG( "You must be in the bank.", player );
4301else if ( bank == 0 ) E_MSG( "You do not have money in your bank account.", player );
4302else if ( !text ) S_MSG( sintaxe + cmd + " <anmount/all>", player );
4303else if ( text == "all" )
4304{
4305I_MSG( "usted saco: $" + bank + ".", player );
4306IncCash( player, bank );
4307DecBank( player, bank );
4308I_MSG( "Nuevo saldo bancario: $" + status[ player.ID ].Banco + ".", player );
4309}
4310else if ( !IsNum( text ) ) E_MSG( "Use numbers or use 'all'.", player );
4311else if ( text.tointeger() < 1 ) E_MSG( "Invalid anmount.", player );
4312else
4313{
4314if ( text.tointeger() > bank ) E_MSG( "You do not have that amount of money in your bank account.", player );
4315else
4316{
4317IncCash( player, text.tointeger() );
4318DecBank( player, text.tointeger() );
4319I_MSG( "Usted saco: $" + text + ".", player );
4320I_MSG( "Nuevo saldo bancario: $" + status[ player.ID ].Banco + ".", player );
4321}
4322}
4323}
4324
4325else if ( cmd == "cash" )
4326{
4327local total = status[ player.ID ].Dinheiro + status[ player.ID ].Banco;
4328if ( Checar( player, null ) ) return 0;
4329else if ( !text ) I_MSG( "Your money: $" + status[ player.ID ].Dinheiro + " | Bank account: $" + status[ player.ID ].Banco + " | Total: $" + total + ".", player );
4330else
4331{
4332local plr = GetPlayer( GetTok( text, " ", 1 ) );
4333if ( !plr ) E_MSG( "Jugador Desconocido.", player );
4334else if ( Checar( player, plr ) ) return 0;
4335else if ( plr.ID == player.ID ) I_MSG( "Your Money: $" + status[ player.ID ].Dinheiro + " | Bank account: $" + status[ player.ID ].Banco + " | Total: $" + total + ".", player );
4336else I_MSG( "Money of " + plr.Name + ": $" + status[ plr.ID ].Dinheiro + " | Bank Account: $" + status[ plr.ID ].Banco + ".", player );
4337}
4338}
4339
4340else if ( cmd == "loc" )
4341{
4342if ( Checar( player, null ) ) return 0;
4343else if ( !player.IsSpawned ) E_MSG("Escoja un skin para usar este comando.", player );
4344else if ( !text ) I_MSG( "Your location is: " + GetDistrictName( player.Pos.x, player.Pos.y ) + ".", player );
4345else
4346{
4347local plr = GetPlayer( GetTok( text, " ", 1 ) );
4348if ( !plr ) E_MSG( "Jugador Desconocido.", player );
4349else if ( plr.ID == player.ID ) I_MSG( "Su Localizacion: " + GetDistrictName( player.Pos.x, player.Pos.y ) + ".", player );
4350else if ( !plr.IsSpawned ) E_MSG( plr.Name + " no ha escogido a un skin.", player );
4351else I_MSG( "Location of " + plr.Name + ": " + GetDistrictName( plr.Pos.x, plr.Pos.y ) + " | Distancia: " + Distance( player.Pos.x, player.Pos.y, plr.Pos.x, plr.Pos.y ).tointeger() + " Metros.", player );
4352}
4353}
4354
4355else if ( cmd == "hp" )
4356{
4357if ( Checar( player, null ) ) return 0;
4358else if ( !player.IsSpawned ) E_MSG("Escoja un skin para usar este comando.", player );
4359else if ( !text ) I_MSG( "Your HP: " + player.Health + "% | Armour: " + player.Armour + "%.", player );
4360else
4361{
4362local plr = GetPlayer( GetTok( text, " ", 1 ) );
4363if ( !plr ) E_MSG( "Jugador Desconocido.", player );
4364else if ( plr.ID == player.ID ) I_MSG( "Your HP: " + player.Health + "% | Armour: " + player.Armour + "%.", player );
4365else if ( !plr.IsSpawned ) E_MSG( plr.Name + " he has not chosen a skin.", player );
4366else I_MSG( "HP of " + plr.Name + ": " + plr.Health + "% | Armour: " + plr.Armour + "%.", player );
4367}
4368}
4369
4370else if ( cmd == "baninfo" )
4371{
4372if ( !text ) MessagePlayer( "[#00BBFF][INFO][#ffffff] /baninfo <Full-Nick>", player );
4373// If Player Not Logged In Message Here
4374// Level To Acces As That Command
4375else {
4376local q = QuerySQL( db, "SELECT * FROM SubBans WHERE Name='" + text + "'" );
4377if ( GetSQLColumnData( q, 0 ) != text ) MessagePlayer( "[#ff0000][Error] - " + text + " is not Banned.", player );
4378else
4379{
4380MessagePlayer( "[#00ffff][INFO][#ffffff] Player Name Found!", player );
4381MessagePlayer( "[#00ffff][INFO][#ffffff] Player : " + text, player );
4382MessagePlayer( "[#00ffff][INFO][#ffffff] IP : " + GetSQLColumnData( q, 1 ), player );
4383MessagePlayer( "[#00ffff][INFO][#ffffff] Banned by : " + GetSQLColumnData( q, 2 ), player );
4384MessagePlayer( "[#00ffff][INFO][#ffffff] Reason : " + GetSQLColumnData( q, 3 ), player );
4385}
4386}
4387}
4388
4389else if ( cmd == "level" )
4390{
4391if ( Checar( player, null ) ) return 0;
4392else if ( !text ) I_MSG( "Your level: " + status[ player.ID ].Level + " | Status: " + LevelTag( player ) + ".", player );
4393else
4394{
4395local plr = GetPlayer( GetTok( text, " ", 1 ) );
4396if ( !plr ) E_MSG( "Jugador Desconocido.", player );
4397else if ( Checar( player, plr ) ) return 0;
4398else if ( plr.ID == player.ID ) I_MSG( "Your level: " + status[ player.ID ].Level + " | Status: " + LevelTag( player ) + ".", player );
4399else I_MSG( "Level of " + plr.Name + ": " + status[ plr.ID ].Level + " | Status: " + LevelTag( plr ) + ".", player );
4400}
4401}
4402
4403else if ( cmd == "ping" )
4404{
4405if ( Checar( player, null ) ) return 0;
4406else if ( !text ) I_MSG( "Your Ping is: " + player.Ping + ".", player );
4407else
4408{
4409local plr = GetPlayer( GetTok( text, " ", 1 ) );
4410if ( !plr ) E_MSG( "Jugador Desconocido.", player );
4411else if ( plr.ID == player.ID ) I_MSG( "Su Ping: " + player.Ping + ".", player );
4412else I_MSG( "Ping de " + plr.Name + ": " + plr.Ping + ".", player );
4413}
4414}
4415
4416else if ( cmd == "fps" )
4417{
4418if ( Checar( player, null ) ) return 0;
4419else if ( !text ) I_MSG( "Your FPS is: " + player.FPS.tointeger() + ".", player );
4420else
4421{
4422local plr = GetPlayer( GetTok( text, " ", 1 ) );
4423if ( !plr ) E_MSG( "Jugador Desconocido.", player );
4424else if ( plr.ID == player.ID ) I_MSG( "Su FPS: " + player.FPS.tointeger() + ".", player );
4425else I_MSG( "FPS de " + plr.Name + ": " + plr.FPS.tointeger() + ".", player );
4426}
4427}
4428
4429else if ( cmd == "carcolors" )
4430{
4431if ( Checar( player, null ) ) return 0;
4432else
4433{
4434I_MSG( "0: Black", player );
4435I_MSG( "1: White", player );
4436I_MSG( "2: Blue", player );
4437I_MSG( "3: Red", player );
4438I_MSG( "4: Grey", player );
4439I_MSG( "5: Pink", player );
4440I_MSG( "6: Yellow", player );
4441I_MSG( "7: Ligh Blue", player );
4442}
4443}
4444
4445else if ( cmd == "buycar" )
4446{
4447if ( Checar( player, null ) ) return 0;
4448else if ( !text ) S_MSG( sintaxe + cmd + " <ID>", player );
4449else if ( !IsNum( text ) ) E_MSG( "Use Numbers.", player );
4450else
4451{
4452local veh = FindVehicle( text.tointeger() );
4453if ( !veh ) E_MSG( "Vehiculo no encontrado.", player );
4454else if ( GetVehInfo( veh, "dono" ) != "Vice-City" ) E_MSG( "This vehicle is not for sale.", player );
4455else if ( GetVehInfo( veh, "preco" ) > status[ player.ID ].Dinheiro ) E_MSG( "You do not have enough money to buy this vehicle.", player );
4456else
4457{
4458local preco = GetVehInfo( veh, "preco" );
4459QuerySQL( db, "UPDATE Carros SET Dono='" + player.Name + "' WHERE ID='" + veh.ID + "'" );
4460I_MSG( "Vehicle Bought! Cost: $" + preco + ".", player );
4461DecCash( player, preco );
4462}
4463}
4464}
4465
4466else if ( ( cmd.tolower() == "admin" ) || ( cmd.tolower() == "admins" ) )
4467 {
4468 local plr, b;
4469 for( local i = 0; i <= GetMaxPlayers(); i++ )
4470 {
4471 plr = FindPlayer( i );
4472 if ( ( plr ) && ( status[ plr.ID ].Level >= 3 ) && ( status[plr.ID].Logado ) )
4473 {
4474 if ( b ) b = b + ", " + plr.Name + " (Level: " + status[ plr.ID ].Level + ")"
4475 else b = plr.Name + " (Level: " + status[ plr.ID ].Level + ")"
4476 }
4477 }
4478 if ( b )
4479 {
4480 Message( "[#00ffff]** Admin's Online:[ [#FFFFFF]" + b + "[#FF4500] ]" );
4481 EchoMessage( "9** Admin's Online:[ 13" + b + "13 ]" );
4482 }
4483 else if ( !b )
4484 {
4485 Message( "[#EE82EE]**There are no admins online." );
4486 EchoMessage( "9** There are no admins online." );
4487 }
4488 }
4489
4490
4491else if ( cmd == "sellcar" )
4492{
4493if ( Checar( player, null ) ) return 0;
4494else if ( !text ) S_MSG( sintaxe + cmd + " <ID>", player );
4495else if ( !IsNum( text ) ) E_MSG( "Use Numbers.", player );
4496else
4497{
4498local veh = FindVehicle( text.tointeger() );
4499if ( !veh ) E_MSG( "Vehiculo no encontrado.", player );
4500else if ( GetVehInfo( veh, "dono" ) != player.Name ) E_MSG( "You do not own this vehicle.", player );
4501else
4502{
4503local preco = GetVehInfo( veh, "preco" ) / 2;
4504QuerySQL( db, "UPDATE Carros SET Dono='Vice-City', Compart='Ninguem' WHERE ID='" + veh.ID + "'" );
4505I_MSG( "Vehiculo Vendido! Precio: $" + preco + ".", player );
4506IncCash( player, preco );
4507}
4508}
4509}
4510
4511if(cmd=="sbike")
4512{
4513if(GetStuntBike() == false)
4514{
4515SetStuntBike(true);
4516PrivMessage( player, "Stuntbike enabled." );
4517}
4518else
4519{
4520 SetStuntBike(false);
4521PrivMessage( player, "Sbike disabled." );
4522}
4523}
4524
4525else if ( cmd == "getcar" )
4526{
4527if ( Checar( player, null ) ) return 0;
4528else if ( !player.IsSpawned ) E_MSG("Choose a skin to use this command.", player );
4529else if ( !text ) S_MSG( sintaxe + cmd + " <ID>", player );
4530else if ( !IsNum( text ) ) E_MSG( "Use Numbers.", player );
4531else if ( player.Vehicle ) E_MSG( "You can not use this command inside a vehicle.", player );
4532else
4533{
4534local veh = FindVehicle( text.tointeger() );
4535if ( !veh ) E_MSG( "Vehicle not found.", player );
4536else if ( veh.Driver ) E_MSG( "Someone is driving that vehicle.", player );
4537else if ( !DonoCompartVeh( player, veh ) ) E_MSG( "You do not own this vehicle.", player );
4538else
4539{
4540veh.Pos = Vector( player.Pos.x + 1, player.Pos.y + 2, player.Pos.z );
4541I_MSG( "Vehicle: " + GetVehicleNameFromModel( veh.Model ) + " pulled.", player );
4542}
4543}
4544}
4545
4546else if ( cmd == "sharecar" )
4547{
4548if ( Checar( player, null ) ) return 0;
4549else if ( !text ) S_MSG( sintaxe + cmd + " <ID> <Nick/ID>", player );
4550else
4551{
4552local id = GetTok( text, " ", 1 );
4553if ( !id ) S_MSG( sintaxe + cmd + " <ID> <Nick/ID>", player );
4554else if ( !IsNum( id ) ) E_MSG( "Use Numbers.", player );
4555else
4556{
4557local veh = FindVehicle( id.tointeger() );
4558if ( !veh ) E_MSG( "Vehiculo no encontrado.", player );
4559else if ( GetVehInfo( veh, "dono" ) != player.Name ) E_MSG( "You do not own this vehicle.", player );
4560else if ( GetVehInfo( veh, "compart" ) != "Ninguem" ) E_MSG( "This vehicle is not shared.", player );
4561else
4562{
4563local plr = GetPlayer( GetTok( text, " ", 2 ) );
4564if ( !plr ) E_MSG( "Jugador Desconocido.", player );
4565else if ( Checar( player, plr ) ) return 0;
4566else if ( plr.ID == player.ID ) E_MSG( "You can not share a vehicle with yourself.", player );
4567else
4568{
4569QuerySQL( db, "UPDATE Carros SET Compart='" + plr.Name + "' WHERE ID='" + veh.ID + "'" );
4570I_MSG( "You have shared the vehicle with ID: " + id + " to " + plr.Name + ".", player );
4571I_MSG( player.Name + " shared vehicle ID: " + id + " with you.", plr );
4572}
4573}
4574}
4575}
4576}
4577
4578else if ( cmd == "delsharecar" )
4579{
4580if ( Checar( player, null ) ) return 0;
4581else if ( !text ) S_MSG( sintaxe + cmd + " <ID>", player );
4582else if ( !IsNum( text ) ) E_MSG( "Use Numeros.", player );
4583else
4584{
4585local veh = FindVehicle( text.tointeger() );
4586if ( !veh ) E_MSG( "Vehiculo no encontrado.", player );
4587else if ( GetVehInfo( veh, "dono" ) != player.Name ) E_MSG( "You do not own this vehicle.", player );
4588else if ( GetVehInfo( veh, "compart" ) == "Ninguem" ) E_MSG( "This vehicle is not shared.", player );
4589else
4590{
4591local plr = GetVehInfo( veh, "compart" );
4592I_MSG( "Tu vehiculo ID: " + text + " fue descompartido de " + plr + ".", player );
4593if ( FindPlayer( plr ) ) I_MSG( player.Name + " Te hand descompartido el vehiculo ID: " + text + " com voce.", player );
4594QuerySQL( db, "UPDATE Carros SET Compart='Ninguem' WHERE ID='" + veh.ID + "'" );
4595}
4596}
4597}
4598
4599else if ( cmd == "mycars" )
4600{
4601if ( Checar( player, null ) ) return 0;
4602else
4603{
4604local i = 1, my = 0, b = false, c = GetVehicleCount();
4605while( i <= c )
4606{
4607local veh = FindVehicle( i );
4608if ( GetVehInfo( veh, "dono" ) == player.Name )
4609{
4610my ++;
4611if ( b ) b = b + " [#FFFF00]| [#00FFFF]" + GetVehicleNameFromModel( veh.Model ) + " [#00FFFF](" + veh.ID + ")";
4612else b = "[#00FFFF]" + GetVehicleNameFromModel( veh.Model ) + " [#00FFFF](" + veh.ID + ")";
4613}
4614i++;
4615}
4616if ( !b ) E_MSG( "You do not own any car.", player );
4617else MessagePlayer( "[#FFFF00]Your Vehicles: (" + my + ") [ " + b + " [#FFFF00]]", player );
4618}
4619}
4620
4621else if ( cmd == "mysharedcars" )
4622{
4623if ( Checar( player, null ) ) return 0;
4624else
4625{
4626local i = 1, my = 0, b = false, c = GetVehicleCount();
4627while( i <= c )
4628{
4629local veh = FindVehicle( i );
4630if ( GetVehInfo( veh, "compart" ) == player.Name )
4631{
4632my ++;
4633if ( b ) b = b + " [#FFFF00]| [#00FFFF]" + GetVehicleNameFromModel( veh.Model ) + " [#00FFFF](" + veh.ID + ")";
4634else b = "[#00FFFF]" + GetVehicleNameFromModel( veh.Model ) + " [#00FFFF](" + veh.ID + ")";
4635}
4636i++;
4637}
4638if ( !b ) E_MSG( "No player has shared a car with you.", player );
4639else MessagePlayer( "[#FFFF00]Vehicles that are shared you: (" + my + ") [ " + b + " [#FFFF00]]", player );
4640}
4641}
4642
4643else if ( cmd == "lights" )
4644{
4645local veh = player.Vehicle;
4646if ( Checar( player, null ) ) return 0;
4647else if ( !player.IsSpawned ) E_MSG("Choose a skin to use this command.", player );
4648else if ( !veh ) E_MSG( "You must be inside your vehicle.", player );
4649else if ( veh.Lights = true ) MessagePlayer( "Lights on", player );
4650}
4651
4652else if ( cmd == "lightsoff" )
4653{
4654local veh = player.Vehicle;
4655if ( Checar( player, null ) ) return 0;
4656else if ( !player.IsSpawned ) E_MSG("Escoja un skin para usar este comando.", player );
4657else if ( !veh ) E_MSG( "Usted debe estar dentro de su vehiculo.", player );
4658else if ( veh.Lights = false ) MessagePlayer( "Lights are off now", player );
4659}
4660
4661else if ( cmd == "carcolor" )
4662{
4663local veh = player.Vehicle;
4664if ( Checar( player, null ) ) return 0;
4665else if ( !player.IsSpawned ) E_MSG("Choose a skin to use this command.", player );
4666else if ( !veh ) E_MSG( "You must be inside your vehicle.", player );
4667else if ( !text ) S_MSG( sintaxe + cmd + " <Color1> <Color2>", player );
4668else if ( GetVehInfo( veh, "dono" ) != player.Name ) E_MSG( "You do not own this vehicle.", player );
4669else
4670{
4671local cor1 = GetTok( text, " ", 1 );
4672if ( !cor1 ) S_MSG( sintaxe + cmd + " <Color1> <Color2>", player );
4673else if ( !IsNum( cor1 ) ) E_MSG( "Use numbers from 0 to 94 for colors.", player );
4674else if ( cor1.tointeger() < 0 || cor1.tointeger() > 94 ) E_MSG( "Use numbers from 0 to 94 for colors.", player );
4675else
4676{
4677local cor2 = GetTok( text, " ", 2 );
4678if ( !cor2 ) S_MSG( sintaxe + cmd + " <Color1> <Color2>", player );
4679else if ( !IsNum( cor2 ) ) E_MSG( "Use numbers from 0 to 94 for colors.", player );
4680else if ( cor2.tointeger() < 0 || cor2.tointeger() > 94 ) E_MSG( "Use numbers from 0 to 94 for colors.", player );
4681else
4682{
4683QuerySQL( db, "UPDATE Carros SET Cor1='" + cor1.tointeger() + "', Cor2='" + cor2.tointeger() + "' WHERE ID='" + veh.ID + "'" );
4684veh.Colour1 = cor1.tointeger();
4685veh.Colour2 = cor2.tointeger();
4686I_MSG( "Colors changed.", player );
4687}
4688}
4689}
4690}
4691
4692else if ( cmd == "park" )
4693{
4694local veh = player.Vehicle;
4695if ( Checar( player, null ) ) return 0;
4696else if ( !player.IsSpawned ) E_MSG("Choose a skin to use this command.", player );
4697else if ( !veh ) E_MSG( "You must be inside your vehicle.", player );
4698else if ( GetVehInfo( veh, "dono" ) != player.Name ) E_MSG( "You do not own this vehicle.", player );
4699else
4700{
4701QuerySQL( db, "UPDATE Carros SET PX='" + veh.Pos.x + "', PY='" + veh.Pos.y + "', PZ='" + veh.Pos.z + "', Angulo='" + veh.EulerAngle.z + "' WHERE ID='" + veh.ID + "'" );
4702veh.SpawnPos = Vector( veh.Pos.x, veh.Pos.y, veh.Pos.z );
4703veh.SpawnAngle = veh.Angle;
4704I_MSG( "Vehicle parked in this location.", player );
4705}
4706}
4707//======================== Comandos de Admin ===================================
4708else if ( cmd == "acmds" )
4709{
4710if ( level == 2 ) I_MSG( "(/)get, ann.", player );
4711else if ( level == 3 ) I_MSG( "(/)get, achat, agoto, night, day, afternoon, sunset, ann.", player );
4712else if ( level == 4 ) I_MSG( "(/)get, achat, agoto, night, day, afternoon, sunset, settime, ann, drown.", player );
4713else if ( level == 5 ) I_MSG( "(/)aheal, kick, achat, get, agoto, night, day, afternoon, sunset, settime, setweather, setpass, setspeed, restore, healall, ann, freeze, drown.", player );
4714else if ( level == 6 ) I_MSG( "(/)aheal, apark, kick, achat, get, agoto, night, day, afternoon, sunset, settime, setweather, setpass, setspeed, restore, healall, ann, ban, unban, freeze, unfreeze, drown.", player );
4715else if ( level == 7 ) I_MSG( "(/)aheal, apark, kick, achat, get, agoto, night, day, afternoon, sunset, settime, setweather, setpass,setspeed, restore, healall, ann, ban, unban, freeze, unfreeze, drown, restore, objcmds, gate.", player );
4716else if ( level == 8 ) I_MSG( "(/)aheal, apark, kick, achat, get, agoto, night, day, afternoon, sunset, settime, setweather, setpass, setspeed, restore, healall ann, ban, unban, freeze, unfreeze, drown, restore, objcmds, gate, addcar.", player );
4717else if ( level == 9 ) I_MSG( "(/)aheal, apark, kick, achat, get, agoto, night, day, afternoon, sunset, settime, setweather, setpass, setspeed, restore, healall ann, ban, unban, freeze, unfreeze, drown, restore, objcmds, gate, addcar, addprop, addrob.", player );
4718else if ( level == 10 ) I_MSG( "(/)aheal, arepair, apark, kick, achat, get, agoto, night, day, afternoon, sunset, settime, setweather, setpass, setspeed, restore, healall, ann,ban, unban, freeze, unfreeze, drown, restore, objcmds, gate, addcar, addprop, addrob, setlevel, reload, exe.", player );
4719else E_MSG( "You do not have access to this command.", player );
4720}
4721
4722 else if ( cmd == "cd" )
4723 {
4724 Message( "[#00de00][Countdown] [#fbf3f3]"+ player.Name +" Has Started Countdown" );
4725 NewTimer( "ClientMessageToAll", 1000, 1, "[#00de00][Countdown] [#fbf3f3]Ready",28, 255, 11 );
4726 NewTimer( "ClientMessageToAll", 3000, 1, "[#00de00][Countdown] [#fbf3f3]Steady",24, 255, 241 );
4727 NewTimer( "ClientMessageToAll", 5000, 1, "[#00de00][Countdown] [#fbf3f3]Go! Go! Go!",249, 57, 56 );
4728 }
4729
4730else if ( cmd == "achat" )
4731{
4732 if ( GetLevel( player ) < 3 ) MessagePlayer("You are not allowed to use that command", player );
4733 else
4734 {
4735 for ( local i = 0; i <= GetMaxPlayers(); i++ )
4736 {
4737 local plr = FindPlayer(i)
4738 if ( ( plr ) && ( GetLevel( plr ) >= 3 ) ) MessagePlayer("[#ff9933][Admin Chat][#cc0000] " + plr.Name + ": [#ff9933] " + text + ".", plr );
4739 }
4740}
4741}
4742
4743else if ( cmd == "createbox" )
4744{
4745 if ( level < 4 ) E_MSG( "You do not have access to this command.", player );
4746 else if ( BoxActive == true ) E_MSG( "Box event started.", player );
4747 else
4748 {
4749 CreateBox();
4750 MSG( "Admin " + player + " created a surprise box! Use /box to see the box location!" );
4751 BoxActive = true;
4752 }
4753}
4754
4755else if ( cmd == "drown" )
4756{
4757if ( level < 4 ) Message( "[#ffffff]You do not have access to this command ", player );
4758else if ( !text ) Message( "[#cccccc]Use /drown <Nick/ID> <Motivo> " );
4759else
4760{
4761local plr = GetPlayer( GetTok( text, " ", 1 ) );
4762if ( !plr ) Message( "[#cccccc]]Jugador desconocido.", player );
4763else
4764{
4765local msg = GetTok( text, " ", 2, NumTok( text, " " ) );
4766if ( !msg ) Message( "[#FF0000]Use the reason." );
4767else
4768{
4769Message( "[#Ffffff]Admin " + player.Name + " drowned " + plr.Name + ". Reason: " + msg + "." );
4770plr.Pos = Vector( 283.521 , -1574.3 , 7.19846 );
4771}
4772}
4773}
4774}
4775
4776else if ( cmd == "setweather" )
4777{
4778if ( !text ) MessagePlayer ( "/setweather WeatherID." , player );
4779else if ( !IsNum ( text ) ) MessagePlayer ( "The ID must be an integer." , player );
4780else if ( GetWeather( ) == text.tointeger( ) ) MessagePlayer( "The weather is already used!" , player );
4781else
4782{
4783SetWeather ( text.tointeger ( ) );
4784Message ( "The climate has been changed to " + text + " by " + player.Name + "." );
4785EchoMessage ( "7[Weather] 1The climate has been changed to " + text + " by 3" + player.Name + "." );
4786}
4787}
4788
4789else if ( cmd == "settime" )
4790{
4791if ( !text ) MessagePlayer ( "/settime <hour/minute>." , player );
4792else if ( split ( text , " " ).len ( ) < 2 ) MessagePlayer ( "/settime <hour/minute>." , player );
4793else if ( !IsNum ( split ( text , " " ) [ 0 ] ) || !IsNum ( split ( text , " " ) [ 1 ] ) ) MessagePlayer ( "Hora incorrecta." , player );
4794else
4795{
4796local splittext = split ( text , " " ),
4797hour = splittext [ 0 ],
4798minute = splittext [ 1 ];
4799SetHour ( hour.tointeger( ) );
4800SetMinute ( minute.tointeger( ) );
4801Message( "Time has been changed a " + GetHour( ) + ":" + GetMinute( ) + " by " + player.Name + "." );
4802}
4803}
4804
4805else if (cmd =="freeze")
4806{
4807if ( !text ) MessagePlayer("Use /freeze [Player/ID]", player );
4808local targ = FindPlayer(text.tointeger())
4809if(targ)
4810{
4811targ.Frozen = true
4812}
4813}
4814
4815else if (cmd =="unfreeze")
4816{
4817if ( !text ) MessagePlayer("Use /unfreeze player_id", player );
4818local targ = FindPlayer(text.tointeger())
4819if(targ)
4820{
4821targ.Frozen = false
4822}
4823}
4824
4825else if(cmd == "message")
4826{
4827}
4828
4829else if(cmd == "message2")
4830{
4831Message("[#66ff00][#cccccc]Do you like events? Then today is your lucky day");
4832}
4833
4834else if(cmd == "message3")
4835{
4836Message("[#66ff00][#cccccc]Looking for a manager, for more information go to the forum");
4837}
4838
4839else if(cmd == "message4")
4840{
4841Message("[#66ff00][#cccccc]when reporting errors or bugs of the server in the forum we will give a good reward");
4842}
4843
4844else if(cmd == "message5")
4845{
4846Message("[#66ff00][#cccccc]you want to see more information from the server?? enter the forum /forum");
4847}
4848
4849else if ( cmd == "night" )
4850{
4851if ( level < 3 ) E_MSG( "Usted no tiene acceso a este comando.", player );
4852SetTime( 0, 0 );
4853}
4854
4855else if ( cmd == "day" )
4856{
4857if ( level < 3 ) E_MSG( "Usted no tiene acceso a este comando.", player );
4858SetTime( 12, 12 );
4859}
4860
4861else if ( cmd == "sunset" )
4862{
4863if ( level < 3 ) E_MSG( "Usted no tiene acceso a este comando.", player );
4864SetTime( 20, 00 );
4865}
4866
4867else if ( cmd == "afternoon" )
4868{
4869if ( level < 3 ) E_MSG( "Usted no tiene acceso a este comando.", player );
4870SetTime( 6, 00 );
4871}
4872
4873else if ( cmd == "setlevel" )
4874{
4875if ( level < 10 ) E_MSG( "Usted no tiene acceso a este comando.", player );
4876else if ( !text ) S_MSG( sintaxe + cmd + " <Nick/ID> <Level>", player );
4877else
4878{
4879local plr = GetPlayer( GetTok( text, " ", 1 ) );
4880if ( !plr ) E_MSG( "Jugador Desconocido.", player );
4881else if ( Checar( player, plr ) ) return 0;
4882else
4883{
4884local lvl = GetTok( text, " ", 2 );
4885if ( !lvl ) S_MSG( sintaxe + cmd + " <Nick/ID> <Level>", player );
4886else if ( !IsNum( lvl ) ) E_MSG("Use Numeros.", player );
4887else
4888{
4889if ( plr.ID == player.ID )
4890{
4891status[ player.ID ].Level = lvl.tointeger();
4892I_MSG( "You change the level to: " + lvl + " - " + LevelTag( player ) + ".", player );
4893}
4894else
4895{
4896status[ plr.ID ].Level = lvl.tointeger();
4897I_MSG( "You change the level to " + plr.Name + " para: " + lvl + " - " + LevelTag( plr ) + ".", player );
4898I_MSG( "Admin " + player.Name + " change your level: " + lvl + " - " + LevelTag( plr ) + ".", plr );
4899}
4900}
4901}
4902}
4903}
4904
4905//========================= inicio CASAS COMANDOS ========================================//
4906else if ( cmd == "addprop" )
4907{
4908if ( level < 8 ) E_MSG( "You do not have access to this command.", player );
4909else
4910if ( !player.IsSpawned ) MessagePlayer( "[#FF0000]Erro: Choose a skin to use this command.", player );
4911else if ( CountProps() >= 1001 ) MessagePlayer( "[#FF0000]Erro: The limit of houses is 1000.", player );
4912else if ( !text ) MessagePlayer( "[#FFA500]Sintaxe: /" + cmd + " <Price> <Prop Name>", player );
4913else
4914{
4915local preco = GetTok( text, " ", 1 );
4916if ( !preco ) MessagePlayer( "[#FFA500]Sintaxe: /" + cmd + " <Price> <Prop Name>", player );
4917else if ( !IsNum( preco ) ) MessagePlayer( "[#FF0000]Erro: Use numbers.", player );
4918else
4919{
4920local nome = GetTok( text, " ", 2 NumTok( text, " " ) );
4921if ( !nome ) MessagePlayer( "[#FFA500]Sintaxe: /" + cmd + " <Price> <Prop Name>", player );
4922else if ( PropNameExist( nome ) ) MessagePlayer( "[#FF0000]Erro: There is already a property with that name.", player );
4923else
4924{
4925local id = CreatePickup( 407, 1, 1, player.Pos.x, player.Pos.y, player.Pos.z, 255, true ).ID;
4926QuerySQL( db, "INSERT INTO Casas VALUES ( '" + CountProps() + "', '" + nome + "', '" + preco.tointeger() + "', 'Vice-City', 'Ninguem', '" + player.Pos.x + "', '" + player.Pos.y + "', '" + player.Pos.z + "' )" );
4927Casa[ id ] = PropStats(), Casa[ id ].ID = CountProps(), Casa[ id ].Nome = nome, Casa[ id ].Preco = preco.tointeger(), Casa[ id ].Dono = "Vice-City", Casa[ id ].Compart = "Ninguem";
4928MessagePlayer( "[#00FF00]*** Propriedade Criada.", player );
4929}
4930}
4931}
4932}
4933
4934else if ( cmd == "buyprop" )
4935{
4936if ( !text ) MessagePlayer( "[#FFA500]Sintaxe: /" + cmd + " <ID>", player );
4937else if ( !IsNum( text ) ) MessagePlayer( "[#FF0000]Erro: Use numeros.", player );
4938else if ( !FindProp( text.tointeger() ) ) MessagePlayer( "[#FF0000]Erro: Property not found.", player );
4939else if ( Casa[ text.tointeger() ].Dono != "Vice-City" ) MessagePlayer( "[#FF0000]Erro: This property is not for sale.", player );
4940else if ( player.Cash < Casa[ text.tointeger() ].Preco ) MessagePlayer( "[#FF0000]Erro: You do not have enough money to buy this house..", player );
4941else
4942{
4943player.Cash -= Casa[ text.tointeger() ].Preco;
4944Casa[ text.tointeger() ].Dono = player.Name;
4945QuerySQL( db, "UPDATE Casas SET Dono='" + player.Name + "' WHERE ID='" + Casa[ text.tointeger() ].ID + "'" );
4946MessagePlayer( "[#00FF00]*** Purchased Property.", player );
4947Message( "[EXT][#ff8000] " + player.Name + "[#ffffff] Bought a property." );
4948EchoMessage( "[EXT]2 " + player.Name + " 12 Bought a property." );
4949}
4950}
4951
4952else if ( cmd == "sellprop" )
4953{
4954if ( !text ) MessagePlayer( "[#FFA500]Sintaxe: /" + cmd + " <ID>", player );
4955else if ( !IsNum( text ) ) MessagePlayer( "[#FF0000]Erro: Use numbers.", player );
4956else if ( !FindProp( text.tointeger() ) ) MessagePlayer( "[#FF0000]Erro: Property not found.", player );
4957else if ( Casa[ text.tointeger() ].Dono != player.Name ) MessagePlayer( "[#FF0000]Erro: You are not the owner of this property..", player );
4958else
4959{
4960player.Cash += Casa[ text.tointeger() ].Preco / 2;
4961Casa[ text.tointeger() ].Dono = "Vice-City";
4962Casa[ text.tointeger() ].Compart = "Ninguem";
4963QuerySQL( db, "UPDATE Casas SET Dono='Vice-City', Compart='Ninguem' WHERE ID='" + Casa[ text.tointeger() ].ID + "'" );
4964MessagePlayer( "[#00FF00]*** Proprty Sold.", player );
4965Message( "[EXT][#ff8000] " + player.Name + "[#ffbf00]Sold a property." );
4966EchoMessage( "[EXT]2 " + player.Name + " 12Sold a property." );
4967}
4968}
4969
4970else if ( cmd == "prop" )
4971{
4972if ( !text ) MessagePlayer( "[#FFA500]Sintaxe: /" + cmd + " <ID>", player );
4973else if ( !IsNum( text ) ) MessagePlayer( "[#FF0000]Erro: Use numbers.", player );
4974else if ( !FindProp( text.tointeger() ) ) MessagePlayer( "[#FF0000]Erro: Property not found.", player );
4975else if ( player.Vehicle ) E_MSG( "You can not use this command inside a vehicle.", player );
4976else if ( Casa[ text.tointeger() ].Dono != player.Name && Casa[ text.tointeger() ].Compart != player.Name ) MessagePlayer( "[#FF0000]Erro: You are not allowed to teleport to this property..", player );
4977else
4978{
4979player.Pos = FindPickup( text.tointeger() ).Pos;
4980MessagePlayer( "[#00FF00]*** Teleported to your property.", player );
4981}
4982}
4983
4984else if ( cmd == "myprops" )
4985{
4986local b;
4987for( local i = 0, pickup; i < GetPickupCount(); i++ )
4988{
4989pickup = FindPickup( i );
4990if ( pickup && Casa[ i ] != null )
4991{
4992if ( Casa[ i ].Dono == player.Name )
4993{
4994if ( b ) b = b + ", " + Casa[ i ].Nome + " (" + i + ")";
4995else b = Casa[ i ].Nome + " (" + i + ")";
4996}
4997}
4998}
4999if ( !b ) MessagePlayer( "[#FF0000]Erro: You do not have properties..", player );
5000else MessagePlayer( "[#00FF00]*** Your Properties: " + b + ".", player );
5001}
5002
5003else if ( cmd == "myshareprops" )
5004{
5005local b;
5006for( local i = 0, pickup; i < GetPickupCount(); i++ )
5007{
5008pickup = FindPickup( i );
5009if ( pickup && Casa[ i ] != null )
5010{
5011if ( Casa[ i ].Compart == player.Name )
5012{
5013if ( b ) b = b + ", " + Casa[ i ].Nome + " (" + i + ")";
5014else b = Casa[ i ].Nome + " (" + i + ")";
5015}
5016}
5017}
5018if ( !b ) MessagePlayer( "[#FF0000]Erro: There are no properties shared with you.", player );
5019else MessagePlayer( "[#00FF00]*** Properties shared with you: " + b + ".", player );
5020}
5021
5022else if ( cmd == "shareprop" )
5023{
5024if ( !text ) MessagePlayer( "[#FFA500]Sintaxe: /" + cmd + " <ID> <Nick/ID>", player );
5025else
5026{
5027local id = GetTok( text, " ", 1 );
5028if ( !id ) MessagePlayer( "[#FFA500]Sintaxe: /" + cmd + " <ID> <Nick/ID>", player );
5029else if ( !IsNum( id ) ) MessagePlayer( "[#FF0000]Erro: Use numeros.", player );
5030else if ( !FindProp( id.tointeger() ) ) MessagePlayer( "[#FF0000]Erro: Property not found.", player );
5031else if ( Casa[ id.tointeger() ].Dono != player.Name ) MessagePlayer( "[#FF0000]Erro: You are not the owner of this property..", player );
5032else if ( Casa[ id.tointeger() ].Compart != "Ninguem" ) MessagePlayer( "[#FF0000]Erro: This property is already shared with " + Casa[ id.tointeger() ].Compart + ".", player );
5033else
5034{
5035local plr = GetPlayer( GetTok( text, " ", 2 ) );
5036if ( !plr ) MessagePlayer( "[#FF0000]Erro: Jogador Desconhecido.", player );
5037else if ( plr.ID == player.ID ) MessagePlayer( "[#FF0000]Erro: You can not share a home with yourself..", player );
5038else
5039{
5040Casa[ text.tointeger() ].Compart = plr.Name;
5041QuerySQL( db, "UPDATE Casas SET Compart='" + plr.Name + "' WHERE ID='" + Casa[ text.tointeger() ].ID + "'" );
5042MessagePlayer( "[#00FF00]*** Propriedade compartilhada com " + plr.Name + ".", player );
5043}
5044}
5045}
5046}
5047
5048else if ( cmd == "delshareprop" )
5049{
5050if ( !text ) MessagePlayer( "[#FFA500]Sintaxe: /" + cmd + " <ID>", player );
5051else if ( !IsNum( text ) ) MessagePlayer( "[#FF0000]Erro: Use numeros.", player );
5052else if ( !FindProp( text.tointeger() ) ) MessagePlayer( "[#FF0000]Erro: Property not found.", player );
5053else if ( Casa[ text.tointeger() ].Dono != player.Name ) MessagePlayer( "[#FF0000]Erro: You are not the owner of this property..", player );
5054else if ( Casa[ text.tointeger() ].Compart == "Ninguem" ) MessagePlayer( "[#FF0000]Erro: This property is not shared.", player );
5055else
5056{
5057Casa[ text.tointeger() ].Compart = "Ninguem";
5058QuerySQL( db, "UPDATE Casas SET Compart='Ninguem' WHERE ID='" + Casa[ text.tointeger() ].ID + "'" );
5059MessagePlayer( "[#00FF00]*** Property Unshared.", player );
5060}
5061}
5062
5063else if ( cmd == "box" || cmd == "caixa" )
5064{
5065 if ( BoxActive == false ) E_MSG( "A box was not created.", player );
5066 else
5067 {
5068 I_MSG( "The box is located em: " + GetDistrictName( Box.Pos.x, Box.Pos.y ) + " a " + DistanceFromPoint( player.Pos.x, player.Pos.y, Box.Pos.x, Box.Pos.y ).tointeger() + " metros.", player );
5069 }
5070}
5071//=========== fim da funcao casa ==============//
5072else if ( cmd == "reload" )
5073{
5074if ( level < 10 ) E_MSG( "You do not have access to this command.", player );
5075else Reload();
5076}
5077
5078else if ( cmd == "exe" )
5079{
5080if ( level < 10 ) E_MSG( "You do not have access to this command.", player );
5081else if ( !text ) S_MSG( sintaxe + cmd + " <Code>", player );
5082else
5083{
5084try
5085{
5086local script = compilestring( text );
5087if( script )
5088{
5089script();
5090I_MSG( "Command executed successfully.", player );
5091}
5092else E_MSG( "Codigo con falla.", player );
5093}
5094catch(e) E_MSG( e, player );
5095}
5096}
5097
5098else if ( cmd == "addcar" )
5099{
5100if ( level < 8 ) E_MSG( "You do not have access to this command.", player );
5101else if ( !player.IsSpawned ) E_MSG("Choose a skin to use this command.", player );
5102else if ( GetVehicleCount() == 1000 ) E_MSG("the server already has too many vehicles.", player );
5103else if ( !text ) S_MSG( sintaxe + cmd + " <Model> <Color1> <Color2> <Price>", player );
5104else
5105{
5106local modelo = GetTok( text, " ", 1 );
5107if ( !modelo ) S_MSG( sintaxe + cmd + " <Model> <Color1> <Color2> <Price>", player );
5108else if ( !IsNum( modelo ) ) E_MSG("Use Numeros.", player );
5109else
5110{
5111local cor1 = GetTok( text, " ", 2 );
5112if ( !cor1 ) S_MSG( sintaxe + cmd + " <Model> <Color1> <Color2> <Price>", player );
5113else if ( !IsNum( cor1 ) ) E_MSG("Use Numeros.", player );
5114else
5115{
5116local cor2 = GetTok( text, " ", 3 );
5117if ( !cor2 ) I_MSG( sintaxe + cmd + " <Model> <Color1> <Color2> <Price>", player );
5118else if ( !IsNum( cor2 ) ) E_MSG("Use Numeros.", player );
5119else
5120{
5121local preco = GetTok( text, " ", 4 );
5122if ( !preco ) S_MSG( sintaxe + cmd + " <Model> <Color1> <Color2> <Price>", player );
5123else if ( !IsNum( preco ) ) E_MSG("Use Numeros.", player );
5124else
5125{
5126local id = GetVehicleCount() + 1, x = player.Pos.x, y = player.Pos.y, z = player.Pos.z, angulo = player.Angle;
5127QuerySQL( db, "INSERT INTO Carros ( ID, Preco, Dono, Compart, Modelo, PX, PY, PZ, Angulo, Cor1, Cor2 ) VALUES ( '" + id + "', '" + preco.tointeger() +
5128"', 'Vice-City', 'Ninguem', '" + modelo.tointeger() + "', '" + x.tofloat() + "', '" + y.tofloat() + "', '" + z.tofloat() + "', '" + angulo.tofloat() +
5129"', '" + cor1.tointeger() + "', '" + cor2.tointeger() + "' )" );
5130CreateVehicle( modelo.tointeger(), 0, Vector( x.tofloat(), y.tofloat(), z.tofloat() ), angulo.tofloat(), cor1.tointeger(), cor2.tointeger() );
5131I_MSG("Vehicle Created.", player );
5132}
5133}
5134}
5135}
5136}
5137}
5138
5139else if ( cmd == "get" )
5140{
5141if ( level < 2 ) E_MSG( "You do not have access to this command.", player );
5142else if ( !player.IsSpawned ) E_MSG("Choose a skin to use this command.", player );
5143else if ( !text ) S_MSG( sintaxe + cmd + " <Nick/ID>", player );
5144else
5145{
5146local plr = GetPlayer( GetTok( text, " ", 1 ) );
5147if ( !plr ) E_MSG( "Unknown Player.", player );
5148else if ( !plr.IsSpawned ) E_MSG( plr.Name + " has not chosen a skin.", player );
5149else
5150{
5151plr.Pos = player.Pos;
5152MSG( "Admin " + player.Name + " pulled player " + plr.Name + "." );
5153}
5154}
5155}
5156
5157else if ( cmd == "agoto" )
5158{
5159if ( level < 3 ) E_MSG( "You do not have access to this command.", player );
5160else if ( !player.IsSpawned ) E_MSG("Choose a skin to use this command.", player );
5161else if ( !text ) S_MSG( sintaxe + cmd + " <Nick/ID>", player );
5162else
5163{
5164local plr = GetPlayer( GetTok( text, " ", 1 ) );
5165if ( !plr ) E_MSG( "Jugador Desconocido.", player );
5166else if ( !plr.IsSpawned ) E_MSG( plr.Name + " has not chosen a skin.", player );
5167else
5168{
5169player.Pos = plr.Pos;
5170I_MSG( "You teleport to the player " + plr.Name + ".", player );
5171I_MSG( "Admin " + player.Name + " teleported to you.", plr );
5172}
5173}
5174}
5175
5176 if(cmd=="vehicles")
5177{
5178MessagePlayer("total vehicles in server: "+GetVehicleCount(),player);
5179}
5180
5181else if ( cmd == "kick" )
5182{
5183if ( level < 5 ) E_MSG( "You do not have access to this command.", player );
5184else if ( !text ) S_MSG( sintaxe + cmd + " <Nick/ID> <Reason>", player );
5185else
5186{
5187local plr = GetPlayer( GetTok( text, " ", 1 ) );
5188if ( !plr ) E_MSG( "Jugador Desconocido.", player );
5189else if ( level < status[ plr.ID ].Level ) E_MSG( "You can not kick someone with bigger level than you.", player );
5190else
5191{
5192local motivo = GetTok( text, " ", 2 NumTok( text, " " ) );
5193if ( motivo == null ) motivo = "Ninguno";
5194Kick( player.Name, plr, motivo );
5195}
5196}
5197}
5198
5199else if ( cmd == "ban" )
5200{
5201if ( level < 5 ) E_MSG( "You can't access this command.", player );
5202else if ( !text ) S_MSG( sintaxe + cmd + " <Nick/ID> <Reason>", player );
5203else
5204{
5205local plr = GetPlayer( GetTok( text, " ", 1 ) );
5206if ( !plr ) E_MSG( "Unknown Player.", player );
5207else if ( level < status[ plr.ID ].Level ) E_MSG( "You can not ban an admin with a level higher than yours.", player );
5208else
5209{
5210local motivo = GetTok( text, " ", 2 NumTok( text, " " ) );
5211if ( motivo == null ) motivo = "Nenhum";
5212Ban( player.Name, plr, motivo );
5213}
5214}
5215}
5216
5217else if ( cmd == "unban" )
5218{
5219local q = QuerySQL(db, "SELECT * FROM Bans WHERE Nome='" + text + "'" );
5220if ( level < 6 ) E_MSG( "You can't access this command.", player );
5221else if ( !text ) S_MSG( sintaxe + cmd + " <Nick Completo>", player );
5222else if ( GetSQLColumnData( q, 0 ) != text ) E_MSG( text + " is not banned.", player );
5223else
5224{
5225QuerySQL( db, "DELETE FROM Bans WHERE Nome LIKE '" + text + "'" );
5226MSG( "Admin " + player.Name + " unbanned " + text + "." );
5227}
5228}
5229
5230else if ( cmd == "mappercmds" )
5231{
5232if ( level == 5 ) I_MSG( "(/)obj, objdel, objsave, mov, rot, gate.", player );
5233else if ( level == 6 ) I_MSG( "(/)obj, objdel, objsave, mov, rot, gate.", player );
5234else if ( level >= 7 ) I_MSG( "(/)obj, objdel, objsave, mov, rot, gate.", player );
5235
5236else E_MSG( "You do not have access to this command.", player );
5237}
5238
5239
5240//======================== Novos Comandos Admin ===================================
5241
5242
5243else if ( cmd == "anuncio" || cmd == "ann" )
5244{
5245 if ( level < 3 ) E_MSG( "You do not have access to this command.", player );
5246 else if ( !text ) S_MSG( sintaxe + cmd + " <Text>", player );
5247 else
5248 {
5249 AnnounceAll( text, 3 )
5250 }
5251}
5252
5253
5254else if ( cmd == "setspeed" )
5255 {
5256 if ( level < 3 ) E_MSG( "Voce nao tem acesso a este comando.", player );
5257 else if ( !text ) S_MSG( sintaxe + cmd + " <Value>", player );
5258 else SetGamespeed( text.tofloat() )
5259 }
5260
5261
5262else if ( cmd == "setskin" )
5263{
5264 if ( level < 5 ) E_MSG( "Voce nao tem acesso a este comando.", player )
5265 else if ( !text ) S_MSG( sintaxe + cmd + " <ID>", player );
5266 else
5267 if ( text && IsNum( text ) )
5268 {
5269 MessagePlayer( "[#ffffff][INFO] [#00ff00] Set the skin: " + GetSkinName( player.Skin ), player );
5270 player.Skin = text.tointeger();
5271 }
5272}
5273
5274else if ( cmd == "healall" )
5275{
5276if ( level < 5 ) E_MSG( "You do not have access to this command.", player )
5277else{
5278Message( "[#FFbb00]*** Admin " + player.Name+ " restored the lifes of all players!");
5279EchoMessage( "7**Admin " + player.Name+ " restored the lifes of all players!");
5280for (local i=0; i<GetMaxPlayers(); i++)
5281{
5282local p=FindPlayer(i);
5283if(p)
5284{
5285p.Health = 100.0;
5286}
5287}
5288}
5289}
5290
5291else if ( cmd == "hack" || cmd == "invencivel" )
5292{
5293 if ( level < 9 ) E_MSG( "You dont have acces to this command.", player )
5294 else
5295 {
5296 MessagePlayer("No one can kill you now.",player);
5297 player.Immunity = 31;
5298 }
5299}
5300
5301else if ( cmd == "removecar" || cmd == "deletecar" )
5302{
5303 if ( level < 9 ) E_MSG( "You do not have access to this command.", player )
5304 else
5305 {
5306 MessagePlayer("Carro removido com sucesso!",player);
5307 player.Vehicle.Remove() //You can use ".Remove()" too.
5308 }
5309}
5310
5311
5312
5313else if ( cmd == "setwep" )
5314{
5315if ( level < 5 ) E_MSG( "You do not have access to this command.", player )
5316else if ( !text ) S_MSG( sintaxe + cmd + " <Player Nick> <Weapon>", player );
5317else
5318{
5319local p = GetPlayer( GetTok( text, " ", 1 ) );
5320if ( !p ) MessagePlayer( "Error - jogador desconhecido.", player);
5321else
5322{
5323local arma = (GetTok( text," ", 2) );
5324if ( !arma ) MessagePlayer("Erro no comando. Use /Setwep <Player> <Weapon>",player);
5325else if ( !IsNum( arma ) ) MessagePlayer( "Error - Use Numbers.", player);
5326else
5327{
5328p.SetWeapon( arma.tointeger(), 1000);
5329Message("[#FFBB00]Admin " + player.Name + " gave weapon with ID [" + arma + "] to " + p.Name + ".");
5330}
5331}
5332}
5333}
5334
5335
5336
5337
5338 else if ( cmd == "killplayer" )
5339 {
5340 if ( level < 3 ) Message( "[#FF0000]Erro - Voce nao tem acesso a esse comando.", player );
5341 else if ( !text ) Message( "[#FF0000]Erro - /matar <Nick/ID> <Motivo>" );
5342 else
5343 {
5344 local plr = GetPlayer( GetTok( text, " ", 1 ) );
5345 if ( !plr ) Message( "[#FF0000]Erro - Jogador Desconhecido." );
5346 else
5347 {
5348 local msg = GetTok( text, " ", 2, NumTok( text, " " ) );
5349 if ( !msg ) Message( "[#FF0000]Reason?" );
5350 else
5351 {
5352 EchoMessage( "7** 7 Admin " + player.Name+ " Killed " + plr.Name + ". Reason: " + msg + " " );
5353 Message ( "[#FFbb00]** Admin " + player.Name+ " Killed " + plr.Name + ". Reason: " + msg + " " );
5354 plr.Pos = plr.Pos
5355 plr.Health = 0;
5356 }
5357 }
5358 }
5359 }
5360
5361else if ( cmd == "unban" )
5362{
5363local q = QuerySQL(db, "SELECT * FROM Bans WHERE Nome='" + text + "'" );
5364if ( level < 3 ) E_MSG( "You do not have access to this command.", player );
5365else if ( !text ) S_MSG( sintaxe + cmd + " <Nick Completo>", player );
5366else if ( GetSQLColumnData( q, 0 ) != text ) E_MSG( text + " nao esta banido.", player );
5367else
5368{
5369QuerySQL( db, "DELETE FROM Bans WHERE Nome LIKE '" + text + "'" );
5370MSG( "Admin " + player.Name + " desbaniu " + text + "." );
5371}
5372}
5373
5374else if ( cmd == "setpass" )
5375{
5376if ( level < 4 ) E_MSG( "You do not have access to this command.", player );
5377else if ( !text ) S_MSG( sintaxe + cmd + " <Nick/ID> <New Password>", player );
5378else
5379{
5380local plr = GetPlayer( GetTok( text, " ", 1 ) );
5381if ( !plr ) E_MSG( "Jogador Desconhecido.", player );
5382else if ( plr.ID == player.ID ) E_MSG( "Para mudar sua senha use /mudarsenha.", player );
5383else if ( Checar( player, plr ) ) return 0;
5384else
5385{
5386local senha = GetTok( text, " ", 2);
5387if ( !senha ) I_MSG( sintaxe + cmd + " <Nick/ID> <Nova Senha>", player );
5388else
5389{
5390local pass = e(senha);
5391QuerySQL( db, "UPDATE Contas SET Senha='" + pass + "' WHERE Nome='" + plr.Name + "'" );
5392I_MSG( "Voce mudou a senha de " + plr.Name + " para: " + senha, player );
5393I_MSG( "Admin " + player.Name + " mudou sua senha para: " + senha, plr );
5394}
5395}
5396}
5397}
5398
5399
5400else if ( cmd == "freeze" )
5401{
5402 if ( level < 4 ) E_MSG( "You do not have access to this command.", player );
5403else
5404{
5405if ( !text ) MessagePlayer( "Syntax, /" + cmd + " <Nick/ID> <Reason>", player );
5406else {
5407local plr = GetPlayer( GetTok( text, " ", 1 ) );
5408if ( !plr ) MessagePlayer( "[#FF0000]Unknown Player..", player );
5409else if ( plr.IsFrozen ) MessagePlayer( "[#FF0000]Player " + plr.Name + " is now Freezed", player );
5410else if ( !plr.IsSpawned ) MessagePlayer( "[#FF0000]Player hasn't spawned yet..", player );
5411else {
5412local reason = GetTok( text, " ", 2, NumTok( text, " " ) );
5413if ( reason == null ) reason = "None"
5414plr.IsFrozen = true;
5415Message( "[#FFbb00]** Admin " + player.Name + " Frozen " + plr.Name + " Reason: " + reason );
5416EchoMessage( "7** Admin " + player.Name + " Frozen " + plr.Name + " Reason: " + reason );
5417}
5418}
5419}
5420}
5421
5422else if ( cmd == "unfreeze" )
5423{
5424 if ( level < 4 ) E_MSG( "You do not have access to this command.", player );
5425else
5426{
5427if ( !text ) MessagePlayer( "[#FF0000]Syntax, /" + cmd + " <Nick/ID>", player );
5428else {
5429local plr = GetPlayer( GetTok( text, " ", 1 ) );
5430if ( !plr ) MessagePlayer( "[#FF0000]Unknown Player..", player );
5431else if ( !plr.IsFrozen ) MessagePlayer( "[#FF0000]" + plr.Name + " is now Unfreezed.", player);
5432else if ( !plr.IsSpawned ) MessagePlayer( "[#FF0000]The Player hasn't spawned yet..", player );
5433else {
5434plr.IsFrozen = false;
5435Message( "[#FFBB00]** Admin " + player + " Descongelou " + plr.Name );
5436EchoMessage( "7** Admin " + player + " Descongelou " + plr.Name );
5437}
5438}
5439}
5440}
5441
5442
5443else if ( cmd == "obj" )
5444{
5445if ( level < 5 ) E_MSG( "You do not have access to this command.", player )
5446else
5447if ( Map[ player.ID ] != null ) MessagePlayer( "[#FF0000]Erro: Voce ja criou um objeto.", player );
5448else if ( !player.IsSpawned ) MessagePlayer( "[#FF0000]Erro: Escolha uma skin para usar esse comando.", player );
5449else if ( !text ) MessagePlayer( "[#FFA500]Sintaxe: /" + cmd + " <Model>", player );
5450else if ( !IsNum( text ) ) MessagePlayer( "[#FF0000]Erro: Voce deve usar numeros no modelo.", player );
5451else
5452{
5453i_1PortaoPos[ player.ID ] = null;
5454i_1PortaoRot[ player.ID ] = null;
5455i_2PortaoPos[ player.ID ] = null;
5456i_2PortaoRot[ player.ID ] = null;
5457Map[ player.ID ] = CreateObject( text.tointeger(), player.World, player.Pos, 255 );
5458MessagePlayer( "[#00FF00]*** Object Created.", player );
5459}
5460}
5461
5462else if ( cmd == "objdel" )
5463{
5464if ( level < 5 ) E_MSG( "You do not have access to this command.", player )
5465else
5466if ( Map[ player.ID ] == null ) MessagePlayer( "[#FF0000]Erro: Voce nao criou um objeto.", player );
5467else
5468{
5469Map[ player.ID ].Delete();
5470Map[ player.ID ] = null;
5471MessagePlayer( "[#00FF00]*** Object Deleted.", player );
5472}
5473}
5474
5475else if ( cmd == "save" )
5476{
5477if ( level < 5 ) E_MSG( "You do not have access to this command.", player )
5478else
5479if ( Map[ player.ID ] == null ) MessagePlayer( "[#FF0000]Erro: Voce nao criou um objeto.", player );
5480else
5481{
5482local map = Map[ player.ID ];
5483local model = map.Model, pos = map.Pos, rot = map.RotationEuler, alpha = map.Alpha;
5484QuerySQL( db, "INSERT INTO Objects VALUES ( '" + model + "', '" + player.World + "', '" + pos.x + "', '" + pos.y + "', '" + pos.z + "', '" + alpha + "', '" + rot.x + "', '" + rot.y + "', '" + rot.z + "', '" + player.Name + "' )" );
5485Map[ player.ID ] = null;
5486MessagePlayer( "[#00FF00]*** Object Saved.", player );
5487}
5488}
5489
5490else if ( cmd == "mov" )
5491{
5492if ( level < 5 ) E_MSG( "You do not have access to this command.", player )
5493else
5494if ( Map[ player.ID ] == null ) MessagePlayer( "[#FF0000]Erro: Voce nao criou um objeto.", player );
5495else if ( !text ) MessagePlayer( "[#FFA500]Sintaxe: /" + cmd + " <x/y/z> <+/-> <Valor>", player );
5496else
5497{
5498local pos = GetTok( text, " ", 1 );
5499if ( !pos ) MessagePlayer( "[#FFA500]Sintaxe: /" + cmd + " <x/y/z> <+/-> <Valor>", player );
5500else if ( pos != "x" && pos != "y" && pos != "z" ) MessagePlayer( "[#FF0000]Erro: Use letras x/y/z.", player );
5501else
5502{
5503local sinal = GetTok( text, " ", 2 );
5504if ( !sinal ) MessagePlayer( "[#FFA500]Sintaxe: /" + cmd + " <x/y/z> <+/-> <Valor>", player );
5505else if ( sinal != "+" && sinal != "-" ) MessagePlayer( "[#FF0000]Erro: Use um sinal + ou -.", player );
5506else
5507{
5508local valor = GetTok( text, " ", 3 );
5509if ( !valor ) MessagePlayer( "[#FFA500]Sintaxe: /" + cmd + " <x/y/z> <+/-> <Valor>", player );
5510else if ( !IsNum( valor ) && !IsFloat( valor ) ) MessagePlayer( "[#FF0000]Erro: Use numeros no valor.", player );
5511else
5512{
5513local map = Map[ player.ID ];
5514if ( pos == "x" )
5515{
5516if ( sinal == "+" ) map.MoveTo( Vector( map.Pos.x + valor.tofloat(), map.Pos.y, map.Pos.z ), 1000 );
5517else if ( sinal == "-" ) map.MoveTo( Vector( map.Pos.x - valor.tofloat(), map.Pos.y, map.Pos.z ), 1000 );
5518}
5519else if ( pos == "y" )
5520{
5521if ( sinal == "+" ) map.MoveTo( Vector( map.Pos.x, map.Pos.y + valor.tofloat(), map.Pos.z ), 1000 );
5522else if ( sinal == "-" ) map.MoveTo( Vector( map.Pos.x, map.Pos.y - valor.tofloat(), map.Pos.z ), 1000 );
5523}
5524else if ( pos == "z" )
5525{
5526if ( sinal == "+" ) map.MoveTo( Vector( map.Pos.x, map.Pos.y, map.Pos.z + valor.tofloat() ), 1000 );
5527else if ( sinal == "-" ) map.MoveTo( Vector( map.Pos.x, map.Pos.y, map.Pos.z - valor.tofloat() ), 1000 );
5528}
5529MessagePlayer( "[#00FF00]*** Object Moved.", player );
5530}
5531}
5532}
5533}
5534}
5535
5536else if ( cmd == "rot" )
5537{
5538if ( level < 5 ) E_MSG( "You do not have access to this command.", player )
5539else
5540if ( Map[ player.ID ] == null ) MessagePlayer( "[#FF0000]Erro: Voce nao criou um objeto.", player );
5541else if ( !text ) MessagePlayer( "[#FFA500]Sintaxe: /" + cmd + " <x/y/z> <+/-> <Valor>", player );
5542else
5543{
5544local pos = GetTok( text, " ", 1 );
5545if ( !pos ) MessagePlayer( "[#FFA500]Sintaxe: /" + cmd + " <x/y/z> <+/-> <Valor>", player );
5546else if ( pos != "x" && pos != "y" && pos != "z" ) MessagePlayer( "[#FF0000]Erro: Use letras x/y/z.", player );
5547else
5548{
5549local sinal = GetTok( text, " ", 2 );
5550if ( !sinal ) MessagePlayer( "[#FFA500]Sintaxe: /" + cmd + " <x/y/z> <+/-> <Valor>", player );
5551else if ( sinal != "+" && sinal != "-" ) MessagePlayer( "[#FF0000]Erro: Use um sinal + ou -.", player );
5552else
5553{
5554local valor = GetTok( text, " ", 3 );
5555if ( !valor ) MessagePlayer( "[#FFA500]Sintaxe: /" + cmd + " <x/y/z> <+/-> <Valor>", player );
5556else if ( !IsNum( valor ) && !IsFloat( valor ) ) MessagePlayer( "[#FF0000]Erro: Use numeros no valor.", player );
5557else
5558{
5559local map = Map[ player.ID ];
5560if ( pos == "x" )
5561{
5562if ( sinal == "+" ) map.RotateToEuler( Vector( map.RotationEuler.x + valor.tofloat(), map.RotationEuler.y, map.RotationEuler.z ), 1000 );
5563else if ( sinal == "-" ) map.RotateToEuler( Vector( map.RotationEuler.x - valor.tofloat(), map.RotationEuler.y, map.RotationEuler.z ), 1000 );
5564}
5565else if ( pos == "y" )
5566{
5567if ( sinal == "+" ) map.RotateToEuler( Vector( map.RotationEuler.x, map.RotationEuler.y + valor.tofloat(), map.RotationEuler.z ), 1000 );
5568else if ( sinal == "-" ) map.RotateToEuler( Vector( map.RotationEuler.x, map.RotationEuler.y - valor.tofloat(), map.RotationEuler.z ), 1000 );
5569}
5570else if ( pos == "z" )
5571{
5572if ( sinal == "+" ) map.RotateToEuler( Vector( map.RotationEuler.x, map.RotationEuler.y, map.RotationEuler.z + valor.tofloat() ), 1000 );
5573else if ( sinal == "-" ) map.RotateToEuler( Vector( map.RotationEuler.x, map.RotationEuler.y, map.RotationEuler.z - valor.tofloat() ), 1000 );
5574}
5575MessagePlayer( "[#00FF00]*** Object Rotated.", player );
5576}
5577}
5578}
5579}
5580}
5581
5582else if ( cmd == "gate" )
5583{
5584if ( Map[ player.ID ] == null ) E_MSG( "You need to create an object before.", player );
5585else if ( !text ) S_MSG( "/" + cmd + " <Prop_ID> <start/end/save>", player );
5586else
5587{
5588local id = GetTok( text, " ", 1 );
5589if ( !id ) S_MSG( "/" + cmd + " <Casa_ID> <start/end/save>", player );
5590else if ( !IsNum( id ) ) MessagePlayer( "Use numbers or house ID.", player );
5591else if ( !FindProp( id.tointeger() ) ) E_MSG( "Property not found.", player );
5592else
5593{
5594local option = GetTok( text, " ", 2 );
5595if ( !option ) S_MSG( "/" + cmd + " <Casa_ID> <start/end/save>", player );
5596else if ( option.tolower() == "start" )
5597{
5598i_1PortaoPos[ player.ID ] = Vector( Map[ player.ID ].Pos.x, Map[ player.ID ].Pos.y, Map[ player.ID ].Pos.z );
5599i_1PortaoRot[ player.ID ] = Vector( Map[ player.ID ].RotationEuler.x, Map[ player.ID ].RotationEuler.y, Map[ player.ID ].RotationEuler.z );
5600I_MSG( "[#00FF00]*** This will be the start of the gate.", player );
5601}
5602else if ( option.tolower() == "end" )
5603{
5604i_2PortaoPos[ player.ID ] = Vector( Map[ player.ID ].Pos.x, Map[ player.ID ].Pos.y, Map[ player.ID ].Pos.z );
5605i_2PortaoRot[ player.ID ] = Vector( Map[ player.ID ].RotationEuler.x, Map[ player.ID ].RotationEuler.y, Map[ player.ID ].RotationEuler.z );
5606I_MSG( "[#00FF00]*** This will be the end of the gate.", player );
5607}
5608else if ( option.tolower() == "save" )
5609{
5610if ( i_1PortaoPos[ player.ID ] == null || i_2PortaoPos[ player.ID ] == null ) E_MSG( "You must select a start and end point to save the gate.", player );
5611else
5612{
5613local model = Map[ player.ID ].Model,
5614pos1 = i_1PortaoPos[ player.ID ].x + " " + i_1PortaoPos[ player.ID ].y + " " + i_1PortaoPos[ player.ID ].z,
5615rot1 = i_1PortaoRot[ player.ID ].x + " " + i_1PortaoRot[ player.ID ].y + " " + i_1PortaoRot[ player.ID ].z,
5616pos2 = i_2PortaoPos[ player.ID ].x + " " + i_2PortaoPos[ player.ID ].y + " " + i_2PortaoPos[ player.ID ].z,
5617rot2 = i_2PortaoRot[ player.ID ].x + " " + i_2PortaoRot[ player.ID ].y + " " + i_2PortaoRot[ player.ID ].z;
5618QuerySQL( db, "INSERT INTO Portoes VALUES ( '" + id.tointeger() + "', '" + model + "', '" + pos1 + "', '" + rot1 + "', '" + pos2 + "', '" + rot2 + "' )" );
5619Portao.push({ Objeto = Map[ player.ID ], ID = id.tointeger(), Pos1 = i_1PortaoPos[ player.ID ], Rot1 = i_1PortaoRot[ player.ID ], Pos2 = i_2PortaoPos[ player.ID ], Rot2 = i_2PortaoRot[ player.ID ], Trancado = true });
5620Map[ player.ID ].Pos = i_1PortaoPos[ player.ID ];
5621Map[ player.ID ].RotateToEuler( i_1PortaoRot[ player.ID ], 0 );
5622i_1PortaoPos[ player.ID ] = null;
5623i_1PortaoRot[ player.ID ] = null;
5624i_2PortaoPos[ player.ID ] = null;
5625i_2PortaoRot[ player.ID ] = null;
5626Map[ player.ID ] = null;
5627I_MSG( "Gate installed successfully in the house: " + id + ".", player );
5628}
5629}
5630else S_MSG( "/" + cmd + " <Casa_ID> <start/end/save>", player );
5631}
5632}
5633}
5634
5635else if ( cmd == "setpass" )
5636{
5637if ( level < 5 ) E_MSG( "Usted no tiene acceso a este comando.", player );
5638else if ( !text ) S_MSG( sintaxe + cmd + " <Nick/ID> <New Password>", player );
5639else
5640{
5641local plr = GetPlayer( GetTok( text, " ", 1 ) );
5642if ( !plr ) E_MSG( "Jugador Desconocido.", player );
5643else if ( plr.ID == player.ID ) E_MSG( "To change your password use /changepass.", player );
5644else if ( status[ plr.ID ].Registrado == false ) E_MSG( plr.Name + " [#cccccc]is not registred.", player );
5645else
5646{
5647local senha = GetTok( text, " ", 2);
5648if ( !senha ) I_MSG( sintaxe + cmd + " <Nick/ID> <New Password>", player );
5649else
5650{
5651local pass = e(contrasenia);
5652QuerySQL( db, "UPDATE Contas SET Senha='" + pass + "' WHERE Nome='" + plr.Name + "'" );
5653I_MSG( "Usted cambio la contrasenia de " + plr.Name + " para: " + senha, player );
5654I_MSG( "Admin " + player.Name + " changed your password to: " + senha, plr );
5655}
5656}
5657}
5658}
5659
5660else MessagePlayer( "", player );
5661}