This repository has been archived by the owner on Jun 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
VSS-Server.nut
2008 lines (1912 loc) · 72.4 KB
/
VSS-Server.nut
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*---------------------------------------------------------------------------------------------------------------------------------------------------------
Vice Super Stunt
----------------------------------------------------------------------------------------------------------------------------------------------------------*/
const ScriptName = "Vice Super Stunt";
const Creator = "JaVeD";
const Mode = "DM-Stunt-Race-RP-Freeroam";
const Version = "v-0.1 ";
const Credits = "JaVeD";
const NameServer = "Vice Super Stunt > Vcmp.RPGKillerS.Com <";
const ICOL_WHITE = "\x000300";
const ICOL_BLACK = "\x000301";
const ICOL_BLUE = "\x000302";
const ICOL_GREEN = "\x000303";
const ICOL_RED = "\x000304";
const ICOL_BROWN = "\x000305";
const ICOL_PURPLE = "\x000306";
const ICOL_ORANGE = "\x000307";
const ICOL_YELLOW = "\x000308";
const ICOL_LGREEN = "\x000309";
const ICOL_CYAN = "\x000310";
const ICOL_LCYAN = "\x000311";
const ICOL_LBLUE = "\x000312";
const ICOL_PINK = "\x000313";
const ICOL_GREY = "\x000314";
const ICOL_LGREY = "\x000315";
const ICOL = "\x0003";
const ICOL_BOLD = "\x0002";
const ICOL_ULINE = "\x0031";
class PlayerStats
{
User = null;
Password = null;
Admin = 0;
VIP = 0;
Kills = 0;
Deaths = 0;
Stunt = 0;
Drift = 0;
Hours = 0;
Minutes = 0;
Seconds = 0;
Respect = 0;
UnRespect = 0;
Cash = 0;
BankCash = 0;
Coins = 0;
Score = 0;
BestSpree = 0;
Joins = 0;
PlayerIP = null;
LastDate = null;
RegDate = null;
Bans = 0;
Kicks = 0;
Jails = 0;
Mutes = 0;
Warns = 0;
Spree = 0;
Muted = false;
MuteTime = 0;
MuteRem = 0;
AutoMute = false;
AutoMuteCount = 60;
SCounter = 0;
STimer = 0;
PTextCount = 0;
PText = null;
SandL = null;
Registered = false;
Logged = false;
FirstSpawned = false;
Warned = false;
Warnings = 0;
Jailed = false;
JailTime = 0;
Attemps = 0;
Process = false;
Leave = false;
AntiHPHack = false;
GodMode = false;
GodCar = false;
IgnorePM = false;
IgnoreGoto = false;
IgnoreSpec = false;
IgnoreDuel = false;
constructor( szPlayerName )
{
local
PlayerQuery = ::QuerySQL( db, "SELECT Name, Pass, Admin, VIP, Kills, Deaths, Stunt, Drift, Hours, Minutes, Seconds, Respect, UnRespect, Cash, BankCash, Coins, Score, BestSpree, Joins, IP, LastDate, RegDate FROM Accounts WHERE Name='" + szPlayerName + "'" ),
AdminQuery = ::QuerySQL( db, "SELECT Bans, Kicks, Jails, Mutes, Warns FROM AdminStats WHERE Name='" + szPlayerName + "'" );
if ( ::GetSQLColumnData( PlayerQuery, 0 ) != null )
{
User = ::GetSQLColumnData( PlayerQuery, 0 );
Password = ::GetSQLColumnData( PlayerQuery, 1 );
Admin = ::GetSQLColumnData( PlayerQuery, 2 );
VIP = ::GetSQLColumnData( PlayerQuery, 3 );
Kills = ::GetSQLColumnData( PlayerQuery, 4 );
Deaths = ::GetSQLColumnData( PlayerQuery, 5 );
Stunt = ::GetSQLColumnData( PlayerQuery, 6 );
Drift = ::GetSQLColumnData( PlayerQuery, 7 );
Hours = ::GetSQLColumnData( PlayerQuery, 8 );
Minutes = ::GetSQLColumnData( PlayerQuery, 9 );
Seconds = ::GetSQLColumnData( PlayerQuery, 10 );
Respect = ::GetSQLColumnData( PlayerQuery, 11 );
UnRespect = ::GetSQLColumnData( PlayerQuery, 12 );
Cash = ::GetSQLColumnData( PlayerQuery, 13 );
BankCash = ::GetSQLColumnData( PlayerQuery, 14 );
Coins = ::GetSQLColumnData( PlayerQuery, 15 );
Score = ::GetSQLColumnData( PlayerQuery, 16 );
BestSpree = ::GetSQLColumnData( PlayerQuery, 17 );
Joins = ::GetSQLColumnData( PlayerQuery, 18 );
PlayerIP = ::GetSQLColumnData( PlayerQuery, 19 );
LastDate = ::GetSQLColumnData( PlayerQuery, 20 );
RegDate = ::GetSQLColumnData( PlayerQuery, 21 );
}
::FreeSQLQuery( PlayerQuery );
if ( Admin >=1 )
{
if ( ::GetSQLColumnData( AdminQuery, 0 ) != null )
{
Bans = ::GetSQLColumnData( AdminQuery, 0 );
Kicks = ::GetSQLColumnData( AdminQuery, 1 );
Jails = ::GetSQLColumnData( AdminQuery, 2 );
Mutes = ::GetSQLColumnData( AdminQuery, 3 );
Warns = ::GetSQLColumnData( AdminQuery, 4 );
}
::FreeSQLQuery( AdminQuery );
}
}
function RegisterPlayer( pPlayer, szPass )
{
local
RegisterQuery = format( "INSERT INTO Accounts ( Name, Pass, Admin, VIP, Kills, Deaths, Stunt, Drift, Hours, Minutes, Seconds, Respect, UnRespect, Cash, BankCash, Coins, Score, BestSpree, Joins, IP, LastDate, RegDate ) VALUES( '" + pPlayer.Name + "', '" + ::SHA256( szPass ) + "', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, '" + pPlayer.IP + "', '" + ::GetFullTime() + "', '" + ::GetFullTime() + "' )" );
::QuerySQL( db, RegisterQuery );
}
function SaveStats( pPlayer )
{
if ( Logged == true )
{
local
SavePStats = format("UPDATE Accounts SET Name='%s', Pass='%s', Admin='%i', VIP='%i', Kills='%i', Deaths='%i', Stunt='%i', Drift='%i', Hours='%i', Minutes='%i', Seconds='%i', Respect='%i', UnRespect='%i', Cash='%i', BankCash='%i', Coins='%i', Score='%i', BestSpree='%i', Joins='%i', IP='%s', LastDate='%s' WHERE Name='%s'",
User, Password, Admin, VIP, Kills, Deaths, Stunt, Drift, Hours, Minutes, Seconds, Respect, UnRespect, Cash, BankCash, Coins, Score, BestSpree, Joins+=1, pPlayer.IP, ::GetFullTime(), pPlayer.Name );
::QuerySQL( db, SavePStats );
::print( pPlayer.Name + "'s Stats Saved User [" + User + "] Admin [" + Admin + "] VIP [" + VIP + "] Kills [" + Kills + "], Deaths [" + Deaths + "], Stunt [" + Stunt + "], Drift [" + Drift + "], Hours[" + Hours + "], Minutes [" + Minutes + "], Second [" + Seconds + "], Respect [" + Respect + "], UnRespect [" + UnRespect + "], Cash [" + Cash + "], BankCash [" + BankCash + "], Coins [" + Coins + "], Score [" + Score + "], BestSpree [" + BestSpree + "], Joins [" + Joins + "], IP [" + pPlayer.IP + "], LastDate [" + GetFullTime() + "]" );
if ( Admin >= 1 )
{
local
SaveAStats = format("UPDATE AdminStats SET Bans='%i', Kicks='%i', Jails='%i', Mutes='%i', Warns='%i' WHERE Name='%s'",
Bans, Kicks, Jails, Mutes, Warns, pPlayer.Name );
if ( AdminStats.find( pPlayer.Name ) != null ) ::QuerySQL( db, SaveAStats );
else return ::QuerySQL( db, "INSERT INTO AdminStats ( Name, Bans, Kicks, Jails, Mutes, Warns ) VALUES ( '" + pPlayer.Name + "', " + Bans + ", " + Kicks + ", " + Jails + ", " + Mutes + ", " + Warns + " )");
::print( pPlayer.Name + "'s Admin Stats Saved Bans [" + Bans + "] Kicks [" + Kicks + "] Jails [" + Jails + "], Mutes [" + Mutes + "], Warns [" + Warns + "] ");
}
}
}
}
ServerNames <-
[
"Beta Testing -> [r2] Vice Super Stunt [r2]",
"Beta Testing -> Vice Super Stunt > 24/7 <",
"Beta Testing -> Vice Super Stunt > GangWars <",
"Beta Testing -> Vice Super Stunt > Drifts <",
"Beta Testing -> Vice Super Stunt > Stunts <",
"Beta Testing -> Vice Super Stunt > Clans <"
];
RandomColors <-
[
[255,255,255], [0,128,128],
[255, 0, 0], [0,0,128],
[0,255,0], [107,142,35],
[0,0,255], [0,255,127],
[255, 255, 0], [0,191,255],
[0,255,255], [106,90,205],
[255,0,255], [238,130,238],
[192,192,192], [255,235,205],
[128,128,128], [244,164,96],
[128,0,0], [176,196,222],
[128,128,0], [224,255,255],
[0,128,0], [128,0,128]
];
RandomMessages <-
[
"Visit us at comming soon :D ",
"Don't Forget to Add this server in Favorites List.",
"Saw a Cheater/Rule Breaker ? do /C Report to Report him.",
"All commands works with (/c) try /c commands, /c help & /c teles",
"You can use /c tops to view top Players and Top Clans.",
"Want to buy VIP ? So try /c buyvip to buy VIP.",
"Want to Create your own Clan ? use /c createclan to do.",
"/c changename & /c changepass to change your name and password.",
"want to know about vip and clan commands ? /c vcmds & clancmds.",
"want to view your Stats or admin Stats ? do /c Stats & /c aStats.",
"NEW SYSTEM: Press LShif to Fix your Car & Space to Flip Your Car!",
"This Server is Protected with JaVeD's Anti-Lag Killing Module!",
"This is Beta Testing Server Hosted By JaVeD",
"Press Fire Button in Vehicle to Up Your Vehicle!",
"Our Complete VSS Version 2 Will come soon :) hope you guys will like!"
];
RandomSpawns <-
[
Vector(217.5168, -417.7297, 10.6972),
Vector(135.3318, -381.5050, 9.8172),
Vector(126.7571, -350.6836, 17.9003),
Vector(82.2338, -385.2808, 9.0851),
Vector(96.6425, -372.7224, 8.7866),
Vector(126.2449, -429.1601, 12.1850),
Vector(157.2513, -412.4132, 8.8048),
Vector(201.8346, -403.9304, 11.0602),
Vector(177.8684, -371.6416, 8.1068),
Vector(149.8020, -358.9100, 8.6707)
];
WarSpawns <-
[
];
MinigunSpawns <-
[
];
OHSpawns <-
[
];
SDMSpawns <-
[
Vector(-679.0595, 1272.3608, 10.8171),
Vector(-651.8962, 1267.5492, 10.8171),
Vector(-656.5438, 1275.8749, 10.8171),
Vector(-661.8282, 1290.5323, 10.8171),
Vector(-674.6853, 1285.2823, 10.8171),
Vector(-680.5518, 1267.5657, 10.8171),
Vector(-661.4938, 1264.3759, 10.8171),
Vector(-670.2382, 1292.8120, 10.8171)
];
SniperSpawns <-
[
Vector(-706.8302, -1626.2749, 31.1671),
Vector(-691.2640, -1613.0621, 32.6164),
Vector(-719.9144, -1606.0313, 23.8581),
Vector(-759.0250, -1613.5568, 23.7350),
Vector(-797.4974, -1578.6960, 23.8581),
Vector(-826.2145, -1576.7120, 28.4827),
Vector(-805.3470, -1575.5330, 28.4827)
];
AdminStats <- [ ];
Rcons <- [ ];
Locked <- [ ];
BannedNames <- [ ];
Bans <- [ ];
IPBans <- [ ];
Locations <- [ ];
Reports <- [ ];
Stats <- array( GetMaxPlayers() );
Timer <- 0;
Event <- false;
EventTime <- 0;
EventReward <- 0;
function onScriptLoad()
{
try
{
LoadModule("vcmp");
//LoadModule("VCMP");
//LoadModule("sq_vcmp");
//LoadModule("vcmp-game");
LoadModule("sq_hashing");
LoadModule("lu_hashing2");
LoadModule("sq_ini");
LoadModule("sq_lite");
//LoadModule("sq_json");
LoadModule("sq_geoip");
Print("-------------\x5 Vice Super Stunt \x5----------");
Print(" ");
Print(" >> Script Name <<");
Print(" " + ScriptName);
Print(" >> Script Creator <<");
Print(" " + Creator);
Print(" ");
Print("-----------------------------------------------");
Print(" Scripts And Databases! ");
Print("-----------------------------------------------");
Print("[Loaded] - VSS-Server Functions.");
dofile("VSS-Functions.JaVeD");
Print("[Loaded] - VSS-Server Commands.");
dofile("VSS-Commands.JaVeD");
Print("[Loading] - VSS-Server IRC-Echo");
dofile("VSS-Echo.JaVeD");
ActivateEcho();
db <- ConnectSQL("DataBase.db");
local DBQuery =
QuerySQL( db, "CREATE TABLE IF NOT EXISTS Accounts ( Name VARCHAR(32), Pass VARCHAR(32), Admin INT, VIP INT, Kills INT, Deaths INT, Stunt INT, Drift INT, Hours INT, Minutes INT, Seconds INT, Respect INT, UnRespect INT, Cash INT, BankCash INT, Coins INT, Score INT, BestSpree INT, Joins INT, IP VARCHAR(32), LastDate VARCHAR(32), RegDate VARCHAR(32) )")
QuerySQL( db, "CREATE TABLE IF NOT EXISTS AdminStats ( Name VARCHAR(32), Bans INT, Kicks INT, Jails INT, Mutes INT, Warns INT )")
QuerySQL( db, "CREATE TABLE IF NOT EXISTS RCON ( Name VARCHAR(32) )")
QuerySQL( db, "CREATE TABLE IF NOT EXISTS Locked ( Name VARCHAR(32) )")
QuerySQL( db, "CREATE TABLE IF NOT EXISTS BannedNames ( Name VARCHAR(32) )")
QuerySQL( db, "CREATE TABLE IF NOT EXISTS Bans ( Name VARCHAR(32), IP VARCHAR(32), Admin VARCHAR(32), Days VARCHAR(32), Reason VARCHAR(32), Date VARCHAR(32), IPBan VARCHAR(32), SubnetBan VARCHAR(32) )")
QuerySQL( db, "CREATE TABLE IF NOT EXISTS Locations ( Name VARCHAR(32), Position VARCHAR(32) )")
QuerySQL( db, "CREATE TABLE IF NOT EXISTS CmdLevels ( ACmd VARCHAR(32), ACmdLevel VARCHAR(32), VCmd VARCHAR(32), VCmdLevel VARCHAR(32) )")
QuerySQL( db, "CREATE TABLE IF NOT EXISTS VSSGangs ( Gang TEXT, Points NUMERIC, Kills NUMERIC, Deaths NUMERIC, Captures NUMERIC, Members NUMERIC, Owner TEXT, CPos VARCHAR(25), Color NUMERIC, Skin NUMERIC, Spawn VARCHAR(25), Wep1 NUMERIC, Wep2 NUMERIC, Wep3 NUMERIC, Wep4 NUMERIC, Wep5 NUMERIC, Wep6 NUMERIC, Info1 TEXT, Info2 TEXT, Info3 TEXT, Info4 TEXT, Info5 TEXT, Info6 TEXT, Info7 TEXT )")
QuerySQL( db, "CREATE TABLE IF NOT EXISTS VSSMembers ( Name TEXT, Gang TEXT, Rank TEXT, GPoints NUMERIC, GKills NUMERIC, GCaptures NUMERIC, GSkin NUMERIC )")
QuerySQL( db, "CREATE TABLE IF NOT EXISTS VSSClans ( CTag TEXT, CName TEXT, CKills NUMERIC, CMembers NUMERIC, COwner TEXT, CSkin NUMERIC, CSpawn VARCHAR(25), CColor NUMERIC, CWeps NUMERIC, CInfo TEXT )")
QuerySQL( db, "CREATE TABLE IF NOT EXISTS VSSCMembers ( CTag TEXT, CName TEXT, CKills, CRank TEXT )");
FreeSQLQuery( DBQuery );
Print("[Connected] -> Database attached to the server.");
Print("[Connected] -> Gang & Clan System by JaVeD Connected!");
local
AdminStatsQuery = QuerySQL( db, "SELECT Name FROM AdminStats"),
RconQuery = QuerySQL( db, "SELECT Name FROM RCON"),
LockedQuery = QuerySQL( db, "SELECT Name FROM Locked"),
BannedNamesQuery = QuerySQL( db, "SELECT Name FROM BannedNames"),
BansQuery = QuerySQL( db, "SELECT Name FROM Bans"),
IPBansQuery = QuerySQL( db, "SELECT IPBan FROM Bans"),
LocationsQuery = QuerySQL( db, "SELECT Name FROM Locations"),
CmdLevelsQuery = QuerySQL( db, "SELECT ACmd, ACmdLevel, VCmd, VCmdLevel FROM CmdLevels");
while
(
GetSQLColumnData ( RconQuery, 0 ) || GetSQLColumnData ( BannedNamesQuery, 0 ) ||
GetSQLColumnData ( LocationsQuery, 0 ) || GetSQLColumnData ( AdminStatsQuery, 0 ) ||
GetSQLColumnData ( LockedQuery, 0 ) || GetSQLColumnData ( BansQuery, 0 ) ||
GetSQLColumnData ( IPBansQuery, 0 )
)
{
AdminStats.push( GetSQLColumnData( AdminStatsQuery, 0 ) );
GetSQLNextRow( AdminStatsQuery );
Rcons.push( GetSQLColumnData( RconQuery, 0 ) );
GetSQLNextRow( RconQuery );
Locked.push( GetSQLColumnData( LockedQuery, 0 ) );
GetSQLNextRow( LockedQuery );
BannedNames.push( GetSQLColumnData( BannedNamesQuery, 0 ) );
GetSQLNextRow( BannedNamesQuery );
Bans.push( GetSQLColumnData( BansQuery, 0 ) );
GetSQLNextRow( BansQuery );
IPBans.push( GetSQLColumnData( IPBansQuery, 0 ) );
GetSQLNextRow( IPBansQuery );
Locations.push( GetSQLColumnData( LocationsQuery, 0 ) );
GetSQLNextRow( LocationsQuery );
}
FreeSQLQuery( AdminStatsQuery );
FreeSQLQuery( RconQuery );
FreeSQLQuery( LockedQuery );
FreeSQLQuery( BannedNamesQuery );
FreeSQLQuery( LocationsQuery );
NewTimer("TheTimer", 1000, 0 );
Print("Vehicles - [ " + GetVehicleCount() + " ] Pickups - [ " + GetPickupCount() + " ]");
Print(" ");
Print("-------------> \x3 Vice Super Stunt \x3 <----------");
local
Player_Count = GetPlayers(),
pPlayer;
if ( !Player_Count ) return;
for ( local PlayerID = 0, PlayerCount = 0; PlayerID < GetMaxPlayers() && PlayerCount < Player_Count; PlayerID++ )
{
if ( !( pPlayer = FindPlayer( PlayerID ) ) ) continue;
PlayerCount++;
onPlayerJoin( pPlayer );
SetCinematicBorder( pPlayer, false );
AnnounceAll(" ");
}
}
catch(e) Print("Error " + e );
}
function onScriptUnload()
{
try
{
if( db )
{
SaveAllStats();
DisconnectSQL( db );
db = null;
}
DisconnectBots();
Print("------> Script UnLoaded <-------");
}
catch(e) Print("Error " + e );
}
function onServerStart()
{
try
{
SetWeatherLock( true );
Print("|--------------------------------------------------------------|");
Print("|--------------------------------------------------------------|");
Print("| |");
Print("| \x1\x1\x1\x1 \x1\x1\x1\x1 \x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1 \x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1 |");
Print("| \x1\x1\x1\x1 \x1\x1\x1\x1 \x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1 \x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1 |");
Print("| \x1\x1\x1\x1 \x1\x1\x1\x1 \x1\x1\x1\x1 \x1\x1\x1\x1 |");
Print("| \x1\x1\x1\x1 \x1\x1\x1\x1 \x1\x1\x1\x1 \x1\x1\x1\x1 |");
Print("| \x1\x1\x1\x1 \x1\x1\x1\x1 \x1\x1\x1\x1 \x1\x1\x1\x1 |");
Print("| \x1\x1\x1\x1 \x1\x1\x1\x1 \x1\x1\x1\x1\x1\x1\x1\x1 \x1\x1\x1\x1\x1\x1\x1 |");
Print("| \x1\x1\x1\x1 \x1\x1\x1\x1 \x1\x1\x1\x1\x1\x1\x1\x1 \x1\x1\x1\x1\x1\x1\x1 |");
Print("| \x1\x1\x1\x1 \x1\x1\x1\x1 \x1\x1\x1\x1 \x1\x1\x1\x1 |");
Print("| \x1\x1\x1\x1\x1\x1\x1\x1 \x1\x1\x1\x1 \x1\x1\x1\x1 |");
Print("| \x1\x1\x1\x1\x1\x1 \x1\x1\x1\x1 \x1\x1\x1\x1 |");
Print("| \x1\x1\x1\x1 \x1\x1\x1\x1\x1\x1\x1\x1\x1\x1 \x1\x1\x1\x1\x1\x1\x1\x1\x1\x1 |");
Print("| \x1\x1 \x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1 \x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1 |");
Print("| |");
Print("| ----Vice Super Stunt---- |");
Print("| By |");
Print("| @JaVeD |");
Print("|--------------------------------------------------------------|");
Print("|--------------------------------------------------------------|");
Print(" Server Started on " + GetFullTime() );
}
catch(e) Print("Error " + e );
}
function onPlayerJoin( pPlayer )
{
try
{
MPCVO( pPlayer );
local
Country = geoip_country_name_by_addr( pPlayer.IP );
Stats[ pPlayer.ID ] = PlayerStats( pPlayer.Name );
pPlayer.IsMuted = true;
SetCinematicBorder( pPlayer, true );
Announce("\x10 \x10 \x10 \x10 \x10 ~y~ Welcome" pPlayer );
ClientMessage("Welcome to Vice Super Stunt, " + pPlayer.Name + "!" pPlayer 255, 0, 0 );
EchoMessage( ICOL_BOLD+ICOL_GREY+ "[" + pPlayer.ID + "] " + pPlayer.Name + " has joined the server.");
if ( Country != null) MessageAllExcept( pPlayer.Name + " Is Connecting From " + Country + ". " pPlayer );
else MessageAllExcept( pPlayer.Name + " Is Connecting From Unkown." pPlayer );
if ( ( IsNum( pPlayer.Name ) ) || ( pPlayer.Name.len() < 3 ) || ( pPlayer.Name.find("'")!=null ) || ( BannedNames.find( pPlayer.Name.tolower() ) != null ) )
{
if ( IsNum( pPlayer.Name ) ) MessagePlayer("VSS-Buster > Your Name Cannot be only numbers!" pPlayer );
else if ( pPlayer.Name.len() < 3 ) MessagePlayer("VSS-Buster > Your Name is Less then 3 Characters!" pPlayer );
else if ( pPlayer.Name.find("'")!=null ) MessagePlayer("VSS-Buster > Your Name Can't Contain Character [ ' ]." pPlayer );
else if ( BannedNames.find( pPlayer.Name.tolower() ) != null ) MessagePlayer("VSS-Buster > Your Name is Blocked!" pPlayer );
MessageAllExcept("VSS-Buster -> Kicked ''" + pPlayer.Name + "'' (Invalid-Nick) " pPlayer );
KickPlayer( pPlayer );
return;
}
if ( IPBans.find( pPlayer.IP ) != null )
{
local IPBan = QuerySQL( db, "SELECT Name, Days, Reason, Date, IPBan FROM Bans WHERE IPBan ='" + pPlayer.IP + "'");
SetCinematicBorder( pPlayer, false );
MessagePlayer(" " pPlayer);
MessagePlayer(" " pPlayer);
MessagePlayer(" " pPlayer);
MessagePlayer(" " pPlayer);
MessagePlayer(" " pPlayer);
ClientMessage("You've been IP-Banned from the Server on " + GetSQLColumnData(IPBan,3) + " for " + GetSQLColumnData(IPBan,1) + " Days for Reason: " + GetSQLColumnData(IPBan,2) + " " pPlayer 255, 255, 0 );
ClientMessage("Make an UnBan Appeal at Vcmp.RPGKillers.Com with " pPlayer 255, 255, 0 );
ClientMessage("Name: " + GetSQLColumnData(IPBan,0 ) + " IP: " + GetSQLColumnData(IPBan,4) + " " pPlayer 255, 255, 0 );
MessageAllExcept("VSS-Buster -> Kicked ''" + pPlayer.Name + "'' (Banned) " pPlayer);
FreeSQLQuery( IPBan );
KickPlayer( pPlayer );
return;
}
else if ( Bans.find( pPlayer.Name ) != null )
{
local Ban = QuerySQL( db, "SELECT IP, Days, Reason, Date FROM Bans WHERE Name ='" + pPlayer.Name + "'");
SetCinematicBorder( pPlayer, false );
MessagePlayer(" " pPlayer);
MessagePlayer(" " pPlayer);
MessagePlayer(" " pPlayer);
MessagePlayer(" " pPlayer);
MessagePlayer(" " pPlayer);
ClientMessage("You've been Banned from the Server on " + GetSQLColumnData(Ban,3) + " for " + GetSQLColumnData(Ban,1) + " Days for Reason: " + GetSQLColumnData(Ban,2) + " " pPlayer 255, 255, 0 );
ClientMessage("Make an UnBan Appeal at Vcmp.RPGKillers.Com with " pPlayer 255, 255, 0 );
ClientMessage("Name: " + pPlayer.Name + " IP: " + GetSQLColumnData(Ban,0 ) + " " pPlayer 255, 255, 0 );
MessageAllExcept("VSS-Buster -> Kicked ''" + pPlayer.Name + "'' (IP-Banned) " pPlayer);
FreeSQLQuery( Ban );
KickPlayer( pPlayer );
return;
}
else if ( Rcons.find( pPlayer.Name ) != null );
else if ( Locked.find( pPlayer.Name ) != null )
{
MessagePlayer(" " pPlayer);
MessagePlayer(" " pPlayer);
MessagePlayer(" " pPlayer);
MessagePlayer(" " pPlayer);
MessagePlayer(" " pPlayer);
MessagePlayer("-----> Account Locked! <-----" pPlayer);
ClientMessage("There was a database problem recently and you got admin level." pPlayer 255, 255, 0 );
ClientMessage("Contact [email protected] to get back your account!" pPlayer 255, 255, 0 );
MessageAllExcept("VSS-Buster -> Kicked ''" + pPlayer.Name + "'' (Acc-Locked!) " pPlayer );
KickPlayer( pPlayer );
return;
}
if ( Stats[ pPlayer.ID ].User == pPlayer.Name )
{
Stats[ pPlayer.ID ].Registered = true;
if ( Stats[ pPlayer.ID ].PlayerIP == pPlayer.IP )
{
pPlayer.IsFrozen = false;
Stats[ pPlayer.ID ].Logged = true;
pPlayer.Cash = Stats[ pPlayer.ID ].Cash;
pPlayer.Score = Stats[ pPlayer.ID ].Score;
PrivMessage("Successfully Auto Logged-in!" pPlayer );
PrivMessage("Nick: " + pPlayer.Name + ", Admin:[ " + Stats[ pPlayer.ID ].Admin + " ], VIP:[ " + Stats[ pPlayer.ID ].VIP + " ]" pPlayer );
}
else PrivMessage("USE: /C Login <Password> to Login in your Account!" pPlayer );
}
else PrivMessage("USE: /C Register <Password> To Register This Nick in our Database." pPlayer );
}
catch(e) Print("Error " + e );
}
function onPlayerRequestClass( pPlayer, szID, szTeam, szSkin )
{
try
{
SetCinematicBorder( pPlayer, false );
local Skin = "Unknown";
switch ( pPlayer.Skin )
{
case 29: case 94: case 68:
Skin = "~b~Stunter";
break;
case 73: case 83: case 86:
Skin = "~y~Killer";
break;
case 62: case 7: case 15:
Skin = "~t~Drifter";
break;
case 9: case 67: case 49:
Skin = "~p~Girl";
break;
case 4: case 1: case 2:
Skin = "~w~Cop";
break;
case 102:
Skin = "~o~VIP";
break;
case 101:
Skin = "~x~Admin";
break;
case 34:
Skin = "~q~RCON";
break;
}
Announce("\x10 \x10 \x10 \x10 \x10 " + Skin, pPlayer );
}
catch(e) Print("Error " + e );
}
function onPlayerSpawn( pPlayer )
{
try
{
if ( Stats[ pPlayer.ID ].Registered == true )
{
if ( Stats[ pPlayer.ID ].Logged == true )
{
if ( CheckMember( pPlayer ) )
{
local spawnPos = split( Getdbpawn( pPlayer ), " ");
pPlayer.Skin = Getdbkin( pPlayer );
pPlayer.Team = GetGangColor( pPlayer );
pPlayer.Pos = Vector( spawnPos[0].tofloat(), spawnPos[1].tofloat(), spawnPos[2].tofloat() );
}
else
{
pPlayer.Team = rand() % 16;
pPlayer.Pos = RandomSpawns[ rand() % RandomSpawns.len() ];
}
Announce("" pPlayer );
Message(">> " + pPlayer + " has Spawned in " + GetDistrictName( pPlayer.Pos.x, pPlayer.Pos.y ) + " Clan: " + ClanChecker( pPlayer ) + ". ");
pPlayer.IsMuted = false;
pPlayer.Cash = Stats[ pPlayer.ID ].Cash;
Stats[ pPlayer.ID ].FirstSpawned = true;
Stats[ pPlayer.ID ].AntiHPHack = true;
ArmourRank( pPlayer );
}
else
{
MessagePlayer("Please Login To Play with This Account!" pPlayer );
pPlayer.IsFrozen = true;
}
}
else
{
pPlayer.Health = 0;
PrivMessage(" " + pPlayer.Name + " You need to register first /c register <Password>" pPlayer );
}
switch ( pPlayer.Skin )
{
case 102:
{
if ( Stats[ pPlayer.ID ].VIP >= 1 )
{
ClientMessage("Successfully Spwned With VIP Skin." pPlayer, 0,211,124);
}
else
{
ClientMessage("You're not VIP, please choose a different skin." pPlayer 255, 255, 0 );
pPlayer.Health= 0;
Stats[ pPlayer.ID ].Deaths--;
}
}
break;
case 101:
{
if ( Stats[ pPlayer.ID ].Admin >= 3 )
{
ClientMessage("Successfully Spwned With Admin Skin." pPlayer, 0,211,124);
}
else
{
ClientMessage("You're not Admin, please choose a different skin." pPlayer 255, 255, 0 );
pPlayer.Health= 0;
Stats[ pPlayer.ID ].Deaths--;
}
}
break;
case 34:
{
if ( pPlayer.IsAdmin )
{
ClientMessage("Successfully Spwned With RCON Skin." pPlayer, 0,211,124);
}
else
{
ClientMessage("You're not RCON, please choose a different skin." pPlayer 255, 255, 0 );
pPlayer.Health= 0;
Stats[ pPlayer.ID ].Deaths--;
}
}
break;
}
if ( Stats[ pPlayer.ID ].VIP >= 9 )
{
SetDriveOnWater( true );
pPlayer.StuntMode = true
SetWeaponDamage( 20, 80 );
}
if ( pPlayer.IsAdmin )
{
pPlayer.ShootInAir = true;
pPlayer.StuntMode = true;
pPlayer.DrivebyAbility = true;
SetDriveOnWater( true );
SetWeaponDamage( 33, 100 );
SetWeaponDamage( 20, 100 );
pPlayer.Health=100;
pPlayer.Armour=100;
}
else return 0;
}
catch(e) Print("Error " + e );
}
function onPlayerChat( pPlayer, szText )
{
try
{
if ( ( Stats[ pPlayer.ID ].FirstSpawned == false ) && ( !pPlayer.IsSpawned ) ) return ClientMessage("First Spawn then Chat!" pPlayer 255, 0, 0 );
else if ( ( Stats[ pPlayer.ID ].Logged == false ) && ( !pPlayer.IsSpawned ) ) return ClientMessage("First Spawn then Chat!" pPlayer 255, 0, 0 );
else if ( ( Stats[ pPlayer.ID ].Registered == false ) && ( pPlayer.IsSpawned ) ) return ClientMessage("Please Use /C Register <Password> before Chatting!" pPlayer 255, 0, 0 );
else if ( ( Stats[ pPlayer.ID ].Logged == false ) && ( pPlayer.IsSpawned ) ) return ClientMessage("Please Use /C Login <Password> before Chatting!" pPlayer 255, 0, 0 );
else if ( Stats[ pPlayer.ID ].Muted == true ) return ClientMessage("[Error] - You are muted by Admin For " + Stats[ pPlayer.ID ].MuteTime + " Minutes, Please Wait " + Stats[ pPlayer.ID ].MuteRem + " Seconds for UnMute." pPlayer 255, 0, 0 );
else if ( Stats[ pPlayer.ID ].AutoMute == true ) return ClientMessage("[Anti-Spam] - Please Wait " + Stats[ pPlayer.ID ].AutoMuteCount + " Seconds to Chat Again!" pPlayer 255, 0, 0 );
else if ( Stats[ pPlayer.ID ].PText == null ) Stats[ pPlayer.ID ].PText = szText;
else if ( Stats[ pPlayer.ID ].PText == szText ) Stats[ pPlayer.ID ].PTextCount = Stats[ pPlayer.ID ].PTextCount+1;
else Stats[ pPlayer.ID ].PTextCount = 0;
Stats[ pPlayer.ID ].PText = szText;
if ( Stats[ pPlayer.ID ].STimer == 0 ) Stats[ pPlayer.ID ].STimer = GetTime().tointeger();
else if ( ( GetTime().tointeger()-Stats[ pPlayer.ID ].STimer ) <2 ) Stats[ pPlayer.ID ].SCounter = Stats[ pPlayer.ID ].SCounter+1;
else
{
Stats[ pPlayer.ID ].SCounter = 0;
Stats[ pPlayer.ID ].STimer=GetTime().tointeger();
}
if ( ( Stats[ pPlayer.ID ].SCounter >2 || Stats[ pPlayer.ID ].PTextCount > 3 ) && pPlayer.IsMuted == false && pPlayer.IsAdmin );
else if ( ( Stats[ pPlayer.ID ].SCounter >2 || Stats[ pPlayer.ID ].PTextCount > 3 ) && pPlayer.IsMuted == false && ( Stats[ pPlayer.ID ].VIP >= 5 ) )
{
pPlayer.IsMuted = true;
Stats[ pPlayer.ID ].AutoMute = true
Stats[ pPlayer.ID ].SCounter = 0;
Stats[ pPlayer.ID ].PTextCount = 0;
ClientMessage("[Anti-Spam] - You Have Been Auto-Muted For 30 Seconds For Spamming!" pPlayer 255, 0, 0 );
}
else if ( ( Stats[ pPlayer.ID ].SCounter >=2 || Stats[ pPlayer.ID ].PTextCount >3 ) && pPlayer.IsMuted == false )
{
pPlayer.IsMuted = true;
Stats[ pPlayer.ID ].AutoMute = true;
Stats[ pPlayer.ID ].SCounter = 0;
Stats[ pPlayer.ID ].PTextCount = 0;
ClientMessage("[Anti-Spam] - You Have Been Auto-Muted For 1 Minute For Spamming!" pPlayer 255, 0, 0 );
}
if ( szText )
{
if ( szText.slice( 0, 1 ) == "!" )
{
local i = NumTok( szText, " " );
if ( i == 1 ) onPlayerCommand2( pPlayer, GetTok( szText.slice( 1 ), " ", 1 ), null );
else onPlayerCommand2( pPlayer, GetTok( szText.slice( 1 ), " ", 1 ), GetTok( szText.slice( 1 ), " ", 2, i ) );
}
}
local Color;
switch ( rand() % 13 )
{
case 0:
Color = ICOL_BLUE;
break;
case 1:
Color = ICOL_GREEN;
break;
case 2:
Color = ICOL_RED;
break;
case 3:
Color = ICOL_BROWN;
break;
case 4:
Color = ICOL_PURPLE;
break;
case 5:
Color = ICOL_ORANGE;
break;
case 6:
Color = ICOL_YELLOW;
break;
case 7:
Color = ICOL_LGREEN;
break;
case 8:
Color = ICOL_CYAN;
break;
case 9:
Color = ICOL_LCYAN;
break;
case 10:
Color = ICOL_LBLUE;
break;
case 11:
Color = ICOL_PINK;
break;
case 12:
Color = ICOL_GREY;
break;
case 13:
Color = ICOL_LGREY;
break;
}
EchoMessage( ICOL_GREEN + "[" + pPlayer.ID + "] " + ICOL + Color + " " + pPlayer.Name + "> " + ICOL + szText );
}
catch(e) Print("Error " + e );
}
function onPlayerKill( Killer, Killed, iReason, szBodyPart )
{
try
{
Stats[ Killer.ID ].Kills++;
Stats[ Killed.ID ].Deaths++;
Stats[ Killer.ID ].Coins += 7;
Stats[ Killed.ID ].Coins -= 2;
Stats[ Killer.ID ].Spree++;
Stats[ Killed.ID ].Spree = 0;
Killer.Score += 50;
Killed.Score -= 10;
Killer.Cash += 750;
Killed.Cash -=250;
Killer.WantedLevel += 1;
Stats[ Killer.ID ].AntiHPHack = true;
if ( Killer.Health < 100 ) Killer.Health +=25;
else if ( Killer.Armour >= 0 ) Killer.Armour +=25;
local Part = "Unknown";
switch( szBodyPart )
{
case 0:
Part = "Body";
break;
case 1:
Part = "Torso";
break;
case 2:
Part = "Left Arm";
break;
case 3:
Part = "Right Arm";
break;
case 4:
Part = "Left Leg";
break;
case 5:
Part = "Right Leg";
break;
case 6:
Part = "Head";
break;
}
local Wep = "Unkown";
switch( iReason )
{
case 0:
Wep = "Fist";
break;
case 1:
Wep = "BrassKnuckle";
break;
case 2:
Wep = "ScrewDriver";
break;
case 3:
Wep = "GolfClub";
break;
case 4:
Wep = "NightStick";
break;
case 5:
Wep = "Knife";
break;
case 6:
Wep = "BaseballBat";
break;
case 7:
Wep = "Hammer";
break;
case 8:
Wep = "Cleaver";
break;
case 9:
Wep = "Machete";
break;
case 10:
Wep = "Katana";
break;
case 11:
Wep = "Chainsaw";
break;
case 12:
Wep = "Grenade";
break;
case 13:
Wep = "RemoteGrenade";
break;
case 14:
Wep = "TearGas";
break;
case 15:
Wep = "Molotov";
break;
case 16:
Wep = "Missile";
break;
case 17:
Wep = "Colt45";
break;
case 18:
Wep = "Python";
break;
case 19:
Wep = "Shotgun";
break;
case 20:
Wep = "Spaz";
break;
case 21:
Wep = "Stubby";
break;
case 22:
Wep = "Tec9";
break;
case 23:
Wep = "Uzi";
break;
case 24:
Wep = "Ingrams";
break;
case 25:
Wep = "MP5";
break;
case 26:
Wep = "M4";
break;
case 27:
Wep = "Ruger";
break;
case 28:
Wep = "SniperRifle";
break;
case 29:
Wep = "LaserScope";
break;
case 30:
Wep = "RocketLauncher";
break;
case 31:
Wep = "FlameThrower";
break;
case 32:
Wep = "M60";
break;
case 33:
Wep = "Minigun";
break;
}
local R = rand() % 255;
switch ( Stats[ Killer.ID ].Spree )
{
case 1:
{
ClientMessageToAll("FIRST BLOOD > " + Killer.Name + " Started Killing!",255, 0, 0 );
Announce("~b~First ~o~Blood~w~!" Killer );
}
break;
case 5:
{
ClientMessageToAll("SPREE > " + Killer.Name + " is on Killing Spree Kills: 5 (Reward: 500$)"R, R, R);
Killer.Cash += 500;
Announce("~y~Killing ~o~Spree~b~!" Killer );
}
break;
case 10:
{
ClientMessageToAll("SPREE > " + Killer.Name + " is on Double Killing Spree Kills: 10 (Reward: 1000$)"R, R, R);
Killer.Cash += 1000;
Announce("~y~Killing ~o~Spree~b~!" Killer );
}
break;
case 15:
{
ClientMessageToAll("SPREE > " + Killer.Name + " is on Triple Killing Spree Kills: 15 (Reward: 1500$)"R, R, R);
Killer.Cash += 1500;
Announce("~y~Killing ~o~Spree~b~!" Killer );
}
break;
case 20:
{
ClientMessageToAll("SPREE > " + Killer.Name + " is on Hunting Killing Spree Kills: 20 (Reward: 2000$)"R, R, R);
Killer.Cash += 2000;
Announce("~y~Killing ~o~Spree~b~!" Killer );
}
break;
case 25:
{
ClientMessageToAll("SPREE > " + Killer.Name + " is on Big Boss Killing Spree Kills: 25 (Reward: 2500$)"R, R, R);
Killer.Cash += 2500;
Announce("~y~Killing ~o~Spree~b~!" Killer );
}
break;
case 30:
{
ClientMessageToAll("SPREE > " + Killer.Name + " is on Blood Seeker Killing Spree Kills: 30 (Reward: 3000$)"R, R, R);
Killer.Cash += 3000;
Announce("~y~Killing ~o~Spree~b~!" Killer );
}
break;
case 35: