· 9 years ago · Aug 19, 2017, 08:16 AM
1#if defined _0_A_d_m_i_n_
2//hi to stuntersgod :p
3#endif
4//Main Include
5#include <a_samp>
6
7
8 /*-----------------------------------------------
9 Don't change this otherwise whirlpool won't work!*/
10 #define MAX_INI_ENTRY_TEXT 130
11 #undef MAX_PLAYER_NAME
12 #define MAX_PLAYER_NAME 24
13 /*-----------------------------------------------*/
14
15//Includes
16#include < YSI/Y_ini >
17#include < sscanf2 >
18#include < zcmd >
19#include < foreach >
20#include < regex >
21//#include YSI/y_scripting
22
23//Version of the script.
24#define Version "1.1"
25
26#pragma dynamic 46500
27//Colors:
28#define ORAN "{FF5500}"
29#define GREE "{94ED40}"
30#define BLUE "{4097ED}"
31#define W "{FFFFFF}"
32#define GREY "{C3C3C3}"
33
34
35//Tags:
36#define Dialog: _:DIALOG_
37#define Color: _:COL_
38
39
40//Shortcuts
41#define D: = 906 //If you have Dialog Problems, please change here, the higher, the better!
42#define PARAMS playerid, params[]
43#define SPD ShowPlayerDialog
44#define LIST DIALOG_STYLE_LIST
45#define INPUT DIALOG_STYLE_INPUT
46#define BOX DIALOG_STYLE_MSGBOX
47#define CaseDialog<%0> case(Dialog:%0):
48#define iDialog<%0> if(dialogid == Dialog:%0)
49#define GetVehicleName(%0) vNames[(%0) - 400]
50#define Freeze(%0) TogglePlayerControllable((%0), false)
51#define UnFreeze(%0) TogglePlayerControllable((%0), true)
52#define Col(%0,%1) ChangeVehicleColor(GetPlayerVehicleID(playerid), (%0), ((%0) & (zC = %1)))
53#define db_GetField DB::get_field_assoc
54#define db_Query DB::query
55#define db_Free DB::free_result
56#define db_Valid DB::num_rows
57#define DB:: db_
58
59/*
60=======================================
61==| Bellow choose your own settings |==
62=======================================
63*/
64
65//----------------------------------------
66#define SECURITY_QUESTION false /*true - Will enable the security question so user can retrieve their password.
67 false - Won't.*/
68//----------------------------------------
69#define STATS_STABILIZER false /*true - Stats will be stabilized, uses OnPlayerUpdate, unchek in case of lag...
70 false - Won't.*/
71//----------------------------------------
72#define SAVE_IN_LOGS true /*true - It will save on file when player gets kicked/banned/muted etc..
73 false - It won't save.*/
74//----------------------------------------
75#define SAVE_MUTE true /*true - Mute with mute time will be saved and on connect it will be re-applied!
76 false - Mute won't be saved and it will be disabled on connect/disconnect*/
77//----------------------------------------
78#define SAVE_FREEZE true /*true - Player will be frozen after re-connect
79 false - Player will be able to move after reconnection.*/
80//----------------------------------------
81#define SAVE_JAIL true /*true - Player after reconection will be jailed for the amount of time set
82 false - Player after reconnection won't go to jail!*/
83//----------------------------------------
84#define USE_RANKS true /*true - Tell player when reaching x kills his new rank!
85 false - Don't use ransk at all!*/
86//----------------------------------------
87#define PRINT_RANKS false /* true - Will print the created rank names in the console.
88 false - Will do the opposite! Won't show them in console!*/
89//----------------------------------------
90#define UPDATE_TOP_ALWAYS true /*true - The top x players file will be update once a kill/death or whatever stat is, has occured.
91 false - It will update only on disconnect.*/
92//----------------------------------------
93#define TRACK_ACCOUNTS true /*true - Each time a player disconnects from the server and he has an account a file of his stats will be created with the stats on date x
94 false - Not gonna happen! Only when admin uses !stats <id> in console or /rcon !stats id in game.*/
95
96//ATTENTION: KEEP THE SYMBOM INSIDE ' '.
97#define ADMIN_CHAT_SYMBOL '@' //Choose symbol1 to let vip members talk among them. Use same symbol on both for 1 usage.
98#define ADMIN_CHAT_SYMBOL2 '#' //Choose symbol2 to let vip members talk among them. Use same symbol on both for 1 usage.
99#define VIP_CHAT_SYMBOL '*' //Choose symbol1 to let Admins talk among them. Use same symbol on both for 1 usage.
100#define VIP_CHAT_SYMBOL2 '$' //Choose symbol2 to let Admins talk among them. Use same symbol on both for 1 usage.
101
102//Start defining here the way you like!
103#define MIN_PASS_LEN (4) //Minimum characters a password must have. (On register)
104#define MAX_PASS_LEN (20) //Maximum characters a password must have. (On register)
105#define MAX_PASS_FAIL (4) //Define how many tries a player has to login.
106#define MAX_RCON_ATTEMPTS 3 //Define how many tries a player must have to enter the right RCON Password.
107#define MIN_PING_LIMIT 100 //Minimum ping an admin must enter on the cPanel, category, "Ping Kicker"
108#define MAX_PING_LIMIT 3000 //Maximum ping an admin must enter on the cPanel, category, "Ping Kicker"
109#define IPGKICK 1 //Minimun level for admin to not be kicked by the Ping Kicker.
110#define LOW_SPAM_RATE (1300) //Each how many seconds the spam rate drops
111#define GOD_TICK_RATE (500) //Once every x ms/seconds the god will update. (If causes lag increase number)
112#define MINIMUM_SPAM (100) //Minimum spam message for the anti-spam to be triggered!
113#define MEDIUM_SPAM (100) //Medium spam messages for the player to be kicked for spamming.
114#define MAXIMUM_SPAM (100) //Maximum spam messages for the player to be BANNED for spamming.
115#define MIN_CMD_SPAM (100) //Minimun commands spam for the player to be kicked for commands spamming.
116#define MAX_CMD_SPAM (100) //Maximum commands spam for the player to be BANNED for commands spamming
117#define MAX_COOKIE_COST 95 //How much a cookie costs!
118#define MAX_P_WARNS 3 //Max warns for the player to achieve to get kicked!
119#define MAX_TOP_LIMIT 15 //Max how many players will be shown in the top x players!
120#define MAX_SHOW_PER_ROW 6 //Define here how many players should be shoed on /vips /admins /muted etc per row!
121#define MAX_RANK_LEN (50) //Define here the max rank name lenght!
122#define EXTRA_MINUTES 15 /*Define how many +minutes of mute or jail the player will receive
123 after evading with a different IP but same name, or same IP but different name*/
124//Files
125#define LOGS_LOC "0Admin/Logs/" //The location where the server will print a log of a ban/kick
126#define KICK_LOG "0Admin/Logs/KickLog.ini" //Naming the Kick Log
127#define BAN_LOG "0Admin/Logs/BanLog.ini" //Naming the Ban Log
128#define RCON_LOG "0Admin/Logs/RCONFails.ini" //Printing in the log what IP tried to break the RCON and with what password!
129#define REPORT_LOG "0Admin/Logs/Reports.ini" //Where the report logs will be saved
130#define SETRANK_LOG "0Admin/Logs/SetRank.ini" //A log where it will store the player that has changed rank etc..
131#define SETLEVEL_LOG "0Admin/Logs/SetLevel.ini" //A log where it will store the player that has changed level etc..
132#define SETVIP_LOG "0Admin/Logs/SetVip.ini" //A log where it will store the player that has changed vip etc..
133#define PMS_LOG "0Admin/Logs/PMs.ini" //Where all Personal Messages will be stored!
134#define WARNS_LOG "0Admin/Logs/Warns.ini" //Where the warns will be stored!
135#define VIPCHAT_LOG "0Admin/Logs/VIP Chat.ini" //Here saves everything admins chat trough the Admin Chat.
136#define ADMINCHAT_LOG "0Admin/Logs/Admin Chat.ini" //Here stores all the messages sent by VIP members
137#define USER_ID "0Admin/Account_ID.ini" //Saving how many accounts have been created and which was the last one
138#define AKA_FILE "0Admin/AKA.ini" //Sacing the AKA(Also Known As) of a player!
139#define SERVER_FILE "0Admin/SVSettings.ini" //The server data, where Autologin Antispam anti whatever will asve!
140#define DATABASE_LOC "0Admin/Database.db" //Define here where the database with the top x players and muted/jaled/frozen
141#define STATS_LOC "0Admin/Stats/" //Where the file of the player creates when admins uses !stats <id> in console.
142
143//For the /SETSTAT command
144#define NAME 0
145#define MONEY 1
146#define SCORE 2
147#define COOKIES 3
148#define RESPECT 4
149#define KILLS 5
150#define DEATHS 6
151#define MESSAGES 7
152#define COMMANDS 8
153#define FCOMMANDS 9
154#define ONLINE 10
155#define LEVEL 11
156#define VLEVEL 12
157#define CPASS 13
158#define BACCOUNT 14
159#define DACCOUNT 15
160
161#define ADMIN_SPEC_TYPE_NONE 0
162#define ADMIN_SPEC_TYPE_PLAYER 1
163#define ADMIN_SPEC_TYPE_VEHICLE 2
164
165
166//Shortcuts
167
168#define CreateTable(%0,%1,%2)\
169 DB::Query((%0), "CREATE TABLE IF NOT EXISTS " "`"%1"`" %2)
170
171
172//----------------------------------------
173#define Public:%0(%1) forward %0(%1);\
174 public %0(%1)
175
176//----------------------------------------
177#define FormatMSG(%0,%1,%2,%3)\
178 do{\
179 format(_S_T_R_, sizeof (_S_T_R_), (%2), %3);\
180 SendClientMessage((%0),(%1), _S_T_R_);\
181 }\
182 while (False)
183
184//----------------------------------------
185#define SendAdminCMD(%0,%1,%2)\
186 do{\
187 foreach(Player, zI){\
188 if(P_DATA[zI][Level]> 1){\
189 if(zI != (%0)){\
190 format(_S_T_R_, sizeof (_S_T_R_), (%1), %2);\
191 SendClientMessage(zI,Color:GREY, _S_T_R_);\
192 }\
193 }\
194 }\
195 }\
196 while (False)
197
198//----------------------------------------
199#define LevelCheck(%0,%1)\
200 do{\
201 if(P_DATA[(%0)][Level] < (%1) && !IsPlayerAdmin((%0))){\
202 if(S_DATA[TellPlayer]){\
203 new Str[256];\
204 format(Str, 256, "SERVER:"W" You must be an admin level "ORAN"%d"W" to use this command!", (%1));\
205 return SendClientMessage((%0), Color:ORAN, Str);\
206 }else return 0;\
207 }\
208 }\
209 while(False)
210
211//----------------------------------------
212#define LoginCheck(%0) \
213 do{\
214 if(!P_DATA[(%0)][Logged])\
215 {\
216 if(S_DATA[TellPlayer])\
217 {\
218 return SendClientMessage((%0), Color:ORAN, "SERVER:"W" You must be logged in to use this command!");\
219 }else return 0;\
220 }\
221 }\
222 while(False)
223
224//----------------------------------------
225#define SaveInLog(%0,%1,%2) \
226 do\
227 {\
228 new File:_File = fopen((%0), io_append);\
229 format(_S_T_R_, sizeof (_S_T_R_), %1 "\r\n", %2);\
230 if((_File))\
231 {\
232 fwrite((_File), _S_T_R_);\
233 fclose((_File));\
234 }\
235 }\
236 while(False)
237
238//----------------------------------------
239#define FileExist(%0);\
240 if(!fexist(%0))\
241 {\
242 printf("MISSING FILE: \"%s\" doesn't exist, created by the system", %0);\
243 new File:uFile = fopen(%0, io_write); fclose(uFile);\
244 Fail = true;\
245 }
246
247//----------------------------------------
248#define CheckImune(%0,%1); \
249 if(P_DATA[(%0)][Level] < P_DATA[(%1)][Level]) \
250 return SendError(%0, "You are not allowed to use this command on this admin!");
251
252//----------------------------------------
253#define VipCheck(%0, %1); \
254 if(P_DATA[(%0)][Vip] < %1 && !IsPlayerAdmin(%0)) \
255 return format(_S_T_R_, 256, "SERVER:"W" You must be a VIP level "ORAN"%d"W" to use this command!", %0),\
256 SendClientMessage((%0), Color:ORAN, _S_T_R_);
257
258//----------------------------------------
259#define CheckComponents(%0,%1)\
260 if(!strcmp(GPVSEx((%0), "Type"), "None") && !P_DATA[(%0)][A_Component1] &&\
261 !P_DATA[(%0)][A_Component2] && !P_DATA[(%0)][A_Component3] &&\
262 !P_DATA[(%0)][A_Component4] && !P_DATA[(%0)][A_Wheels] &&\
263 !P_DATA[(%0)][A_Color])\
264 return SendError((%0), %1),cmd_accp((%0), "")
265
266//----------------------------------------
267#define PRESSED(%0) \
268 (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
269
270//----------------------------------------
271#define RELEASED(%0) \
272 (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
273
274//----------------------------------------
275#define OpenWriteClose(%0,%1,%2,%3);\
276 {\
277 new INI:%1 = INI_Open((%0));\
278 INI_WriteInt((%1), %2, (%3));\
279 INI_Close((%1));\
280 }
281//----------------------------------------
282#define _0CMD(%0) \
283 if(!strcmp(cmd, "!0" %0, true))
284
285//----------------------------------------
286#define Triadic(%0)\
287 (%0) ? ("Enabled") : ("Disabled")
288
289//----------------------------------------
290#define CONSOLE(%0) \
291 if(!strcmp(cmd, (%0), true, .length = strlen((%0))))
292
293//----------------------------------------
294#define PrintError(%0) \
295 print("\n----------------\n" %0 "\n----------------\n")
296
297//----------------------------------------
298#define PrintErrorEx(%0,%1) \
299 printf("\n----------------\n" %0 "\n----------------\n", %1)
300
301//----------------------------------------
302#define loop(%0,%1) \
303 for(new _%0; (_%0) != (%1); (_%0)++)
304
305//----------------------------------------
306#define _GetField<%0>Store<%1>\
307 DB::GetField(Result, %0, (Field), sizeof((Field)));\
308 P_DATA[playerid][%1] = strval(Field);
309
310//----------------------------------------
311#define Show(%0) \
312 ShowPlayerDialog(playerid, Dialog:Empty, BOX, ""W"Your Commands:", (%0), "Close", "")
313
314//----------------------------------------
315#define Detour<%0,%1> \
316 CMD:%0(PARAMS) return cmd_%1(playerid, "");
317
318native WP_Hash(buffer[], len, const str[]);
319
320stock
321 bool:False = false,
322 _S_T_R_[256];
323
324enum
325 Colors
326 {
327 COL_ORAN = 0xFF5500FF,
328 COL_GREY = 0xC3C3C3FF,
329 COL_GREE = 0xADEB50FF,
330 COL_FUNC = 0xFFA640FF,
331 COL_BLUE = 0x4097EDFF,
332 COL_WHITE = -1
333 };
334
335enum
336 Dialogs
337 {
338 Dialog:Register D:+1, Dialog:Register1 D:+2,
339 Dialog:Login D:+3, Dialog:Login2 D:+4,
340 Dialog:Login3 D:+5, Dialog:Stats D:+6,
341 Dialog:cPanel D:+7, Dialog:cPanel_Back D:+8,
342 Dialog:cPanel_Ping D:+9, Dialog:cPanel2 D:+10,
343 Dialog:Empty D:+11, Dialog:ACCP D:+12,
344 Dialog:ACCP_NOS D:+13, Dialog:ACCP_COLORS D:+14,
345 Dialog:ACCP_C_C D:+15, Dialog:ACCP_WHEELS D:+16,
346 Dialog:ACCP_COMPS D:+17, Dialog:ACCP_SAVE D:+18,
347 Dialog:ACCP_LOAD D:+19, Dialog:ACCP_DISCARD D:+20,
348 Dialog:SetStatsSure D:+21, Dialog:SetStatsTrue D:+22,
349 Dialog:TOP D:+23, Dialog:TOP_SELECT D:+24,
350 Dialog:TOP_RESPECT D:+25, Dialog:CLICK D:+26,
351 Dialog:CLICK_PM D:+27, Dialog:CLICK_RP D:+28,
352 Dialog:CLICK_MONEY D:+29, Dialog:CLICK_REPORT D:+30,
353 Dialog:PCP D:+31, Dialog:NAME D:+32,
354 Dialog:MONEY D:+33, Dialog:SCORE D:+34,
355 Dialog:COOKIES D:+35, Dialog:RESPECT D:+36,
356 Dialog:KILLS D:+37, Dialog:DEATHS D:+38,
357 Dialog:MESSAGES D:+39, Dialog:COMMANDS D:+40,
358 Dialog:FCOMMANDS D:+41, Dialog:ONLINE D:+42,
359 Dialog:LEVEL D:+43, Dialog:VLEVEL D:+44,
360 Dialog:CPASS D:+45, Dialog:BACCOUNT D:+46,
361 Dialog:DACCOUNT D:+47, Dialog:RESPECT_NEG D:+48,
362 Dialog:RESPECT_POS D:+49, Dialog:ONLINE_H D:+50,
363 Dialog:ONLINE_M D:+51, Dialog:ONLINE_S D:+52,
364 Dialog:SAnswer D:+53, Dialog:SAnswer2 D:+54,
365 Dialog:SQuestion D:+55, Dialog:ForgPass D:+56,
366 Dialog:PCPBack D:+57, Dialog:PCPShout D:+58
367
368 };
369enum
370 P_ENUM_DATA
371 {
372 Money, Score, MutedAll, Level,
373 Vip, Rank, Msgs, Cmds,
374 fCmds, Kills, Deaths, Negative,
375 Positive, God, CarGod, Boost,
376 Banned, Kicks, LogFail, Logged,
377 Muted, Frozen, Jailed, cmgddon,
378 Hours, Minutes, Seconds, TotalTime,
379 ConnTime, AccID, MutedTime, JailTime,
380 SpamMSG, cSpam, tLevel, PMSent,
381 RepMSG[128], Warns, Cookies, aCar,
382 pAuto, GiveCar, Spec_ID, Spec_Type,
383 NosTimer, Accp_Saved, A_Color, Spin,
384 A_Component1, A_Component2, A_Component3, A_Component4,
385 A_Wheels, Incred, BAPMs, VIPTag,
386 Text3D:Tag3D, Float:bSpeed
387 };
388enum
389 S_ENUM_DATA
390 {
391 AntiSpam, AntiCSpam, Ping, sAccounts,
392 RconFails, RCONProt, TellPlayer, Chat,
393 ReadPM, ReadCMD, AKA, ShowFunction,
394 AntiRepeat, AutoLogin, AnnRank, AntiAD,
395 sCMDS, sMSGS, sCrashes, sDisc,
396 sConn, sKB, sPlayers, sRecord,
397 sD, sM, sY, RecordBy[MAX_PLAYER_NAME],
398 sH, sMi, sS, VipChat,
399 AdminChat
400 };
401
402enum INI_Enum_NV { iName[15], iValue };
403enum INI_Server_Enum_NV { isName[15], isValue };
404enum WHEELS_E { iWheel, iwName[15] };
405enum vCOLORS_E { ivColor, ivcRGB[9], ivcName[15] };
406enum vCOMPONENTS_E { iComponent, icName[20] };
407enum RANKS_E { iRank, irName[MAX_RANK_LEN] };
408
409
410new
411 bool:Fail = false;
412
413
414new
415 DB:_DB,
416 PlayerIP[MAX_PLAYERS][50],
417 P_DATA[MAX_PLAYERS][P_ENUM_DATA],
418 S_DATA[S_ENUM_DATA],
419 MuteTimer[MAX_PLAYERS],
420 JailTimer[MAX_PLAYERS],
421 PlayerText3D:ZaAdminCar[MAX_PLAYERS],
422 StatsString[800],
423 WhosStats[129],
424
425 _Levels[][] =
426 {
427 { "Member" },
428 { "Helper" },
429 { "Mini Moderator" },
430 { "Moderator" },
431 { "Administrator" },
432 { "Owner" }
433 },
434
435 #if USE_RANKS == true
436
437 //When you add/remove a rank, count each rank and insert here the number:
438 #define TOTAL_RANKS (12)
439
440 _Ranks[TOTAL_RANKS][RANKS_E] =
441 {
442/* Kills Rank Name */
443 { 0, "Looser" },
444 { 25, "Easy Killa'" },
445 { 50, "Baby Killer" },
446 { 75, "e-Gangsta" },
447 { 100, "Boss" },
448 { 150, "Lil' Psycho" },
449 { 200, "Psycho" },
450 { 300, "Unstopable" },
451 { 400, "Elite Killer" },
452 { 600, "Godlike killer!" },
453 { 800, "INSANE KILLER" },
454 { 1000, "The God of Deathmatch" }//Last row must NOT have the ','
455 },
456 #endif
457
458 ACCP_Components[7][vCOMPONENTS_E] =
459 {
460/* Model Component Name */
461 { 1019, "Twin Exhaust" },
462 { 1018, "Upswept Exhaust" },
463 { 1001, "Win Spoiler" },
464 { 1023, "Fury Spoiler" },
465 { 1003, "Alpha Spoiler" },
466 { 1087, "Hydraulics" },
467 { 1017, "Skirt" }
468 },
469
470 ACCP_Colors[16][vCOLORS_E] =
471 {
472/* CarCol RRGGBB Color Name */
473 { 1, "{FFFFFF}", "White" },
474 { 0, "{000000}", "Black" },
475 { 2, "{2a77a1}", "Light Blue" },
476 { 3, "{840510}", "Dark Red" },
477 { 25, "{253739}", "Dark Grey" },
478 { 85, "{87446f}", "Soft Magenta" },
479 { 6, "{d68f11}", "Orange" },
480 { 109, "{bdbdc5}", "Grey" },
481 { 49, "{d6dbd5}", "White Grey" },
482 { 86, "{34603f}", "Green" },
483 { 113, "{5f272a}", "Brown" },
484 { 126, "{ed6aae}", "Pinky" },
485 { 51, "{305045}", "Dark Green" },
486 { 12, "{5e7e8d}", "Soft Blue" },
487 { 102, "{ab9d83}", "Easy Color" },
488 { 65, "{8f8c47}", "Ugly Green" }
489 },
490
491
492 Wheels[17][WHEELS_E] =
493 {
494/* Model Wheel Name */
495 { 1_025, "Offroad" },
496 { 1_073, "Shadow" },
497 { 1_074, "Mega" },
498 { 1_075, "Rimshine" },
499 { 1_076, "Wires" },
500 { 1_077, "Classic" },
501 { 1_078, "Twist" },
502 { 1_079, "Cutter" },
503 { 1_080, "Switch" },
504 { 1_081, "Grove" },
505 { 1_082, "Import" },
506 { 1_083, "Dollar" },
507 { 1_084, "Trance" },
508 { 1_085, "Atomic" },
509 { 1_096, "Ahab" },
510 { 1_097, "Virtual" },
511 { 1_098, "Access" }
512 },
513 SpamColors[35] =
514 {
515 0xFBBA00FF, 0xB4B5B7AA, 0xAFAFAFAA, 0x0000BBAA, 0x800080AA,
516 0x000000AA, 0x33AA33AA, 0xA52A2AAA, 0xFFA00AFF, 0xFF560AFF,
517 0xFFD8B0FF, 0xFFD876FF, 0xFFBF3BFF, 0xFFC628FF, 0xFF4D28FF,
518 0xFFFF28FF, 0xC0C0C0AA, 0xFFDD80FF, 0x00DD37FF, 0x2C2727AA,
519 0xC968FCFF, 0xC9C0FCFF, 0xA790FCFF, 0x0097FFFF, 0xFF6463FF,
520 0x00DDFFFF, 0x00DDFF15, 0xC500FFFF, 0x33AA33AA, 0x00DD37FF
521 },
522 INI_Server_Info[16][INI_Server_Enum_NV] =
523 {
524/* Feature Value */
525 { "AntiSpam", 1 },
526 { "AntiCMDSpam", 1 },
527 { "MaxPing", 750 },
528 { "RconProtect", 1 },
529 { "TellPlayer", 1 },
530 { "BlockChat", 0 },
531 { "ReadPMs", 0 },
532 { "ReadCommands", 0 },
533 { "AKA", 1 },
534 { "ShowFunction", 1 },
535 { "AntiRepeat", 1 },
536 { "AutoLogin", 0 },
537 { "AnnRank", 1 },
538 { "AntiAdv", 1 },
539 { "AdminChat", 1 },
540 { "VipChat", 1 }
541 },
542 vNames[212][] =
543 {
544 {"Landstalker"}, {"Bravura"}, {"Buffalo"}, {"Linerunner"}, {"Perrenial"}, {"Sentinel"}, {"Dumper"},
545 {"Firetruck"}, {"Trashmaster"}, {"Stretch"}, {"Manana"}, {"Infernus"}, {"Voodoo"}, {"Pony"}, {"Mule"},
546 {"Cheetah"}, {"Ambulance"}, {"Leviathan"}, {"Moonbeam"}, {"Esperanto"}, {"Taxi"}, {"Washington"},
547 {"Bobcat"}, {"Mr Whoopee"}, {"BF Injection"}, {"Hunter"}, {"Premier"}, {"Enforcer"}, {"Securicar"},
548 {"Banshee"}, {"Predator"}, {"Bus"},{"Rhino"}, {"Barracks"}, {"Hotknife"}, {"Trailer 1"}, {"Previon"},
549 {"Coach"}, {"Cabbie"}, {"Stallion"}, {"Rumpo"}, {"RC Bandit"}, {"Romero"}, {"Packer"}, {"Monster"},
550 {"Admiral"}, {"Squalo"}, {"Seasparrow"}, {"Pizzaboy"}, {"Tram"}, {"Trailer 2"}, {"Turismo"},
551 {"Speeder"}, {"Reefer"}, {"Tropic"}, {"Flatbed"}, {"Yankee"}, {"Caddy"}, {"Solair"}, {"Berkley's RC Van"},
552 {"Skimmer"}, {"PCJ-6_0_0"}, {"Faggio"}, {"Freeway"}, {"RC Baron"}, {"RC Raider"}, {"Glendale"}, {"Oceanic"},
553 {"Sanchez"}, {"Sparrow"}, {"Patriot"}, {"Quad"}, {"Coastguard"}, {"Dinghy"}, {"Hermes"}, {"Sabre"},
554 {"Rustler"}, {"ZR-3_5_0"}, {"Walton"}, {"Regina"}, {"Comet"},{"BMX"}, {"Burrito"}, {"Camper"}, {"Marquis"},
555 {"Baggage"}, {"Dozer"}, {"Maverick"}, {"News Chopper"}, {"Rancher"}, {"FBI Rancher"}, {"Virgo"}, {"Greenwood"},
556 {"Jetmax"}, {"Hotring"}, {"Sandking"}, {"Blista Compact"}, {"Police Maverick"},{"Boxville"}, {"Benson"},
557 {"Mesa"}, {"RC Goblin"}, {"Hotring Racer A"}, {"Hotring Racer B"},{"Bloodring Banger"},{"Rancher"},
558 {"Super GT"}, {"Elegant"}, {"Journey"}, {"Bike"}, {"Mountain Bike"}, {"Beagle"}, {"Cropdust"}, {"Stunt"},
559 {"Tanker"}, {"Roadtrain"}, {"Nebula"}, {"Majestic"}, {"Buccaneer"}, {"Shamal"}, {"Hydra"}, {"FCR-900"},
560 {"NRG-500"}, {"HPV1000"}, {"Cement Truck"}, {"Tow Truck"}, {"Fortune"}, {"Cadrona"}, {"FBI Truck"},
561 {"Willard"}, {"Forklift"}, {"Tractor"}, {"Combine"}, {"Feltzer"}, {"Remington"}, {"Slamvan"},
562 {"Blade"}, {"Freight"}, {"Streak"}, {"Vortex"}, {"Vincent"}, {"Bullet"}, {"Clover"}, {"Sadler"},
563 {"Firetruck LA"}, {"Hustler"}, {"Intruder"}, {"Primo"}, {"Cargobob"}, {"Tampa"}, {"Sunrise"}, {"Merit"},
564 {"Utility"}, {"Nevada"}, {"Yosemite"}, {"Windsor"}, {"Monster A"}, {"Monster B"}, {"Uranus"}, {"Jester"},
565 {"Sultan"}, {"Stratum"}, {"Elegy"}, {"Raindance"}, {"RC Tiger"}, {"Flash"}, {"Tahoma"}, {"Savanna"},
566 {"Bandito"}, {"Freight Flat"}, {"Streak Carriage"}, {"Kart"}, {"Mower"}, {"Duneride"}, {"Sweeper"},
567 {"Broadway"}, {"Tornado"}, {"AT-400"}, {"DFT-30"}, {"Huntley"}, {"Stafford"}, {"BF-400"}, {"Newsvan"},
568 {"Tug"}, {"Trailer 3"}, {"Emperor"}, {"Wayfarer"}, {"Euros"}, {"Hotdog"}, {"Club"}, {"Freight Carriage"},
569 {"Trailer 3"}, {"Andromada"}, {"Dodo"}, {"RC Cam"}, {"Launch"}, {"Police Car LSPD"},{"Police Car SFPD"},
570 {"Police _LVPD"}, {"Police Ranger"}, {"Picador"}, {"SWAT. Van"}, {"Alpha"}, {"Phoenix"}, {"Glendale"},
571 {"Sadler"}, {"Luggage Trailer A"}, {"Luggage Trailer B"}, {"Stair Trailer"},{"Boxville"}, {"Farm Plow"},
572 {"Utility Trailer"}
573
574 };
575 #if USE_RANKS == true
576
577 new _RankNames[sizeof(_Ranks)][MAX_RANK_LEN];
578
579 #endif
580
581
582public OnPlayerUpdate(playerid)
583{
584 #if STATS_STABILIZER == true
585
586 if(P_DATA[playerid][Kills] != GetPVarInt((playerid), "0_Kills"))
587 P_DATA[(playerid)][Kills] = GetPVarInt((playerid), "0_Kills");
588
589 if(P_DATA[playerid][Deaths] != GetPVarInt((playerid), "0_Deaths"))
590 P_DATA[(playerid)][Deaths] = GetPVarInt((playerid), "0_Deaths");
591
592 if(P_DATA[playerid][Level] != GetPVarInt((playerid), "0_Level"))
593 P_DATA[(playerid)][Level] = GetPVarInt((playerid), "0_Level");
594
595 if(P_DATA[playerid][Vip] != GetPVarInt((playerid), "0_Vip"))
596 P_DATA[(playerid)][Vip] = GetPVarInt((playerid), "0_Vip");
597
598 if(P_DATA[playerid][Cookies] != GetPVarInt((playerid), "0_Cookies"))
599 P_DATA[(playerid)][Cookies] = GetPVarInt((playerid), "0_Cookies");
600
601 if(P_DATA[playerid][God] != GetPVarInt((playerid), "0_God"))
602 P_DATA[(playerid)][God] = GetPVarInt((playerid), "0_God");
603
604 if(P_DATA[playerid][CarGod] != GetPVarInt((playerid), "0_CarGod"))
605 P_DATA[(playerid)][CarGod] = GetPVarInt((playerid), "0_CarGod");
606
607 if(P_DATA[playerid][Positive] != GetPVarInt((playerid), "0_Positive"))
608 P_DATA[(playerid)][Positive] = GetPVarInt((playerid), "0_Positive");
609
610 if(P_DATA[playerid][Negative] != GetPVarInt((playerid), "0_Negative"))
611 P_DATA[(playerid)][Negative] = GetPVarInt((playerid), "0_Negative");
612
613 if(P_DATA[playerid][Boost] != GetPVarInt((playerid), "0_Boost"))
614 P_DATA[(playerid)][Boost] = GetPVarInt((playerid), "0_Boost");
615
616 if(P_DATA[playerid][Rank] != GetPVarInt((playerid), "0_Rank"))
617 P_DATA[(playerid)][Rank] = GetPVarInt((playerid), "0_Rank");
618
619 #endif
620 return 1;
621}
622
623public OnFilterScriptInit()
624{
625 if(fexist("0Admin/"))
626 {
627 #if SAVE_IN_LOGS == true
628 if(fexist(LOGS_LOC))
629 {
630 FileExist(VIPCHAT_LOG);
631 FileExist(ADMINCHAT_LOG);
632 FileExist(WARNS_LOG);
633 FileExist(PMS_LOG);
634 FileExist(SETRANK_LOG);
635 FileExist(SETLEVEL_LOG);
636 FileExist(SETVIP_LOG);
637 FileExist(KICK_LOG);
638 FileExist(BAN_LOG);
639 FileExist(RCON_LOG);
640 FileExist(REPORT_LOG);
641 }
642 else print("MISSING FOLDER: Folder \""#LOGS_LOC"\" doesn't exist! Please create it!"),
643 Fail = true;
644
645 #endif
646
647 FileExist(AKA_FILE);
648 if(!fexist(USER_ID))
649 {
650 printf("MISSING FILE: \""#USER_ID"\" doesn't exist, created by the system");
651 new File:uFile = fopen(USER_ID, io_append);
652 if(uFile)
653 {
654 fwrite(uFile, "Accounts_Created = 0\r\nLast_Account = None\r\nLast_Account_Date = Never");
655 fclose(uFile);
656 }
657 Fail = true;
658 }
659
660 if(!fexist(STATS_LOC))
661 {
662 print("MISSING FOLDER: Folder \""#STATS_LOC"\" doesn't exist! Please create it!");
663 Fail = true;
664 }
665 }else print("MISSING FOLDER: The main folder \"/0Admin/\" is missing from the \"scriptfiles\""),
666 Fail = true;
667
668 _DB = db_open(DATABASE_LOC);
669
670 new String[750];
671 strcat(String, "CREATE TABLE IF NOT EXISTS `Accounts` ", 750);
672 strcat(String, "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, \
673 `IP` TEXT, \
674 `Name` TEXT, \
675 `Password` TEXT, \
676 `Online` TEXT, \
677 `JoinDate` TEXT, \
678 `Level` NUMERIC, \
679 `VIP` NUMERIC, \
680 `Rank` NUMERIC, \
681 `Autologin` NUMERIC, \
682 `Money` NUMERIC, \
683 `Score` NUMERIC, \
684 `Kills` NUMERIC, \
685 `Deaths` NUMERIC, \
686 `Cookies` NUMERIC, \
687 `Positive` NUMERIC, \
688 `Negative` NUMERIC, \
689 `Messages` NUMERIC, \
690 `Commands` NUMERIC, \
691 `fCommands` NUMERIC, \
692 `Warns` NUMERIC, \
693 `Kicks` NUMERIC, \
694 `God` NUMERIC, \
695 `Cargod` NUMERIC,", 750);
696
697 strcat(String, " `ACCP` NUMERIC, \
698 `ACCPSav` TEXT, \
699 `BlockPM` NUMERIC, \
700 `Boost` NUMERIC, \
701 `bSpeed` NUMERIC, \
702 `RPassword` TEXT, \
703 `Question` TEXT, \
704 `Answer` TEXT, \
705 `WearTAG` NUMERIC, \
706 `Spin` NUMERIC, \
707 `Incred` NUMERIC)", 750);
708
709 DB::Query(_DB, String);
710 CreateTable(_DB, "Top", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `Name` TEXT,`Kills` NUMERIC,`Deaths` NUMERIC,`Hours` NUMERIC,`Rank` NUMERIC,`Ratio` TEXT,`Negative` NUMERIC,`Positive` NUMERIC)");
711
712 #if SAVE_MUTE == true
713 CreateTable(_DB, "Muted", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `IP` TEXT,`Muted` NUMERIC,`Time` NUMERIC,`RealName` TEXT)");
714 #endif
715
716 #if SAVE_JAIL == true
717 CreateTable(_DB, "Jailed", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `IP` TEXT,`Jailed` NUMERIC,`Time` NUMERIC,`RealName` TEXT)");
718 #endif
719
720 #if SAVE_FREEZE == true
721 CreateTable(_DB, "Frozen", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `IP` TEXT,`Frozen` NUMERIC,`RealName` TEXT)");
722 #endif
723
724 CreateTable(_DB, "Banlist", "(`IP` TEXT,`Name` TEXT, `Reason` TEXT, `Admin` TEXT, `BanDate` TEXT)");
725 CreateTable(_DB, "Positive", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `Name` TEXT,`Expiration` TEXT)");
726 CreateTable(_DB, "Negative", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `Name` TEXT,`Expiration` TEXT)");
727 CreateTable(_DB, "ServerStats", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `Commands`,`Messages`,`Crashes`,`Quits`,`Kicks/Bans`,`Connections`,`Uptime`)");
728 CreateTable(_DB, "Record", "(`Players`,`Date`,`Time`,`By`,`DateOLD`,`TimeOLD`,`ByOLD`)");
729
730 new
731 DBResult: R1;
732
733 R1 = DB::Query(_DB, "SELECT `Players`, `Date`, `Time`, `By` FROM `Record`");
734
735 if(R1)
736 {
737 if(DB::Valid(R1))
738 {
739 new Field[64];
740
741 DB::GetField(R1, "Players", Field, 64);
742 S_DATA[sRecord] = strval(Field);
743
744 DB::GetField(R1, "Date", Field, 64);
745 sscanf(Field, "p</>iii", S_DATA[sD], S_DATA[sM], S_DATA[sY]);
746
747 DB::GetField(R1, "Time", Field, 64);
748 sscanf(Field, "p<:>iii", S_DATA[sH], S_DATA[sMi], S_DATA[sS]);
749
750 DB::GetField(R1, "By", Field, 64);
751 format(S_DATA[RecordBy], MAX_PLAYER_NAME, "%s", Field);
752
753 DB::Free(R1);
754 }
755 else
756 {
757 DB::Free(R1);
758 DB::Query(_DB, "INSERT INTO `Record` VALUES('0','0/0/0','0:0:0','Nobody','0/0/0','0:0:0','Nobody')");
759 }
760 }
761 SetTimer("PingKick", 2000, true);
762 SetTimer("LowerSpam", LOW_SPAM_RATE, true);
763 SetTimer("GodLike", GOD_TICK_RATE, true);
764
765
766 INI_ParseFile(USER_ID, "ParseUserID" );
767 INI_ParseFile(SERVER_FILE, "LoadServerData");
768
769 if(S_DATA[Ping] < 100 && S_DATA[Ping] != 0)
770 {
771 new RandomPing = 600 + random(300);
772 printf("WARNING: Ping Kicker was under 100, randomly set to: %d", RandomPing);
773 S_DATA[Ping] = (RandomPing);
774 }
775 #if USE_RANKS == true
776
777 #if PRINT_RANKS == true
778
779 print("Ranks created succesfully!\n----------------------------");
780
781 #endif
782 for (new r = 0; r < sizeof(_Ranks); r++)
783 {
784 format(_RankNames[r], MAX_RANK_LEN, "%s", _Ranks[r][irName]);
785 #if PRINT_RANKS == true
786
787 printf("Rank: %s | Kills requiered: %d", _RankNames[r], _Ranks[r][iRank]);
788
789 #endif
790 }
791
792 #endif
793
794 if(Fail == true)
795 {
796 print(#\n\n\nWARNING:);
797 print(#----------------\n- When a file is missing","# the system will create it.);
798 print(#- However","# if you get a folder error","# you must create the folder on your own!);
799 print(#- If a folder or a file is deleted while the server runs","# problems may occur!\n\n);
800 }
801 if(fexist("/0Admin/"))
802 {
803 if(!fexist(SERVER_FILE))
804 {
805 printf("MISSING FILE: \""#SERVER_FILE"\" doesn't exist, created by the system");
806 print("Thew following atributions have been added to the following features:");
807
808 new INI:ServerFile = INI_Open(SERVER_FILE),
809 pStr[512];
810 print("\n==========================================");
811 print("||\tFeature\t\tState\tValue\t||");
812 print("||--------------------------------------||");
813
814 for(new i = 0; i < sizeof(INI_Server_Info); ++i)
815 {
816 INI_WriteInt(ServerFile, INI_Server_Info[i][isName], INI_Server_Info[i][isValue]);
817 format(pStr, sizeof (pStr), "||\t%s%s| %s%s",
818 INI_Server_Info[i][isName],
819 (i == 2 || i == 6 || i == 8 || i == 12 || i == 13 || i == 15) ? ("\t\t") : ("\t"),
820 (INI_Server_Info[i][isValue]) ? ((i == 2) ? (EX(INI_Server_Info[i][isValue])) : ("Yes")) : ("No"),
821 (INI_Server_Info[i][isValue]) ? ((i == 2) ? ("\t||") : ("\t\t||")) : ("\t\t||"));
822 print(pStr);
823 }
824
825 print("==================\t\t\t||");
826 print("\t\t|| Copyright jejemonerz123 2011 ||");
827 print("\t\t==========================\n\n\n");
828 INI_Close(ServerFile);
829 INI_ParseFile(SERVER_FILE, "LoadServerData");
830 }
831 }
832 if(!Fail) SetTimer("Display", 800, 0);
833
834
835 /*new
836 cmdBuffer[32],
837 commandCount;
838
839 for(new it = 0; it < Scripting_GetPublicsCount(); it++) {
840 Scripting_GetPublic(it, cmdBuffer);
841
842 if(!strcmp(cmdBuffer, "cmd_", false, 4)) {
843 strdel(cmdBuffer, 0, 4);
844 strins(cmdBuffer, "/", 0);
845 strins(cmdBuffer, "\r\n", strlen(cmdBuffer));
846 printf(#%d. %s, it - 47, cmdBuffer);
847 new File:F = fopen("Cmds.txt", io_append);
848
849 if(F)
850 {
851 fwrite(F, cmdBuffer);
852 fclose(F);
853 }
854
855 commandCount++;
856 }
857 }
858 printf(#A total of %d commands, commandCount);*/
859 return 1;
860}
861stock CountZCMDCmds() {
862 new
863 cmdBuffer[32],
864 commandCount;
865
866 for(new it = 0; it < Scripting_GetPublicsCount(); it++) {
867 Scripting_GetPublic(it, cmdBuffer);
868
869 if(!strcmp(cmdBuffer, "cmd_", false, 4)) {
870 commandCount++;
871 }
872 }
873
874 return commandCount;
875}
876public OnFilterScriptExit()
877{
878
879 db_close(_DB);
880
881 if(fexist(SERVER_FILE))
882 {
883 new INI:ServerFile = INI_Open(SERVER_FILE);
884
885 INI_WriteInt(ServerFile, INI_Server_Info[0][isName], S_DATA[AntiSpam]);
886 INI_WriteInt(ServerFile, INI_Server_Info[1][isName], S_DATA[AntiCSpam]);
887 INI_WriteInt(ServerFile, INI_Server_Info[2][isName], S_DATA[Ping]);
888 INI_WriteInt(ServerFile, INI_Server_Info[3][isName], S_DATA[RCONProt]);
889 INI_WriteInt(ServerFile, INI_Server_Info[4][isName], S_DATA[TellPlayer]);
890 INI_WriteInt(ServerFile, INI_Server_Info[5][isName], S_DATA[Chat]);
891 INI_WriteInt(ServerFile, INI_Server_Info[6][isName], S_DATA[ReadPM]);
892 INI_WriteInt(ServerFile, INI_Server_Info[7][isName], S_DATA[ReadCMD]);
893 INI_WriteInt(ServerFile, INI_Server_Info[8][isName], S_DATA[AKA]);
894 INI_WriteInt(ServerFile, INI_Server_Info[9][isName], S_DATA[ShowFunction]);
895 INI_WriteInt(ServerFile, INI_Server_Info[10][isName], S_DATA[AntiRepeat]);
896 INI_WriteInt(ServerFile, INI_Server_Info[11][isName], S_DATA[AutoLogin]);
897 INI_WriteInt(ServerFile, INI_Server_Info[12][isName], S_DATA[AnnRank]);
898 INI_WriteInt(ServerFile, INI_Server_Info[13][isName], S_DATA[AntiAD]);
899 INI_WriteInt(ServerFile, INI_Server_Info[14][isName], S_DATA[AdminChat]);
900 INI_WriteInt(ServerFile, INI_Server_Info[15][isName], S_DATA[VipChat]);
901 INI_Close(ServerFile);
902 }
903 return 1;
904}
905public OnRconCommand(cmd[])
906{
907 new
908 Player, P2, Reason[129];
909
910
911 if(!strcmp(cmd, ">", true, .length = 1))
912 {
913 if(!sscanf(cmd[1], "s[129]", Reason))
914 {
915 FormatMSG(0, Color:BLUE, "STUNTER'S GOD: "W"%s", Reason);
916 }
917 }
918 CONSOLE("!stats")
919 {
920 if(!sscanf(cmd[6], "uD(0)", Player, P2))
921 {
922 if(Player != (0xFFFF))
923 {
924 new
925 Str[24],fStr[500];
926
927 format(Str, sizeof(Str) + strlen(STATS_LOC), ""#STATS_LOC"%s.ini", Name(Player));
928
929
930 format(fStr, sizeof (fStr), "Date: %s\r\n------------------------------------------\r\n\
931 Registration Date: %s\r\n\
932 IP: %s\r\n\
933 Account ID: %d\r\n\
934 Level: %d\r\n\
935 VIP: %d\r\n\
936 Rank: %d\r\n\
937 Commands Used: %d\r\n\
938 Failed Commands: %d\r\n\
939 Messages Sent: %d\r\n\
940 Cookies: %d\r\n\
941 Online: %s\r\n\
942 Respect: %d/-%d\r\n\
943 Money: %d\r\n\
944 Score: %d\r\n\
945 Deaths: %d\r\n\
946 Kills: %d\r\n\
947 Ratio: %.3f\r\n\
948 Kicks Received: %d\r\n",
949 zDate (),
950 GPVSEx(Player, "AccountDate"),
951 PlayerIP[Player],
952 P_DATA[Player][AccID],
953 P_DATA[Player][Level],
954 P_DATA[Player][Vip],
955 P_DATA[Player][Rank],
956 P_DATA[Player][Cmds],
957 P_DATA[Player][fCmds],
958 P_DATA[Player][Msgs],
959 P_DATA[Player][Cookies],
960 FormatOnline(Player),
961 P_DATA[Player][Positive],
962 P_DATA[Player][Negative],
963 GetPlayerMoney(Player),
964 GetPlayerScore(Player),
965 P_DATA[Player][Deaths],
966 P_DATA[Player][Kills],
967 (Float:P_DATA[Player][Deaths] / Float:P_DATA[Player][Kills]),
968 P_DATA[Player][Kicks]);
969
970
971
972 if(P2 > 0) print(fStr);
973 printf("\n---------------------------------------------------------------------\n\
974 # %s's stats saved inside\n\n# "STATS_LOC"%s.ini\n\n# Open for his account details.\n\
975 ---------------------------------------------------------------------\n\
976 Type !stats <id> 1 to see them in the console.", Name(Player), Name(Player));
977 new
978 File:Stats = fopen(Str, io_append);
979
980 if(Stats)
981 {
982 if(fexist(Str)) fwrite(Stats, "\r\n\r\n\r\n");
983 fwrite(Stats, fStr);
984 fclose(Stats);
985 }
986 }
987 else PrintError("Player not connected!");
988 }
989 else PrintError("Invalid Syntax");
990 }
991 CONSOLE("!warn")
992 {
993 if(!sscanf(cmd[5], "u", Player))
994 {
995 if(Player != (0xFFFF))
996 {
997 ++P_DATA[Player][Warns];
998
999 if(P_DATA[Player][Warns] != MAX_P_WARNS){
1000 printf(" >>> You warned %s. (Warn Level: %d/"#MAX_P_WARNS")", Name(Player), P_DATA[Player][Warns]);}
1001
1002 else if(P_DATA[Player][Warns] >= MAX_P_WARNS){
1003 P_DATA[Player][Warns] = 0,
1004 printf(" >>> You warned %s. (Warn Level: %d/"#MAX_P_WARNS") > Kicked from the server for reaching the Warn Limit.", Name(Player), P_DATA[Player][Warns]);}
1005
1006 FormatMSG(Player, Color:GREY, "You have been warned by the owner of the server! ("ORAN"%d"GREY"/"ORAN""#MAX_P_WARNS")", P_DATA[Player][Warns]);
1007 SendAdminCMD(Player, "Owner of the server warned player %s. ("ORAN"%d"GREY"/"ORAN""#MAX_P_WARNS")", Name(Player), P_DATA[Player][Warns]);
1008 }
1009 else PrintError("Player not connected!");
1010 }
1011 else PrintError("Invalid Syntax");
1012 }
1013 CONSOLE("!2012")
1014 {
1015 if(!sscanf(cmd[5], "u", Player))
1016 {
1017 if(Player != (0xFFFF))
1018 {
1019 for (new w = 0; w < 11; w++)
1020 {SetPlayerSkillLevel(Player, w, 0);}
1021
1022 SetPlayerHealth(Player, 0.1); SetPlayerArmour(Player, 0.0);
1023 SetPlayerTime(Player, 0, 0); SetPlayerWeather(Player, -66);
1024 SetPlayerWantedLevel(Player, 6); SetPlayerSkin(Player, 159);
1025 ResetPlayerWeapons(Player); GivePlayerWeapon(Player, 10, 1);
1026 ResetPlayerMoney(Player); SetPlayerScore(Player, 0);
1027 SetPlayerDrunkLevel(Player, 99999);
1028
1029 printf(" >>> You fucked up %s's game!.", Name(Player));
1030 SendClientMessage(Player, Color:GREY, "You have been fucked up by the owner of the server!");
1031 SendAdminCMD(Player, "Owner of the server fucked up player %s", Name(Player));
1032
1033 new
1034 String[MAX_PLAYER_NAME];
1035
1036 format(String, MAX_PLAYER_NAME, "[NUB]%s", Name(Player));
1037 if(strfind(Name(Player), "[NUB]", false, 0)) SetPlayerName(Player, String);
1038 }
1039 else PrintError("Player not connected!");
1040 }
1041 else PrintError("Invalid Syntax");
1042 }
1043 CONSOLE("!kill")
1044 {
1045 if(!sscanf(cmd[5], "u", Player))
1046 {
1047 if(Player != (0xFFFF))
1048 {
1049 SetPlayerHealth(Player, 0.0);
1050
1051 printf(" >>> You killed %s.", Name(Player));
1052 SendClientMessage(Player, Color:GREY, "You have been killed by the owner of the server!");
1053 SendAdminCMD(Player, "Owner of the server killed player %s", Name(Player));
1054 }
1055 else PrintError("Player not connected!");
1056 }
1057 else PrintError("Invalid Syntax");
1058 }
1059 CONSOLE("!setonline")
1060 {
1061 new
1062 T[3];
1063 if(!sscanf(cmd[10], "udD(0)D(0)", Player, T[0], T[1], T[2]))
1064 {
1065 if(Player != (0xFFFF))
1066 {
1067 if(T[1] > 60 || T[1] < 0) return PrintError("Invalid minutes!");
1068 if(T[2] > 60 || T[2] < 0) return PrintError("Invalid seconds!");
1069
1070 P_DATA[Player][Hours] = T[0];
1071 P_DATA[Player][Minutes] = T[1];
1072 P_DATA[Player][Seconds] = T[2];
1073
1074 P_DATA[Player][ConnTime] = gettime();
1075
1076 printf(" >>> You set %s's online time to %d:%d:%d.",Name(Player), T[0], T[1], T[2]);
1077 FormatMSG(Player, Color:GREY, "Owner of the server set your online time to: "BLUE"%d"W":"BLUE"%d"W":"BLUE"%d", T[0], T[1], T[2]);
1078 SendAdminCMD(Player, "Owner of the server set %s's online time to: "BLUE"%d"W":"BLUE"%d"W":"BLUE"%d", Name(Player), T[0], T[1], T[2]);
1079 }
1080 else PrintError("Player not connected!");
1081 }
1082 else PrintError("Invalid Syntax");
1083 }
1084 CONSOLE("!spawn")
1085 {
1086 if(!sscanf(cmd[6], "u", Player))
1087 {
1088 if(Player != (0xFFFF))
1089 {
1090 SpawnPlayer(Player);
1091
1092 printf(" >>> You spawned %s.", Name(Player));
1093 SendClientMessage(Player, Color:GREY, "You have been spawned by the owner of the server!");
1094 SendAdminCMD(Player, "Owner of the server spawned player %s", Name(Player));
1095 }
1096 else PrintError("Player not connected!");
1097 }
1098 else PrintError("Invalid Syntax");
1099 }
1100 CONSOLE("!unfreeze")
1101 {
1102 if(!sscanf(cmd[9], "u", Player))
1103 {
1104 if(Player != (0xFFFF))
1105 {
1106 if(P_DATA[Player][Frozen])
1107 {
1108 P_DATA[Player][Frozen] = 0;
1109 UnFreeze(Player);
1110
1111 #if SAVE_FREEZE == true
1112
1113 new Query[256], DBResult:Result;
1114 format(Query, 256, "SELECT `Key` FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
1115 Result = DB::Query(_DB, Query);
1116
1117 if(Result)
1118 {
1119 if(DB::Valid(Result))
1120 {
1121 DB::Free(Result);
1122 format(Query, 256, "DELETE FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
1123 DB::Query(_DB, Query);
1124 }
1125 else DB::Free(Result);
1126 }
1127
1128 #endif
1129
1130 printf(" >>> You unfroze %s.", Name(Player));
1131 SendClientMessage(Player, Color:GREY, "You have been unfrozen by the owner of the server!");
1132 SendAdminCMD(Player, "Owner of the server unfrozen player %s", Name(Player));
1133 }
1134 else PrintError("Player is is not frozen!");
1135 }
1136 else PrintError("Player not connected!");
1137 }
1138 else PrintError("Invalid Syntax");
1139 }
1140 CONSOLE("!freeze")
1141 {
1142 if(!sscanf(cmd[7], "u", Player))
1143 {
1144 if(Player != (0xFFFF))
1145 {
1146 if(!P_DATA[Player][Frozen])
1147 {
1148 P_DATA[Player][Frozen] = 1;
1149 Freeze(Player);
1150
1151 #if SAVE_FREEZE == true
1152
1153 new
1154 Query[256],
1155 DBResult:R1;
1156 format(Query, sizeof(Query), "SELECT `Key` FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
1157 R1 = DB::Query(_DB, Query);
1158
1159 if(R1)
1160 {
1161 if(!DB::Valid(R1))
1162 {
1163 DB::Free(R1);
1164 format(Query, sizeof(Query), "INSERT INTO `Frozen` VALUES(NULL, '%s', '1', '%s')",GetPlayerIPEx(Player), Name(Player));
1165 DB::Query(_DB, Query);
1166 }
1167 else
1168 {
1169 DB::Free(R1);
1170 format(Query, sizeof(Query), "UPDATE `Frozen` SET `Frozen` = '1', `RealName` = '%s' WHERE `IP` = '%s'", Name(Player), GetPlayerIPEx(Player));
1171 DB::Query(_DB, Query);
1172 }
1173 }
1174
1175 #endif
1176
1177 printf(" >>> You froze %s.", Name(Player));
1178 SendClientMessage(Player, Color:GREY, "You have been frozen by the owner of the server!");
1179 SendAdminCMD(Player, "Owner of the server froze player %s", Name(Player));
1180 }
1181 else PrintError("Player is already frozen!");
1182 }
1183 else PrintError("Player not connected!");
1184 }
1185 else PrintError("Invalid Syntax");
1186 }
1187 CONSOLE("!unmute")
1188 {
1189 if(!sscanf(cmd[7], "u", Player))
1190 {
1191 if(Player != (0xFFFF))
1192 {
1193 if(P_DATA[Player][Muted])
1194 {
1195 P_DATA[Player][Muted] = 0;
1196 P_DATA[Player][MutedTime] = 0;
1197
1198 KillTimer(MuteTimer[Player]);
1199
1200 #if SAVE_MUTE == true
1201
1202 new
1203 Query[256];
1204 format(Query, 256, "DELETE FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
1205 DB::Query(_DB, Query);
1206
1207 #endif
1208
1209 printf(" >>> You unmuted %s.", Name(Player));
1210 SendClientMessage(Player, Color:GREY, "You have been unmuted by the owner of the server!");
1211 SendAdminCMD(Player, "Owner of the server unmuted player %s", Name(Player));
1212 }
1213 else PrintError("Player is not muted!");
1214 }
1215 else PrintError("Player not connected!");
1216 }
1217 else PrintError("Invalid Syntax");
1218 }
1219 CONSOLE("!mute")
1220 {
1221 if(!sscanf(cmd[5], "uD(0)", Player, P2))
1222 {
1223 if(Player != (0xFFFF))
1224 {
1225 if(!P_DATA[Player][Muted])
1226 {
1227
1228 if(!P2)
1229 {
1230 P_DATA[Player][Muted] = 1;
1231 P_DATA[Player][MutedTime] = 0;
1232
1233
1234 #if SAVE_MUTE == true
1235
1236 new
1237 pQue[256];
1238
1239 format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
1240 new DBResult:R1 = DB::Query(_DB, pQue);
1241
1242 if(R1)
1243 {
1244 if(!DB::Valid(R1))
1245 {
1246 DB::Free(R1);
1247 format(pQue, sizeof (pQue), "INSERT INTO `Muted` VALUES(NULL, '%s', '1', '0', '%s')", GetPlayerIPEx(Player), Name(Player));
1248 DB::Query(_DB, pQue);
1249 }
1250 else
1251 {
1252 DB::Free(R1);
1253 format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '0', `RealName` = '%s' WHERE `IP` = '%s'", Name(Player), GetPlayerIPEx(Player));
1254 DB::Query(_DB, pQue);
1255 }
1256 }
1257
1258 #endif
1259 printf(" >>> You muted %s forever", Name(Player));
1260 SendAdminCMD(INVALID_PLAYER_ID, "The owner of the server muted player "ORAN"%s[%i]"GREY" forever.", Name(Player), Player);
1261 SendClientMessage(Player, Color:GREY, "You have been muted forever by the owner of the server!");
1262 }
1263 else
1264 {
1265 P_DATA[Player][Muted] = 1;
1266
1267 SendAdminCMD(INVALID_PLAYER_ID, "The owner of the server muted player "ORAN"%s[%i] "GREY"["ORAN"Time: "W"%d"GREY" seconds]", Name(Player), Player, P2);
1268 FormatMSG(Player, Color:GREY, "You have been muted by the owner of the server! "W"["GREE"Time: "W"%d"GREY" seconds"W"]", P2);
1269
1270 #if SAVE_MUTE == true
1271
1272 new
1273 pQue[256];
1274
1275 format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
1276 new DBResult:R1 = DB::Query(_DB, pQue);
1277
1278 if(R1)
1279 {
1280 if(!DB::Valid(R1))
1281 {
1282 DB::Free(R1);
1283 format(pQue, sizeof (pQue), "INSERT INTO `Muted` VALUES(NULL, '%s', '1', '%d', '%s')", GetPlayerIPEx(Player), P2, Name(Player));
1284 DB::Query(_DB, pQue);
1285 }
1286 else
1287 {
1288 DB::Free(R1);
1289 format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '%d', `RealName` = '%s' WHERE `IP` = '%s'", P2, Name(Player), GetPlayerIPEx(Player));
1290 DB::Query(_DB, pQue);
1291 }
1292 }
1293
1294 #endif
1295 printf(" >>> You muted %s for %d seconds!", Name(Player), P2);
1296
1297 KillTimer(MuteTimer[Player]);
1298 MuteTimer[Player] = SetTimerEx("UnMutePlayer", P2, true, "i", Player);
1299 P_DATA[Player][MutedTime] = P2;
1300 }
1301 }else PrintError("Player is already muted!");
1302 }
1303 else PrintError("Player not connected!");
1304 }
1305 else PrintError("Invalid Syntax");
1306 }
1307 CONSOLE("!ban")
1308 {
1309 if(!sscanf(cmd[4], "uS(No Reason)[129]", Player, Reason))
1310 {
1311 if(Player != (0xFFFF))
1312 {
1313 printf(" >>> You banned %s from the server", Name(Player));
1314 printf(" >>> REASON: %s", Reason);
1315 SendClientMessage(Player, Color:GREY, " * You have been banned from the server by the owner. ");
1316 FormatMSG(Player, Color:BLUE, "REASON: "W"%s", Reason);
1317 SendAdminCMD(INVALID_PLAYER_ID, ""BLUE"%s"GREY" has been banned from the server by the server owner!", Name(Player));
1318 BanEx2(Player, "CONSOLE OWNER", Reason);
1319 }
1320 else PrintError("Player not connected!");
1321 }
1322 else PrintError("Invalid Syntax");
1323 return 1;
1324 }
1325 CONSOLE("!kick")
1326 {
1327 if(!sscanf(cmd[5], "uS(No Reason)[129]", Player, Reason))
1328 {
1329 if(Player != (0xFFFF))
1330 {
1331 printf(" >>> You kicked %s from the server", Name(Player));
1332 printf(" >>> REASON: %s", Reason);
1333 SendClientMessage(Player, Color:GREY, " * You have been kicked from the server by the owner. ");
1334 FormatMSG(Player, Color:BLUE, "REASON: "W"%s", Reason);
1335 KickEx(Player, "CONSOLE OWNER", Reason, false);
1336 SendAdminCMD(INVALID_PLAYER_ID, ""BLUE"%s"GREY" has been kicked from the server by the server owner!", Name(Player));
1337 }
1338 else PrintError("Player not connected!");
1339 }
1340 else PrintError("Invalid Syntax");
1341 return 1;
1342 }
1343 CONSOLE("!setrank")
1344 {
1345 if(!sscanf(cmd[8], "ud", Player, P2))
1346 {
1347 if(Player != (0xFFFF))
1348 {
1349 if(P2 > 0 || P2 < sizeof(_Ranks) - 1)
1350 {
1351 #if SAVE_IN_LOGS == true
1352 SaveInLog(SETRANK_LOG, "Owner of the server %s %s from Rank %d to %d on %s", (P_DATA[Player][Rank] < P2) ? ("promoved") : ("demoted"), Name(Player), P_DATA[Player][Rank], P2, zDate());
1353 #endif
1354
1355 FormatMSG(Player, Color:GREY, " * The owner of the server %s you to rank "BLUE"%d"GREY" | "BLUE"%s", (P_DATA[Player][Rank] < P2) ? ("promoved") : ("demoted"), P2, RankName(P2));
1356
1357 printf(" >>> You %s %s to rank to %d | %s.", (P_DATA[Player][Rank] < P2) ? ("promoved") : ("demoted"), Name(Player), P2, RankName(P2));
1358
1359 P_DATA[Player][Rank] = P2;
1360 }
1361 else PrintErrorEx("Maximu rank level is: %d", sizeof(_Ranks) - 1);
1362 }
1363 else PrintError("Player not connected!");
1364 }
1365 else PrintError("Invalid Syntax");
1366 return 1;
1367 }
1368 CONSOLE("!setvip")
1369 {
1370 if(!sscanf(cmd[7], "ud", Player, P2))
1371 {
1372 if(Player != (0xFFFF))
1373 {
1374 if(P2 < 5 || P2 > 0)
1375 {
1376 #if SAVE_IN_LOGS == true
1377
1378 SaveInLog(SETVIP_LOG, "Owner of the server %s %s from VIP level %d to %d on %s", (P_DATA[Player][Vip] < P2) ? ("promoved") : ("demoted"),Name(Player), P_DATA[Player][Vip], P2, zDate());
1379 #endif
1380 P_DATA[Player][Vip] = P2;
1381 printf(" >>> You %s %s's VIP level to %d.",(P_DATA[Player][Vip] < P2) ? ("promoved") : ("demoted"), Name(Player), P2);
1382 FormatMSG(Player, Color:GREY, " * The owner of the server %s you to VIP level "BLUE"%d"GREY"", (P_DATA[Player][Vip] < P2) ? ("promoved") : ("demoted"), P2);
1383 }
1384 else PrintError("Min. VIP: 0 | Max. VIP: 3");
1385 }
1386 else PrintError("Player not connected!");
1387 }
1388 else PrintError("Invalid Syntax");
1389 return 1;
1390 }
1391 CONSOLE("!setlevel")
1392 {
1393 if(!sscanf(cmd[9], "ud", Player, P2))
1394 {
1395 if(Player != (0xFFFF))
1396 {
1397 if(P2 < 5 || P2 > 0)
1398 {
1399 #if SAVE_IN_LOGS == true
1400 SaveInLog(SETLEVEL_LOG, "Owner of the server %s %s from %d to %d on %s", (P_DATA[Player][Level] < P2) ? ("promoved") : ("demoted"), Name(Player), P_DATA[Player][Level], P2, zDate());
1401 #endif
1402
1403 printf(" >>> You %s %s as %s of the server! (Level: %d)", (P_DATA[Player][Level] < P2) ? ("promoved") : ("demoted"), Name(Player), LevelName(P2), P2);
1404
1405 P_DATA[Player][Level] = P2;
1406 FormatMSG(Player, Color:GREY, " * The owner of the server set you as "BLUE"%s"GREY" of the server. (Admin Level: "BLUE"%d"GREY")", LevelName(P2), P2);
1407 }
1408 else PrintError("Min. level: 0 | Max. level: 5");
1409 }
1410 else PrintError("Player not connected!");
1411 }
1412 else PrintError("Invalid Syntax");
1413 return 1;
1414 }
1415 _0CMD("cmds")
1416 {
1417 print("Commands trough console of 0Admin System V"#Version"");
1418 print("------------------------------------------------------\n");
1419 print(" !setlevel <id> <level>\t!setvip <id> <vip>" );
1420 print(" !setrank <id> <rank>\t\t!ranks <no params>");
1421 print(" !kick <id> <reason>\t\t!ban <id> <reason>");
1422 print(" ![un]mute <id> <time>\t\t![un]freeze <id>");
1423 print(" ![un]jail <id> <time>\t\t!spawn <id>" );
1424 print(" !setonline <id> <h> <m> <s>\t!kill <id>" );
1425 print(" !2012 <id>\t\t\t!stats <id>" );
1426 }
1427 _0CMD("features")
1428 {
1429
1430 new
1431 pStr[1_5];
1432
1433 if(!S_DATA[Ping]) pStr = "\tN/A"; else format(pStr, 1_5, "\t\t%d", S_DATA[Ping]);
1434 print ("-------------------------------------------------");
1435 print ("| Feature\t\tState\t\tValue\t|" );
1436 print ("-------------------------------------------------");
1437
1438 printf("| Anti Spam\t\t%s%sN/A\t|\n\
1439 | Anti CMD Spam\t%s%sN/A\t|\n\
1440 | Ping Kicker\t\t%s%s\t|\n\
1441 | RCON Protection\t%s%sN/A\t|\n\
1442 | Tell Player\t\t%s%sN/A\t|\n\
1443 | Block Chat\t\t%s%sN/A\t|\n\
1444 | Read PM\t\t%s%sN/A\t|\n\
1445 | Read Commands\t%s\tN/A\t|",
1446 Triadic(S_DATA[AntiSpam] ),
1447 S_DATA[AntiSpam] ? ("\t\t") :("\t"),
1448 Triadic(S_DATA[AntiCSpam]),
1449 S_DATA[AntiCSpam] ? ("\t\t") :("\t"),
1450 Triadic(S_DATA[Ping] ),pStr,
1451 Triadic(S_DATA[RCONProt] ),
1452 S_DATA[RCONProt] ? ("\t\t") :("\t"),
1453 Triadic(S_DATA[TellPlayer]),
1454 S_DATA[TellPlayer] ? ("\t\t") :("\t"),
1455 Triadic(S_DATA[Chat] ),
1456 S_DATA[Chat] ? ("\t\t") :("\t"),
1457 Triadic(S_DATA[ReadPM] ),
1458 S_DATA[ReadPM] ? ("\t\t") :("\t"),
1459 Triadic(S_DATA[ReadCMD] ));
1460
1461 printf("| AKA\t\t\t%s%sN/A\t|\n\
1462 | Show Function\t%s%sN/A\t|\n\
1463 | Anti Repeat\t\t%s%sN/A\t|\n\
1464 | Auto Login\t\t%s%sN/A\t|\n\
1465 | Announce Rank\t%s%sN/A\t|\n\
1466 | Anti Advertising\t%s%sN/A\t|",
1467 Triadic(S_DATA[AKA] ),
1468 S_DATA[AKA] ? ("\t\t") :("\t"),
1469 Triadic(S_DATA[ShowFunction]),
1470 S_DATA[ShowFunction] ? ("\t\t") :("\t"),
1471 Triadic(S_DATA[AntiRepeat] ),
1472 S_DATA[AntiRepeat] ? ("\t\t") :("\t"),
1473 Triadic(S_DATA[AutoLogin] ),
1474 S_DATA[AutoLogin] ? ("\t\t") :("\t"),
1475 Triadic(S_DATA[AnnRank] ),
1476 S_DATA[AnnRank] ? ("\t\t") :("\t"),
1477 Triadic(S_DATA[AntiAD] ),
1478 S_DATA[AntiAD] ? ("\t\t") :("\t"));
1479 print ("-------------------------------------------------");
1480 }
1481 _0CMD("info")
1482 {
1483 print("\n\n\n");
1484 print("Informations about 0Admin System V"#Version"");
1485 print("------------------------------------------------------\n");
1486 print(" - The idea of creating a new and optimised Admin System came\n\
1487 to me when i was seeing all these new and old fashioned admin\n\
1488 scripts with the oldest functions and less optimisation.\n\
1489 So i decided to start working on a new and unique admin script\n\
1490 that everyone will enjoy no mather what server you own,\n\
1491 Stunt, RP, Freeroam, Trucking, etc.\n");
1492 print(" - The system is provided with the fastest functions like sscanf\n\
1493 ZCMD - the almost fastest command processor and of course\n\
1494 using Regular Expresions to detect an advertising in chat.\n\n \
1495 - The system is mostly based on dialogs, for example Control Panel\n\
1496 which is available for Admins and VIP or regular members to control\n\
1497 and use them whenever they need with a vast ease.\n");
1498 print(" - The basic idea was to let all kind of people that don't know\n\
1499 the basics or it's new into this kind of game. That's the main\n\
1500 reason for using so many dialogs, because many don't really know\n\
1501 or forgot commands name, so I decidede to pack everything up\n\
1502 and insert it into a dialog.\n");
1503 print(" - The story ends here, main reason was told. ");
1504 print("------------------------------------------------------\n");
1505
1506 }
1507 if(!strcmp(cmd, "!help", true))
1508 {
1509 print("\n\n\n");
1510 print("Help for 0Admin System V"#Version"");
1511 print("--------------------------------------------------------");
1512 print(" # Type !acmds to use a command inside a server." );
1513 print(" # Type !0credits to see the credits." );
1514 print(" # Type !0info to see informations about this system." );
1515 print(" # Type !0FAQ for answers to your problems." );
1516 print(" # Type !0svstats to see the stats of the server." );
1517 print(" # Type !0features to see enabled/disabled features." );
1518 print("--------------------------------------------------------");
1519 print(" > Check often the forums for new updates!");
1520 print("------");
1521 }
1522 if(!strcmp(cmd, "reload0", true))
1523 {
1524 SendRconCommand("reloadfs 0Admin");
1525 print("Reloading 0Admin!");
1526 }
1527 return 1;
1528}
1529
1530#if USE_RANKS == true
1531 CheckRank(killer, rank)
1532 {
1533 if(P_DATA[killer][Kills] == _Ranks[rank][iRank])
1534 return 1;
1535
1536 return 0;
1537 }
1538 AnnounceRank(killer, rank)
1539 {
1540 new Str[256];
1541 format(Str, sizeof (Str), "RANK UP: "GREY" You are now a member with Rank "ORAN"%d"GREY" |"ORAN" %s", rank, RankName(rank));
1542 SendClientMessage(killer, Color:ORAN, Str);
1543 SetPVarInt(killer, "0_Rank", rank);
1544 P_DATA[killer][Rank] = rank;
1545 if(S_DATA[AnnRank])
1546 {
1547 format(Str, sizeof (Str), "*** "ORAN"%s[%i]"GREY" ranked up! With "ORAN"%d"GREY" kills and from now on must be known as "ORAN"%s"GREY" !", Name(killer), killer, P_DATA[killer][Kills], RankName(rank));
1548 foreach(Player, k){
1549 if(k != killer){
1550 SendClientMessage(k, Color:GREY, Str);
1551 }
1552 }
1553 }
1554 #if UPDATE_TOP_ALWAYS == true
1555
1556 new
1557 Query[256],
1558 DBResult: R1;
1559
1560
1561 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(killer));
1562 R1 = DB::Query(_DB, Query);
1563
1564 if(R1)
1565 {
1566 if(DB::Valid(R1))
1567 {
1568 DB::Free(R1);
1569 format(Query, sizeof(Query), "UPDATE `Top` SET `Rank` = '%d' WHERE `Name` = '%s'", rank, Name(killer));
1570 DB::Query(_DB, Query);
1571 }
1572 else
1573 {
1574 DB::Free(R1);
1575 format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `Rank`) VALUES('%s','%d')", Name(killer), rank);
1576 DB::Query(_DB, Query);
1577 }
1578 }
1579 #endif
1580 }
1581#endif
1582
1583public OnPlayerDeath(playerid, killerid, reason)
1584{
1585 if(killerid != INVALID_PLAYER_ID)
1586 {
1587 P_DATA[killerid][Kills]++;
1588 SetPVarInt(killerid, "0_Kills", GetPVarInt(killerid, "0_Kills") + 1);
1589 }
1590 P_DATA[playerid][Deaths]++;
1591 SetPVarInt(playerid, "0_Deaths",GetPVarInt(playerid, "0_Deaths") + 1);
1592
1593 #if UPDATE_TOP_ALWAYS == true
1594
1595 new
1596 Query[256],
1597 DBResult:R1;
1598
1599
1600 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(playerid));
1601 R1 = DB::Query(_DB, Query);
1602
1603 if(R1)
1604 {
1605 if(DB::Valid(R1))
1606 {
1607 DB::Free(R1);
1608 format(Query, sizeof(Query), "UPDATE `Top` SET `Deaths` = '%d', `Ratio` = '%f' WHERE `Name` = '%s'", P_DATA[playerid][Deaths], (Float:P_DATA[playerid][Kills] / Float:P_DATA[playerid][Deaths]), Name(playerid));
1609 DB::Query(_DB, Query);
1610 }
1611 else
1612 {
1613 DB::Free(R1);
1614 format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `Deaths`, `Ratio`) VALUES('%s', '%d', '%f')",Name(playerid), P_DATA[playerid][Deaths], (Float:P_DATA[playerid][Kills] / Float:P_DATA[playerid][Deaths]));
1615 DB::Query(_DB, Query);
1616 }
1617 }
1618 if(killerid != (0xFFFF))
1619 {
1620 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(killerid));
1621 R1 = DB::Query(_DB, Query);
1622
1623 if(R1)
1624 {
1625 if(DB::Valid(R1))format(Query, sizeof(Query), "UPDATE `Top` SET `Kills` = '%d', `Ratio` = '%f' WHERE `Name` = '%s'", P_DATA[killerid][Kills], (Float:P_DATA[killerid][Kills] / Float:P_DATA[killerid][Deaths]), Name(killerid));
1626 else format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `Kills`, `Ratio`) VALUES('%s', '%d', '%f')", Name(killerid), P_DATA[killerid][Kills], (Float:P_DATA[killerid][Kills] / Float:P_DATA[killerid][Deaths]));
1627
1628 DB::Free(R1);
1629 DB::Query(_DB, Query);
1630 }
1631 }
1632
1633
1634 #endif
1635
1636 #if USE_RANKS == true
1637
1638 if (CheckRank(killerid, 1))AnnounceRank(killerid, 1);
1639 else if(CheckRank(killerid, 2))AnnounceRank(killerid, 2);
1640 else if(CheckRank(killerid, 3))AnnounceRank(killerid, 3);
1641 else if(CheckRank(killerid, 4))AnnounceRank(killerid, 4);
1642 else if(CheckRank(killerid, 5))AnnounceRank(killerid, 5);
1643 else if(CheckRank(killerid, 6))AnnounceRank(killerid, 6);
1644 else if(CheckRank(killerid, 7))AnnounceRank(killerid, 7);
1645 else if(CheckRank(killerid, 8))AnnounceRank(killerid, 8);
1646
1647 #endif
1648 return 1;
1649}
1650CMD:gmx(PARAMS)
1651{
1652 SendRconCommand("gmx");
1653 return 1;
1654}
1655
1656Detour<acmds,acmds>
1657Detour<ahelp,acmds>
1658Detour<admincmds,adminhelp>
1659Detour<ac,acmds>
1660
1661
1662CMD:arules(PARAMS)
1663{
1664 LoginCheck(playerid);
1665
1666 new String[2_000];
1667
1668 switch(P_DATA[playerid][Level])
1669 {
1670 case 0:
1671 {
1672 strcat(String, ""W"["BLUE"0"W"] "BLUE"Member"W"\n\
1673 - Don't do anything stupid.\n\
1674 - You are just a player under rules!", 2_000);
1675 }
1676 case 1:
1677 {
1678 strcat(String, ""W"["BLUE"1"W"] "BLUE"Helper"W"\n\
1679 - Make sure players have what they need, like time, weather.\n\
1680 - Make sure when a player asks for help to give them the appropriate response.\n\
1681 - You are just a helper! Don't act cocky! Act like a helper!\n\
1682 - Dealing with players that surpass your abillities? Ask for help to the superiors!\n\n", 2_000);
1683 }
1684 case 2:
1685 {
1686 strcat(String, "["BLUE"2"W"] "BLUE"Mini Moderator"W"\n\
1687 - You have somewhat control over the players. You can mute/freeze them.\n\
1688 - If you notice a hacker or someone with illegal weapons, use "BLUE"/disarm"W".\n\
1689 - When a players asks for something, do it, like change skin, heal car etc..\n\
1690 - Use "BLUE"/bankrupt"W" to remove player's money if you they hack.\n\n", 2_000);
1691 }
1692 case 3:
1693 {
1694 strcat(String, "["BLUE"3"W"] "BLUE"Moderator"W"\n\
1695 - You are a full moderator, your job is to take care of the server while superiors are offline\n\
1696 - Make sure nobody spams the chat, use "BLUE"/clearchat"W" to clear the chat just in case.\n\
1697 - You can manipulate player's account, like set his time,skin,cookies,money,score,kills etc..\n\
1698 - Your abilities are high enough! Use with caution!\n\n", 2_000);
1699 }
1700 case 4:
1701 {
1702 strcat(String, "["BLUE"4"W"] "BLUE"Administrator"W"\n\
1703 - No proper rules for you.\n\
1704 - Do whatever you think it's right.\n\
1705 - Lower level member may not judge your actions.\n\n", 2_000);
1706 }
1707 case 5:
1708 {
1709 strcat(String, "["BLUE"5"W"] "BLUE"Owner"W"\n\
1710 - Lower level member may not judge your actions.\n\
1711 - Do whatever you want.", 2_000);
1712 }
1713 }
1714
1715 Show(String);
1716 return 1;
1717}
1718
1719CMD:adminhelp(PARAMS)
1720{
1721 LoginCheck(playerid);
1722
1723
1724 switch(P_DATA[playerid][Level])
1725 {
1726 case 0:
1727 {
1728 Show(""BLUE"Normal Member"W"\n\
1729 /register /login /stats /pm /admins /vips /top /time changepass(/cpass)\n\
1730 /cookies /buycookies /eatcookie /buycookiesjar /giftcookie /cookieshelp\n\n\
1731 "BLUE"Remember to read the rules of your level!!");
1732
1733 }
1734 case 1:
1735 {
1736 Show(""BLUE"Helper"W"\n\
1737 /goto /gotopos /getip /settime /spawn /acar /jailed /frozen\n\
1738 /muted /car /acar /accp /unblock /cargod /god\n\n\
1739 "BLUE"Remember to read the rules at "BLUE"/arules!");
1740 }
1741 case 2:
1742 {
1743 Show(""BLUE"Mini Moderator"W"\n\
1744 /disarm /bankrupt /tplayer /eject /heal /spec /show /setskin\n\
1745 /[un]freeze /[un]mute /aweapons /healcar /setvhealth /carcolor\n\
1746 /ann /ann2 /aka\n\
1747 "BLUE"Remember to read the rules at "BLUE"/arules!");
1748 }
1749 case 3:
1750 {
1751 Show(""BLUE"Moderator"W"\n\
1752 /giveweapon /warn /healall /heal /aweapons /givecar /write /destroyv\n\
1753 /[un]jail /slap /clearchat /akill /explode /setalltime /setallweather\n\
1754 /set(cookies|health|armour|score|cash|skin|time|weather|world|interior|drunk|respect|wanted)\n\n\
1755 "BLUE"Remember to read the rules at "BLUE"/arules!");
1756 }
1757 case 4:
1758 {
1759 new Str[600];
1760 strcat(Str, \
1761 ""BLUE"Administrator"W"\n\
1762 /setall(health|armour|score|cash|skin|world|interior|drunk|cookies|respect|wanted)\n\
1763 /giveall(h(ealth)|armour|score|cash|cookies|wanted|weapon)\n\
1764 /kick /wcheck /setdeaths /setkills /2012 /resetallrespect /killall\n", 600);
1765
1766 strcat(Str, \
1767 "/[un]muteall /[un]freezeall /spawnall /2012all /chat /slapall\n\
1768 /disarmall /explodeall\n\n\
1769 "BLUE"Remember to read the rules at "BLUE"/arules!", 600);
1770
1771 Show(Str);
1772 }
1773 case 5:
1774 {
1775 Show(""BLUE"Owner"W"\n\
1776 /setlevel /settemplevel /ban /unban /acp /respawncars /removeacc\n\
1777 /setonline /setstat /fake /fakechat /fakecmd /fakecon /fakedisc /fakedeath\n\
1778 /kickall /banall\n\n\
1779 "BLUE"Remember to read the rules at "BLUE"/arules!");
1780
1781 }
1782 }
1783 return 1;
1784}
1785CMD:announce2(PARAMS)
1786{
1787 SendClientMessage(playerid, Color:GREY, "Use "BLUE"/ann2"GREY" instead!");
1788 return 1;
1789}
1790CMD:announce(PARAMS)
1791{
1792 SendClientMessage(playerid, Color:GREY, "Use "BLUE"/ann"GREY" instead!");
1793 return 1;
1794}
1795CMD:changepass(PARAMS)
1796{
1797 SendClientMessage(playerid, Color:GREY, "Use "BLUE"/cpass"GREY" instead!");
1798 return 1;
1799}
1800CMD:cpass(PARAMS)
1801{
1802 LoginCheck(playerid);
1803
1804 new OldPass[MAX_PASS_LEN], NewPass[MAX_PASS_LEN];
1805 if(sscanf(params, "s[20]s[20]", OldPass, NewPass)) return SendUsage(playerid, "/cpass "GREY"<old pass> <new pass>", "Will change your password.");
1806 else
1807 {
1808 if(strlen(NewPass) < MIN_PASS_LEN || strlen(NewPass) > MAX_PASS_LEN)
1809 return SendError(playerid, "The new password has an invalid length!");
1810
1811 new Query[300], DBResult:Result, Buf[129];
1812 WP_Hash(Buf, 129, OldPass);
1813 format(Query, 300, "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s' AND `Password` = '%s'", Name(playerid), Buf);
1814 Result = DB::Query(_DB, Query);
1815
1816 if(Result)
1817 {
1818 if(DB::Valid(Result))
1819 {
1820 DB::Free(Result);
1821 WP_Hash(Buf, 129, NewPass);
1822 format(Query, 300, "UPDATE `Accounts` SET `Password` = '%s', `RPassword` = '%s' WHERE `Name` = '%s'", Buf, OldPass, Name(playerid));
1823 DB::Query(_DB, Query);
1824
1825 FormatMSG(playerid, Color:GREY, "Password changed! New password is: "BLUE"%s", NewPass);
1826 SendAdminCMD(playerid, "PLayer "ORAN"%s[%i]"GREY" changed his password!", Name(playerid), playerid);
1827 }
1828 else
1829 {
1830 DB::Free(Result);
1831 return SendError(playerid, "Old Password doesn't match the current password!");
1832 }
1833 }
1834 }
1835 return 1;
1836}
1837
1838
1839CMD:ann2(PARAMS)
1840{
1841 LoginCheck(playerid);
1842 LevelCheck(playerid, 2);
1843
1844 new Announce[129], Time, Style;
1845 if(sscanf(params, "s[129]dd", Announce, Time, Style)) return SendUsage(playerid, "/ann2 "GREY"<text> <time> <style>", "Send a text to the server with style and time. (Time is in ms)");
1846 else
1847 {
1848 if(Style > 6 || Style < 0) return SendError(playerid, "Style: 0-6");
1849 GameTextForAll(Announce, Time, Style );
1850 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" used command "ORAN"/ann2", Name(playerid), playerid);
1851 SendClientMessage(playerid, Color:GREY, "Announce sent!");
1852 }
1853 return 1;
1854}
1855CMD:ann(PARAMS)
1856{
1857 LoginCheck(playerid);
1858 LevelCheck(playerid, 2);
1859
1860 new Announce[129];
1861 if(sscanf(params, "s[129]", Announce)) return SendUsage(playerid, "/ann "GREY"<text>", "Will show a text in the middle of the screen!");
1862 else
1863 {
1864 GameTextForAll(Announce, 7000, 3 );
1865 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" used command "ORAN"/ann", Name(playerid), playerid);
1866 SendClientMessage(playerid, Color:GREY, "Announce sent!");
1867 }
1868 return 1;
1869}
1870CMD:aka(PARAMS)
1871{
1872 LoginCheck(playerid);
1873 LevelCheck(playerid, 2);
1874
1875 new Player;
1876 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/aka "GREY"<id>", "Will show the aka list of a player");
1877 else
1878 {
1879 if(Player == 0xFFFF)
1880 return SendError(playerid, "Player not connected!");
1881
1882 INI_ParseFile(AKA_FILE, "LoadAKA", .bExtra = true, .extra = Player);
1883
1884 if(strlen(GPVSEx(Player, "pAKA")) > 3)
1885 {
1886 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" is viewing the aka list of "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
1887 FormatMSG(playerid, Color:GREY, "Player "ORAN"%s"GREY" has used the following names: "ORAN"%s"GREY".", Name(Player), GPVSEx(Player, "pAKA"));
1888 }
1889 else
1890 {
1891 SendError(playerid, "An error has occured");
1892 }
1893 }
1894 return 1;
1895}
1896CMD:unblock(PARAMS)
1897{
1898 LoginCheck(playerid);
1899 LevelCheck(playerid, 1);
1900
1901 new Player;
1902 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/unblock "GREY"<id>", "Will unstuck a player");
1903 else
1904 {
1905 TogglePlayerControllable(Player, true);
1906
1907 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unblocked player "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
1908 FormatMSG(playerid, Color:GREY, "You unstucked player "ORAN"%s[%i]", Name(Player), Player);
1909 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" unblocked you", Name(playerid), playerid);
1910 }
1911 return 1;
1912}
1913CMD:time(PARAMS)
1914{
1915 LoginCheck(playerid);
1916
1917 new T[2], Str[10];
1918 gettime(T[0], T[1]);
1919 format(Str, 10, "~r~%d~w~:~r~%d", T[0], T[1]);
1920 GameTextForPlayer(playerid, Str, 3000, 1);
1921
1922 return 1;
1923}
1924CMD:cargod(PARAMS)
1925{
1926 LoginCheck(playerid);
1927 LevelCheck(playerid, 1);
1928
1929 switch(P_DATA[playerid][CarGod])
1930 {
1931 case false:
1932 {
1933 P_DATA[playerid][CarGod] = 1;
1934 SetPVarInt(playerid, "0_CarGod", 1);
1935 SendClientMessage(playerid, Color:GREY, "Vehicle God has been activated!");
1936 }
1937 case true:
1938 {
1939 P_DATA[playerid][CarGod] = 0;
1940 SetPVarInt(playerid, "0_CarGod", 0);
1941 SendClientMessage(playerid, Color:GREY, "Vehicle God has been deactivated!");
1942
1943 }
1944 }
1945 return 1;
1946}
1947CMD:god(PARAMS)
1948{
1949 LoginCheck(playerid);
1950 LevelCheck(playerid, 1);
1951
1952 switch(P_DATA[playerid][God])
1953 {
1954 case false:
1955 {
1956 P_DATA[playerid][God] = 1;
1957 SetPVarInt(playerid, "0_God", 1);
1958 SendClientMessage(playerid, Color:GREY, "Godlike has been activated!");
1959 }
1960 case true:
1961 {
1962 P_DATA[playerid][God] = 0;
1963 SetPVarInt(playerid, "0_God", 0);
1964 SendClientMessage(playerid, Color:GREY, "Godlike has been deactivated!");
1965
1966 }
1967 }
1968 return 1;
1969}
1970
1971
1972CMD:pcp(PARAMS)
1973{
1974 LoginCheck(playerid);
1975
1976 SPD(playerid, Dialog:PCP, LIST, "Player control panel", PcPanel(playerid), "ON/Select", "OFF/Exit");
1977 return 1;
1978}
1979
1980CMD:record(playerid)
1981{
1982 LoginCheck(playerid);
1983
1984 new
1985 Str[1024];
1986 format(Str, sizeof (Str), ""W"Record details:\n\n\
1987 "GREE"NEW RECORD:\n\
1988 "GREY"Broken by: "BLUE"%s\n\
1989 "GREY"Date: "BLUE"%d/%d/%d\n\
1990 "GREY"Time: "BLUE"%d:%d:%d\n\
1991 "GREY"Record: "BLUE"%d "GREY"players",
1992 S_DATA[RecordBy],
1993 S_DATA[sD], S_DATA[sM], S_DATA[sY],
1994 S_DATA[sH], S_DATA[sMi], S_DATA[sS],
1995 S_DATA[sRecord]);
1996
1997 new
1998 Field[4][64],
1999 DBResult: R1;
2000
2001 R1 = DB::Query(_DB, "SELECT `ByOLD`, `DateOLD`, `TimeOLD` FROM `Record`;");
2002 if(DB::Valid(R1))
2003 {
2004 DB::GetField(R1, "ByOLD", Field[0], 64);
2005 DB::GetField(R1, "DateOLD", Field[1], 64);
2006 DB::GetField(R1, "TimeOLD", Field[2], 64);
2007 DB::Free(R1);
2008 }
2009 else
2010 {
2011 DB::Free(R1);
2012 Field[0] = "Nobody"; Field[1] = "Never"; Field[2] = "Never";
2013 }
2014 format(Str, sizeof (Str), "%s\n\n{FF0000}OLD RECORD:\n\
2015 "GREY"Broken by: "ORAN"%s\n\
2016 "GREY"Date: "ORAN"%s\n\
2017 "GREY"Time: "ORAN"%s\n\
2018 "GREY"Record: "ORAN"%d "GREY"players",
2019 Str,
2020 Field[0], Field[1], Field[2], S_DATA[sRecord] - 1);
2021 SPD(playerid, Dialog:Empty, BOX, ""W"Players record!", Str, "Close", "");
2022 return 1;
2023}
2024
2025public OnPlayerConnect(playerid)
2026{
2027 if(IsPlayerNPC(playerid)) return 1;
2028
2029 new DBResult:bResult, bQuery[129];
2030 format(bQuery, 129, "SELECT `IP`, `Reason`, `Admin`, `BanDate` FROM `Banlist` WHERE `Name` = '%s';", Name(playerid));
2031 bResult = DB::Query(_DB, bQuery);
2032
2033 new bField[4][129], Field[50];
2034 if(bResult)
2035 {
2036 if(DB::Valid(bResult))
2037 {
2038 DB::GetField(bResult, "Reason", bField[0], 129);
2039 DB::GetField(bResult, "Admin", bField[1], 129);
2040 DB::GetField(bResult, "BanDate", bField[2], 129);
2041
2042 DB::Free(bResult);
2043 for (new i = 0; i < 10; i++)SendClientMessage(playerid, -1, " ");
2044
2045 SendClientMessage(playerid, Color:ORAN, "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *");
2046 SendClientMessage(playerid, Color:ORAN, "BANNED:"W" Sorry to inform you, but this account is "ORAN"banned"W" from this server!");
2047 FormatMSG(playerid, ~1, "You were banned by Administrator "ORAN"%s"W" on "ORAN"%s"W" with the following reason:", bField[1], bField[2]);
2048 SendClientMessage(playerid, Color:ORAN, bField[0]);
2049
2050 KickEx(playerid, "System", "Banned Account", true);
2051
2052 return 0;
2053 }
2054 else
2055 {
2056 DB::Free(bResult);
2057
2058 new DBResult:bResult2;
2059 format(bQuery, 129, "SELECT `IP`, `Name`, `Reason`, `Admin`, `BanDate` FROM `Banlist` WHERE `IP` = '%s';", GetPlayerIPEx(playerid));
2060 bResult2 = DB::Query(_DB, bQuery);
2061
2062 if(bResult2)
2063 {
2064 if(DB::Valid(bResult2))
2065 {
2066 loop(i, 4){ bField[_i][0] = '\0'; }
2067 DB::GetField(bResult2, "IP", bField[3], 129);
2068 if(!strcmp(GetPlayerIPEx(playerid), bField[3]))
2069 {
2070 DB::GetField(bResult2, "Reason", bField[0], 129);
2071 DB::GetField(bResult2, "Admin", bField[1], 129);
2072 DB::GetField(bResult2, "BanDate", bField[2], 129);
2073
2074 DB::Free(bResult2);
2075 loop(o, 10){ SendClientMessage(playerid, -1, " "); }
2076
2077 SendClientMessage(playerid, Color:ORAN, "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *");
2078 SendClientMessage(playerid, Color:ORAN, "BANNED:"W" Sorry to inform you, but this account is "ORAN"banned"W" from this server!");
2079 FormatMSG(playerid, -1, "You were banned by Administrator "ORAN"%s"W" on "ORAN"%s"W" with the following reason:", bField[1], bField[2]);
2080 SendClientMessage(playerid, Color:ORAN, bField[0]);
2081
2082 KickEx(playerid, "System", "Banned Account", true);
2083 return 0;
2084 }
2085 }else DB::Free(bResult2);
2086 }
2087 }
2088 }
2089
2090 S_DATA[sPlayers] ++;
2091
2092 if(S_DATA[sRecord] < S_DATA[sPlayers])
2093 {
2094 new
2095 Date[6],
2096 Query[256];
2097
2098 getdate(Date[2], Date[1], Date[0]);
2099 gettime(Date[3], Date[4], Date[5]);
2100
2101 if(!strlen(S_DATA[RecordBy])) format(S_DATA[RecordBy], MAX_PLAYER_NAME, "Nobody");
2102 format(Query, sizeof (Query), "UPDATE `Record` SET `Players` = '%d', `Date` = '%d/%d/%d', `Time` = '%d:%d:%d', `By` = '%s', `DateOLD` = '%d/%d/%d', `TimeOLD` = '%d:%d:%d', `ByOLD` = '%s'",\
2103 S_DATA[sPlayers], Date[0], Date[1], Date[2], Date[3], Date[4], Date[5], Name(playerid), S_DATA[sD], S_DATA[sM], S_DATA[sY], S_DATA[sH], S_DATA[sMi], S_DATA[sS], S_DATA[RecordBy]);
2104
2105 DB::Query(_DB, Query);
2106
2107 getdate(S_DATA[sY], S_DATA[sM], S_DATA[sD]);
2108 gettime(S_DATA[sH], S_DATA[sMi], S_DATA[sS]);
2109
2110
2111 SendClientMessage(playerid, -1, " ");
2112 SendClientMessage(playerid, -1, " ");
2113 SendClientMessage(playerid, -1, " ");
2114 SendClientMessage(playerid, Color:BLUE, "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ");
2115 FormatMSG(playerid, Color:BLUE, "RECORD BROKEN!! "GREY"You broke "BLUE"%s"GREY"'s record of "BLUE"%d"GREY" most players online!", S_DATA[RecordBy], S_DATA[sRecord]);
2116 SendClientMessage(playerid, Color:GREY, "Use "BLUE"/record"GREY" to check more details!");
2117 SendClientMessage(playerid, Color:BLUE, "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ");
2118 SendClientMessage(playerid, -1, " ");
2119 SendClientMessage(playerid, -1, " ");
2120 foreach(Player, i)
2121 {
2122 if(i != playerid)
2123 {
2124 FormatMSG(i, Color:BLUE, "*** %s "GREY" broke "BLUE"%s"GREY"'s record of "BLUE"%d"GREY" most players online!", Name(playerid), S_DATA[RecordBy], S_DATA[sRecord]);
2125 SendClientMessage(i, Color:GREY, "Use "BLUE"/record"GREY" to check more details!");
2126 }
2127 }
2128 format(S_DATA[RecordBy], MAX_PLAYER_NAME, "%s", Name(playerid));
2129 S_DATA[sRecord] = S_DATA[sPlayers];
2130 }
2131
2132 format(PlayerIP[playerid], 50, "%s", GetPlayerIPEx(playerid));
2133
2134 SetPVarInt(playerid, "FirstConnection", 1);
2135 new String[256];
2136
2137 if(!S_DATA[AKA])
2138 {
2139 format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined the server!", Name(playerid), playerid);
2140 SendClientMessageToAll(Color:ORAN, String);
2141 }
2142 else
2143 {
2144 INI_ParseFile(AKA_FILE, "LoadAKA", .bExtra = true, .extra = playerid);
2145
2146
2147 if(strlen(GPVSEx(playerid, "pAKA")) < 3)
2148 {
2149 format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined the server!", Name(playerid), playerid);
2150 }
2151 else if(!strcmp(GPVSEx(playerid, "pAKA"), Name(playerid), true))
2152 {
2153 format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined the server!", Name(playerid), playerid);
2154 }
2155 else format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined the server!"GREY"[AKA:"W" %s"GREY"]",Name(playerid), playerid, GPVSEx(playerid, "pAKA"));
2156
2157 foreach(Player, i)
2158 {
2159 if(P_DATA[i][Level] > 2)
2160 {
2161 if(i != playerid)SendClientMessage(i, Color:ORAN, String);
2162 }
2163 else
2164 {
2165 format(String, sizeof (String),"%s["W"%i"ORAN"]"W" Has joined the server!", Name(playerid), playerid);
2166 SendClientMessage(i, Color:ORAN, String);
2167 }
2168 }
2169
2170 new pIP[30];
2171 GetPlayerIp(playerid, pIP, 30);
2172
2173
2174 //INI_ParseFile(AKA_FILE, "LoadAKA", .bExtra = true, .extra = playerid);
2175 if(!strlen(GPVSEx(playerid, "pAKA")))
2176 {
2177 new INI: pAka = INI_Open(AKA_FILE);
2178 INI_WriteString(pAka, pIP, Name(playerid));
2179 INI_Close(pAka);
2180 }
2181 else
2182 {
2183 if(strfind(GPVSEx(playerid, "pAKA"), Name(playerid), true) == -1)
2184 {
2185 new Str[256];
2186 format (Str, 256, "%s,%s", GPVSEx(playerid, "pAKA"), Name(playerid));
2187 new INI: pAka = INI_Open(AKA_FILE);
2188 INI_WriteString(pAka, pIP, Str);
2189 INI_Close(pAka);
2190 }
2191 }
2192 }
2193 P_DATA[playerid][ConnTime] = gettime();
2194 P_DATA[playerid][LogFail] = MAX_PASS_FAIL;
2195 P_DATA[playerid][Spec_ID] = 0xFFFF;
2196 P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_NONE;
2197
2198 ClearVars(playerid);
2199
2200
2201 #if SAVE_FREEZE == true
2202
2203 new Query[256];
2204
2205 format(Query, sizeof (Query), "SELECT `Key`, `Frozen`, `RealName` FROM `Frozen` WHERE `IP` = '%s';", GetPlayerIPEx(playerid));
2206 new DBResult:Result1 = DB::Query(_DB, Query);
2207
2208 if(Result1)
2209 {
2210 if(DB::Valid(Result1))
2211 {
2212 new xField[64];
2213
2214 DB::GetField(Result1, "RealName", xField, 64);
2215 SetPVarString(playerid, "FreezeName", xField);
2216
2217 DB::GetField(Result1, "Frozen", xField, 64);
2218 P_DATA[playerid][Frozen] = strval(xField);
2219
2220 DB::Free(Result1);
2221 }
2222 else
2223 {
2224 DB::Free(Result1);
2225 format(Query, 256, "SELECT `IP`, `Frozen`, `RealName` FROM `Frozen` WHERE `RealName` = '%s';", Name(playerid));
2226 new DBResult:Result2 = DB::Query(_DB, Query);
2227
2228 if(Result2)
2229 {
2230 if(DB::Valid(Result2))
2231 {
2232 DB::GetField(Result2, "IP", Field, sizeof (Field));
2233 SetPVarString(playerid, "FalseIP", Field);
2234
2235 if(strcmp(GetPlayerIPEx(playerid), Field))
2236 {
2237 DB::GetField(Result2, "Frozen", Field, sizeof (Field));
2238 P_DATA[playerid][Frozen] = strval(Field);
2239
2240 DB::GetField(Result2, "RealName", Field, sizeof (Field));
2241 SetPVarString(playerid, "FreezeName", Field);
2242
2243 DB::GetField(Result2, "IP", Field, sizeof (Field));
2244 SetPVarString(playerid, "FalseIP", Field);
2245 }
2246 DB::Free(Result2);
2247 }
2248 else
2249 {
2250 DB::Free(Result2);
2251 SetPVarString(playerid, "FreezeName", "5;6:2:6:*:$:^");
2252 }
2253 }
2254 }
2255
2256 }
2257
2258 if(P_DATA[playerid][Frozen])
2259 {
2260 if(strcmp(GPVSEx(playerid, "FreezeName"), Name(playerid), false))
2261 {
2262 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2263 FormatMSG(playerid, Color:ORAN, "MUTE EVADING:"W" You have received "ORAN" 2 WARNINGS"W" for FREEZE EVADING! "GREY"(Old name: "ORAN"%s"GREY")", GPVSEx(playerid, "FreezeName"));
2264 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2265
2266 P_DATA[playerid][Warns] += 2;
2267
2268 SetPlayerName(playerid, GPVSEx(playerid, "FreezeName"));
2269 }
2270 else if(strcmp(GPVSEx(playerid, "FalseIP"), GetPlayerIPEx(playerid)))
2271 {
2272 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2273 FormatMSG(playerid, Color:ORAN, "MUTE EVADING:"W" You have received "ORAN" 2 WARNINGS"W" for FREEZE EVADING! "GREY"(Old IP: "ORAN"%s"GREY")", GPVSEx(playerid, "FalseIP"));
2274 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2275
2276 P_DATA[playerid][Warns] += 2;
2277
2278 SetPlayerName(playerid, GPVSEx(playerid, "FreezeName"));
2279 }
2280
2281 format(Query, 256, "UPDATE `Frozen` SET `IP` = '%s', `Frozen` = '1', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "FreezeName"));
2282 DB::Query(_DB, Query);
2283
2284 if(P_DATA[playerid][Warns] >= MAX_P_WARNS)
2285 {
2286 SendClientMessage(playerid, Color:GREY, "You have been kicked from the server for exceeding warnings!");
2287 KickEx(playerid, "System", "Exceeding Warnings");
2288 return 0;
2289 }
2290 }
2291 #endif
2292
2293 #if SAVE_MUTE == true
2294
2295 new Query2[256],
2296 DBResult:Result3;
2297
2298 format(Query2, sizeof (Query2), "SELECT `Muted`, `Time`, `RealName` FROM `Muted` WHERE `IP` = '%s';", GetPlayerIPEx(playerid));
2299 Result3 = DB::Query(_DB, Query2);
2300
2301 if(Result3)
2302 {
2303 if(DB::Valid(Result3))
2304 {
2305 DB::GetField(Result3, "Muted", Field, sizeof (Field));
2306 P_DATA[playerid][Muted] = strval(Field);
2307
2308 DB::GetField(Result3, "Time", Field, sizeof (Field));
2309 P_DATA[playerid][MutedTime] = strval(Field);
2310
2311 DB::GetField(Result3, "RealName", Field, sizeof (Field));
2312 SetPVarString(playerid, "MuteName", Field);
2313
2314 DB::Free(Result3);
2315 GameTextForPlayer(playerid, "~r~You have been cought freeze evading the system!~n~You have been punished!", 7600, 3);
2316 }
2317 else
2318 {
2319 DB::Free(Result3);
2320 format(Query2, sizeof(Query2), "SELECT `IP`, `Muted`, `RealName`, `Time` FROM `Muted` WHERE `RealName` = '%s';", Name(playerid));
2321 new DBResult:Result4 = DB::Query(_DB, Query2);
2322
2323 if(Result4)
2324 {
2325 if(DB::Valid(Result4))
2326 {
2327 DB::GetField(Result4, "IP", Field, sizeof (Field));
2328 if(strcmp(GetPlayerIPEx(playerid), Field))
2329 {
2330 DB::GetField(Result4, "Muted", Field, sizeof (Field));
2331 P_DATA[playerid][Muted] = strval(Field);
2332
2333 DB::GetField(Result4, "Time", Field, sizeof (Field));
2334 P_DATA[playerid][MutedTime] = strval(Field);
2335
2336 DB::GetField(Result4, "RealName", Field, sizeof (Field));
2337 SetPVarString(playerid, "MuteName", Field);
2338
2339 DB::GetField(Result4, "IP", Field, sizeof (Field));
2340 SetPVarString(playerid, "FalseIP", Field);
2341
2342 GameTextForPlayer(playerid, "~r~You have been cought mute evading the system!~n~You have been punished!", 7600, 3);
2343 }
2344 DB::Free(Result4);
2345 }
2346 else
2347 {
2348 DB::Free(Result4);
2349 SetPVarString(playerid, "MuteName", "5;6:2:6:*:$:^");
2350 SetPVarString(playerid, "FalseIP", "5;6:2:6:*:$:^");
2351 }
2352 }
2353 }
2354 }
2355
2356 if(P_DATA[playerid][MutedTime] > 0)
2357 {
2358 if(strcmp(GPVSEx(playerid, "MuteName"), Name(playerid), false))
2359 {
2360 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2361 FormatMSG(playerid, Color:ORAN, "MUTE EVADING:"W" You have received an extra "ORAN""#EXTRA_MINUTES""W" minutes for mute evading! "GREY"(Old Name: "ORAN"%s"GREY")", GPVSEx(playerid, "MuteName"));
2362 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2363
2364 SetPlayerName(playerid, GPVSEx(playerid, "MuteName"));
2365
2366 P_DATA[playerid][MutedTime] += (EXTRA_MINUTES);
2367 }
2368 else if(strcmp(GPVSEx(playerid, "FalseIP"), GetPlayerIPEx(playerid)))
2369 {
2370 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2371 FormatMSG(playerid, Color:ORAN, "MUTE EVADING:"W" You have received an extra "ORAN""#EXTRA_MINUTES""W" minutes for mute evading! "GREY"(Old IP: "ORAN"%s"GREY")", GPVSEx(playerid, "FalseIP"));
2372 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2373
2374 SetPlayerName(playerid, GPVSEx(playerid, "MuteName"));
2375
2376 P_DATA[playerid][MutedTime] += (EXTRA_MINUTES);
2377 }
2378 P_DATA[playerid][Muted] = 1;
2379
2380 FormatMSG(playerid, Color:ORAN, "SERVER:"W" You are still muted! "ORAN"["GREY"Aprox. "W"%d minutes"ORAN"]", P_DATA[playerid][MutedTime]);
2381 MuteTimer[playerid] = SetTimerEx("UnMutePlayer", 60_000, true, "i", playerid);
2382
2383 new pQ[129];
2384 format(pQ, sizeof (pQ), "UPDATE `Muted` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "MuteName"));
2385 DB::Query(_DB, pQ);
2386
2387 }
2388 else if(P_DATA[playerid][Muted] && !P_DATA[playerid][MutedTime])
2389 {
2390 if(strcmp(GPVSEx(playerid, "MuteName"), Name(playerid), false))
2391 {
2392 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2393 FormatMSG(playerid, Color:ORAN, "MUTE EVADING:"W" You have received"ORAN" 2 WARNINGS"W" for MUTE EVADING! "GREY"(Old Name: "ORAN"%s"GREY")", GPVSEx(playerid, "MuteName"));
2394 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2395
2396 SetPlayerName(playerid, GPVSEx(playerid, "MuteName"));
2397
2398 P_DATA[playerid][Warns] += 2;
2399
2400 new pQ[129];
2401 format(pQ, sizeof (pQ), "UPDATE `Muted` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "MuteName"));
2402 DB::Query(_DB, pQ);
2403 }
2404 else if(strcmp(GPVSEx(playerid, "FalseIP"), GetPlayerIPEx(playerid)))
2405 {
2406 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2407 FormatMSG(playerid, Color:ORAN, "MUTE EVADING:"W" You have received"ORAN" 2 WARNINGS"W" for MUTE EVADING! "GREY"(Old IP: "ORAN"%s"GREY")", GPVSEx(playerid, "FalseIP"));
2408 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2409
2410 SetPlayerName(playerid, GPVSEx(playerid, "MuteName"));
2411
2412 P_DATA[playerid][Warns] += 2;
2413
2414 format(Query2, sizeof (Query2), "UPDATE `Muted` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "MuteName"));
2415 DB::Query(_DB, Query2);
2416 }
2417 SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You are still muted! "ORAN"["GREY"Mute time: "W"Forever"ORAN"]");
2418 }
2419 if(P_DATA[playerid][Warns] == MAX_P_WARNS)
2420 {
2421 SendClientMessage(playerid, Color:GREY, "You have been kicked from the server for exceeding warnings!");
2422 KickEx(playerid, "System", "Exceeding Warnings");
2423 return 0;
2424 }
2425
2426 #endif
2427
2428
2429 new pQuery[512], DBResult:pResult;
2430 format(pQuery, 512, "SELECT `Autologin` FROM `Accounts` WHERE `Name` = '%s';", Name(playerid));
2431 pResult = DB::Query(_DB, pQuery);
2432 new pField[60];
2433
2434 if(pResult)
2435 {
2436 if(DB::Valid(pResult))
2437 {
2438
2439 DB::GetField(pResult, "Autologin", pField, sizeof(pField));
2440 P_DATA[playerid][pAuto] = strval(pField);
2441
2442 DB::Free(pResult);
2443 if(P_DATA[playerid][pAuto])
2444 {
2445 new DBResult:pResult2;
2446 format(pQuery, 512, "SELECT `IP`, `RPassword` FROM `Accounts` WHERE `Name` = '%s';", Name(playerid));
2447 pResult2 = DB::Query(_DB, pQuery);
2448
2449 if(pResult2)
2450 {
2451 if(DB::Valid(pResult2))
2452 {
2453 DB::GetField(pResult2, "IP", pField, sizeof(pField));
2454 if(!strcmp(pField, GetPlayerIPEx(playerid), false))
2455 {
2456 DB::GetField(pResult2, "RPassword", pField, sizeof(pField));
2457 LoginPlayer(playerid, pField, .pAutoLogin = true);
2458 }
2459 else SendLogin(playerid);
2460 }
2461 else SendLogin(playerid);
2462 }
2463 } else SendLogin(playerid);
2464 }
2465 else
2466 {
2467 new zStr[256];
2468 format(zStr, sizeof (zStr), ""W"Welcome "GREE"%s "W"on "GREE"%s."W"\n\nThis server requiers that you register an account\nPlease write your desired password", Name(playerid), GetServerHostName());
2469 ShowPlayerDialog(playerid, Dialog:Register, DIALOG_STYLE_INPUT, ""W"Register an account", zStr, "Register", "Kick");
2470 }
2471 }
2472 return 1;
2473}
2474SendLogin(playerid)
2475{
2476 new zStr[150];
2477 format(zStr, sizeof (zStr), ""W"Welcome back "GREE"%s"W"\n\nPlease login into your account:", Name(playerid));
2478
2479 #if SECURITY_QUESTION == true
2480
2481 SPD(playerid, Dialog:Login2, INPUT, ""W"Welcome back", zStr, "Login", "Forg. Pass");
2482
2483 #else
2484
2485 SPD(playerid, Dialog:Login2, INPUT, ""W"Welcome back", zStr, "Login", "Kick");
2486
2487 #endif
2488
2489}
2490public OnPlayerDisconnect(playerid, reason)
2491{
2492 S_DATA[sPlayers] --;
2493
2494 DeletePlayer3DTextLabel(playerid, ZaAdminCar[playerid]);
2495
2496 if(P_DATA[playerid][tLevel])
2497 {
2498 P_DATA[playerid][Level] = 0;
2499 }
2500
2501 DestroyVehicle(P_DATA[playerid][aCar]);
2502
2503 new zStr[256];
2504 switch(reason)
2505 {
2506 case 0: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[CRASH]", Name(playerid), playerid);
2507 case 1: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[LEAVING]", Name(playerid), playerid);
2508 case 2: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[KICK"W"/"ORAN"BAN]", Name(playerid), playerid);
2509
2510 }
2511 SendClientMessageToAll(Color:ORAN, zStr);
2512
2513 if(P_DATA[playerid][Logged]) { SavePlayerData(playerid); }
2514
2515 new Query[129];
2516
2517 #if !SAVE_JAIL && !SAVE_MUTE
2518 #pragma unused Query
2519 #endif
2520
2521 #if SAVE_JAIL == true
2522
2523 if(P_DATA[playerid][JailTime] > 0 )
2524 {
2525 format(Query, 129, "UPDATE `Jailed` SET `Jailed` = '%d', `Time` = '%d', `RealName` = '%s' WHERE `IP` = '%s'", P_DATA[playerid][Jailed], P_DATA[playerid][JailTime], Name(playerid), PlayerIP[playerid]);
2526 DB::Query(_DB, Query);
2527 }
2528 else if(!P_DATA[playerid][JailTime] && P_DATA[playerid][Jailed])
2529 {
2530 format(Query, 129, "SELECT `Key` FROM `Jailed` WHERE `IP` = '%s';", PlayerIP[playerid]);
2531 new DBResult:Result = DB::Query(_DB, Query);
2532
2533 if(Result)
2534 {
2535 if(!DB::Valid(Result))
2536 {
2537 DB::Free(Result);
2538 format(Query, 129, "DELETE FROM `Jailed` WHERE `IP` = '%s'", PlayerIP[playerid]);
2539 DB::Query(_DB, Query);
2540 }
2541 }
2542 }
2543
2544 #endif
2545
2546 #if SAVE_MUTE == true
2547
2548
2549 if(P_DATA[playerid][MutedTime] > 0)
2550 {
2551 format(Query, 129, "UPDATE `Muted` SET `Muted` = '%d', `Time` = '%d', `RealName` = '%s' WHERE `IP` = '%s'", P_DATA[playerid][Muted], P_DATA[playerid][MutedTime], Name(playerid), PlayerIP[playerid]);
2552 DB::Query(_DB, Query);
2553 }
2554 else if(!P_DATA[playerid][MutedTime] && P_DATA[playerid][Muted])
2555 {
2556 format(Query, 129, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", PlayerIP[playerid]);
2557 new DBResult:Result = DB::Query(_DB, Query);
2558
2559 if(Result)
2560 {
2561 if(!DB::Valid(Result))
2562 {
2563 DB::Free(Result);
2564 format(Query, 129, "DELETE FROM `Muted` WHERE `IP` = '%s'", PlayerIP[playerid]);
2565 DB::Query(_DB, Query);
2566 }
2567 }
2568 }
2569
2570 #endif
2571 for(new i = 0; i < 5; i++)
2572 {
2573 if(IsPlayerAttachedObjectSlotUsed(playerid, i))
2574 {
2575 RemovePlayerAttachedObject(playerid, i);
2576 }
2577 }
2578
2579
2580 KillTimer(MuteTimer[playerid] );
2581 KillTimer(JailTimer[playerid] );
2582 KillTimer(P_DATA[playerid][NosTimer] );
2583 P_DATA[playerid][LogFail] = 0;
2584 ClearVars(playerid);
2585
2586 return 1;
2587}
2588
2589public OnPlayerCommandPerformed(playerid, cmdtext[], success)
2590{
2591
2592 if(success)
2593 {
2594 P_DATA[playerid][Cmds]++;
2595 SetPVarInt(playerid, "0_Commands", P_DATA[playerid][Cmds]);
2596
2597 if(S_DATA[ReadCMD])
2598 {
2599 SendAdminCMD(playerid, ""GREY"[CMD] %s[%i] "W"used command{FF0000} %s", Name(playerid), playerid, cmdtext);
2600 printf(#[%s] %s - %s, zDate(), Name(playerid), cmdtext);
2601 }
2602 }
2603 else
2604 {
2605 P_DATA[playerid][fCmds]++;
2606 SetPVarInt(playerid, "0_Fail_Commands", P_DATA[playerid][fCmds]) ;
2607 return 0;
2608 }
2609 return 1;
2610}
2611public OnPlayerCommandReceived(playerid, cmdtext[])
2612{
2613 P_DATA[playerid][cSpam]++;
2614 if(S_DATA[AntiCSpam] && (!IsPlayerAdmin(playerid) || P_DATA[playerid][Level] != 5))
2615 {
2616 if(P_DATA[playerid][cSpam] > MAX_CMD_SPAM && !IsPlayerAdmin(playerid))
2617 {
2618 BanEx2(playerid, .zReason = "Extreme command spam");
2619 return 0;
2620 }
2621 else if(P_DATA[playerid][cSpam] > MIN_CMD_SPAM)
2622 {
2623 KickEx(playerid, .zReason = "Command spam");
2624 return 0;
2625 }
2626 }
2627 if(P_DATA[playerid][Jailed] && !P_DATA[playerid][JailTime] && P_DATA[playerid][Level] != 5 && !IsPlayerAdmin(playerid))
2628 {
2629 SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You are not allowed to use any commands while jailed! "GREY"[Jail Time: "ORAN"Forever"GREY"]");
2630 return 0;
2631 }
2632 else if(P_DATA[playerid][Jailed] && P_DATA[playerid][JailTime] > 0 && P_DATA[playerid][Level] != 5 && !IsPlayerAdmin(playerid))
2633 {
2634 FormatMSG(playerid, Color:ORAN, "SERVER:"W" You are not allowed to use any commands while jailed! "GREY"[Jail Time: "ORAN"%d"GREY" minutes]", P_DATA[playerid][JailTime]);
2635 return 0;
2636 }
2637 return 1;
2638}
2639
2640public OnPlayerSpawn(playerid)
2641{
2642 if(IsPlayerNPC(playerid)) return 1;
2643 #if SAVE_JAIL == true
2644
2645 if(GetPVarType(playerid, "FirstConnection"))
2646 {
2647 if(P_DATA[playerid][Incred])
2648 {
2649 for(new i = 0; i < 5; i++)
2650 if(IsPlayerAttachedObjectSlotUsed(playerid, i))
2651 RemovePlayerAttachedObject(playerid, i);
2652
2653 SetPlayerAttachedObject(playerid, 0, 18693, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
2654 SetPlayerAttachedObject(playerid, 1, 18693, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
2655 SetPlayerAttachedObject(playerid, 2, 18703, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
2656 SetPlayerAttachedObject(playerid, 3, 18703, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
2657 SetPlayerAttachedObject(playerid, 4, 18965, 2, 0.111052, 0.021643, -0.000846, 92.280899, 92.752510, 358.071044, 1.200000, 1.283168, 1.200000 );
2658 }
2659 if(P_DATA[playerid][VIPTag])
2660 {
2661 if(P_DATA[playerid][Tag3D])
2662 {
2663 Attach3DTextLabelToPlayer(P_DATA[playerid][Tag3D], playerid, 0.0, 0.0, 1.2);
2664 }
2665 }
2666 DeletePVar(playerid, "FirstConnection");
2667 new Query[256],
2668 DBResult:Result1;
2669
2670 format(Query, sizeof (Query), "SELECT `Key`, `Jailed`, `Time`, `RealName` FROM `Jailed` WHERE `IP` = '%s';", GetPlayerIPEx(playerid));
2671 Result1 = DB::Query(_DB, Query);
2672
2673 if(Result1)
2674 {
2675 if(DB::Valid(Result1))
2676 {
2677 new Field[30];
2678
2679 DB::GetField(Result1, "Jailed", Field, sizeof (Field));
2680 P_DATA[playerid][Jailed] = strval(Field);
2681
2682 DB::GetField(Result1, "Time", Field, sizeof (Field));
2683 P_DATA[playerid][JailTime] = strval(Field);
2684
2685 DB::GetField(Result1, "RealName", Field, sizeof (Field));
2686 SetPVarString(playerid, "JailName", Field);
2687
2688 DB::Free(Result1);
2689 }
2690 else
2691 {
2692 DB::Free(Result1);
2693 format(Query, 256, "SELECT `IP` FROM `Jailed` WHERE `RealName` = '%s'", Name(playerid));
2694 new DBResult:Result2 = DB::Query(_DB, Query);
2695
2696 if(Result2)
2697 {
2698 if(DB::Valid(Result2))
2699 {
2700 new Field[64];
2701 DB::GetField(Result2, "IP", Field, sizeof (Field));
2702 if(strcmp(GetPlayerIPEx(playerid), Field))
2703 {
2704 format(Query, sizeof (Query), "SELECT `Key`, `Jailed`, `Time`, `RealName`, `IP` FROM `Jailed` WHERE `RealName` = '%s';", Name(playerid));
2705 Result1 = DB::Query(_DB, Query);
2706
2707 DB::GetField(Result2, "Jailed", Field, sizeof (Field));
2708 P_DATA[playerid][Jailed] = strval(Field);
2709
2710 DB::GetField(Result2, "Time", Field, sizeof (Field));
2711 P_DATA[playerid][JailTime] = strval(Field);
2712
2713 DB::GetField(Result2, "RealName", Field, sizeof (Field));
2714 SetPVarString(playerid, "JailName", Field);
2715
2716 DB::GetField(Result2, "IP", Field, sizeof (Field));
2717 SetPVarString(playerid, "JFalseIP", Field);
2718
2719 DB::Free(Result2);
2720 }
2721 }
2722 else DB::Free(Result2);
2723
2724 }
2725 }
2726 }
2727
2728 if(P_DATA[playerid][JailTime] > 0)
2729 {
2730 if(strcmp(GPVSEx(playerid, "JailName"), Name(playerid), false))
2731 {
2732 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2733 FormatMSG(playerid, Color:ORAN, "JAIL EVADING:"W" You have received an extra "ORAN""#EXTRA_MINUTES""W" minutes for JAIL EVADING! "GREY"(Old name: "ORAN"%s"GREY")", GPVSEx(playerid, "JailName"));
2734 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2735
2736 SetPlayerName(playerid, GPVSEx(playerid, "JailName"));
2737 P_DATA[playerid][JailTime] += (EXTRA_MINUTES);
2738 }
2739 else if(strcmp(GPVSEx(playerid, "JFalseIP"), GetPlayerIPEx(playerid), false))
2740 {
2741 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2742 FormatMSG(playerid, Color:ORAN, "JAIL EVADING:"W" You have received an extra "ORAN""#EXTRA_MINUTES""W" minutes for JAIL EVADING! "GREY"(Old IP: "ORAN"%s"GREY")", GPVSEx(playerid, "JFalseIP"));
2743 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2744
2745 SetPlayerName(playerid, GPVSEx(playerid, "JailName"));
2746 P_DATA[playerid][JailTime] += (EXTRA_MINUTES);
2747 }
2748 P_DATA[playerid][Jailed] = 1;
2749
2750 FormatMSG(playerid, Color:ORAN, "SERVER:"W" You are still jailed! "ORAN"["GREY"Jail time: "W"%d minutes"ORAN"]", P_DATA[playerid][JailTime]);
2751
2752 SetTimerEx("JailPlayer", 1500, false, "i", playerid);
2753
2754 new pQ[129];
2755 format(pQ, sizeof (pQ), "UPDATE `Jailed` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "JailName"));
2756 DB::Query(_DB, pQ);
2757
2758 }
2759 else if(P_DATA[playerid][Jailed] && P_DATA[playerid][JailTime] == 0)
2760 {
2761 if(strcmp(GPVSEx(playerid, "JailName"), Name(playerid), false))
2762 {
2763 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2764 FormatMSG(playerid, Color:ORAN, "JAIL EVADING:"W" You have received an extra "ORAN"2 WARNINGS"W" minutes for JAIL EVADING! "GREY"(Old name: "ORAN"%s"GREY")", GPVSEx(playerid, "JailName"));
2765 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2766
2767 SetPlayerName(playerid, GPVSEx(playerid, "JailName"));
2768 P_DATA[playerid][Warns] += 2;
2769 }
2770 else if(strcmp(GPVSEx(playerid, "JFalseIP"), GetPlayerIPEx(playerid), false))
2771 {
2772 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2773 FormatMSG(playerid, Color:ORAN, "JAIL EVADING:"W" You have received an extra "ORAN"2 WARNINGS"W" minutes for JAIL EVADING! "GREY"(Old IP: "ORAN"%s"GREY")", GPVSEx(playerid, "JFalseIP"));
2774 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2775
2776 SetPlayerName(playerid, GPVSEx(playerid, "JailName"));
2777 P_DATA[playerid][Warns] += 2;
2778 }
2779 SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You are still jailed! "ORAN"["GREY"Jail time: "W"Forever"ORAN"]");
2780
2781 SetTimerEx("JailPlayer", 1500, false, "i", playerid);
2782
2783 new pQ[129];
2784 format(pQ, sizeof (pQ), "UPDATE `Jailed` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "JailName"));
2785 DB::Query(_DB, pQ);
2786
2787 if(P_DATA[playerid][Warns] == MAX_P_WARNS)
2788 {
2789 SendClientMessage(playerid, Color:GREY, "You have been kicked from the server for exceeding warnings!");
2790 KickEx(playerid, "System", "Exceeding Warnings");
2791 return 0;
2792 }
2793
2794 }
2795 }
2796 #endif
2797 if(P_DATA[playerid][Frozen])
2798 {
2799 Freeze(playerid);
2800 SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You are still frozen, you cannot move! "GREY"(If this is not true, please "W"/report"GREY" to admins!)");
2801 }
2802 return 1;
2803}
2804public OnRconLoginAttempt(ip[], password[], success)
2805{
2806 if(! success)
2807 {
2808 new zStr[180];
2809 if(S_DATA[RCONProt])
2810 {
2811 S_DATA[RconFails] += 1;
2812 if(S_DATA[RconFails] >= MAX_RCON_ATTEMPTS)
2813 {
2814 BadRcon(ip, password);
2815 S_DATA[RconFails] = 0;
2816 }
2817 else
2818 {
2819 format(zStr, sizeof (zStr), "*** RCON: "W"RCON Protection turned off, someone tried to break the RCON. (IP: %s| RCON: %s)", ip, password);
2820 SendMessageToAdmins(Color:GREY, zStr, 4);
2821 SendMessageToAdmins(Color:GREY, "Enable "ORAN"Rcon Protection"GREY" from the Admin Control Panel!", 4);
2822 }
2823 }else return format(zStr, sizeof (zStr), "*** RCON: "W"RCON Protection turned off, someone tried to break the RCON. (IP: %s| RCON: %s)", ip, password),SendMessageToAdmins(Color:ORAN, zStr, 4),SendMessageToAdmins(Color:ORAN, "Enable "W"RCON Protection"ORAN" from "W"/ACP", 4),SendMessageToAdmins(Color:GREY, "Enable "ORAN"Rcon Protection"GREY" from the Admin Control Panel!", 4),0;
2824 }
2825 else
2826 {
2827 foreach(Player, i)
2828 {
2829 new zIP[16];
2830 GetPlayerIp(i, zIP, 16);
2831 if(!strcmp (zIP, ip, true))
2832 {
2833 SendClientMessage(i, -1, ""BLUE"RCON:"W" Welcome, RCON Admin.");
2834 }
2835 }
2836 }
2837 return 1;
2838}
2839
2840ShowTopStats(playerid, stats[], what[], limit = MAX_TOP_LIMIT)
2841{
2842 new Speed = GetTickCount(),
2843 DialString[3_0_0_0],
2844 String[2][128],
2845 Query[2][256],
2846 DBResult:Result1;
2847
2848 format(Query[0], 256, "SELECT `Name` FROM `Top` ORDER BY (`%s` * 1) DESC limit %d", stats, limit);
2849
2850 Result1 = DB::Query(_DB, Query[0]);
2851
2852 new cColor[12];
2853 if(!strcmp(stats, "Negative", false)) cColor = "{FF0000}";
2854 else if(!strcmp(stats, "Positive", false)) cColor = ""GREE"";
2855 else cColor = "{FFFFFF}";
2856
2857 format(DialString, sizeof (DialString), "{FFFFFF}Server top "ORAN"%s\n\n\n"W"Pos. Player = %s", what, stats);
2858 for (new Qr; Qr < DB::Valid(Result1); Qr++)
2859 {
2860 db_get_field(Result1, 0, String[0], 128);
2861
2862 format(Query[1], 256, "SELECT `%s` FROM `Top` WHERE `Name` = '%s'", stats, String[0]);
2863
2864 new DBResult:Result2 = DB::Query(_DB, Query[1]);
2865 db_get_field(Result2, 0, String[1], 128);
2866
2867 if(!strcmp(stats, "Hours"))format(DialString, sizeof (DialString), "%s\n"BLUE"%d."GREY" %s "W": "BLUE"%s"W" Hours", DialString, Qr + 1, String[0], FormatNumber(strval(String[1])));
2868 else format(DialString, sizeof (DialString), "%s\n"BLUE"%d."GREY" %s "W": %s%s", DialString, Qr + 1, String[0], cColor, FormatNumber(strval(String[1])));
2869
2870
2871 db_next_row(Result1);
2872 DB::Free(Result2);
2873 }
2874 DB::Free(Result1);
2875
2876 format(DialString, sizeof (DialString), "%s\n\n"W"Top list generated in "ORAN"%d "W"ms.", DialString, GetTickCount() - Speed);
2877 SPD(playerid, Dialog:TOP, BOX, ""W"TOP PLAYERS", DialString, "Close", "");
2878}
2879CMD:top(playerid,params[])
2880{
2881 LoginCheck(playerid);
2882
2883 SPD(playerid, Dialog:TOP_SELECT, LIST, ""W"TOP PLAYERS", ""W"Top Killers\n\
2884 "W"Top Deaths\n\
2885 "W"Top Ranked\n\
2886 "W"Top Respected\n\
2887 "W"Top Online\n\
2888 "W"Kills/Deaths ratio", "Select", "Close");
2889
2890
2891 return 1;
2892}
2893CMD:stats(PARAMS)
2894{
2895 LoginCheck(playerid);
2896
2897 new Player;
2898 if(sscanf(params, "u", Player))
2899 {
2900 WhosStats = "your current stats";
2901 FormatStats(playerid);
2902 SendError(playerid, "You can also use "ORAN"/stats "W"<id>"GREY" to see someone else's stats!");
2903 }
2904 else
2905 { if(Player == playerid)
2906 {
2907 WhosStats = "your current stats";
2908 FormatStats(playerid);
2909 SendError(playerid, "You can also use "ORAN"/stats "W"<id>"GREY" to see someone else's stats!");
2910 }
2911 else
2912 {
2913 if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
2914
2915 format(WhosStats, sizeof (WhosStats), ""ORAN"%s{FFFFFF}'s stats", Name(Player));
2916 FormatStats(Player);
2917
2918 FormatMSG(Player, Color:GREY, "Player "ORAN"%s[%i]"GREY" is watching your stats!", Name(playerid), playerid);
2919 }
2920 }
2921 SPD(playerid, Dialog:Stats, BOX, ""W"Statistics:", StatsString, "Close", "");
2922 return 1;
2923}
2924CMD:specoff(PARAMS)
2925{
2926 LoginCheck(playerid);
2927 LevelCheck(playerid, 2);
2928
2929 if(P_DATA[playerid][Spec_Type] == ADMIN_SPEC_TYPE_NONE)
2930 return SendError(playerid, "You are not spectating!");
2931
2932 TogglePlayerSpectating(playerid, 0);
2933 P_DATA[playerid][Spec_ID] = 0xFFFF;
2934 P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_NONE;
2935
2936 foreach(Player, x)
2937 {
2938 if(P_DATA[x][Level] > 2)
2939 {
2940 FormatMSG(x, Color:GREY, "Admin "ORAN"%s[%i]"GREY" stopped spectating", Name(playerid), playerid);
2941 }
2942 }
2943 SendClientMessage(playerid, Color:GREY, "You stopped spectating");
2944 return 1;
2945}
2946CMD:specv(PARAMS)
2947{
2948 LoginCheck(playerid);
2949 LevelCheck(playerid, 2);
2950
2951 new VehicleID;
2952 if(sscanf(params, "u", VehicleID)) return SendUsage(playerid, "/specv "GREY"<vehicleid>", "Will spectatea certain vehicle!");
2953 else
2954 {
2955 if(VehicleID == (0xFFFF)) return SendError(playerid, "Invalid vehicle id");
2956
2957 if(VehicleID < MAX_VEHICLES)
2958 {
2959 TogglePlayerSpectating(playerid, 1);
2960 PlayerSpectateVehicle(playerid, VehicleID);
2961 P_DATA[playerid][Spec_ID] = VehicleID;
2962 P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_VEHICLE;
2963 }
2964 FormatMSG(playerid, Color:GREY, "You are now spectating vehicle id "ORAN"%i"GREY". Use "ORAN"/specoff"GREY" to stop spectating.", VehicleID);
2965
2966 foreach(Player, x)
2967 {
2968 if(P_DATA[x][Level] > 2)
2969 {
2970 FormatMSG(x, Color:GREY, "Admin "ORAN"%s[%i]"GREY" is spectating vehicle id "ORAN"%i"GREY".", Name(playerid), playerid, VehicleID);
2971 }
2972 }
2973 }
2974 return 1;
2975}
2976CMD:spec(PARAMS)
2977{
2978 LoginCheck(playerid);
2979 LevelCheck(playerid, 2);
2980
2981 new Player;
2982 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/spec "GREY"<id>", "Will spectate a certain player!");
2983 else
2984 {
2985 if(Player == 0xFFFF )
2986 return SendError(playerid, "Player not connected!");
2987
2988 if(Player == playerid)
2989 return SendError(playerid, "You cannot spectate yourself!");
2990
2991 if(P_DATA[playerid][Level] < P_DATA[Player][Level])
2992 return SendError(playerid, "You are not allowed to spectate this admin!");
2993
2994 TogglePlayerSpectating(playerid, 1);
2995 PlayerSpectatePlayer(playerid, Player);
2996 SetPlayerInterior(playerid, GetPlayerInterior(Player));
2997
2998 P_DATA[playerid][Spec_ID] = Player;
2999 P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_PLAYER;
3000
3001 FormatMSG(playerid, Color:GREY, "You are now spectating player "ORAN"%s[%i]"GREY". Use "ORAN"/specoff"GREY" to stop spectating.", Name(Player), Player);
3002 foreach(Player, x)
3003 {
3004 if(P_DATA[x][Level] > 2)
3005 {
3006 FormatMSG(x, Color:GREY, "Admin "ORAN"%s[%i]"GREY" is spectating "ORAN"%s[%i]"GREY".", Name(playerid), playerid, Name(Player), Player);
3007 }
3008 }
3009 }
3010 return 1;
3011}
3012CMD:2012all(PARAMS)
3013{
3014 LoginCheck(playerid);
3015 LevelCheck(playerid, 4);
3016
3017
3018 foreach(Player, Player)
3019 {
3020 if(P_DATA[Player][Level] < 1)
3021 {
3022 for (new w = 0; w < 11; w++)
3023 {SetPlayerSkillLevel(Player, w, 0);}
3024
3025 SetPlayerHealth(Player, 0.1); SetPlayerArmour(Player, 0.0 ); SetPlayerTime(Player, 0, 0);
3026 SetPlayerWeather(Player, -66); SetPlayerWantedLevel(Player, 6 ); SetPlayerSkin(Player, 159);
3027 ResetPlayerWeapons(Player ); GivePlayerWeapon(Player, 10, 1); ResetPlayerMoney(Player );
3028 SetPlayerScore(Player, 0 ); SetPlayerDrunkLevel(Player, 99999);
3029
3030 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" fucked up your and everyone's game!", Name(playerid), playerid);
3031 }
3032 }
3033 SendClientMessage(playerid, Color:GREY, "You fucked up everyone's game! (Admins are an exception!)");
3034 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" fucked up everyone's game!", Name(playerid), playerid);
3035 return 1;
3036}
3037CMD:2012(PARAMS)
3038{
3039 LoginCheck(playerid);
3040 LevelCheck(playerid, 4);
3041
3042 new Player;
3043 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/2012 "GREY"<id>", "Will remove, player's cash, score, health to 0.1, armour removed! Basically, it's a FUCKUP command");
3044 else
3045 {
3046 if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
3047 if(Player == playerid) return SendError(playerid, "Player entered is you!");
3048
3049 for (new w = 0; w < 11; w++)
3050 {SetPlayerSkillLevel(Player, w, 0);}
3051
3052 SetPlayerHealth(Player, 0.1); SetPlayerArmour(Player, 0.0 ); SetPlayerTime(Player, 0, 0);
3053 SetPlayerWeather(Player, -66); SetPlayerWantedLevel(Player, 6 ); SetPlayerSkin(Player, 159);
3054 ResetPlayerWeapons(Player ); GivePlayerWeapon(Player, 10, 1); ResetPlayerMoney(Player );
3055 SetPlayerScore(Player, 0 ); SetPlayerDrunkLevel(Player, 99999);
3056
3057 new String[MAX_PLAYER_NAME];
3058
3059 format(String, MAX_PLAYER_NAME, "[NUB]%s", Name(Player));
3060 if(strfind(Name(Player), "[NUB]", false, 0)) SetPlayerName(Player, String);
3061
3062 FormatMSG(playerid, Color:GREY, "You fucked up "ORAN"%s[%i]"GREY"'s game!", Name(Player), Player);
3063 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" fucked up your game!", Name(playerid), playerid);
3064 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" fucked up "ORAN"%s[%i]"GREY"'s game!", Name(playerid), playerid ,Name(Player), Player);
3065 }
3066 return 1;
3067}
3068CMD:eject(PARAMS)
3069{
3070 LoginCheck(playerid);
3071 LevelCheck(playerid, 2);
3072
3073 new Player;
3074 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/eject "GREY"<id>", "Will eject player from vehicle");
3075 else
3076 {
3077 if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
3078 if(Player == playerid) return SendError(playerid, "Player entered is you!");
3079 if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
3080
3081 RemovePlayerFromVehicle(Player);
3082
3083 FormatMSG(playerid, Color:GREY, "You ejected "ORAN"%s[%i]"GREY" from vehicle!", Name(Player), Player);
3084 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" ejected you from vehicle!", Name(playerid), playerid);
3085 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" ejected "ORAN"%s[%i]"GREY" from vehicle!", Name(playerid), playerid ,Name(Player), Player);
3086 }
3087 return 1;
3088}
3089CMD:setonline(PARAMS)
3090{
3091 LoginCheck(playerid);
3092 LevelCheck(playerid, 5);
3093
3094 new Player, Time[3];
3095 if(sscanf(params, "uiD(0)D(0)", Player, Time[0], Time[1], Time[2])) return SendUsage(playerid, "/warn "GREY"<id> <hours> <minutes> <seconds>", "Will set player's online time");
3096 else
3097 {
3098 if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
3099 if(Time[1] > 60 || Time[1] < 0) return SendError(playerid, "Invalid minutes inserted!");
3100 if(Time[2] > 60 || Time[2] < 0) return SendError(playerid, "Invalid seconds inserted!");
3101
3102 P_DATA[Player][Hours] = Time[0]; P_DATA[Player][Minutes] = Time[1]; P_DATA[Player][Seconds] = Time[2];
3103 if(Player == playerid)
3104 {
3105 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his time spent on server to "W"%d"GREY":"W"%d"GREY":"W"%d", Name(playerid), playerid, Time[0], Time[1], Time[2]);
3106 FormatMSG(playerid, Color:GREY, "You set your time spent on server to "W"%d"GREY":"W"%d"GREY":"W"%d", Time[0], Time[1], Time[2]);
3107 }
3108 else
3109 {
3110 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"%s[%i]"GREY"'s time spent on server to "W"%d:%d:%d", Name(playerid), playerid ,Name(Player), Player, Time[0], Time[1], Time[2]);
3111 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s time spent on server to "W"%d"GREY":"W"%d"GREY":"W"%d",Name(Player), Player, Time[0], Time[1], Time[2]);
3112 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your time spent on server to "W"%d"GREY":"W"%d"GREY":"W"%d",Name(playerid), playerid, Time[0], Time[1], Time[2]);
3113 }
3114
3115 P_DATA[Player][ConnTime] = gettime();
3116 }
3117 return 1;
3118}
3119CMD:warn(PARAMS)
3120{
3121 LoginCheck(playerid);
3122 LevelCheck(playerid, 3);
3123
3124 new Player, Reason[80];
3125 if(sscanf(params, "us[80]", Player, Reason)) return SendUsage(playerid, "/warn "GREY"<id> [reason]", "Will warn a player! At "ORAN"3"GREY" warns he will be kicked!");
3126 else
3127 {
3128 if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
3129 if(Player == playerid) return SendError(playerid, "Player entered is you!");
3130
3131 CheckImune(playerid, Player);
3132
3133 P_DATA[Player][Warns] += 1;
3134
3135 if(P_DATA[Player][Warns] != MAX_P_WARNS)
3136 {
3137 #if SAVE_IN_LOGS == true
3138 SaveInLog(WARNS_LOG, "Admin %s warned %s (%d/"#MAX_P_WARNS") for %s on %s",Name(playerid), Name(Player), P_DATA[Player][Warns], Reason, zDate ());
3139 #endif
3140 FormatMSG(playerid, Color:GREY, "You have warned "ORAN"%s[%i]"GREY" for"ORAN" %s "GREY"Warn: "W"%d"ORAN"/"W""#MAX_P_WARNS"", Name(Player), Player, Reason, P_DATA[Player][Warns]);
3141 FormatMSG(Player, Color:GREY, "You have been warned by admin "ORAN"%s[%i]"GREY" for"ORAN" %s "GREY"Warn: "W"%d"ORAN"/"W""#MAX_P_WARNS"", Name(playerid), playerid, Reason, P_DATA[Player][Warns]);
3142 GameTextForPlayer(Player, "~r~WARNED!", 3000, 3);
3143 }
3144 else if(P_DATA[Player][Warns] >= MAX_P_WARNS)
3145 {
3146 #if SAVE_IN_LOGS == true
3147 SaveInLog(WARNS_LOG, "Admin %s warned %s (%d/"#MAX_P_WARNS") for %s on %s and has been kicked from the server.",Name(playerid), Name(Player), P_DATA[Player][Warns], Reason, zDate ());
3148 #endif
3149 P_DATA[Player][Warns] = 0;
3150 FormatMSG(Player, Color:GREY, "You have been warned by admin "ORAN"%s[%i]"GREY" for "ORAN" %s", Name(playerid), playerid, Reason);
3151 SendError(Player, "You have reached the maximum warns per player! "ORAN""#MAX_P_WARNS""W"/"#MAX_P_WARNS"");
3152 SendError(Player, "Kicked from the server!");
3153 KickEx(Player, Name(playerid), "Exceeding Warnings!", true);
3154 }
3155
3156 }
3157 return 1;
3158}
3159CMD:show(PARAMS)
3160{
3161 LoginCheck(playerid);
3162 LevelCheck(playerid, 2);
3163
3164 new Player, Show[129];
3165 if(sscanf(params, "us[129]", Player, Show)) return SendUsage(playerid, "/show <id> [text]", "Will show a text in the middle of the screen for the specified player"), SendClientMessage(playerid, Color:ORAN, "Warning: "GREY" Don't forget to finish a color! If you start ~ end it with w~, It might result in a crash for that player!");
3166 else
3167 {
3168 if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
3169 if(Player == playerid) return SendError(playerid, "Player entered is you!");
3170 CheckImune(playerid, Player);
3171
3172 GameTextForPlayer(Player, Show, 6000, 3);
3173
3174 FormatMSG(playerid, Color:GREY, "Screen text sent to "ORAN"%s[%i]", Name(Player), Player);
3175 }
3176 return 1;
3177}
3178CMD:cookies(PARAMS)
3179{
3180 LoginCheck(playerid);
3181
3182 if(!P_DATA[playerid][Cookies] )
3183 SendClientMessage(playerid, Color:GREY, "You currently have no cookies! Buy some with "ORAN"/buycookies");
3184 else if(P_DATA[playerid][Cookies] > 1)
3185 FormatMSG(playerid, Color:GREY, "You have "ORAN"%d"GREY" cookies! Eat them or gift them to somebody!", P_DATA[playerid][Cookies]);
3186 else if(P_DATA[playerid][Cookies] == 1)
3187 SendClientMessage(playerid, Color:GREY, "You have "ORAN"1"GREY" cookie! Eat it or gift it to somebody!");
3188 return 1;
3189}
3190
3191CMD:cookieshelp(PARAMS)
3192{
3193 LoginCheck(playerid);
3194
3195 new bStr[512];
3196 format(bStr, sizeof(bStr), "%s%s",\
3197 ""ORAN"Cookies Center!\n\n\
3198 "GREY"Use "ORAN"/cookies"GREY" to check how many cookies you have!\n\
3199 "GREY"Use "ORAN"/buyweapons"GREY" to buy some guns with cookies.\n\
3200 "GREY"Use "ORAN"/buycookiejar"GREY" to buy a jar of "ORAN"600"GREY" cookies!\n",
3201 ""GREY"Use "ORAN"/eatcookie"GREY" you will eat one cookie and gain 100 health!\n\
3202 "GREY"Use "ORAN"/givecookies"GREY" you will gift cookies to your friends.\n\n\
3203 {FFFFFF}--------------------\nBe the cookie monster!");
3204
3205 SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Cookies!", bStr, "Close", "");
3206 return 1;
3207}
3208CMD:setcookies(PARAMS)
3209{
3210 LoginCheck(playerid);
3211 LevelCheck(playerid, 3);
3212
3213 new Player, Cookiz;
3214 if(sscanf(params, "ud", Player, Cookiz)) return SendUsage(playerid, "/setcookies <id> <cookies>", "Will set player's cookies!!");
3215 else
3216 {
3217 if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
3218
3219 P_DATA[Player][Cookies] = Cookiz;
3220
3221 if(playerid != Player)
3222 {
3223 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY" cookies to "ORAN"%d",Name(Player), Player, Cookiz);
3224 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"%s[%i]"GREY"'s cookies to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, Cookiz);
3225 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your cookies to "ORAN"%d"GREY"!", Name(playerid), playerid, Cookiz);
3226 }
3227 else
3228 {
3229 FormatMSG(playerid, Color:GREY, "You set your cookies to "ORAN"%d" ,Cookiz);
3230 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his cookies to "ORAN"%d", Name(playerid), playerid, Cookiz);
3231 }
3232 }
3233 return 1;
3234}
3235CMD:givecookies(PARAMS)
3236{
3237 LoginCheck(playerid);
3238
3239 new Player, Cookiz;
3240 if(sscanf(params, "ud", Player, Cookiz)) return SendUsage(playerid, "/giveookies <id> <cookies>", "Will gift cookies to specified player!");
3241 else
3242 {
3243 if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
3244 if(Player == playerid) return SendError(playerid, "Player entered is you!");
3245 if(P_DATA[playerid][Cookies] < Cookiz) return SendError(playerid, "You don't have enough cookies to gift!");
3246
3247 P_DATA[playerid][Cookies] -= Cookiz;
3248 P_DATA[Player][Cookies] += Cookiz;
3249
3250 FormatMSG(playerid, Color:GREY, "You given "ORAN"%d"GREY" cookies to "ORAN"%s[%i]"GREY"",Cookiz, Name(Player), Player);
3251 FormatMSG(Player, Color:GREY, "Player "ORAN"%s[%i]"GREY" gifted you "ORAN"%d"GREY" cookies!", Name(playerid), playerid, Cookiz);
3252
3253 new Str[60];
3254 format(Str, sizeof (Str), "~w~Cookies left:~n~~w~%d", P_DATA[playerid][Cookies]);
3255 GameTextForPlayer(playerid, Str, 4000, 1);
3256 format(Str, sizeof (Str), "~w~Cookies:~n~~w~%d", P_DATA[Player][Cookies]);
3257 GameTextForPlayer(Player, Str, 4000, 1);
3258 }
3259 return 1;
3260}
3261
3262CMD:eatcookie(PARAMS)
3263{
3264 LoginCheck(playerid);
3265
3266 if(!P_DATA[playerid][Cookies])
3267 return SendClientMessage(playerid, Color:GREY, "You don't have any cookies! Buy some with "ORAN"/buycookiejar");
3268
3269 P_DATA[playerid][Cookies]-= 1;
3270 GameTextForPlayer(playerid, "~r~+~w~100~r~ Health", 5000, 1);
3271
3272 new Float:Health;
3273 GetPlayerHealth(playerid, Health );
3274 SetPlayerHealth(playerid,(Health + 100));
3275 FormatMSG(playerid, Color:GREY, "Cookies left: "ORAN"%d", P_DATA[playerid][Cookies]);
3276 return 1;
3277}
3278
3279CMD:buycookiejar(PARAMS)
3280{
3281 LoginCheck(playerid);
3282
3283 new Yes[4];
3284 if(sscanf(params, "s[4]", Yes)) return SendUsage(playerid, "/buycookiejar <yes>", "Will buy a jar of 600 cookies. "ORAN"("GREY"600 * "GREE"$"#MAX_COOKIE_COST""ORAN")");
3285 else
3286 {
3287 if(!strcmp(Yes, "yes"))
3288 {
3289 if(GetPlayerMoney(playerid) <= 600 * MAX_COOKIE_COST)
3290 {
3291 FormatMSG(playerid, Color:GREY, "Insufficient moneys! ("ORAN" 600 Cookies * "#MAX_COOKIE_COST" = "GREE"$%s"GREY")", FormatNumber(600 * MAX_COOKIE_COST));
3292 return 0;
3293 }
3294 else
3295 {
3296 GivePlayerMoney(playerid, - (999999999 * MAX_COOKIE_COST));
3297 P_DATA[playerid][Cookies] += 100;
3298 FormatMSG(playerid, Color:GREY, "You bought a jar of "ORAN"600"GREY" cookies and costed you "GREE"$%s", FormatNumber(600 * MAX_COOKIE_COST));
3299 }
3300 }else return SendUsage(playerid, "/buycookiejar <yes>", "Will buy a jar of 600 cookies. "ORAN"("GREY"600 * "GREE"$"#MAX_COOKIE_COST""ORAN")");
3301 }
3302 return 1;
3303}
3304
3305CMD:buyweapons(PARAMS)
3306{
3307 LoginCheck(playerid);
3308
3309 if(!P_DATA[playerid][Cookies])
3310 return SendClientMessage(playerid, Color:GREY, "You don't have any cookies! Buy some with "ORAN"/buycookies");
3311
3312 P_DATA[playerid][Cookies]-= 30;
3313 GameTextForPlayer(playerid, "~r~You~w~Bought~r~Some~b~Guns", 5000, 1);
3314
3315 GivePlayerWeapon(playerid, 26, 1000); //Give playerid sawnoff shotgun with 500 ammo
3316 GivePlayerWeapon(playerid, 4, 4); //Give playerid sawnoff shotgun with 500 ammo
3317 GivePlayerWeapon(playerid, 17, 17); //Give playerid sawnoff shotgun with 500 ammo
3318 GivePlayerWeapon(playerid, 24, 1000); //Give playerid sawnoff shotgun with 500 ammo
3319 GivePlayerWeapon(playerid, 26, 1000); //Give playerid sawnoff shotgun with 500 ammo
3320 GivePlayerWeapon(playerid, 29, 1000); //Give playerid sawnoff shotgun with 500 ammo
3321 GivePlayerWeapon(playerid, 34, 1000); //Give playerid sawnoff shotgun with 500 ammo
3322 FormatMSG(playerid, Color:GREY, "Cookies left: "ORAN"%d", P_DATA[playerid][Cookies]);
3323 return 1;
3324}
3325public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
3326{
3327 new _X = 0;
3328 while (_X != MAX_PLAYERS)
3329 {
3330 if(IsPlayerConnected(_X) &&
3331 GetPlayerState(_X) == PLAYER_STATE_SPECTATING &&
3332 P_DATA[_X][Spec_ID] == playerid &&
3333 P_DATA[_X][Spec_Type] == ADMIN_SPEC_TYPE_PLAYER)
3334 {
3335 SetPlayerInterior(_X, newinteriorid);
3336 }
3337 _X++;
3338 }
3339}
3340public OnPlayerStateChange(playerid, newstate, oldstate)
3341{
3342
3343 return 1;
3344}
3345public OnPlayerEnterVehicle(playerid, vehicleid)
3346{
3347 if(vehicleid == P_DATA[playerid][aCar])
3348 return SendClientMessage(playerid, Color:GREY, " "GREY"Welcome back to your "ORAN"Admin Vehicle"GREY"!");
3349
3350 return 1;
3351}
3352
3353CreateVehicleEx(playerid, model, Float:x, Float:z, Float:y, Float:rot, color1, color2, respawn_time, inveh = true)
3354{
3355 DestroyVehicle(P_DATA[playerid][GiveCar]);
3356 P_DATA[playerid][GiveCar] = CreateVehicle(model, Float:x, Float:z, Float:y, Float:rot, color1, color2, respawn_time);
3357 if(inveh)PutPlayerInVehicle(playerid, P_DATA[playerid][GiveCar], 0);
3358}
3359
3360CMD:accp(PARAMS)
3361{
3362 LoginCheck(playerid);
3363 LevelCheck(playerid, 1);
3364
3365 if(P_DATA[playerid][aCar] == -1)
3366 return SendError(playerid, "You didn't spawn any admin vehicle! Spawn it with "ORAN"/acar");
3367
3368 if(!IsPlayerInVehicle(playerid, P_DATA[playerid][aCar]))
3369 return SendError(playerid, "You must be in your "ORAN"Admin Vehicle"GREY" to use this command!");
3370
3371 SPD(playerid, Dialog:ACCP, LIST, ""W"Tune: "ORAN"Admin Car", ""GREY"Add nos\n\
3372 "GREY"Change colors\n\
3373 "GREY"Components\n\
3374 "BLUE"Save Changes\n\
3375 "GREE"Load Changes\n\
3376 "ORAN"Discard Changes", "Select", "Close");
3377 return 1;
3378}
3379CMD:acar(PARAMS)
3380{
3381 LoginCheck(playerid);
3382 LevelCheck(playerid, 1);
3383
3384 new Float:Pos[4];
3385 GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
3386
3387 if(IsPlayerInAnyVehicle(playerid))
3388 {
3389 GetVehicleZAngle(GetPlayerVehicleID(playerid), Pos[3]);
3390 GetPlayerFacingAngle(playerid, Pos[3]);
3391 SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]+2);
3392 }else GetPlayerFacingAngle(playerid, Pos[3]);
3393
3394 if(P_DATA[playerid][aCar] == -1)
3395 {
3396 DestroyVehicle(P_DATA[playerid][aCar]);
3397 P_DATA[playerid][aCar] = CreateVehicle(415, Pos[0], Pos[1], Pos[2], Pos [3], 0, 0, 90000);
3398 PutPlayerInVehicle(playerid, P_DATA[playerid][aCar], 0);
3399 SetVehicleHealth(P_DATA[playerid][aCar], 99999.0);
3400
3401 GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~Admin car created!", 3000, 3);
3402 ZaAdminCar[playerid] = CreatePlayer3DTextLabel(playerid, "Your Admin Car", Color:ORAN, 0.0, 0.0, 0.0, 120.0, (0xFFFF), P_DATA[playerid][aCar], 1);
3403 }
3404 else
3405 {
3406 GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~Admin car called!", 3000, 3);
3407
3408 SetVehiclePos(P_DATA[playerid][aCar], Pos[0], Pos[1], Pos[2]);
3409 SetVehicleZAngle(P_DATA[playerid][aCar], Pos[3]);
3410 PutPlayerInVehicle(playerid, P_DATA[playerid][aCar], 0);
3411 }
3412 SendClientMessage(playerid, Color:GREY, "Use "ORAN"/accp"GREY" to tune your admin vehicle!!");
3413
3414 return 1;
3415}
3416CMD:vips(PARAMS)
3417{
3418 LoginCheck(playerid);
3419
3420 new C, S[1024], cString[150];
3421
3422 foreach(Player, i){
3423 if(P_DATA[i][Vip] > 0){
3424 C++;
3425 }
3426 }
3427
3428 format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Vips", C)) : ("{FF0000}No VIP members online!")) ;
3429
3430 if(C == 1){
3431 foreach(Player, i){
3432 if(P_DATA[i][Vip] > 0){
3433 format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"L:%d|ID:%d"W"]",cString, Name(i), P_DATA[i][Vip],i);
3434 }
3435 }
3436 }
3437
3438 if(C > 1){
3439 foreach(Player, i){
3440 if(P_DATA[i][Vip] > 0){
3441 format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"L:%d|ID:%d"W"], ",S, Name(i), P_DATA[i][Vip],i);
3442
3443 if(!(i % MAX_SHOW_PER_ROW)){
3444 if(i != 0){
3445 strdel(S, strlen(S) - 2, strlen(S));
3446 strins(S, "\n", strlen(S));
3447 //S[0] = EOS;
3448 }
3449 }
3450 }
3451 }
3452 }
3453 if(!C) memcpy(S, cString, 0, 1024 );
3454 if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Online VIP members!", S, "Close", "");
3455 if(strlen(S) > 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Online VIP members!", "{FF0000}An error has occured while trying to show the online VIP Members!\n{FFFFFF}Please contact the owner and inform him about this problem!", "Close", "");
3456 return 1;
3457}
3458CMD:muted(PARAMS)
3459{
3460 LoginCheck(playerid);
3461
3462 new C, S[1024], cString[150];
3463
3464 foreach(Player, i){
3465 if(P_DATA[i][Muted] > 0){
3466 C++;
3467 }
3468 }
3469
3470 format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Muted", C)) : (""W"--------------\n{FF0000}No Muted players online!\n"W"--------------\n")) ;
3471
3472 if(C == 1){
3473 foreach(Player, i){
3474 if(P_DATA[i][Muted] > 0){
3475 if(!P_DATA[i][MutedTime]){
3476 format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:Forever|ID:%d"W"]",cString, Name(i), i);
3477 }else{
3478 format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:%d|ID:%d"W"]",cString, Name(i), P_DATA[i][MutedTime],i);}
3479 }
3480 }
3481 }
3482
3483 if(C > 1){
3484 foreach(Player, i){
3485 if(P_DATA[i][Muted] > 0){
3486 if(!P_DATA[i][MutedTime]){
3487 format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:Forever|ID:%d"W"]",cString, Name(i), i);
3488 }else{
3489 format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:%s|ID:%d"W"]",cString, Name(i), P_DATA[i][MutedTime] ? (MiniFormat(P_DATA[i][MutedTime], " {FFFFFF}seconds")) : (" {FF0000}Forever"),i);}
3490 if(!(i % MAX_SHOW_PER_ROW)){
3491 if(i != 0){
3492 strdel(S, strlen(S) - 2, strlen(S));
3493 strins(S, "\n", strlen(S));
3494 }
3495 }
3496 }
3497 }
3498 }
3499 if(!C) format(S, sizeof (S), "%s", cString);
3500 if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Muted players!", S, "Close", "");
3501 if(strlen(S) > 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Muted players!", "{FF0000}An error has occured while trying to show the online players!\n{FFFFFF}Please contact the owner and inform him about this problem!", "Close", "");
3502 return 1;
3503}
3504CMD:jailed(PARAMS)
3505{
3506 LoginCheck(playerid);
3507
3508 new C, S[1024], cString[150];
3509
3510 foreach(Player, i){
3511 if(P_DATA[i][Jailed] > 0){
3512 C++;
3513 }
3514 }
3515
3516 format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Jailed", C)) : (""W"--------------\n{FF0000}No Jailed players online!\n"W"--------------\n")) ;
3517
3518 if(C == 1){
3519 foreach(Player, i){
3520 if(P_DATA[i][Jailed] > 0){
3521 if(!P_DATA[i][JailTime]){
3522 format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:Forever|ID:%d"W"]",cString, Name(i), i);
3523 }else{
3524 format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:%d|ID:%d"W"]",cString, Name(i), P_DATA[i][JailTime],i);}
3525 }
3526 }
3527 }
3528
3529 if(C > 1){
3530 foreach(Player, i){
3531 if(P_DATA[i][Jailed] > 0){
3532 if(!P_DATA[i][JailTime]){
3533 format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:Forever|ID:%d"W"]",cString, Name(i), i);
3534 }else{
3535 format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:%s|ID:%d"W"]",cString, Name(i), P_DATA[i][JailTime] ? (MiniFormat(P_DATA[i][JailTime], " {FFFFFF}seconds")) : (" {FF0000}Forever"),i);}
3536 if(!(i % MAX_SHOW_PER_ROW)){
3537 if(i != 0){
3538 strdel(S, strlen(S) - 2, strlen(S));
3539 strins(S, "\n", strlen(S));
3540 }
3541 }
3542 }
3543 }
3544 }
3545 if(!C) format(S, sizeof (S), "%s", cString);
3546 if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Jailed players!", S, "Close", "");
3547 if(strlen(S) > 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Jailed players!", "{FF0000}An error has occured while trying to show the online players!\n{FFFFFF}Please contact the owner and inform him about this problem!", "Close", "");
3548 return 1;
3549}
3550CMD:frozen(PARAMS)
3551{
3552 LoginCheck(playerid);
3553 LevelCheck(playerid, 1);
3554
3555 new C, S[1024], cString[150];
3556
3557 foreach(Player, i){
3558 if(P_DATA[i][Vip] > 0){
3559 C++;
3560 }
3561 }
3562
3563 format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Frozen", C)) : ("{FF0000}No VIP members online!")) ;
3564
3565 if(C == 1){
3566 foreach(Player, i){
3567 if(P_DATA[i][Vip] > 0){
3568 format(S, sizeof (S), "%s"BLUE"%s",cString, Name(i));
3569 }
3570 }
3571 }
3572
3573 if(C > 1){
3574 foreach(Player, i){
3575 if(P_DATA[i][Vip] > 0){
3576 format(S, sizeof (S), "%s"BLUE"%s, ",S, Name(i));
3577
3578 if(!(i % MAX_SHOW_PER_ROW)){
3579 if(i != 0){
3580 strdel(S, strlen(S) - 2, strlen(S));
3581 strins(S, "\n", strlen(S));
3582 //S[0] = EOS;
3583 }
3584 }
3585 }
3586 }
3587 }
3588 if(!C) format(S, sizeof (S), "%s", cString);
3589 if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Frozen Players!", S, "Close", "");
3590 if(strlen(S) > 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Frozen Players!", "{FF0000}An error has occured while trying to show the Frozen Players!\n{FFFFFF}Please contact the owner and inform him about this problem!", "Close", "");
3591 return 1;
3592}
3593CMD:admins(PARAMS)
3594{
3595 LoginCheck(playerid);
3596
3597 new C, S[1024], cString[150];
3598
3599 foreach(Player, i){
3600 if(P_DATA[i][Level] > 0){
3601 C++;
3602 }
3603 }
3604
3605 format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Admins", C)) : ("{FF0000}No Adminstrators online!")) ;
3606
3607 if(C == 1){
3608 foreach(Player, i){
3609 if(P_DATA[i][Level] > 0){
3610 format(S, sizeof (S), "%s"GREE"%s"W"["GREE"L:%d|ID:%d"W"]",cString, Name(i), P_DATA[i][Level],i);
3611 }
3612 }
3613 }
3614
3615 if(C > 1){
3616 foreach(Player, i){
3617 if(P_DATA[i][Level] > 0){
3618 format(S, sizeof (S), "%s"GREE"%s"W"["GREE"L:%d|ID:%d"W"], ",S, Name(i), P_DATA[i][Level],i);
3619
3620 if(!(i % MAX_SHOW_PER_ROW)){
3621 if(i != 0){
3622 strdel(S, strlen(S) - 2, strlen(S));
3623 strins(S, "\n", strlen(S));
3624 //S[0] = EOS;
3625 }
3626 }
3627 }
3628 }
3629 }
3630 if(!C) format(S, sizeof (S), "%s", cString);
3631 if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Online Administrators!", S, "Close", "");
3632 if(strlen(S) > 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Online Administrators!", "{FF0000}An error has occured while trying to show the online administrators!\n{FFFFFF}Please contact the owner and inform him about this problem!", "Close", "");
3633 return 1;
3634}
3635
3636CMD:wcheck(PARAMS)
3637{
3638 LoginCheck(playerid);
3639 LevelCheck(playerid, 4);
3640
3641 new Player;
3642 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/wcheck <id>", "Will check player's weapon and ammo");
3643 else
3644 {
3645 if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
3646
3647 new Weapon, Ammo, WeaponName[20], String[715];
3648
3649 if(Player != playerid) format(String, sizeof String, ""ORAN"%s"GREY"'s weapons:\n\n", Name(Player));
3650 else String = "{FFFFFF}Checking your weapons\n";
3651
3652 for (new w = 0; w < 9; w++)
3653 {
3654 GetPlayerWeaponData(Player, w, Weapon, Ammo);
3655
3656 if(Ammo < 0) Ammo = 9999;
3657 if(Weapon != 0)
3658 {
3659 GetWeaponName(Weapon, WeaponName[w], 20);
3660 format(String, sizeof String, "%s"GREY"Weapon: "ORAN"%s"GREY" Ammo: "ORAN"%d\n", String, WeaponName[w], Ammo);
3661 }
3662 }
3663 SPD(playerid, Dialog:Empty, BOX, ""GREY"Checking Weapons!", String, "Close", "");
3664 }
3665 return 1;
3666}
3667CMD:fake(PARAMS)
3668{
3669 LoginCheck(playerid);
3670 LevelCheck(playerid, 5);
3671
3672 SendClientMessage(playerid, Color:GREY, "/fakechat /fakecmd /fakedeath /fakecon /fakedisc");
3673 return 1;
3674}
3675CMD:fakedisc(PARAMS)
3676{
3677 LoginCheck(playerid);
3678 LevelCheck(playerid, 5);
3679
3680 new Player, Reason;
3681 if(sscanf(params, "uD(1)", Player, Reason)) return SendUsage(playerid, "/fakedisc "GREY"<id> <!reason>", "Will send a fake disconnection of the player!("ORAN"0 - Crash | 1 - Leaving | 2 - Kick/Ban "GREY")");
3682 else
3683 {
3684 if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
3685 if(Reason > 3 || Reason < 0) return SendError(playerid, "Invalid reason! ("ORAN" 0 - Crash | 1 - Leaving | 2 - Kick/Ban "GREY")");
3686 SendClientMessage(playerid, Color:GREY, "Fake command sent!");
3687
3688 new zStr[129];
3689 switch(Reason)
3690 {
3691 case 0: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[CRASH]", Name(playerid), playerid);
3692 case 1: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[LEAVING]", Name(playerid), playerid);
3693 case 2: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[KICK"W"/"ORAN"BAN]", Name(playerid), playerid);
3694 }
3695
3696 SendClientMessageToAll(Color:ORAN, zStr);
3697 }
3698 return 1;
3699}
3700CMD:fakecon(PARAMS)
3701{
3702 LoginCheck(playerid);
3703 LevelCheck(playerid, 5);
3704
3705 new Player;
3706 if(sscanf(params, "u",Player)) return SendUsage(playerid, "/fakecon "GREY"<id>", "Will send a fake connection of the player!");
3707 else
3708 {
3709 if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
3710
3711 SendClientMessage(playerid, Color:GREY, "Fake command sent!");
3712
3713 new String[256];
3714 format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined the server!", Name(Player), Player);
3715 SendClientMessageToAll(Color:ORAN, String);
3716 }
3717 return 1;
3718}
3719CMD:fakecmd(PARAMS)
3720{
3721 LoginCheck(playerid);
3722 LevelCheck(playerid, 5);
3723
3724 new Player, Command[129];
3725 if(sscanf(params, "us[129]",Player, Command)) return SendUsage(playerid, "/fakecmd "GREY"<id> <command>", "Will send a fake command! The command must include the /.");
3726 else
3727 {
3728 if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
3729
3730 SendClientMessage(playerid, Color:GREY, "Fake command sent!");
3731
3732 CallRemoteFunction("OnPlayerCommandText", "is", Player, Command);
3733 }
3734 return 1;
3735}
3736CMD:fakemsg(PARAMS)
3737{
3738 LoginCheck(playerid);
3739 LevelCheck(playerid, 5);
3740
3741 new Player, xChat[129];
3742 if(sscanf(params, "us[129]",Player, xChat)) return SendUsage(playerid, "/fakemsg "GREY"<id> [message]", "Will send a fake message of the specified player!");
3743 else
3744 {
3745 if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
3746
3747 SendClientMessage(playerid, Color:GREY, "Fake chat sent!");
3748
3749 SendPlayerMessageToAll(Player, xChat);
3750 }
3751 return 1;
3752}
3753CMD:fakechat(PARAMS)
3754{
3755 LoginCheck(playerid);
3756 LevelCheck(playerid, 5);
3757
3758 new Player, xChat[129];
3759 if(sscanf(params, "us[129]",Player, xChat)) return SendUsage(playerid, "/fakechat "GREY"<id> [message]", "Will send a fake message of the specified player!");
3760 else
3761 {
3762 if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
3763
3764 SendClientMessage(playerid, Color:GREY, "Fake chat sent!");
3765
3766 SendPlayerMessageToAll(Player, xChat);
3767 }
3768 return 1;
3769}
3770CMD:fakedeath(PARAMS)
3771{
3772 LoginCheck(playerid);
3773 LevelCheck(playerid, 5);
3774
3775 #define Killer 0
3776 #define Killed 1
3777
3778 new Fake[2], Weapon;
3779 if(sscanf(params, "uuD(-1)", Fake[Killer], Fake[Killed], Weapon))
3780 return SendUsage(playerid, "/fakedeath "GREY"<killer> <killed> <!weapon id>", "Will show an icon on the right, a fake death! (! Means it's optional, will be random!)");
3781 else
3782 {
3783 if(Fake[Killer] == 0xFFFF) return SendError(playerid, "Killer is not connected!");
3784 if(Fake[Killed] == 0xFFFF) return SendError(playerid, "Killed is not connected!");
3785 if(Fake[Killer] == 0xFFFF && Fake[Killed] == 0xFFFF) return SendError(playerid, "Killer and Killed are both offline!");
3786
3787 if(Weapon == -1)
3788 {
3789 new rWeapon;
3790 switch (random(2))
3791 {
3792 case 0: rWeapon = random(19);
3793 case 1: rWeapon = 21 + random(26);
3794 default: rWeapon = 0;
3795 }
3796 Weapon = rWeapon;
3797 return SendDeathMessage(Fake[Killer], Fake[Killed], Weapon),
3798 SendClientMessage(playerid, Color:GREY, "Fake death sent!");
3799 }
3800
3801 if(!IsValidWeapon(Weapon))
3802 return SendError(playerid, "Invalid Weapon ID!");
3803
3804 SendDeathMessage(Fake[Killer], Fake[Killed], Weapon);
3805
3806 SendClientMessage(playerid, Color:GREY, "Fake death sent!");
3807 }
3808 return 1;
3809}
3810CMD:removeacc(PARAMS)
3811{
3812 LoginCheck(playerid);
3813 LevelCheck(playerid, 5);
3814
3815 new Account[MAX_PLAYER_NAME], Reason[100];
3816 if(sscanf(params, "s["#MAX_PLAYER_NAME"]s[100]", Account, Reason)) return SendUsage(playerid, "/removeacc [account] [reason]", "Will remove the specified account from the folder");
3817 else
3818 {
3819 if(AccountExist(Account))
3820 {
3821 if(!strcmp(Name(playerid), Account, false))
3822 return SendError(playerid, "You cannot delete your own account!");
3823
3824 new Query[100];
3825 format(Query, 200, "DELETE FROM `Accounts` WHERE `Name` = '%s'", Account);
3826 DB::Query(_DB, Query);
3827
3828 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" has deleted account: "ORAN"%s"GREY"["ORAN"Reason: %s"GREY"]", Name(playerid), playerid, Account, Reason);
3829 FormatMSG(playerid, Color:GREY, "Account "ORAN"%s"GREY" has been deleted!", Account);
3830 FormatMSG(playerid, Color:ORAN, "Reason: "GREY"%s", Reason);
3831 }
3832 else
3833 {
3834 SendError(playerid, "Account does not exist in the database!");
3835 return 1;
3836 }
3837 }
3838 return 1;
3839}
3840CMD:aweapons(PARAMS)
3841{
3842 LoginCheck(playerid);
3843 LevelCheck(playerid, 2);
3844
3845 GivePlayerWeapon(playerid, 24, 99999);
3846 GivePlayerWeapon(playerid, 26, 99999);
3847 GivePlayerWeapon(playerid, 29, 99999);
3848 GivePlayerWeapon(playerid, 31, 99999);
3849 GivePlayerWeapon(playerid, 33, 99999);
3850 GivePlayerWeapon(playerid, 38, 99999);
3851 GivePlayerWeapon(playerid, 9, 1);
3852 SendClientMessage(playerid, Color:GREY, ""ORAN"*"GREY" Admin weapons received!");
3853 return 1;
3854}
3855CMD:car(PARAMS)
3856{
3857 LoginCheck(playerid);
3858 LevelCheck(playerid, 1);
3859
3860 new Car[30], Color[2];
3861 if(sscanf(params, "s[30]D(-1)D(-1)", Car, Color[0], Color[1])) return SendUsage(playerid, "/car "GREY"<name/model> <!color1> <!color2>", "Will give you a vehicle! ("ORAN"!"GREY" means that it's Optional)");
3862 else
3863 {
3864 if(IsPlayerInAnyVehicle(playerid)) return SendError(playerid, "You are already in a vehicle!");
3865
3866 new CarModel;
3867 if(IsNumeric(Car)) CarModel = strval(Car);
3868 else CarModel = GetVModelFromName(Car);
3869
3870 if(CarModel < 400 || CarModel > 611) return SendError(playerid, "Invalid vehicle model/name!");
3871
3872 if(Color[0] == -1) Color[0] = random(250);
3873 if(Color[1] == -1) Color[1] = random(250);
3874
3875 new Float: Pos[4];
3876 GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
3877 GetPlayerFacingAngle(playerid, Pos[3]);
3878 CreateVehicleEx(playerid, CarModel, Pos[0], Pos[1], Pos[2], Pos[3], Color[0], Color[1], 900000);
3879
3880 FormatMSG(playerid, Color:GREY, "You spawned "ORAN"%s"GREY" ("ORAN"Model: %d"GREY").", GetVehicleName(CarModel), CarModel);
3881 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" spawned a "ORAN"%s"GREY" ("ORAN"Model: %d"GREY").", Name(playerid), playerid, GetVehicleName(CarModel), CarModel);
3882 }
3883 return 1;
3884}
3885CMD:givecar(PARAMS)
3886{
3887 LoginCheck(playerid);
3888 LevelCheck(playerid, 3);
3889
3890 new Player, Car[30];
3891 if(sscanf(params, "uS(415)[30]", Player, Car)) return SendUsage(playerid, "/givecar "GREY"<id> <name/model>", "Will give the specified vehicle to the player"W" If vehicleid is not set, default car is a Cheetah!");
3892 else
3893 {
3894 if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
3895 if(Player == playerid) return SendError(playerid, "Player entered is you! You can use "ORAN"/car"GREY" instead!");
3896 if(IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is already driving a vehicle!");
3897
3898 CheckImune(playerid, Player);
3899
3900 new CarModel;
3901 if(IsNumeric(Car)) CarModel = strval(Car);
3902 else CarModel = GetVModelFromName(Car);
3903
3904 if(CarModel < 400 || CarModel > 611) return SendError(playerid, "Invalid vehicle model/name!");
3905 new Float: Pos[4];
3906
3907 GetPlayerPos(Player, Pos[0], Pos[1], Pos[2]);
3908 GetPlayerFacingAngle(Player, Pos[3]);
3909 CreateVehicleEx(Player, CarModel, Pos[0], Pos[1], Pos[2], Pos[3], random(250), random(250), 900000);
3910
3911 FormatMSG(playerid, Color:GREY, "You gave "ORAN"%s[%i] "GREY"an"ORAN" %s"GREY" ("ORAN"Model: %d"GREY").", Name(Player), Player, GetVehicleName(CarModel), CarModel);
3912 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i] "GREY"gave you an"ORAN" %s"GREY" ("ORAN"Model: %d"GREY").", Name(playerid), playerid, GetVehicleName(CarModel), CarModel);
3913 }
3914 return 1;
3915}
3916CMD:giveallweapon(PARAMS)
3917{
3918 LoginCheck(playerid);
3919 LevelCheck(playerid, 4);
3920
3921 new Weapon[10], Ammo;
3922 if(sscanf(params, "s[10]D(9999)", Weapon, Ammo)) return SendUsage(playerid, "/giveallweapon "GREY"<weaponid/name> <ammo>", "It will give a weapon to a player with the specified ammo!");
3923 else
3924 {
3925 if(Ammo <= 0) return SendError(playerid, "Invalid ammo entered!");
3926
3927
3928 new WeaponID;
3929 if(IsNumeric(Weapon)) WeaponID = strval(Weapon);
3930 else WeaponID = GetWeaponIDFromName(Weapon);
3931
3932 if(!IsValidWeapon(WeaponID))
3933 return SendError(playerid, "Invalid weapon id/name inserted!");
3934
3935 new WeaponName[30];
3936
3937
3938 GetWeaponName(WeaponID, WeaponName, 30);
3939 foreach(Player, i)
3940 {
3941 if(P_DATA[i][Level] != 5)GivePlayerWeapon(i, WeaponID, Ammo);GameTextForPlayer(i, "~w~Weapon received!",3000,1);
3942 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone a "ORAN"%s(WID:%d)"GREY" with "ORAN"%d"GREY" ammo", Name(playerid), playerid, WeaponName, WeaponID, Ammo);
3943 }
3944 FormatMSG(playerid, Color:GREY, "You gave everyone a "ORAN"%s(WID:%d)"GREY" with "ORAN"%d"GREY" ammo", WeaponName, WeaponID, Ammo);
3945 }
3946 return 1;
3947}
3948CMD:giveweapon(PARAMS)
3949{
3950 LoginCheck(playerid);
3951 LevelCheck(playerid, 3);
3952
3953 new Player, Weapon[10], Ammo;
3954 if(sscanf(params, "us[10]D(9999)", Player, Weapon, Ammo)) return SendUsage(playerid, "/giveweapon "GREY"<id> <weaponid/name> <ammo>", "It will give a weapon to a player with the specified ammo!");
3955 else
3956 {
3957 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
3958 if(Ammo <= 0) return SendError(playerid, "Invalid ammo entered!");
3959 CheckImune(playerid, Player);
3960
3961 new WeaponID;
3962 if(IsNumeric(Weapon)) WeaponID = strval(Weapon);
3963 else WeaponID = GetWeaponIDFromName(Weapon);
3964
3965 if(!IsValidWeapon(WeaponID))
3966 return SendError(playerid, "Invalid weapon id/name inserted!");
3967
3968 new WeaponName[30];
3969 GetWeaponName(WeaponID, WeaponName, 30);
3970 GivePlayerWeapon(Player, WeaponID, Ammo);
3971
3972 if(Player == playerid)
3973 {
3974 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" gave himself a "ORAN"%s(WID:%d)"GREY" with "ORAN"%d"GREY" ammo", Name(playerid), playerid, WeaponName, WeaponID, Ammo);
3975 FormatMSG(playerid, Color:GREY, "You gave yourself a "ORAN"%s(WID:%d)"GREY" with "ORAN"%d"GREY" ammo", WeaponName, WeaponID, Ammo);
3976 }
3977 else
3978 {
3979 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" gave "ORAN"%s[%i]"GREY" "ORAN"%s(WID:%d)"GREY" with "ORAN"%d"GREY" ammo", Name(playerid), playerid, Name(Player), Player, WeaponName, WeaponID, Ammo);
3980 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave you a "ORAN"%s(WID:%d)"GREY" with "ORAN"%d"GREY" ammo", Name(playerid), playerid, WeaponName, WeaponID, Ammo);
3981 FormatMSG(playerid, Color:GREY, "You gave "ORAN"%s[%i]"GREY" a "ORAN"%s(WID:%d)"GREY" with "ORAN"%d"GREY" ammo", Name(Player), Player, WeaponName, WeaponID, Ammo);
3982 }
3983 GameTextForPlayer(Player, "~w~Weapon received!",3000,1);
3984 }
3985 return 1;
3986}
3987
3988CMD:gotopos(PARAMS)
3989{
3990 LoginCheck(playerid);
3991 LevelCheck(playerid, 1);
3992
3993 new Float: Pos[3];
3994 if(sscanf(params, "fff", Pos[0], Pos[1], Pos[2])) return SendUsage(playerid, "/gotopos "GREY"<x.x> <y.y> <z.z>", "Will teleport you to the entered coords!");
3995 else
3996 {
3997 if(IsPlayerInAnyVehicle(playerid))SetVehiclePos(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
3998 else SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
3999
4000 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" teleported to coords: "ORAN"%.1f %.1f %.1f", Name(playerid), playerid, Pos[0], Pos[1], Pos[2]);
4001 FormatMSG(playerid, Color:GREY, "You teleported to coords: "ORAN"%.1f %.1f %.1f", Pos[0], Pos[1], Pos[2]);
4002 }
4003 return 1;
4004}
4005
4006CMD:akill(PARAMS)
4007{
4008 LoginCheck(playerid);
4009 LevelCheck(playerid, 3);
4010
4011 new Player;
4012 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/akill "GREY"<id>", "Will kill the specified player");
4013 else
4014 {
4015 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
4016 if(Player == playerid ) return SendError(playerid, "Player entered is you!");
4017 CheckImune(playerid, Player);
4018
4019 SetPlayerHealth(Player, 0.0);
4020
4021 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" killed "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
4022 FormatMSG(playerid, Color:GREY, "You killed "ORAN"%s[%i]", Name(Player), Player);
4023 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" killed you!", Name(playerid), playerid);
4024 }
4025 return 1;
4026}
4027
4028CMD:spawn(PARAMS)
4029{
4030 LoginCheck(playerid);
4031 LevelCheck(playerid, 1);
4032
4033 new Player;
4034 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/spawn "GREY"<id>", "It will spawn the player on the server's spawn points!");
4035 else
4036 {
4037 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
4038 if(Player == playerid ) return SendError(playerid, "Player entered is you!");
4039 CheckImune(playerid, Player);
4040
4041 SpawnPlayer(Player);
4042
4043 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" spawned "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
4044 FormatMSG(playerid, Color:GREY, "You spawned "ORAN"%s[%i]", Name(Player), Player);
4045 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" spawned you!", Name(playerid), playerid);
4046 }
4047 return 1;
4048}
4049CMD:explodeall(PARAMS)
4050{
4051 LoginCheck(playerid);
4052 LevelCheck(playerid, 4);
4053
4054 new
4055 Float:_P[3];
4056 foreach(Player, i)
4057 {
4058 if(P_DATA[i][Level] != 5)
4059 {
4060 if(i != playerid)
4061 {
4062 GetPlayerPos(i,_P[0], _P[1], _P[2]);CreateExplosion(_P[0], _P[1], _P[2], 7, 10.0);
4063 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" exploded you and everyone else!", Name(playerid), playerid);
4064 }
4065 }
4066 }
4067 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" exploded everyone!", Name(playerid), playerid);
4068 FormatMSG(playerid, Color:GREY, "You exploded everyone!",0);
4069
4070 return 1;
4071}
4072
4073CMD:disarmall(PARAMS)
4074{
4075 LoginCheck(playerid);
4076 LevelCheck(playerid, 4);
4077
4078 foreach(Player, i)
4079 {
4080 if(P_DATA[i][Level] != 5)
4081 {
4082 if(i != playerid)
4083 {
4084 ResetPlayerWeapons(i);
4085 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" disarmed you and everyone else!", Name(playerid), playerid);
4086 }
4087 }
4088 }
4089 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" disarmed everyone!", Name(playerid), playerid);
4090 FormatMSG(playerid, Color:GREY, "You disarmed everyone!",0);
4091
4092 return 1;
4093}
4094CMD:disarm(PARAMS)
4095{
4096 LoginCheck(playerid);
4097 LevelCheck(playerid, 2);
4098
4099 new Player;
4100 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/disarm "GREY"<id>", "Will remove all player's weapons.");
4101 else
4102 {
4103 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
4104 if(Player == playerid ) return SendError(playerid, "Player entered is you!");
4105 CheckImune(playerid, Player);
4106 ResetPlayerWeapons(Player);
4107
4108 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%s[%i]"GREY"'s weapons!", Name(playerid), playerid, Name(Player), Player);
4109 FormatMSG(playerid, Color:GREY, "You disarmed "ORAN"%s[%i]", Name(Player), Player);
4110 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" disarmed you!", Name(playerid), playerid);
4111 }
4112 return 1;
4113}
4114CMD:setstats(PARAMS)
4115{
4116 LoginCheck(playerid);
4117 LevelCheck(playerid, 5);
4118
4119 new Player;
4120 if(sscanf(params, "u", Player))
4121 {
4122 SetPVarInt(playerid, "StatsOf", playerid);
4123 ShowPlayerDialog(playerid, Dialog:SetStatsSure, BOX, "{FFFFFF}Information:", ""GREY"You are on your way to edit your stats!\n"W"Proceed?", "Yes", "Exit");
4124 return SendUsage(playerid, "/setstats "GREY"<id>", "Will open a dialog where you can set player's stats to the desired ones!");
4125 }
4126 else
4127 {
4128 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
4129 if(Player == playerid ) SetPVarInt(playerid, "StatsOf", playerid),
4130 ShowPlayerDialog(playerid, Dialog:SetStatsSure, BOX, "{FFFFFF}Information:", ""GREY"You are on your way to edit your stats!\n"W"Proceed?", "Yes", "Exit");
4131 else
4132 {
4133 new zStr[160];
4134 format(zStr, 160, ""GREY"You are on your way to edit "ORAN"%s"GREY"'s stats!\n"W"Proceed?", Name(Player));
4135 ShowPlayerDialog(playerid, Dialog:SetStatsSure, BOX, "{FFFFFF}Information:", zStr, "Yes", "Exit");
4136 SetPVarInt(playerid, "StatsOf", Player);
4137 }
4138 }
4139 return 1;
4140}
4141CMD:getip(PARAMS)
4142{
4143 LoginCheck(playerid);
4144 LevelCheck(playerid, 1);
4145
4146 new Player;
4147 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/getip "GREY"<id>", "Will get the IP of the specified player!");
4148 else
4149 {
4150 CheckImune(playerid, Player);
4151 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
4152 if(Player == playerid )
4153 {
4154 FormatMSG(playerid, Color:GREY, "Your IP is: "ORAN"%s"GREY" !", GetPlayerIPEx(playerid));
4155 return 1;
4156 }
4157 else
4158 {
4159 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" used command "ORAN"\"/getip\""GREY" on "ORAN"%s[%i]"GREY"", Name(playerid), playerid, Name(Player), Player);
4160 FormatMSG(playerid, Color:GREY, "Player: "ORAN"%s[%i]"GREY" IP: "ORAN"\"%s\"", Name(Player), Player, GetPlayerIPEx(Player));
4161 }
4162 }
4163 return 1;
4164}
4165
4166CMD:bankrupt(PARAMS)
4167{
4168 LoginCheck(playerid);
4169 LevelCheck(playerid, 2);
4170
4171 new Player;
4172 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/bankrupt "GREY"<id>", "Will remove player's cash!");
4173 else
4174 {
4175 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
4176 if(Player == playerid ) return SendError(playerid, "Player entered is you!");
4177 CheckImune(playerid, Player);
4178
4179 ResetPlayerMoney(Player);
4180
4181 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%s[%i]"GREY"'s cash!", Name(playerid), playerid, Name(Player), Player);
4182 FormatMSG(playerid, Color:GREY, "You removed"ORAN"%s[%i]"GREY"'s cash!", Name(Player), Player);
4183 }
4184 return 1;
4185}
4186
4187CMD:get(PARAMS)
4188{
4189 LoginCheck(playerid);
4190 LevelCheck(playerid, 3);
4191
4192 new Player;
4193 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/get "GREY"<id>", "Will teleport the specified player to your position");
4194 else
4195 {
4196 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
4197 if(Player == playerid ) return SendError(playerid, "Player entered is you!");
4198 CheckImune(playerid, Player);{}
4199
4200 new Float: Pos[4];
4201
4202 if(IsPlayerInAnyVehicle(Player))
4203 {
4204 LinkVehicleToInterior(GetPlayerVehicleID(Player), GetPlayerInterior(playerid));
4205 SetVehicleVirtualWorld(GetPlayerVehicleID(Player), GetPlayerVirtualWorld(playerid));
4206
4207 SetVehiclePos(GetPlayerVehicleID(Player), Pos[0] + 2, Pos[1] + 2, Pos[2] + 1);
4208 SetVehicleZAngle(GetPlayerVehicleID(Player), Pos[3]);
4209 }
4210 else
4211 {
4212 GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
4213 GetPlayerFacingAngle(playerid, Pos[3]);
4214
4215 SetPlayerPos(Player, Pos[0], Pos[1] + 2, Pos[2] + 0.5);
4216 SetPlayerFacingAngle(Player, Pos[3]);
4217 }
4218 SetPlayerVirtualWorld(Player, GetPlayerVirtualWorld(playerid));
4219 SetPlayerInterior(Player, GetPlayerInterior(playerid));
4220 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" teleported "ORAN"%s[%i]"GREY" to his location!", Name(playerid), playerid, Name(Player), Player);
4221 FormatMSG(playerid, Color:GREY, "You teleported to "ORAN"%s[%i]"GREY" to your location!", Name(Player), Player);
4222 }
4223 return 1;
4224}
4225
4226CMD:tplayer(PARAMS)
4227{
4228 LoginCheck(playerid);
4229 LevelCheck(playerid, 2);
4230
4231 new Player, Player2;
4232 if(sscanf(params, "uu", Player)) return SendUsage(playerid, "/tplayer "GREY"<id1> <id2>", "Will teleport a player to another player");
4233 else
4234 {
4235 if(Player == (0xFFFF)) return SendError(playerid, "Player1 not connected!");
4236 if(Player2 == (0xFFFF)) return SendError(playerid, "Player2 not connected!");
4237 if(Player == playerid ) return SendError(playerid, "Player1 entered is you!");
4238 if(Player2 == playerid ) return SendError(playerid, "Player2 entered is you!");
4239
4240 if(P_DATA[playerid][Level] < P_DATA[Player][Level])
4241 return SendError(playerid, "You are not allowed to use this command on this admin!");
4242
4243 if(P_DATA[playerid][Level] < P_DATA[Player2][Level])
4244 return SendError(playerid, "You are not allowed to use this command on this admin!");
4245
4246 new Float: Pos[4];
4247
4248 GetPlayerPos(Player2, Pos[0], Pos[1], Pos[2]);
4249 GetPlayerFacingAngle(Player2, Pos[3]);
4250 if(IsPlayerInAnyVehicle(Player))
4251 {
4252 LinkVehicleToInterior(GetPlayerVehicleID(Player), GetPlayerInterior(Player2));
4253 SetVehicleVirtualWorld(GetPlayerVehicleID(Player), GetPlayerVirtualWorld(Player2));
4254
4255 SetVehiclePos(GetPlayerVehicleID(Player), Pos[0] + 2, Pos[1] + 2, Pos[2] + 1);
4256 SetVehicleZAngle(GetPlayerVehicleID(Player), Pos[3]);
4257 }
4258 else
4259 {
4260 SetPlayerPos(Player, Pos[0], Pos[1] + 2, Pos[2] + 0.5);
4261 SetPlayerFacingAngle(Player, Pos[3]);
4262 }
4263
4264 SetPlayerVirtualWorld(Player, GetPlayerVirtualWorld(Player2));
4265 SetPlayerInterior(Player, GetPlayerInterior(Player2));
4266
4267 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" teleported to "ORAN"%s[%i]"GREY" to "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player, Name(Player2), Player2);
4268 FormatMSG(playerid, Color:GREY, "You teleported "ORAN"%s[%i]"GREY" to "ORAN"%s[%i]", Name(Player), Player ,Name(Player2), Player2);
4269
4270 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" teleported you to "ORAN"%s[%i]"GREY"", Name(playerid), playerid ,Name(Player2), Player2);
4271 FormatMSG(Player2, Color:GREY, "Admin "ORAN"%s[%i]"GREY" teleported "ORAN"%s[%i]"GREY" to your position", Name(playerid), playerid ,Name(Player), Player);
4272 }
4273 return 1;
4274}
4275
4276CMD:goto(PARAMS)
4277{
4278 LoginCheck(playerid);
4279 LevelCheck(playerid, 1);
4280
4281 new Player;
4282 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/goto "GREY"<id>", "Will teleport you to the specified player");
4283 else
4284 {
4285 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
4286 if(Player == playerid ) return SendError(playerid, "Player entered is you!");
4287 CheckImune(playerid, Player);
4288
4289 new Float: Pos[4];
4290
4291 GetPlayerPos(Player, Pos[0], Pos[1], Pos[2]);
4292 GetPlayerFacingAngle(Player, Pos[3]);
4293
4294 if(IsPlayerInAnyVehicle(playerid))
4295 {
4296 LinkVehicleToInterior(GetPlayerVehicleID(playerid), GetPlayerInterior(Player));
4297 SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(Player));
4298
4299 SetVehiclePos(GetPlayerVehicleID(playerid), Pos[0] + 2, Pos[1] + 2, Pos[2] + 1);
4300 SetVehicleZAngle(GetPlayerVehicleID(playerid), Pos[3]);
4301 }
4302 else
4303 {
4304 SetPlayerPos(playerid, Pos[0], Pos[1] + 2, Pos[2] + 0.5);
4305 SetPlayerFacingAngle(playerid, Pos[3]);
4306 }
4307 SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(Player));
4308 SetPlayerInterior(playerid, GetPlayerInterior(Player));
4309 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" teleported to "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
4310 FormatMSG(playerid, Color:GREY, "You teleported to "ORAN"%s[%i]", Name(Player), Player);
4311 }
4312 return 1;
4313}
4314
4315
4316CMD:write(PARAMS)
4317{
4318 LoginCheck(playerid);
4319 LevelCheck(playerid, 3);
4320
4321 new Message[129];
4322 if(sscanf(params, "s[129]", Message)) return SendUsage(playerid, "/write "GREY"[message]", "Will send a message in the chat with grey color");
4323 else
4324 {
4325 SendClientMessageToAll(Color:GREY, Message);
4326 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" sent a message to the server.", Name(playerid), playerid);
4327 GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~g~~h~Message sent!", 3000, 3);
4328 }
4329 return 1;
4330}
4331CMD:giveallcash(PARAMS)
4332{
4333 LoginCheck(playerid);
4334 LevelCheck(playerid, 4);
4335
4336 new Cash;
4337 if(sscanf(params, "i", Cash)) return SendUsage(playerid, "/giveallcash "GREY"<cash>", "Will give everyone money("GREY"You can use negative numbers to take money! "W")");
4338 else
4339 {
4340 foreach(Player, i)
4341 {
4342 if(P_DATA[i][Level] != 5)GivePlayerMoney(i, Cash);
4343 if(Cash > 0)
4344 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"$%d"GREY" cash!", Name(playerid), playerid, Cash);
4345 else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"$%d"GREY" cash from everyone!", Name(playerid), playerid, Cash);
4346 }
4347 }
4348 return 1;
4349}
4350CMD:setallcash(PARAMS)
4351{
4352 LoginCheck(playerid);
4353 LevelCheck(playerid, 4);
4354
4355 new Cash;
4356 if(sscanf(params, "i", Cash)) return SendUsage(playerid, "/setallcash "GREY"<cash>", "Will set everyone's cash to the amount set");
4357 else
4358 {
4359 foreach(Player, i)
4360 {
4361 if(P_DATA[i][Level] != 5)
4362 {
4363 ResetPlayerMoney(i);
4364 GivePlayerMoney(i, Cash);
4365 }
4366 if(Cash > 0)
4367 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's cash to "ORAN"%d", Name(playerid), playerid, Cash);
4368 else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed everyone's cash!", Name(playerid), playerid);
4369 }
4370 }
4371 return 1;
4372}
4373CMD:giveallarmour(PARAMS)
4374{
4375 LoginCheck(playerid);
4376 LevelCheck(playerid, 4);
4377
4378 new Armour;
4379 if(sscanf(params, "i", Armour)) return SendUsage(playerid, "/giveallarmour "GREY"<armour>", "Will give everyone armour("GREY"Negative numbers are not allowed! "W")");
4380 else
4381 {
4382 if(Armour < 1) return SendUsage(playerid, "/giveallarmour "GREY"<armour>", "Will give everyone armour("GREY"Negative numbers are not allowed! "W")");
4383 foreach(Player, i)
4384 {
4385 if(P_DATA[i][Level] != 5)
4386 {
4387 new Float:a;
4388 GetPlayerArmour(i, a);
4389 SetPlayerArmour(i, a + Armour);
4390 }
4391 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" armour!", Name(playerid), playerid, Armour);
4392 }
4393 }
4394 return 1;
4395}
4396CMD:setallarmour(PARAMS)
4397{
4398 LoginCheck(playerid);
4399 LevelCheck(playerid, 4);
4400
4401 new Armour;
4402 if(sscanf(params, "i", Armour)) return SendUsage(playerid, "/setallarmour "GREY"<armour>", "Will set everyone's armour");
4403 else
4404 {
4405 foreach(Player, i)
4406 {
4407 if(P_DATA[i][Level] != 5)
4408 {
4409 SetPlayerArmour(i, Armour);
4410 }
4411 if(Armour > 0)
4412 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's Armour to "ORAN"%d", Name(playerid), playerid, Armour);
4413 else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed everyone's armour!", Name(playerid), playerid);
4414 }
4415 }
4416 return 1;
4417}
4418CMD:giveallh(PARAMS)
4419{
4420 LoginCheck(playerid);
4421 LevelCheck(playerid, 4);
4422
4423 new Health;
4424 if(sscanf(params, "i", Health)) return SendUsage(playerid, "/giveallh "GREY"<health>", "Will give everyone health("GREY"Negative numbers are not allowed! "W")");
4425 else
4426 {
4427 if(Health < 1) return SendUsage(playerid, "/ah "GREY"<health>", "Will give everyone health("GREY"Negative numbers are not allowed! "W")");
4428 foreach(Player, i)
4429 {
4430 if(P_DATA[i][Level] != 5)
4431 {
4432 new Float:he;
4433 GetPlayerHealth(i, he),
4434 SetPlayerHealth(i, he + Health);
4435 }
4436 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" health!", Name(playerid), playerid, Health);
4437 }
4438 }
4439 return 1;
4440}
4441CMD:setallhealth(PARAMS)
4442{
4443 LoginCheck(playerid);
4444 LevelCheck(playerid, 4);
4445
4446 new Health;
4447 if(sscanf(params, "i", Health)) return SendUsage(playerid, "/setallhealth "GREY"<health>", "Will set everyone's health");
4448 else
4449 {
4450 foreach(Player, i)
4451 {
4452 if(P_DATA[i][Level] != 5)
4453 {
4454 SetPlayerHealth(i, Health);
4455 }
4456 if(Health > 0)
4457 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's health to "ORAN"%d", Name(playerid), playerid, Health);
4458 else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" killed everyone!", Name(playerid), playerid);
4459 }
4460 }
4461 return 1;
4462}
4463
4464CMD:setalldrunk(PARAMS)
4465{
4466 LoginCheck(playerid);
4467 LevelCheck(playerid, 4);
4468
4469 new Drunk;
4470 if(sscanf(params, "i", Drunk)) return SendUsage(playerid, "/setalldrunk "GREY"<level>", "Will make players get drunk! Use "ORAN"0"W" to remove drunkenness");
4471 else
4472 {
4473 foreach(Player, i)
4474 {
4475 if(P_DATA[i][Level] != 5)
4476 {
4477 if(Drunk != 0) SetPlayerDrunkLevel(i, 9999 + Drunk);
4478 else SetPlayerDrunkLevel(i, 0);
4479 }
4480 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's drunk level to "ORAN"%d", Name(playerid), playerid, Drunk);
4481 }
4482 }
4483 return 1;
4484}
4485
4486CMD:setallint(PARAMS)
4487{
4488 LoginCheck(playerid);
4489 LevelCheck(playerid, 4);
4490
4491 new Interior;
4492 if(sscanf(params, "i", Interior)) return SendUsage(playerid, "/setallint "GREY"<interior>", "Will set everyone's interior id to the sapecified interior");
4493 else
4494 {
4495 foreach(Player, i)
4496 {
4497 if(P_DATA[i][Level] != 5)
4498 {
4499 SetPlayerInterior(i, Interior);
4500 }
4501 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's interior to "ORAN"%d", Name(playerid), playerid, Interior);
4502 }
4503 }
4504 return 1;
4505}
4506
4507CMD:setallworld(PARAMS)
4508{
4509 LoginCheck(playerid);
4510 LevelCheck(playerid, 4);
4511
4512 new World;
4513 if(sscanf(params, "i", World)) return SendUsage(playerid, "/setallworld "GREY"<world>", "Will set everyone's Virtual World to the specified world");
4514 else
4515 {
4516 foreach(Player, i)
4517 {
4518 if(P_DATA[i][Level] != 5)
4519 {
4520 SetPlayerVirtualWorld(i, World);
4521 }
4522 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's virtual world to "ORAN"%d", Name(playerid), playerid, World);
4523 }
4524 }
4525 return 1;
4526}
4527CMD:giveallscore(PARAMS)
4528{
4529 LoginCheck(playerid);
4530 LevelCheck(playerid, 4);
4531
4532 new zScore;
4533 if(sscanf(params, "i", zScore)) return SendUsage(playerid, "/giveallscore "GREY"<score>", "Will give everyone score("GREY"You can use negative numbers to take score! "W")");
4534 else
4535 {
4536 foreach(Player, i)
4537 {
4538 if(P_DATA[i][Level] != 5)SetPlayerScore(i, (zScore) ? (GetPlayerScore(i) + zScore) : (GetPlayerScore(i) - zScore));
4539 if(zScore > 0)
4540 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" score!", Name(playerid), playerid, zScore);
4541 else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%d"GREY" score from everyone!", Name(playerid), playerid, zScore);
4542 }
4543 }
4544 return 1;
4545}
4546CMD:setallscore(PARAMS)
4547{
4548 LoginCheck(playerid);
4549 LevelCheck(playerid, 4);
4550
4551 new aScore;
4552 if(sscanf(params, "i", aScore)) return SendUsage(playerid, "/setallscore "GREY"<score>", "Will set everyone's score to the specified score");
4553 else
4554 {
4555 foreach(Player, i)
4556 {
4557 if(P_DATA[i][Level] != 5)
4558 {
4559 SetPlayerScore(i, aScore);
4560 }
4561 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's score to "ORAN"%d", Name(playerid), playerid, aScore);
4562 }
4563 }
4564 return 1;
4565}
4566CMD:giveallwanted(PARAMS)
4567{
4568 LoginCheck(playerid);
4569 LevelCheck(playerid, 4);
4570
4571 new Wanted;
4572 if(sscanf(params, "i", Wanted)) return SendUsage(playerid, "/giveallwanted "GREY"<stars>", "Will give everyone wanted stars("GREY"You can use negative numbers to take wanted stars! "W")");
4573 else
4574 {
4575 foreach(Player, i)
4576 {
4577 if(P_DATA[i][Level] != 5)
4578 {
4579 if(GetPlayerWantedLevel(i) >= 0)
4580 {
4581 SetPlayerWantedLevel(i, (Wanted) ? (GetPlayerWantedLevel(i) + Wanted) : (GetPlayerWantedLevel(i) - Wanted));
4582 if(GetPlayerWantedLevel(i) < 0) SetPlayerWantedLevel(i, 0);
4583 }
4584 }
4585 if(Wanted > 0) FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" wanted stars!", Name(playerid), playerid, Wanted);
4586 else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%d"GREY" wanted stars from everyone!", Name(playerid), playerid, Wanted);
4587 }
4588 }
4589 return 1;
4590}
4591CMD:giveallcookies(PARAMS)
4592{
4593 LoginCheck(playerid);
4594 LevelCheck(playerid, 4);
4595
4596 new Cookiz;
4597 if(sscanf(params, "i", Cookiz)) return SendUsage(playerid, "/giveallcookies "GREY"<cookies>", "Will give everyone cookies("GREY"You can use negative numbers to take cookies! "W")");
4598 else
4599 {
4600 new String[10];
4601 if(Cookiz < 0)
4602 {
4603 format(String, sizeof String, "%d", Cookiz);
4604 strdel(String, 0, 1);
4605 }
4606 foreach(Player, i)
4607 {
4608 if(P_DATA[i][Level] != 5)
4609 {
4610 if(Cookiz < 0)P_DATA[i][Cookies] -= strval(String);
4611 else P_DATA[i][Cookies] += Cookiz;
4612
4613
4614 if(P_DATA[i][Cookies] < 0) P_DATA[i][Cookies] = 0;
4615 }
4616 if(Cookiz > 0) FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" cookies!", Name(playerid), playerid, Cookiz);
4617 else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%d"GREY" cookies from everyone!", Name(playerid), playerid, Cookiz);
4618 }
4619 }
4620 return 1;
4621}
4622
4623CMD:setrespect(PARAMS)
4624{
4625 LoginCheck(playerid);
4626 LevelCheck(playerid, 3);
4627
4628 new Player, rType[2],Respect;
4629 if(sscanf(params, "us[2]i", Player, rType, Respect)) return SendUsage(playerid, "/setrespect "GREY"<id> <-/+> <respect>", "Will change player's negative/positive respect!");
4630 else
4631 {
4632 if(Respect < 0) return SendUsage(playerid, "/setrespect "GREY"<id> <-/+> <respect>", "Will change player's negative/positive respect!");
4633 if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
4634 CheckImune(playerid, Player);
4635
4636 if(!strcmp(rType, "+", false)) SetPVarInt(Player, "0_Positive", Respect);
4637 else if(!strcmp(rType, "-", false))SetPVarInt(Player, "0_Negative", Respect);
4638 else return SendError(playerid, "The first parameter must contain either '+' or '-' without '. (+ Positive respect | - Negative respect)");
4639
4640 if(playerid != Player)
4641 {
4642 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed "ORAN"%s[%i]"GREY"'s %s respect to %d!", Name(playerid), playerid ,Name(Player), Player, (strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Respect);
4643 FormatMSG(playerid, Color:GREY,"You set "ORAN"%s[%i]"GREY"'s %s respect to "ORAN"%d", Name(Player), Player, (strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Respect);
4644 FormatMSG(Player, Color:GREY,"Admin "ORAN"%s[%i]"GREY" set your %s respect to "ORAN"%d", Name(playerid), Player, (strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Respect);
4645 }
4646 else
4647 {
4648 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his %s respect to "ORAN"%d!", Name(playerid), playerid, (strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Respect);
4649 FormatMSG(playerid, Color:GREY,"You set your %s respect to "ORAN"%d", (strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Respect);
4650 }
4651 #if UPDATE_TOP_ALWAYS == true
4652 new
4653 Query[256],
4654 DBResult: R1;
4655
4656 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
4657 R1 = DB::Query(_DB, Query);
4658
4659 if(R1)
4660 {
4661 if(DB::Valid(R1))
4662 {
4663 DB::Free(R1);
4664 format(Query, sizeof(Query), "UPDATE `Top` SET `%s` = '%d' WHERE `Name` = '%s'", (!strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Respect, Name(Player));
4665 DB::Query(_DB, Query);
4666 }
4667 else
4668 {
4669 DB::Free(R1);
4670 format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `%s`) VALUES('%s','%d')", (!strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Name(Player), Respect);
4671 DB::Query(_DB, Query);
4672 }
4673 }
4674 #endif
4675 }
4676 return 1;
4677}
4678CMD:giveallrespect(PARAMS)
4679{
4680 LoginCheck(playerid);
4681 LevelCheck(playerid, 4);
4682
4683 new rType[2],Respect;
4684 if(sscanf(params, "s[2]i", rType, Respect)) return SendUsage(playerid, "/giveallrespect "GREY"<-/+> <respect>", "Will give everyone respect(Either negative respect that even positive respect)");
4685 else
4686 {
4687 if(Respect < 0) return SendUsage(playerid, "/giveallrespect "GREY"<-/+> <respect>", "Will give everyone respect(Either negative respect that even positive respect)");
4688 if(!strcmp(rType, "+", false))
4689 {
4690 foreach(Player, i)
4691 {
4692 if(P_DATA[i][Level] != 5)
4693 {
4694 SetPVarInt(i, "0_Positive", GetPVarInt(i, "0_Positive") + Respect);
4695 #if UPDATE_TOP_ALWAYS == true
4696 new
4697 Query[256],
4698 DBResult: R1;
4699
4700 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
4701 R1 = DB::Query(_DB, Query);
4702
4703 if(R1)
4704 {
4705 if(DB::Valid(R1))
4706 {
4707 DB::Free(R1);
4708 format(Query, sizeof(Query), "UPDATE `Top` SET `Positive` = '%d' WHERE `Name` = '%s'", GetPVarInt(i, "0_Positive"), Name(i));
4709 DB::Query(_DB, Query);
4710 }
4711 }
4712 #endif
4713 }
4714 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" positive respect!", Name(playerid), playerid, Respect);
4715 }
4716 }
4717 else if(!strcmp(rType, "-", false))
4718 {
4719 foreach(Player, i)
4720 {
4721 if(P_DATA[i][Level] != 5)
4722 {
4723 SetPVarInt(i, "0_Negative", GetPVarInt(i, "0_Negative") + Respect);
4724 #if UPDATE_TOP_ALWAYS == true
4725 new
4726 Query[256],
4727 DBResult: R1;
4728
4729 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
4730 R1 = DB::Query(_DB, Query);
4731
4732 if(R1)
4733 {
4734 if(DB::Valid(R1))
4735 {
4736 DB::Free(R1);
4737 format(Query, sizeof(Query), "UPDATE `Top` SET `Negative` = '%d' WHERE `Name` = '%s'", GetPVarInt(i, "0_Negative"), Name(i));
4738 DB::Query(_DB, Query);
4739 }else DB::Free(R1);
4740 }
4741 #endif
4742 }
4743 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" negative respect!", Name(playerid), playerid, Respect);
4744 }
4745 }
4746 else return SendError(playerid, "The first parameter must contain either '+' or '-' without '. (+ Positive respect | - Negative respect)");
4747 }
4748 return 1;
4749}
4750CMD:resetallrespect(PARAMS)
4751{
4752 LoginCheck(playerid);
4753 LevelCheck(playerid, 4);
4754
4755 new rType[2];
4756 if(sscanf(params, "s[2]", rType)) return SendUsage(playerid, "/resetallrespect "GREY" <-/+>", "Will reset everyone's positive/negative respect!");
4757 else
4758 {
4759 if(!strcmp(rType, "+", false))
4760 {
4761 foreach(Player, i)
4762 {
4763 if(P_DATA[i][Level] != 5)
4764 {
4765 #if UPDATE_TOP_ALWAYS == true
4766 new
4767 Query[256],
4768 DBResult: R1;
4769
4770 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
4771 R1 = DB::Query(_DB, Query);
4772
4773 if(R1)
4774 {
4775 if(DB::Valid(R1))
4776 {
4777 DB::Free(R1);
4778 format(Query, sizeof(Query), "UPDATE `Top` SET `Positive` = '0' WHERE `Name` = '%s'", Name(i));
4779 DB::Query(_DB, Query);
4780 }
4781 }
4782 #endif
4783 SetPVarInt(i, "0_Positive", 0);
4784 }
4785 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" reseted everyone's positive respect!", Name(playerid), playerid);
4786 }
4787 }
4788 else if(!strcmp(rType, "-", false))
4789 {
4790 foreach(Player, i)
4791 {
4792 if(P_DATA[i][Level] != 5)
4793 {
4794 #if UPDATE_TOP_ALWAYS == true
4795 new
4796 Query[256],
4797 DBResult: R1;
4798
4799 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
4800 R1 = DB::Query(_DB, Query);
4801
4802 if(R1)
4803 {
4804 if(DB::Valid(R1))
4805 {
4806 DB::Free(R1);
4807 format(Query, sizeof(Query), "UPDATE `Top` SET `Negative` = '0' WHERE `Name` = '%s'", Name(i));
4808 DB::Query(_DB, Query);
4809 }
4810 }
4811 #endif
4812 SetPVarInt(i, "0_Negative", 0);
4813 }
4814 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" reseted everyone's negative respect!", Name(playerid), playerid);
4815 }
4816 }
4817 }
4818 return 1;
4819}
4820CMD:setallrespect(PARAMS)
4821{
4822 LoginCheck(playerid);
4823 LevelCheck(playerid, 4);
4824
4825 new rType[2],Respect;
4826 if(sscanf(params, "s[2]i", rType, Respect)) return SendUsage(playerid, "/setallrespect "GREY"<-/+> <respect>", "Will set everyone's respect(Either negative respect that even positive respect)");
4827 else
4828 {
4829 if(Respect < 0) return SendUsage(playerid, "/setallrespect "GREY"<-/+> <respect>", "Will set everyone's respect(Either negative respect that even positive respect)");
4830 if(!strcmp(rType, "+", false))
4831 {
4832 foreach(Player, i)
4833 {
4834 if(P_DATA[i][Level] != 5)
4835 {
4836 #if UPDATE_TOP_ALWAYS == true
4837 new
4838 Query[256],
4839 DBResult: R1;
4840
4841 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
4842 R1 = DB::Query(_DB, Query);
4843
4844 if(R1)
4845 {
4846 if(DB::Valid(R1))
4847 {
4848 DB::Free(R1);
4849 format(Query, sizeof(Query), "UPDATE `Top` SET `Positive` = '%d' WHERE `Name` = '%s'", Respect, Name(i));
4850 DB::Query(_DB, Query);
4851 }else DB::Free(R1);
4852 }
4853 #endif
4854 SetPVarInt(i, "0_Positive", Respect);
4855 }
4856 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's positive respect to "ORAN"%d", Name(playerid), playerid, Respect);
4857 }
4858 }
4859 else if(!strcmp(rType, "-", false))
4860 {
4861 foreach(Player, i)
4862 {
4863 if(P_DATA[i][Level] != 5)
4864 {
4865 #if UPDATE_TOP_ALWAYS == true
4866 new
4867 Query[256],
4868 DBResult: R1;
4869
4870 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
4871 R1 = DB::Query(_DB, Query);
4872
4873 if(R1)
4874 {
4875 if(DB::Valid(R1))
4876 {
4877 DB::Free(R1);
4878 format(Query, sizeof(Query), "UPDATE `Top` SET `Negative` = '%d' WHERE `Name` = '%s'", Respect, Name(i));
4879 DB::Query(_DB, Query);
4880 }else DB::Free(R1);
4881 }
4882
4883 #endif
4884 SetPVarInt(i, "0_Negative", Respect);
4885 }
4886 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's negative respect to "ORAN"%d", Name(playerid), playerid, Respect);
4887 }
4888 }
4889 else return SendError(playerid, "The first parameter must contain either '+' or '-' without '. (+ Positive respect | - Negative respect)");
4890 }
4891 return 1;
4892}
4893CMD:setallwanted(PARAMS)
4894{
4895 LoginCheck(playerid);
4896 LevelCheck(playerid, 4);
4897
4898 new Wanted;
4899 if(sscanf(params, "i", Wanted)) return SendUsage(playerid, "/setallwanted "GREY"<level>", "Will make a player wanted of the specified level");
4900 else
4901 {
4902 foreach(Player, i)
4903 {
4904 if(P_DATA[i][Level] != 5)
4905 {
4906 SetPlayerWantedLevel(i, Wanted);
4907 }
4908 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's wanted level to "ORAN"%d", Name(playerid), playerid, Wanted);
4909 }
4910 }
4911 return 1;
4912}
4913CMD:healcar(PARAMS)
4914{
4915 LoginCheck(playerid);
4916 LevelCheck(playerid, 2);
4917
4918 new Player;
4919 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/healcar "GREY"<id>", "Will heal a player's car!");
4920 else
4921 {
4922 if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
4923 if(Player == playerid) return SendError(playerid, "You can use "ORAN"/cargod"W" if you want!");
4924 if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
4925
4926 SetVehicleHealth(GetPlayerVehicleID(Player), 1200);
4927
4928 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" healed "ORAN"%s[%i]'s"GREY" vehicle!", Name(playerid), playerid, Name(Player), Player);
4929 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" healed your vehicle!", Name(playerid), playerid);
4930 FormatMSG(Player, Color:GREY, "You healed "ORAN"%s[%i]"GREY"'s vehicle!", Name(Player), Player);
4931 }
4932 return 1;
4933}
4934CMD:destroyv(PARAMS)
4935{
4936 LevelCheck(playerid, 3);
4937
4938 new Player;
4939
4940 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/destroyv "GREY"<id>", "Will destroy player's vehicle!");
4941 else
4942 {
4943 if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
4944 if(Player == playerid) return SendError(playerid, "Player entered is you!");
4945 if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
4946
4947 P_DATA[Player][CarGod] = 0;
4948 SetVehicleHealth(GetPlayerVehicleID(Player), 0);
4949
4950 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" destroyed "ORAN"%s[%i]'s"GREY" vehicle!", Name(playerid), playerid, Name(Player), Player);
4951 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" destroyed your vehicle!", Name(playerid), playerid);
4952 FormatMSG(Player, Color:GREY, "You destroyed "ORAN"%s[%i]"GREY"'s vehicle!", Name(Player), Player);
4953 }
4954 return 1;
4955}
4956
4957CMD:setvhealth(PARAMS)
4958{
4959 LoginCheck(playerid);
4960 LevelCheck(playerid, 2);
4961
4962 new Player, vHealth;
4963 if(sscanf(params, "ui", Player, vHealth)) return SendUsage(playerid, "/setvh "GREY"<id> <health>", "Will set player's vehicle health!");
4964 else
4965 {
4966 if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
4967 if(Player == playerid) return SendError(playerid, "Player entered is you!");
4968 if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
4969
4970 SetVehicleHealth(GetPlayerVehicleID(Player), vHealth);
4971
4972 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"%s[%i]'s"GREY" vehicle health to"ORAN"%d!", Name(playerid), playerid, Name(Player), Player, vHealth);
4973 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your vehicle's health to"ORAN"%d!", Name(playerid), playerid, vHealth);
4974 FormatMSG(Player, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s vehicle health to"ORAN"%d!", Name(Player), Player, vHealth);
4975 }
4976 return 1;
4977}
4978CMD:carcolor(PARAMS)
4979{
4980 LoginCheck(playerid);
4981 LevelCheck(playerid, 2);
4982
4983 new Player, vColor[2];
4984 if(sscanf(params, "uD(0)D(0)", Player, vColor[0], vColor[1])) return SendUsage(playerid, "/carcolor <id> <!color1> <!color2>", "Will change player's vehicle colors! (! means it's optional, if not set, returns random)");
4985 {
4986 if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
4987 if(Player == playerid) return SendError(playerid, "Player entered is you!");
4988 if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
4989
4990 if(!vColor[0]) vColor[0] = random(255);
4991 if(!vColor[1]) vColor[1] = random(255);
4992
4993 ChangeVehicleColor(GetPlayerVehicleID(Player), vColor[0], vColor[1]);
4994
4995 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed "ORAN"%s[%i]'s"GREY" vehicle colors", Name(playerid), playerid, Name(Player), Player);
4996 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" changed your vehicle's colors", Name(playerid), playerid);
4997 FormatMSG(Player, Color:GREY, "You changed "ORAN"%s[%i]"GREY"'s vehicle colors", Name(Player), Player);
4998 }
4999 return 1;
5000}
5001
5002CMD:heal(PARAMS)
5003{
5004 LoginCheck(playerid);
5005
5006 new Player;
5007 if(sscanf(params, "u", Player))
5008 {
5009 if(P_DATA[playerid][Level] == 2)
5010 {
5011 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" healed himself!", Name(playerid), playerid);
5012 SendClientMessage(playerid, Color:GREY, "You healed yourself!");
5013 }
5014 else if(P_DATA[playerid][Level] > 2)
5015 {
5016 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" healed himself!", Name(playerid), playerid);
5017 SendClientMessage(playerid, Color:GREY, "You healed yourself!");
5018 return SendUsage(playerid, "/heal"GREY" <id>", "Will heal a specified player!");
5019 }
5020 }
5021 else
5022 {
5023 if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
5024 SetPlayerHealth(Player, 100.0);
5025
5026 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" healed "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
5027 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" healed you!", Name(playerid), playerid);
5028 FormatMSG(playerid, Color:GREY, "You healed player "ORAN"%s[%i]", Name(Player), Player);
5029 }
5030 return 1;
5031}
5032
5033CMD:healall(PARAMS)
5034{
5035 LoginCheck(playerid);
5036 LevelCheck(playerid, 3);
5037
5038 foreach(Player, i)
5039 {
5040 if(P_DATA[i][Level] != 5)
5041 {
5042 SetPlayerHealth(i, 100.0);
5043 }
5044 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" healed everyone", Name(playerid), playerid);
5045 }
5046 return 1;
5047}
5048CMD:setallskin(PARAMS)
5049{
5050 LoginCheck(playerid);
5051 LevelCheck(playerid, 4);
5052
5053 new Skin;
5054 if(sscanf(params, "i", Skin)) return SendUsage(playerid, "/setallskin "GREY"<skin>", "Will set everyone's skin to the specified ID");
5055 else
5056 {
5057 if(!IsValidSkin(Skin)) return SendError(playerid, "Invalid skin ID!");
5058
5059 foreach(Player, i)
5060 {
5061 if(P_DATA[i][Level] != 5)
5062 {
5063 SetPlayerSkin(i, Skin);
5064 }
5065 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's skin to "ORAN"%d", Name(playerid), playerid, Skin);
5066 }
5067 }
5068 return 1;
5069}
5070
5071CMD:setalltime(PARAMS)
5072{
5073 LoginCheck(playerid);
5074 LevelCheck(playerid, 3);
5075
5076 new Time;
5077 if(sscanf(params, "i", Time)) return SendUsage(playerid, "/setalltime "GREY"<hour>", "Will change everyone's in-game time");
5078 else
5079 {
5080 foreach(Player, i)
5081 {
5082 if(P_DATA[i][Level] != 5)
5083 {
5084 SetPlayerTime(i, Time, 0);
5085 }
5086 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's time to "ORAN"%d:00", Name(playerid), playerid, Time);
5087 }
5088 }
5089 return 1;
5090}
5091CMD:setallweather(PARAMS)
5092{
5093 LoginCheck(playerid);
5094 LevelCheck(playerid, 3);
5095
5096 new Weather;
5097 if(sscanf(params, "i", Weather)) return SendUsage(playerid, "/setallweather "GREY"<weather id>", "Will change everyone's weather");
5098 else
5099 {
5100 foreach(Player, i)
5101 {
5102 if(P_DATA[i][Level] != 5)
5103 {
5104 SetPlayerWeather(i, Weather);
5105 }
5106 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's weather to "ORAN"%d", Name(playerid), playerid, Weather);
5107 }
5108 }
5109 return 1;
5110}
5111
5112CMD:setdrunk(PARAMS)
5113{
5114 LoginCheck(playerid);
5115 LevelCheck(playerid, 3);
5116
5117 new Player, Drunk;
5118 if(sscanf(params, "ui", Player, Drunk)) return SendUsage(playerid, "/setdrunk "GREY"<id> <level>", "Will set a player drunk of the specified level");
5119 else
5120 {
5121 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5122 CheckImune(playerid, Player);
5123
5124 SetPlayerDrunkLevel(Player, Drunk);
5125
5126 if(Player != playerid)
5127 {
5128 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s drunk level to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, Drunk);
5129 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s drunk level to "ORAN"%d", Name(Player), Player, Drunk);
5130 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your drunk level to "ORAN"%d", Name(playerid), playerid, Drunk);
5131 }
5132 else
5133 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set drunk level to "ORAN"%d", Name(playerid), playerid, Drunk);
5134 }
5135 return 1;
5136}
5137CMD:setwanted(PARAMS)
5138{
5139 LoginCheck(playerid);
5140 LevelCheck(playerid, 3);
5141
5142 new Player, Wanted;
5143 if(sscanf(params, "ui", Player, Wanted)) return SendUsage(playerid, "/setwanted "GREY"<id> <level>", "Will set the specified player wanted of the specified level");
5144 else
5145 {
5146 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5147 CheckImune(playerid, Player);
5148
5149 SetPlayerWantedLevel(Player, Wanted);
5150
5151 if(Player != playerid)
5152 {
5153 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s wanted level to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, Wanted);
5154 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s wanted level to "ORAN"%d", Name(Player), Player, Wanted);
5155 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your wanted level to "ORAN"%d", Name(playerid), playerid, Wanted);
5156 }
5157 else
5158 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his wanted level to "ORAN"%d", Name(playerid), playerid, Wanted);
5159 }
5160 return 1;
5161}
5162CMD:setinterior(PARAMS)
5163{
5164 LoginCheck(playerid);
5165 LevelCheck(playerid, 3);
5166
5167 new Player, Interior;
5168 if(sscanf(params, "ui", Player, Interior)) return SendUsage(playerid, "/setinterior "GREY"<id> <interior>", "Will set player's interior");
5169 else
5170 {
5171 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5172 CheckImune(playerid, Player);
5173
5174 SetPlayerInterior(Player, Interior);
5175
5176 if(Player != playerid)
5177 {
5178 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s virtual world to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, Interior);
5179 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s interior to "ORAN"%d", Name(Player), Player, Interior);
5180 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your interior to "ORAN"%d", Name(playerid), playerid, Interior);
5181 }
5182 else
5183 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his interior to "ORAN"%d", Name(playerid), playerid, Interior);
5184 }
5185 return 1;
5186}
5187CMD:setworld(PARAMS)
5188{
5189 LoginCheck(playerid);
5190 LevelCheck(playerid, 3);
5191
5192 new Player, World;
5193 if(sscanf(params, "ui", Player, World)) return SendUsage(playerid, "/setworld "GREY"<id> <world>", "Will change player's virtual world");
5194 else
5195 {
5196 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5197 CheckImune(playerid, Player);
5198
5199 SetPlayerVirtualWorld(Player, World);
5200
5201 if(Player != playerid)
5202 {
5203 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s virtual world to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, World);
5204 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s virtual world to "ORAN"%d", Name(Player), Player, World);
5205 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your virtual world to "ORAN"%d", Name(playerid), playerid, World);
5206 }
5207 else
5208 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his virtual world to "ORAN"%d", Name(playerid), playerid, World);
5209 }
5210 return 1;
5211}
5212CMD:setcash(PARAMS)
5213{
5214 LoginCheck(playerid);
5215 LevelCheck(playerid, 3);
5216
5217 new Player, Cash;
5218 if(sscanf(params, "ui", Player, Cash)) return SendUsage(playerid, "/setcash "GREY"<id> <cash>", "Will set player's cash to the amount inserted");
5219 else
5220 {
5221 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5222 CheckImune(playerid, Player);
5223
5224 ResetPlayerMoney(Player);
5225 GivePlayerMoney(Player, Cash);
5226
5227 if(Player != playerid)
5228 {
5229 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s cash to "GREE"$%d", Name(playerid), playerid, Name(Player), Player, Cash);
5230 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s cash to "GREE"$%d", Name(Player), Player, Cash);
5231 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your cash to "GREE"$%d", Name(playerid), playerid, Cash);
5232 }
5233 else
5234 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his cash to "GREE"$%d", Name(playerid), playerid, Cash);
5235 }
5236 return 1;
5237}
5238CMD:setscore(PARAMS)
5239{
5240 LoginCheck(playerid);
5241 LevelCheck(playerid, 3);
5242
5243 new Player, aScore;
5244 if(sscanf(params, "ui", Player, aScore)) return SendUsage(playerid, "/setscore "GREY"<id> <score>", "Will set player's score to the specified score");
5245 else
5246 {
5247 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5248 CheckImune(playerid, Player);
5249
5250 SetPlayerScore(Player, aScore);
5251
5252 if(Player != playerid)
5253 {
5254 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s score to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, aScore);
5255 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s score to "ORAN"%d", Name(Player), Player, aScore);
5256 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your score to "ORAN"%d", Name(playerid), playerid, aScore);
5257 }
5258 else
5259 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his score to "ORAN"%d", Name(playerid), playerid, aScore);
5260 }
5261 return 1;
5262}
5263CMD:setdeaths(PARAMS)
5264{
5265 LoginCheck(playerid);
5266 LevelCheck(playerid, 4);
5267
5268 new Player, zDeaths;
5269 if(sscanf(params, "ui", Player, zDeaths) || zDeaths < 0) return SendUsage(playerid, "/setdeaths "GREY"<id> <deaths>", "Will change player's deaths");
5270 else
5271 {
5272 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5273 CheckImune(playerid, Player);
5274
5275 SetPVarInt(Player, "0_Deaths", zDeaths);
5276 P_DATA[Player][Deaths] = zDeaths;
5277 if(Player != playerid)
5278 {
5279 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s deaths to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, zDeaths);
5280 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s deaths to "ORAN"%d", Name(Player), Player, zDeaths);
5281 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your deaths to "ORAN"%d", Name(playerid), playerid, zDeaths);
5282 }
5283 else
5284 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his deaths to "ORAN"%d", Name(playerid), playerid, zDeaths);
5285
5286 #if UPDATE_TOP_ALWAYS
5287
5288 new
5289 Query[256],
5290 DBResult: R1;
5291
5292 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
5293 R1 = DB::Query(_DB, Query);
5294
5295 if(R1)
5296 {
5297 if(DB::Valid(R1))
5298 {
5299 DB::Free(R1);
5300 format(Query, sizeof(Query), "UPDATE `Top` SET `Deaths` = '%d' WHERE `Name` = '%s'", zDeaths, Name(Player));
5301 DB::Query(_DB, Query);
5302 }
5303 else
5304 {
5305 DB::Free(R1);
5306 format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Deaths`) VALUES('%s','%d')", Name(Player), zDeaths);
5307 DB::Query(_DB, Query);
5308 }
5309 }
5310 #endif
5311 }
5312 return 1;
5313}
5314CMD:setkills(PARAMS)
5315{
5316 LoginCheck(playerid);
5317 LevelCheck(playerid, 4);
5318
5319 new Player, zKills;
5320 if(sscanf(params, "ui", Player, zKills) || zKills < 0) return SendUsage(playerid, "/setkills "GREY"<id> <kills>", "Will change player's kills");
5321 else
5322 {
5323 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5324 CheckImune(playerid, Player);
5325
5326 SetPVarInt(Player, "0_Kills", zKills);
5327 P_DATA[Player][Kills] = zKills;
5328
5329 if(Player != playerid)
5330 {
5331 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s kills to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, zKills);
5332 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s kills to "ORAN"%d", Name(Player), Player, zKills);
5333 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your kills to "ORAN"%d", Name(playerid), playerid, zKills);
5334 }
5335 else
5336 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his kills to "ORAN"%d", Name(playerid), playerid, zKills);
5337
5338 #if UPDATE_TOP_ALWAYS == true
5339
5340 new
5341 Query[256],
5342 DBResult: R1;
5343
5344 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
5345 R1 = DB::Query(_DB, Query);
5346
5347 if(R1)
5348 {
5349 if(DB::Valid(R1))
5350 {
5351 DB::Free(R1);
5352 format(Query, sizeof(Query), "UPDATE `Top` SET `Kills` = '%d' WHERE `Name` = '%s'", zKills, Name(Player));
5353 DB::Query(_DB, Query);
5354 }
5355 else
5356 {
5357 DB::Free(R1);
5358 format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Kills`) VALUES('%s','%d')", Name(Player), zKills);
5359 DB::Query(_DB, Query);
5360 }
5361 }
5362
5363 #endif
5364 }
5365 return 1;
5366}
5367CMD:setweather(PARAMS)
5368{
5369 LoginCheck(playerid);
5370 LevelCheck(playerid, 3);
5371
5372 new Player, Weather;
5373 if(sscanf(params, "ui", Player, Weather)) return SendUsage(playerid, "/setweather "GREY"<id> <weather id>", "Will change player's weather to the specified weather ID");
5374 else
5375 {
5376 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5377 CheckImune(playerid, Player);
5378
5379 SetPlayerWeather(Player, Weather);
5380
5381 if(Player != playerid)
5382 {
5383 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed "ORAN"\"%s[%i]"GREY"'s weather to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, Weather);
5384 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s weather to "ORAN"%d", Name(Player), Player, Weather);
5385 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your weather to "ORAN"%d", Name(playerid), playerid, Weather);
5386 }
5387 else
5388 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his weather to "ORAN"%d", Name(playerid), playerid, Weather);
5389 }
5390 return 1;
5391}
5392CMD:settime(PARAMS)
5393{
5394 LoginCheck(playerid);
5395 LevelCheck(playerid, 1);
5396
5397 new Player, Time;
5398 if(sscanf(params, "ui", Player, Time)) return SendUsage(playerid, "/settime "GREY"<id> <hour>", "Will change player's time");
5399 else
5400 {
5401 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5402 CheckImune(playerid, Player);
5403 if(Time < 0 || Time > 24) return SendError(playerid, "Invalid hour! (0 - 24)");
5404 SetPlayerTime(Player, Time, 0);
5405
5406 if(Player != playerid)
5407 {
5408 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed "ORAN"\"%s[%i]"GREY"'s time to "ORAN"%d:00", Name(playerid), playerid, Name(Player), Player, Time);
5409 FormatMSG(Player, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s time to "ORAN"%d:00", Name(Player), Player, Time);
5410 }
5411 else
5412 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his time to "ORAN"%d:00", Name(playerid), playerid, Time);
5413 }
5414 return 1;
5415}
5416CMD:setskin(PARAMS)
5417{
5418 LoginCheck(playerid);
5419 LevelCheck(playerid, 2);
5420
5421 new Player, Skin;
5422 if(sscanf(params, "ui", Player, Skin)) return SendUsage(playerid, "/setskin "GREY"<id> <skin>", "Will change player's skin to the specified skin ID");
5423 else
5424 {
5425 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5426 CheckImune(playerid, Player);
5427 if(!IsValidSkin(Skin)) return SendError(playerid, "Invalid skin!");
5428 SetPlayerSkin(Player, Skin);
5429
5430 if(Player != playerid)
5431 {
5432 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed "ORAN"\"%s[%i]"GREY"'s skin to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, Skin);
5433 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s skin to "ORAN"%d", Name(Player), Player, Skin);
5434 }
5435 else
5436 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his skin to "ORAN"%d", Name(playerid), playerid, Skin);
5437 }
5438 return 1;
5439}
5440CMD:setarmour(PARAMS)
5441{
5442 LoginCheck(playerid);
5443 LevelCheck(playerid, 3);
5444
5445 new Player, Float: Armour;
5446 if(sscanf(params, "uf", Player, Armour)) return SendUsage(playerid, "/setarmour "GREY"<id> <armour>", "Will set player's armour to the specified armour");
5447 else
5448 {
5449 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5450 CheckImune(playerid, Player);
5451
5452 SetPlayerArmour(Player, Float: Armour);
5453
5454 if(Player != playerid)
5455 {
5456 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s armour to "ORAN"%.1f", Name(playerid), playerid, Name(Player), Player, Armour);
5457 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s armour to "ORAN"%.1f", Name(Player), Player, Armour);
5458 }
5459 else
5460 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his armour to "ORAN"%.1f", Name(playerid), playerid, Armour);
5461 }
5462 return 1;
5463}
5464CMD:sethealth(PARAMS)
5465{
5466 LoginCheck(playerid);
5467 LevelCheck(playerid, 3);
5468
5469 new Player, Float: Health;
5470 if(sscanf(params, "uf", Player, Health)) return SendUsage(playerid, "/sethealth "GREY"<id> <health>", "Will set player's health to the specified health");
5471 else
5472 {
5473 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5474 CheckImune(playerid, Player);
5475
5476 SetPlayerHealth(Player, Float: Health);
5477
5478 if(Player != playerid)
5479 {
5480 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s health to "ORAN"%.1f", Name(playerid), playerid, Name(Player), Player, Health);
5481 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s health to "ORAN"%.1f", Name(Player), Player, Health);
5482 }
5483 else
5484 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his health to "ORAN"%.1f", Name(playerid), playerid, Health);
5485 }
5486 return 1;
5487}
5488CMD:pm(PARAMS)
5489{
5490 LoginCheck(playerid);
5491
5492 if((P_DATA[playerid][Muted] || P_DATA[playerid][Muted]) && P_DATA[playerid][Level] != 5 && !IsPlayerAdmin(playerid))
5493 return SendError(playerid, "You are not allowed to send personal message while muted!");
5494
5495 new Player, Message[129];
5496 if(sscanf(params, "us[129]", Player, Message)) return SendUsage(playerid, "/pm "GREY"<id> [message]", "Sends a personal message to the specified id");
5497 else
5498 {
5499 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5500 if(Player == playerid ) return SendError(playerid, "You cannot PM yourself!");
5501
5502 FormatMSG(Player, Color:ORAN, "PM Received: {FFD48A}%s[%i] says: "W"%s", Name(playerid), playerid, Message);
5503 FormatMSG(playerid, Color:ORAN, "PM Sent: {FFD48A}to %s[%i]: %s", Name(Player), Player, Message);
5504
5505 if(S_DATA[ReadPM])
5506 {
5507 SendAdminCMD(playerid, "PM Detected: {FFD48A}%s[%i] "GREY"to %s[%i]", Name(playerid), playerid, Name(Player), Player);
5508 SendAdminCMD(playerid, "Message: {FFD48A}%s", Message);
5509 }
5510 #if SAVE_IN_LOGS == true
5511 SaveInLog(PMS_LOG, "---------------------------\r\n\
5512 Sender %s\r\n\
5513 Receiver %s\r\n\
5514 Message: %s\r\n\
5515 Date: %s\r\n\
5516 ---------------------------\r\n\\r\n", Name(playerid), Name(Player), Message, zDate());
5517 #endif
5518 }
5519 return 1;
5520}
5521CMD:register(PARAMS)
5522{
5523 if(P_DATA[playerid][Logged])
5524 return SendClientMessage(playerid, -1, ""ORAN"ACCOUNT: "W"You are already registered and logged in! ");
5525
5526 new zStr[100];
5527 if(AccountExist(Name(playerid)))
5528 {
5529 format(zStr, sizeof (zStr), ""GREY"Hello "GREE"%s"GREY", you already have an account!\n\nPlease login into your account:", Name(playerid));
5530 SPD(playerid, Dialog:Login3, INPUT, ""W"Welcome back", zStr, "Login", "Exit");
5531 }
5532 else
5533 {
5534 format(zStr, sizeof (zStr), ""GREY"Hello "ORAN"%s"GREY"\n\nPlease write your desired password:", Name(playerid));
5535 ShowPlayerDialog(playerid, Dialog:Register1, DIALOG_STYLE_INPUT, ""W"Register an account", zStr, "Register", "Exit");
5536
5537 }
5538 return 1;
5539}
5540CMD:login(PARAMS)
5541{
5542 if(P_DATA[playerid][Logged])
5543 return SendClientMessage(playerid, -1, ""ORAN"ACCOUNT: "W"You are already registered and logged in! ");
5544
5545 new zStr[100];
5546 if(AccountExist(Name(playerid)))
5547 {
5548 format(zStr, sizeof (zStr), ""GREY"Hello "GREE"%s"GREY"!\n\nPlease login into your account:", Name(playerid));
5549 SPD(playerid, Dialog:Login3, INPUT, ""W"Welcome back", zStr, "Login", "Exit");
5550 }
5551 else
5552 {
5553 format(zStr, sizeof (zStr), ""GREY"Hello "ORAN"%s"GREY", you don't have an account!\n\nPlease write your desired password:", Name(playerid));
5554 ShowPlayerDialog(playerid, Dialog:Register1, DIALOG_STYLE_INPUT, ""W"Register an account", zStr, "Register", "Exit");
5555 }
5556 return 1;
5557}
5558CMD:t(p){FormatMSG(p, -1, "%d", P_DATA[p][Logged]);return 1;}
5559CMD:acp(PARAMS)
5560{
5561 LoginCheck(playerid);
5562 LevelCheck(playerid, 5);
5563
5564 SPD(playerid, Dialog:cPanel, LIST, ""ORAN"Server Control Panel", cPanel(), "Enable", "Disable");
5565 return 1;
5566}
5567CMD:clearchat(PARAMS)
5568{
5569 LoginCheck(playerid);
5570 LevelCheck(playerid, 3);
5571
5572 new Yes[3];
5573 if(sscanf(params, "s[3]", Yes)) return SendUsage(playerid, "/clearchat "GREY"[yes]", "Will clear the chat");
5574 else
5575 {
5576 if(!strcmp(Yes, "yes"))
5577 {
5578 for(new m = 0; m < 10; m ++) { SendClientMessage(m, -1, " "); }
5579 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" cleared the chat", Name(playerid), playerid);
5580 SendClientMessage(playerid, Color:GREY, "You cleared the chat.");
5581 }
5582 else SendUsage(playerid, "/clearchat "GREY"[yes]", "Will clear the chat");
5583 }
5584 return 1;
5585}
5586CMD:chat(PARAMS)
5587{
5588 LoginCheck(playerid);
5589 LevelCheck(playerid, 4);
5590
5591 if(!strlen(params))
5592 return SendUsage(playerid, "/chat "GREY"[block/unblock/spam/clear]");
5593
5594 if(!strcmp(params, "unblock"))
5595 {
5596 if(!S_DATA[Chat]) return SendError(playerid, "Chat already unblocked!");
5597
5598 S_DATA[Chat] = 0;
5599 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unblocked the chat", Name(playerid), playerid);
5600 SendClientMessage(playerid, Color:GREY, "You unblocked the chat.");
5601 }
5602 else if(!strcmp(params, "block"))
5603 {
5604 BlockChat(playerid);
5605 }
5606 else if(!strcmp(params, "clear"))
5607 {
5608 for(new m = 0; m < 20; m ++) { SendClientMessageToAll(-1, "-"); }
5609 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" cleared the chat", Name(playerid), playerid);
5610 SendClientMessage(playerid, Color:GREY, "You cleared the chat.");
5611 }
5612 else if(!strcmp(params, "spam"))
5613 {
5614 new Str[65],
5615 Preload[65] = "zxcvbnmlkjhgfdsaqwertyuioplmkjnhbgfvcdfrtghyasetgrhnhgrftghnhjki";
5616
5617
5618 for(new x = 0; x < 45; x++)
5619 {
5620 new rCo = random(sizeof(SpamColors)),
5621 rMe = random(65);
5622
5623 format(Str, sizeof (Str), "%s%s", Str[rMe], Preload[rMe]);
5624 foreach(Player, i)
5625 {
5626
5627 SendClientMessage(i, SpamColors[rCo], Str[x]);
5628 }
5629 }
5630
5631 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" spammed the chat", Name(playerid), playerid);
5632 SendClientMessage(playerid, Color:GREY, "You spammed the chat.");
5633 }
5634 else return SendUsage(playerid, "/chat "GREY"[block/unblock/spam/clear]");
5635
5636 return 1;
5637}
5638
5639CMD:respawncars(PARAMS)
5640{
5641 LoginCheck(playerid);
5642 LevelCheck(playerid, 5);
5643
5644 new Yes[3];
5645 if(sscanf(params, "s[3]", Yes)) return SendUsage(playerid, "/respawncars "GREY"[yes]", "Will respawn all server's unoccupied vehicles");
5646 else
5647 {
5648 if(!strcmp(Yes, "yes"))
5649 {
5650 for (new v = 0; v < MAX_VEHICLES; v++)
5651 {
5652 if(!VehicleOccupied(v))
5653 {
5654 SetVehicleToRespawn(v);
5655 }
5656 }
5657 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" respawned all server unoccupied vehicles!", Name(playerid), playerid);
5658 SendClientMessage(playerid, Color:GREY, "You respawned all server unoccupied vehicles!");
5659 }else SendUsage(playerid, "/respawncars "GREY"[yes]", "Will rspawn all server's unoccupied vehicles");
5660 }
5661
5662 return 1;
5663}
5664CMD:explode(PARAMS)
5665{
5666 LoginCheck(playerid);
5667 LevelCheck(playerid, 3);
5668
5669 if(sscanf(params, "u", params[0])) return SendUsage(playerid, "/explode "GREY"<id>", "Will create an explosion near specified player's location");
5670 else
5671 {
5672 CheckImune(playerid, params[0]);
5673 if(params[0] == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
5674 if(params[0] == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot unfreeze yourself!");
5675
5676 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" exploded player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
5677 FormatMSG(playerid, Color:GREY, "You exploded "ORAN"%s[%i]", Name(params[0]), params[0]);
5678 SendClientMessage(params[0], Color:GREY, "You have been exploded!");
5679
5680 new Float: _P[3];
5681 GetPlayerPos(params[0],_P[0], _P[1], _P[2]);CreateExplosion(_P[0], _P[1], _P[2], 7, 10.0);
5682 }
5683 return 1;
5684}
5685
5686CMD:slap(PARAMS)
5687{
5688 LoginCheck(playerid);
5689 LevelCheck(playerid, 3);
5690
5691 if(sscanf(params, "u", params[0], params[1])) return SendUsage(playerid, "/slap "GREY"<id>", "Will slap the specified player, throwing him 10 ft. up and loose -30 health");
5692 else
5693 {
5694 CheckImune(playerid, params[0]);
5695 if(params[0] == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
5696 if(params[0] == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot slap yourself!");
5697
5698 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" slapped player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
5699 FormatMSG(playerid, Color:GREY, "You slapped "ORAN"%s[%i]", Name(params[0]), params[0]);
5700 SendClientMessage(params[0], Color:GREY, "You have been slapped!");
5701
5702 new Float:Pos[3], Float: Health;
5703 GetPlayerPos(params[0], Pos[0], Pos[1], Pos[2]);
5704 SetPlayerPos(params[0], Pos[0], Pos[1], Pos[2] + 3.5);
5705 GetPlayerHealth(params[0], Health);
5706 SetPlayerHealth(params[0], Health - 30);
5707 }
5708 return 1;
5709}
5710CMD:unfreeze(PARAMS)
5711{
5712 LoginCheck(playerid);
5713 LevelCheck(playerid, 2);
5714
5715 if(sscanf(params, "u", params[0], params[1])) return SendUsage(playerid, "/unfreeze "GREY"<id>", "Will un-freeze the player that has been frozen");
5716 else
5717 {
5718 CheckImune(playerid, params[0]);
5719 if(params[0] == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
5720 if(params[0] == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot unfreeze yourself!");
5721 if(!P_DATA[params[0]][Frozen]) return SendClientMessage(playerid, -1, ""GREY"Player is not frozen!");
5722
5723 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unfreezed player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
5724 FormatMSG(playerid, Color:GREY, "You unfreezed "ORAN"%s[%i]", Name(params[0]), params[0]);
5725 SendClientMessage(params[0], Color:GREY, "You have been unfreezed!");
5726
5727 P_DATA[params[0]][Frozen] = 0;
5728 UnFreeze(params[0]);
5729
5730 #if SAVE_FREEZE == true
5731
5732 new
5733 Query[256];
5734 format(Query, 256, "DELETE FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
5735 DB::Query(_DB, Query);
5736
5737 #endif
5738 }
5739 return 1;
5740}
5741CMD:freeze(PARAMS)
5742{
5743 LoginCheck(playerid);
5744 LevelCheck(playerid, 2);
5745
5746 if(sscanf(params, "u", params[0])) return SendUsage(playerid, "/freeze "GREY"<id>", "Will freeze a specified player, he will cannot freeze-evade!");
5747 else
5748 {
5749 CheckImune(playerid, params[0]);
5750 if(params[0] == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
5751 if(params[0] == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot freeze yourself!");
5752 if(P_DATA[params[0]][Frozen]) return SendClientMessage(playerid, -1, ""GREY"Player is already frozen!");
5753
5754 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" freezed player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
5755 FormatMSG(playerid, Color:GREY, "You freezed "ORAN"%s[%i]", Name(params[0]), params[0]);
5756 SendClientMessage(params[0], Color:GREY, "You have been freezed!");
5757
5758 P_DATA[params[0]][Frozen] = 1;
5759 Freeze(params[0]);
5760
5761 #if SAVE_FREEZE == true
5762
5763 new
5764 Query[256],
5765 DBResult:R1;
5766 format(Query, sizeof(Query), "SELECT `Key` FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(params [0]));
5767 R1 = DB::Query(_DB, Query);
5768
5769 if(R1)
5770 {
5771 if(DB::Valid(R1))
5772 {
5773 DB::Free(R1);
5774 format(Query, sizeof(Query), "INSERT INTO `Frozen` VALUES(NULL, '%s',1, '%s')",Name(params [0]), GetPlayerIPEx(params [0]));
5775 DB::Query(_DB, Query);
5776 }
5777 else
5778 {
5779 DB::Free(R1);
5780 format(Query, sizeof(Query), "UPDATE `Frozen` SET `Frozen` = '1', `RealName` = '%s' WHERE `IP` = '%s'", Name(params [0]), GetPlayerIPEx(params [0]));
5781 DB::Query(_DB, Query);
5782 }
5783 }
5784
5785 #endif
5786 }
5787 return 1;
5788}
5789CMD:unjail(PARAMS)
5790{
5791 LoginCheck(playerid);
5792 LevelCheck(playerid, 3);
5793
5794 new Player;
5795 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/unjail "GREY"<id>", "Will unjail the specified player");
5796 else
5797 {
5798 CheckImune(playerid, Player);
5799 if(Player == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
5800 if(Player == playerid && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, ""GREY"You cannot unjail yourself!");
5801 if(!P_DATA[Player][Jailed]) return SendClientMessage(playerid, -1, ""GREY"Player is not jailed!");
5802
5803 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unjailed player "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
5804 FormatMSG(playerid, Color:GREY, "You unjailed "ORAN"%s[%i]", Name(Player), Player);
5805 SendClientMessage(Player, Color:GREY, "You have been unjailed!");
5806
5807 P_DATA[Player][Jailed] = 0;
5808 P_DATA[Player][JailTime] = 0;
5809
5810 SetPlayerInterior(playerid, 0);
5811 SetPlayerPos(playerid, 0.0, 0.0, 0.0);
5812 SpawnPlayer(playerid);
5813 PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
5814
5815 #if SAVE_JAIL == true
5816
5817 new Query[256], DBResult:Result;
5818 format(Query, 256, "SELECT `Key` FROM `Jailed` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
5819 Result = DB::Query(_DB, Query);
5820
5821 if(Result)
5822 {
5823 if(DB::Valid(Result))
5824 {
5825 DB::Free(Result);
5826 format(Query, 256, "DELETE FROM `Jailed` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
5827 DB::Query(_DB, Query);
5828 }
5829 else
5830 {
5831 DB::Free(Result);
5832 }
5833 }
5834
5835 #endif
5836 }
5837 return 1;
5838}
5839CMD:jail(PARAMS)
5840{
5841 LoginCheck(playerid);
5842 LevelCheck(playerid, 3);
5843
5844 new Player, Time, Reason[40];
5845 if(sscanf(params, "uD(0)S(No Reason)[40]", Player, Time, Reason)) return SendUsage(playerid, "/jail "GREY"<id> <time> [reason] "W"NOTICE: "GREY"Time must be in minutes! (If time was not set, jailed forever)", "Will jail the specified player with the specified amount of time");
5846 else
5847 {
5848 CheckImune(playerid, Player);
5849 if(Player == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
5850 if(Player == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot jail yourself!");
5851 if(P_DATA[Player][Jailed]) return SendClientMessage(playerid, -1, ""GREY"Player is already jailed!");
5852
5853 if(Time == 0)
5854 {
5855 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" jailed player "ORAN"%s[%i] "GREY"[Reason: "W"%s"GREY"]", Name(playerid), playerid, Name(Player), Player, Reason);
5856 FormatMSG(playerid, Color:GREY, "You jailed "ORAN"%s[%i] "GREY"[Reason: "W"%s"GREY"][Time: "W"Forever]", Name(Player), Player, Reason, Time);
5857 SendClientMessage(Player, Color:GREY, "You have been jailed "W"["GREY"Time:"W" Forever[");
5858 }
5859 if(Time > 0)
5860 {
5861 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" jailed player "ORAN"%s[%i] "GREY"[Reason: "W"%s"GREY"][Time: "W"%d"GREY" Minutes]", Name(playerid), playerid, Name(Player), Player, Reason, Time);
5862 FormatMSG(playerid, Color:GREY, "You jailed "ORAN"%s[%i] "GREY"[Reason: "W"%s"GREY"][Time: "W"%d"GREY" Minutes]", Name(Player), Player, Reason, Time);
5863 FormatMSG(Player, Color:GREY, "You have been jailed "W"["GREY"Time:"W" %d "GREY"Minutes "W"]", Time);
5864 }
5865 P_DATA[Player][Jailed] = 1;
5866 P_DATA[Player][JailTime] = Time;
5867
5868 SetTimerEx("JailPlayer", 1500, false, "i", Player);
5869
5870 #if SAVE_JAIL == true
5871
5872 new Query[256],DBResult:R1;
5873 format(Query, sizeof(Query), "SELECT `Key` FROM `Jailed` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
5874 R1 = DB::Query(_DB, Query);
5875
5876 if(R1)
5877 {
5878 if(DB::Valid(R1))
5879 {
5880 DB::Free(R1);
5881 format(Query, sizeof(Query), "INSERT INTO `Jailed` (`IP`,`Jailed`,`Time`,`RealName`) VALUES('%s','1','%d','%s')",Name(Player), Time, GetPlayerIPEx(Player));
5882 DB::Query(_DB, Query);
5883 }
5884 else
5885 {
5886 DB::Free(R1);
5887 format(Query, sizeof(Query), "UPDATE `Jailed` SET `Jailed` = '1', `Time` = '%d', `RealName` = '%s' WHERE `IP` = '%s'", Time, GetPlayerIPEx(Player), Name(Player));
5888 DB::Query(_DB, Query);
5889 }
5890 }
5891
5892 #endif
5893 }
5894 return 1;
5895}
5896CMD:settemplevel(PARAMS)
5897{
5898 LoginCheck(playerid);
5899 LevelCheck(playerid, 5);
5900
5901 new Player, TempLevel;
5902 if(sscanf(params, "ui", Player, TempLevel)) return SendUsage(playerid, "/settemplevel "GREY"<id> <level>", "Will set player's temporary level, but on exist he will loose the level");
5903 else
5904 {
5905 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5906 if(Player == playerid ) return SendError(playerid, "Player entered is you!");
5907 if(Player < 0 || TempLevel > 5) return SendError(playerid, "Invalid level! Maximum level is "ORAN"5");
5908
5909 P_DATA[Player][tLevel] = 1;
5910 P_DATA[Player][Level] = TempLevel;
5911
5912 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"%s[%i]"GREY"'s temporary level to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, TempLevel);
5913 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s temporary level to "ORAN"%d", Name(Player), Player, TempLevel);
5914 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your temporary level to "ORAN"%d", Name(playerid), playerid, TempLevel);
5915 SendClientMessage(playerid, Color:ORAN, "Level will expire on exit!");
5916 }
5917 return 1;
5918}
5919CMD:setvip(PARAMS)
5920{
5921 LoginCheck(playerid);
5922 LevelCheck(playerid, 5);
5923
5924 if(sscanf(params, "ui", params[0], params[1])) return SendUsage(playerid, "/setvip "GREY"<id> <level>", "Will set a player to the specified VIP level");
5925 else
5926 {
5927 if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
5928 if(!P_DATA[params[0]][Logged]) return SendError(playerid, "Player must be logged in to change his level!");
5929 if(P_DATA[params[0]][Vip] == params[1]) return SendError(playerid, "Player is already that level!");
5930 if(params[1] < 0 || params[1] > 3) return SendError(playerid, "Invalid level! Maximum VIP level is "ORAN"3");
5931
5932 if(params[0] == playerid)
5933 {
5934 #if SAVE_IN_LOGS == true
5935 SaveInLog(SETVIP_LOG, "Admin %s set his VIP level %d on %s", Name(playerid), params[1], zDate());
5936 #endif
5937 SendAdminCMD(-1, "Admin "ORAN"%s[%i]"GREY" set himself a VIP member level "ORAN"%d", Name(playerid), playerid, params[1]);
5938 FormatMSG(playerid, Color:GREY, "You set yourself a VIP member level "ORAN"%d", params[1]);
5939 }
5940 else
5941 {
5942 #if SAVE_IN_LOGS == true
5943 SaveInLog(SETVIP_LOG, "Admin %s changed %s's VIP level from %d to %d on %s", Name(playerid), Name(params[0]), P_DATA[params[0]][Vip], params[1], zDate());
5944 #endif
5945 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"%s[%i]"GREY"'s VIP level to "ORAN"%d", Name(playerid), playerid, Name(params[0]), params[0], params[1]);
5946 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s VIP level to "ORAN"%d", Name(params[0]), params[0], params[1]);
5947 FormatMSG(params[0], Color:GREY,"Admin "ORAN"%s[%i]"GREY" set your VIP level to "ORAN"%d", Name(playerid), playerid, params[1]);
5948 }
5949 SetPVarInt(params[0], "0_Vip", params[1]);
5950 P_DATA[params[0]][Vip] = params[1];
5951
5952 if(AccountExist(Name(params[0])))
5953 {
5954 new Query[100];
5955 format(Query, 120, "UPDATE `Accounts` SET `VIP` = '%d' WHERE `Name` = '%s'", params[1], Name(params[0]));
5956 DB::Query(_DB, Query);
5957 }
5958 }
5959 return 1;
5960}
5961CMD:ranks(PARAMS)
5962{
5963 #if USE_RANKS == false
5964
5965 return SendError(playerid, "Using ranks is disabled from script!");
5966
5967 #else
5968
5969 LoginCheck(playerid);
5970
5971 new
5972 RankString[2_0_0_0];
5973 RankString = ""BLUE"# "GREY"The current server ranks:\n\n";
5974 for (new r = 0; r < sizeof(_Ranks); r++)
5975 {
5976 format(RankString, sizeof (RankString), "%s"GREY"Rank: "BLUE"%d"GREY" | Kills: "BLUE"%d"GREY" | Name: "BLUE"%s\n",RankString, r, _Ranks[r][iRank], _Ranks[r][irName]);
5977 }
5978 ShowPlayerDialog(playerid, Dialog:Empty, BOX, ""BLUE"Server Ranks", RankString, "Close", "");
5979 return 1;
5980
5981 #endif
5982}
5983CMD:setrank(PARAMS)
5984{
5985 #if USE_RANKS == false
5986
5987 return SendError(playerid, "Using ranks is disabled from script!");
5988
5989 #else
5990
5991 LoginCheck(playerid);
5992 LevelCheck(playerid, 4);
5993
5994 if(sscanf(params, "ud", params[0], params[1])) return SendUsage(playerid, "/setrank "GREY"<id> <rank>", "Will change a player's rank position!("ORAN"Check /RANKS "GREY")");
5995 else
5996 {
5997 if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
5998 if(!P_DATA[params[0]][Logged]) return SendError(playerid, "Player must be logged in to change his rank!");
5999 if(P_DATA[params[0]][Rank] == params[1]) return SendError(playerid, "Player is already that rank!");
6000 if(params[1] < 0 || params[1] > sizeof(_Ranks) - 1)
6001 {
6002 FormatMSG(playerid, Color:ORAN, "* "GREY"Invalid level! Maximum rank is "ORAN"%d "W"-"ORAN"%s", sizeof(_Ranks) - 1, _Ranks[sizeof(_Ranks) - 1][irName]);
6003 return 1;
6004 }
6005 if(params[0] == playerid)
6006 {
6007 #if SAVE_IN_LOGS == true
6008 SaveInLog(SETRANK_LOG, "Admin %s promoved set his rank to %d on %s", Name(playerid), params[1], zDate());
6009 #endif
6010 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his rank to "ORAN"%d "GREY"|"ORAN" %s", Name(playerid), playerid, params[1], RankName(params[1]));
6011 FormatMSG(playerid, Color:GREY, "You set your rank to "ORAN"%d "GREY"|"ORAN" %s", params[1], RankName(params[1]));
6012
6013 SetPVarInt(playerid, "0_Rank", params[1]) ;
6014 P_DATA[playerid][Rank] = params[1];
6015 }
6016 else
6017 {
6018 if(P_DATA[params[0]][Rank] < params[1])
6019 {
6020 #if SAVE_IN_LOGS == true
6021 SaveInLog(SETRANK_LOG, "Admin %s promoved %s from Rank %d to %d on %s", Name(playerid), Name(params[0]), P_DATA[params[0]][Rank], params[1], zDate());
6022 #endif
6023 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" promoved "ORAN"%s[%i]"GREY" with a new rank: "ORAN"%d | %s", Name(playerid), playerid, Name(params[0]), params[0], params[1], RankName(params [1]));
6024 GameTextForPlayer(params[0], "~n~~n~~n~~n~~n~~n~~n~~g~Ranked up!!", 6000, 1);
6025 FormatMSG(params[0], Color:GREY,"Admin "ORAN"%s[%i]"GREY" set your rank to "ORAN"%d | %s", Name(playerid), playerid, params[1], RankName(params [1]));
6026 FormatMSG(playerid, Color:GREY,"You set "ORAN"%s[%i]"GREY"'s rank to "ORAN"%d | %s", Name(params[0]), params[0], params[1], RankName(params [1]));
6027 }
6028 else
6029 {
6030 #if SAVE_IN_LOGS == true
6031 SaveInLog(SETRANK_LOG, "Admin %s demoted %s from Rank %d to %d on %s", Name(playerid), Name(params[0]), P_DATA[params[0]][Rank], params[1], zDate());
6032 #endif
6033 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" demoted "ORAN"%s[%i]"GREY"'s rank to "ORAN"%d | %s", Name(playerid), playerid, Name(params[0]), params[0], params[1], RankName(params [1]));
6034 GameTextForPlayer(params[0], "~n~~n~~n~~n~~n~~n~~n~~r~Ranked down!!", 6000, 1);
6035 FormatMSG(params[0], Color:GREY,"Admin "ORAN"%s[%i]"GREY" set your rank to "ORAN"%d | %s", Name(playerid), playerid, params[1], RankName(params [1]));
6036 FormatMSG(playerid, Color:GREY,"You set "ORAN"%s[%i]"GREY"'s rank to "ORAN"%d | %s", Name(params[0]), params[0], params[1], RankName(params [1]));
6037 }
6038 P_DATA[params[0]][Rank] = params[1];
6039 SetPVarInt(params[0], "0_Rank", params[1]);
6040 }
6041 new Query[120];
6042 if(AccountExist(Name(params[0])))
6043 {
6044 format(Query, 120, "UPDATE `Accounts` SET `Rank` = '%d' WHERE `Name` = '%s'", params[1], Name(params[0]));
6045 DB::Query(_DB, Query);
6046 }
6047
6048 #if UPDATE_TOP_ALWAYS == true
6049 new
6050 DBResult: R1;
6051
6052 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(params[0]));
6053 R1 = DB::Query(_DB, Query);
6054
6055 if(R1)
6056 {
6057 if(DB::Valid(R1))
6058 {
6059 DB::Free(R1);
6060 format(Query, sizeof(Query), "UPDATE `Top` SET `Rank` = '%d' WHERE `Name` = '%s'", params[1], Name(params[0]));
6061 DB::Query(_DB, Query);
6062 }
6063 else
6064 {
6065 DB::Free(R1);
6066 format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Rank`) VALUES('%s','%d')",Name(params[0]), params[1]);
6067 DB::Query(_DB, Query);
6068 }
6069 }
6070 #endif
6071 }
6072 return 1;
6073
6074 #endif
6075}
6076CMD:setlevel(PARAMS)
6077{
6078 LoginCheck(playerid);
6079 LevelCheck(playerid, 5);
6080
6081 if(sscanf(params, "ud", params[0], params[1])) return SendUsage(playerid, "/setlevel "GREY"<id> <level>", "Will change a player's level position!");
6082 else
6083 {
6084 if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
6085 if(!P_DATA[params[0]][Logged]) return SendError(playerid, "Player must be logged in to change his level!");
6086 if(P_DATA[params[0]][Level] == params[1]) return SendError(playerid, "Player is already that level!");
6087 if(params[1] < 0 || params[1] > 5) return SendError(playerid, "Invalid level! Maximum level is "ORAN"5");
6088
6089 if(params[0] == playerid)
6090 {
6091 #if SAVE_IN_LOGS == true
6092 SaveInLog(SETLEVEL_LOG, "Admin %s set his level to %d | %s on %s", Name(playerid), params[1], LevelName(params[1]), zDate());
6093 #endif
6094 SetPVarInt(playerid, "0_Level", params[1]) ;
6095 P_DATA[playerid][Level] = params[1];
6096 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set himself as "ORAN"%s"GREY" of the server!", Name(playerid), playerid, LevelName(params[1]));
6097 FormatMSG(playerid, Color:GREY, "You set yourself as "ORAN"%s"GREY" of the server!", LevelName(params[1]));
6098 }
6099 else
6100 {
6101 if(P_DATA[params[0]][Level] < params[1])
6102 {
6103 #if SAVE_IN_LOGS == true
6104 SaveInLog(SETLEVEL_LOG, "Admin %s promoved %s from %d to %d on %s", Name(playerid), Name(params[0]), P_DATA[params[0]][Level], params[1], zDate());
6105 #endif
6106 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" promoved "ORAN"%s[%i]"GREY" as "ORAN"%s", Name(playerid), playerid, Name(params[0]), params[0], LevelName(params[1]));
6107 GameTextForPlayer(params[0], "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~Promoved!", 6000, 1);
6108 FormatMSG(params[0], Color:GREY,"Admin "ORAN"%s[%i]"GREY" promoved you as "ORAN"%s"GREY" of the server", Name(playerid), playerid, LevelName(params[1]));
6109 FormatMSG(playerid, Color:GREY,"You promoved "ORAN"%s[%i]"GREY" as "ORAN"%s"GREY" of the server", Name(params[0]), params[0], LevelName(params[1]));
6110 }
6111 else
6112 {
6113 #if SAVE_IN_LOGS == true
6114 SaveInLog(SETLEVEL_LOG, "Admin %s demoted %s from %d to %d on %s", Name(playerid), Name(params[0]), P_DATA[params[0]][Level], params[1], zDate());
6115 #endif
6116 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" demoted "ORAN"%s[%i]"GREY" to "ORAN"%s", Name(playerid), playerid, Name(params[0]), params[0], LevelName(params[1]));
6117 GameTextForPlayer(params[0], "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~Demoted!", 6000, 1);
6118 FormatMSG(params[0], Color:GREY,"Admin "ORAN"%s[%i]"GREY" demoted to a "ORAN"%s"GREY" of the server", Name(playerid), playerid, LevelName(params[1]));
6119 FormatMSG(playerid, Color:GREY,"You demoted "ORAN"%s[%i]"GREY" as "ORAN"%s"GREY" of the server", Name(params[0]), params[0], LevelName(params[1]));
6120
6121 }
6122 SetPVarInt(params[0], "0_Level", params[1]) ;
6123 P_DATA[params[0]][Level] = params[1];
6124
6125 }
6126
6127 new Query[120];
6128 if(AccountExist(Name(params[0])))
6129 {
6130 format(Query, 120, "UPDATE `Accounts` SET `Level` = '%d' WHERE `Name` = '%s'", params[1], Name(params[0]));
6131 DB::Query(_DB, Query);
6132 }
6133 }
6134 return 1;
6135}
6136
6137CMD:unmute(PARAMS)
6138{
6139 LoginCheck(playerid);
6140 LevelCheck(playerid, 2);
6141
6142 if(sscanf(params, "u", params[0])) return SendUsage(playerid, "/unmute "GREY"<id>", "Will unmute the specified player");
6143 else
6144 {
6145 CheckImune(playerid, params[0]);
6146 if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
6147 if(params[0] == playerid ) return SendError(playerid, "You cannot unmute yourself!");
6148 if(!P_DATA[params[0]][Muted]) return SendError(playerid, "Player is not muted!");
6149
6150 P_DATA[params[0]][Muted] = 0;
6151 P_DATA[params[0]][MutedTime] = 0;
6152
6153 KillTimer(MuteTimer[params[0]]);
6154 #if SAVE_MUTE == true
6155
6156 new
6157 Query[256];
6158 format(Query, 256, "DELETE FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
6159 DB::Query(_DB, Query);
6160
6161
6162 #endif
6163
6164 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unmuted player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
6165 FormatMSG(playerid, Color:GREY, "You unmuted "ORAN"%s[%i]", Name(params[0]), params[0]);
6166 SendClientMessage(params[0], Color:GREY, "You have been unmuted!");
6167 }
6168 return 1;
6169}
6170CMD:spawnall(PARAMS)
6171{
6172 LoginCheck(playerid);
6173 LevelCheck(playerid, 4);
6174
6175 foreach(Player, i)
6176 {
6177 if(P_DATA[i][Level] != 5)
6178 {
6179 if(i != playerid)
6180 {
6181 SpawnPlayer(i);
6182 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" spawned you and everyone!", Name(playerid), playerid);
6183 }
6184 }
6185 }
6186 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" spawned everyone!", Name(playerid), playerid);
6187 SendClientMessage(playerid, Color:GREY, "You spawned everyone in the server!");
6188 return 1;
6189}
6190CMD:killall(PARAMS)
6191{
6192 LoginCheck(playerid);
6193 LevelCheck(playerid, 4);
6194
6195 foreach(Player, i)
6196 {
6197 if(P_DATA[i][Level] != 5)
6198 {
6199 if(i != playerid)
6200 {
6201 SetPlayerHealth(i, 0.0);
6202 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" killed you and everyone!", Name(playerid), playerid);
6203 }
6204 }
6205 }
6206 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" killed everyone!", Name(playerid), playerid);
6207 SendClientMessage(playerid, Color:GREY, "You killed everyone in the server!");
6208 return 1;
6209}
6210CMD:unfreezeall(PARAMS)
6211{
6212 LoginCheck(playerid);
6213 LevelCheck(playerid, 4);
6214
6215 foreach(Player, i)
6216 {
6217 if(P_DATA[i][Level] != 5)
6218 {
6219 if(i != playerid)
6220 {
6221 P_DATA[i][Frozen] = 0;
6222 UnFreeze(i);
6223 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" defrosted you and everyone!", Name(playerid), playerid);
6224 }
6225 }
6226 }
6227 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" defrosted everyone!", Name(playerid), playerid);
6228 SendClientMessage(playerid, Color:GREY, "You defrosted everyone in the server!");
6229 return 1;
6230}
6231CMD:freezeall(PARAMS)
6232{
6233 LoginCheck(playerid);
6234 LevelCheck(playerid, 4);
6235
6236 foreach(Player, i)
6237 {
6238 if(P_DATA[i][Level] != 5)
6239 {
6240 if(i != playerid)
6241 {
6242 P_DATA[i][Frozen] = 1;
6243 Freeze(i);
6244 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" froze you and everyone!", Name(playerid), playerid);
6245 }
6246 }
6247 }
6248 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" froze everyone!", Name(playerid), playerid);
6249 SendClientMessage(playerid, Color:GREY, "You froze everyone in the server! However, if the re-connect, they will be able to move again.");
6250 return 1;
6251}
6252CMD:banall(PARAMS)
6253{
6254 LoginCheck(playerid);
6255 LevelCheck(playerid, 5);
6256
6257 new
6258 File:zFile,
6259 zStr[100];
6260
6261
6262 zFile = fopen(BAN_LOG, io_append);
6263 format(zStr, sizeof (zStr), "\r\n\r\n\r\n][MASSIVE BAN ON %s[]\r\n", zDate ());
6264
6265 fwrite(zFile, zStr);
6266
6267 foreach(Player, i)
6268 {
6269 if(P_DATA[i][Level] < 3 || !P_DATA[i][Vip])
6270 {
6271 if(i != playerid)
6272 {
6273 #if SAVE_IN_LOGS == true
6274
6275 if(zFile)
6276 {
6277
6278 format(zStr, sizeof (zStr), "Player: %s[%i] has been banned by \"%s\" with reason \"Massive ban!\" on %s\r\n",
6279 Name(i),
6280 i,
6281 Name(playerid),
6282 zDate());
6283 fwrite(zFile, zStr);
6284
6285 }
6286
6287 #endif
6288 }
6289 }
6290 }
6291 fwrite(zFile, "][!! END OF MASSIVE BAN !![]");
6292 fclose(zFile);
6293 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" banned everyone from the server except VIP members and level 3 admins!", Name(playerid), playerid);
6294 SendClientMessage(playerid, Color:GREY, "You banned everyone from the server!");
6295 return 1;
6296}
6297CMD:kickall(PARAMS)
6298{
6299 LoginCheck(playerid);
6300 LevelCheck(playerid, 5);
6301
6302
6303 new
6304 File:zFile,
6305 zStr[100];
6306
6307
6308 zFile = fopen(KICK_LOG, io_append);
6309 format(zStr, sizeof (zStr), "\r\n\r\n\r\n][MASSIVE KICK ON %s[]\r\n", zDate ());
6310
6311 fwrite(zFile, zStr);
6312
6313 foreach(Player, i)
6314 {
6315 if(P_DATA[i][Level] < 3 || !P_DATA[i][Vip])
6316 {
6317 if(i != playerid)
6318 {
6319 KickEx(i, Name(i), "Massive kick!", false);
6320 }
6321 }
6322 }
6323 fwrite(zFile, "][!! END OF MASSIVE KICK !![]");
6324 fclose(zFile);
6325 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" kicked everyone from the server except VIP members and level 3 admins!", Name(playerid), playerid);
6326 SendClientMessage(playerid, Color:GREY, "You kicked everyone from the server!");
6327 return 1;
6328}
6329CMD:slapall(PARAMS)
6330{
6331 LoginCheck(playerid);
6332 LevelCheck(playerid, 4);
6333
6334 new
6335 Float:Pos[3],
6336 Float:Health
6337 ;
6338
6339 foreach(Player, i)
6340 {
6341 if(P_DATA[i][Level] != 5)
6342 {
6343 if(i != playerid)
6344 {
6345
6346 GetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
6347 SetPlayerPos(i, Pos[0], Pos[1], Pos[2] + 3.5);
6348 GetPlayerHealth(i, Health);
6349 SetPlayerHealth(i, Health - 30);
6350 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" unmuted you and everyone!", Name(playerid), playerid);
6351 }
6352 }
6353 }
6354 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" slapped everyone!", Name(playerid), playerid);
6355 SendClientMessage(playerid, Color:GREY, "You slapped everyone in the server!");
6356 return 1;
6357}
6358
6359CMD:unmuteall(PARAMS)
6360{
6361 LoginCheck(playerid);
6362 LevelCheck(playerid, 4);
6363
6364 foreach(Player, i)
6365 {
6366 if(P_DATA[i][Level] != 5)
6367 {
6368 if(i != playerid)
6369 {
6370 P_DATA[i][MutedAll] = 0;
6371 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" unmuted you and everyone!", Name(playerid), playerid);
6372 }
6373 }
6374 }
6375 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unmuted everyone!", Name(playerid), playerid);
6376 SendClientMessage(playerid, Color:GREY, "You unmuted everyone in the server!");
6377 return 1;
6378}
6379CMD:muteall(PARAMS)
6380{
6381 LoginCheck(playerid);
6382 LevelCheck(playerid, 3);
6383
6384 foreach(Player, i)
6385 {
6386 if(P_DATA[i][Level] != 5)
6387 {
6388 if(i != playerid)
6389 {
6390 P_DATA[i][MutedAll] = 1;
6391 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" muted you and everyone!", Name(playerid), playerid);
6392 }
6393 }
6394 }
6395 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" muted everyone!", Name(playerid), playerid);
6396 SendClientMessage(playerid, Color:GREY, "You muted everyone in the server! However, if the re-connect, they will be able to speak.");
6397 return 1;
6398}
6399CMD:mute(PARAMS)
6400{
6401 LoginCheck(playerid);
6402 LevelCheck(playerid, 2);
6403
6404 if(sscanf(params, "uD(0)", params[0], params[1])) return SendUsage(playerid, "/mute "GREY"<id> <time> "W"NOTICE: "GREY"Time must be in minutes! (If time was not set, muted forever)", "Will mute the player with time, player cannt mute-evade this");
6405 else
6406 {
6407 CheckImune(playerid, params[0]);
6408 if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
6409 if(params[0] == playerid) return SendError(playerid, "You cannot mute yourself!");
6410 if(P_DATA[params[0]][Muted]) return SendError(playerid, "Player is already muted!");
6411
6412 if(!params[1])
6413 {
6414
6415 P_DATA[params[0]][Muted] = 1;
6416 P_DATA[params[0]][MutedTime] = 0;
6417
6418
6419 #if SAVE_MUTE == true
6420 new
6421 pQue[256];
6422
6423 format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
6424 new DBResult:R1 = DB::Query(_DB, pQue);
6425
6426 if(R1)
6427 {
6428 if(!DB::Valid(R1))
6429 {
6430 DB::Free(R1);
6431 format(pQue, sizeof (pQue), "INSERT INTO `Muted` VALUES (NULL, '%s', '1', '0', '%s')", GetPlayerIPEx(params[0]), Name(params[0]));
6432 DB::Query(_DB, pQue);
6433 }
6434 else
6435 {
6436 DB::Free(R1);
6437 format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '0', `RealName` = '%s' WHERE `IP` = '%s'", Name(params[0]), GetPlayerIPEx(params[0]));
6438 DB::Query(_DB, pQue);
6439 }
6440 }
6441
6442 #endif
6443
6444 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" muted player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0], params[1]);
6445 FormatMSG(playerid, Color:GREY, "You muted "ORAN"%s[%i]", Name(params[0]), params[0]);
6446 SendClientMessage(params[0], Color:GREY, "You have been muted!");
6447 }
6448 else
6449 {
6450 P_DATA[params[0]][Muted] = 1;
6451
6452 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" muted player "ORAN"%s[%i] "GREY"["ORAN"Time: "W"%d"GREY" minutes[", Name(playerid), playerid, Name(params[0]), params[0], params[1]);
6453 FormatMSG(playerid, Color:GREY, "You muted "ORAN"%s[%i] "GREY"["ORAN"Time: "W"%d"GREY" minutes[", Name(params[0]), params[0], params[1]);
6454 FormatMSG(params[0], Color:GREY, "You have been muted! "W"["GREE"Time: "W"%d"GREY" minutes"W"[", params[1]);
6455
6456 #if SAVE_MUTE == true
6457
6458 new
6459 pQue[256];
6460
6461 format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
6462 new DBResult:R1 = DB::Query(_DB, pQue);
6463
6464 if(R1)
6465 {
6466 if(!DB::Valid(R1))
6467 {
6468 DB::Free(R1);
6469 format(pQue, sizeof (pQue), "INSERT INTO `Muted` VALUES (NULL, '%s', '1', '%d', '%s')", GetPlayerIPEx(params[0]), params[1], Name(params[0]));
6470 DB::Query(_DB, pQue);
6471 }
6472 else
6473 {
6474 DB::Free(R1);
6475 format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '%d', `RealName` = '%s' WHERE `IP` = '%s'", params[1], Name(params[0]), GetPlayerIPEx(params[0]));
6476 DB::Query(_DB, pQue);
6477 }
6478 }
6479
6480 #endif
6481
6482 KillTimer(MuteTimer[params[0]]);
6483 MuteTimer[params[0]] = SetTimerEx("UnMutePlayer", 60_000, true, "i", params[0]);
6484 P_DATA[params[0]][MutedTime] = params[1];
6485 }
6486 }
6487 return 1;
6488}
6489
6490CMD:kick(PARAMS)
6491{
6492 LoginCheck(playerid);
6493 LevelCheck(playerid, 4);
6494
6495 if(sscanf(params, "uS(No Reason)[40]", params[0], params[1])) return SendUsage(playerid, "/kick "GREY"<id> [reason]", "Will kick the specified player, a log of this kick will be created");
6496 else
6497 {
6498 if(playerid == params[0]) return SendError(playerid, "You can't kick yourself!");
6499 if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
6500
6501 CheckImune(playerid, params[0]);
6502
6503 KickEx(params[0], Name(playerid), params[1], true);
6504 }
6505 return 1;
6506}
6507CMD:unban(PARAMS)
6508{
6509 LoginCheck(playerid);
6510 LevelCheck(playerid, 5);
6511
6512 new Account[50];
6513 if(sscanf(params, "s[50]", Account)) return SendUsage(playerid, "/unban [name]","Will unban a banned account");
6514 else
6515 {
6516 new DBResult:Result, Query[129];
6517 format(Query, 129, "SELECT `IP` FROM `Banlist` WHERE `Name` = '%s'", Account);
6518 Result = DB::Query(_DB, Query);
6519
6520 if(Result)
6521 {
6522 if(DB::Valid(Result))
6523 {
6524 new fIP[30];
6525 DB::GetField(Result, "IP", fIP, 30);
6526
6527 if(strlen(fIP) > 0)
6528 {
6529 new Str[50];
6530 format(Str, sizeof (Str), "unbanip %s", fIP);
6531 SendRconCommand(Str), SendRconCommand("reloadbans");
6532 }
6533 DB::Free(Result);
6534 format(Query, 129, "DELETE FROM `Banlist` WHERE `Name` = '%s'", Account);
6535 DB::Query(_DB, Query);
6536
6537 FormatMSG(playerid, Color:GREY, "Account "ORAN"%s"GREY" has been removed from the Banlist!", Account);
6538 }
6539 else
6540 {
6541 DB::Free(Result);
6542 SendError(playerid, "Account not found in the Banlist!");
6543 return 1;
6544 }
6545 }
6546
6547 }
6548 return 1;
6549}
6550
6551CMD:ban(PARAMS)
6552{
6553 LoginCheck(playerid);
6554 LevelCheck(playerid, 5);
6555
6556 new Player, IpBan, Reason[40];
6557 if(sscanf(params, "udS(No Reason)[40]", Player, IpBan, Reason) || IpBan > 1 || IpBan < 0) return SendUsage(playerid, "/ban "GREY"<id> <ipban 1/0> [reason] "GREY"(1 - It will IP Ban the player | 0 - Only account ban!)", "Will ban the specified player, a log of this ban will be created");
6558 else
6559 {
6560 if(playerid == Player) return SendError(playerid, "You can't ban yourself!");
6561 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
6562 CheckImune(playerid, Player);
6563
6564 if(IpBan)
6565 {
6566 #if SAVE_IN_LOGS == true
6567 new
6568 zStr[256],
6569 File:zFile;
6570
6571 format(zStr, sizeof (zStr), "Player: %s[%i] has been IP banned by \"%s\" with reason \"%s\" on %s\r\n",
6572 Name(playerid),
6573 playerid,
6574 Name(playerid),
6575 Reason,
6576 zDate());
6577
6578
6579 zFile = fopen(BAN_LOG, io_append);
6580 if(zFile)
6581 {
6582 fwrite(zFile, zStr);
6583 fclose(zFile);
6584 }
6585 #endif
6586
6587 FormatMSG(playerid, Color:ORAN, "SERVER:"W" You have been banned from this server! "W"["GREY" %s"W"]", Reason);
6588 BanEx(Player, Reason);
6589 }
6590 else
6591 {
6592 BanEx2(Player, Name(playerid), Reason);
6593 FormatMSG(playerid, Color:ORAN, "SERVER:"W" You have been banned from this server! "W"["GREY" %s"W"]", Reason);
6594 }
6595 SendAdminCMD(playerid, ""W"Player "ORAN"%s[%i]"W" has been %s by "ORAN"%s[%i] "W"with reason"ORAN" \"%s\"",Name(Player),Player,(IpBan) ? ("IP banned") : ("account banned"),Name(playerid),playerid,Reason);
6596
6597 }
6598 return 1;
6599}
6600stock AntiIP(const string[])
6601{
6602 static
6603 RegEx:IP;
6604 if(!IP)IP = regex_build("(.*?)([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})(.*?)");
6605
6606 return regex_match_exid(string, IP);
6607}
6608stock AntiSite(const string[])
6609{
6610 static
6611 RegEx:Site;
6612 if(!Site)Site = regex_build("([\\w-]*://)?([\\w-]+\\.)+([\\w-]+)(/[^\\s]*)*");
6613
6614 return regex_match_exid(string, Site);
6615}
6616public OnPlayerText(playerid, text[])
6617{
6618 if(!P_DATA[playerid][Muted] || !P_DATA[playerid][MutedAll])
6619 {P_DATA[playerid][Msgs]++;}
6620
6621 //If player is NOT the RCON admin and NEITHER the OWNER
6622 if(!IsPlayerAdmin(playerid) && P_DATA[playerid][Level] != 5)
6623 {
6624
6625 //Then, take action!
6626 if((P_DATA[playerid][Muted] || P_DATA[playerid][MutedAll]))
6627 {
6628 if(!P_DATA[playerid][MutedTime])
6629 SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You are not allowed to chat! You have been muted!");
6630 else
6631 FormatMSG(playerid, Color:ORAN, "SERVER:"W" You are still muted! "ORAN"["GREY"Aprox: "W"%d minutes"ORAN"]",P_DATA[playerid][MutedTime]);
6632
6633 return 0;
6634 }
6635
6636
6637 if(S_DATA[AntiRepeat])
6638 {
6639 if(!isnull(P_DATA[playerid][RepMSG]))
6640 {
6641 if(!strcmp(text, P_DATA[playerid][RepMSG], false))
6642 {
6643 SendClientMessage(playerid, Color:ORAN, "SERVER:"W" Please don't repeat yourself!");
6644 SendAdminCMD(playerid, "Player %s[%i] repeated himself!", Name(playerid), playerid);
6645 return 0;
6646 }
6647 }
6648 format(P_DATA[playerid][RepMSG], 129, text);
6649 }
6650 if(S_DATA[Chat])
6651 {
6652 return GameTextForPlayer(playerid, "~n~~n~~n~~n~~r~Chat has been disabled!~w~You cannot send any messages!", 5000, 3);
6653 }
6654
6655 P_DATA[playerid][SpamMSG] ++;
6656 if(!P_DATA[playerid][Muted] && S_DATA[AntiSpam])
6657 {
6658 if(P_DATA[playerid][SpamMSG] > MAXIMUM_SPAM && !IsPlayerAdmin(playerid))
6659 return BanEx2(playerid, .zReason = "Extreme Spam!"),false;
6660
6661 else if(P_DATA[playerid][SpamMSG] > MEDIUM_SPAM)
6662 return KickEx(playerid, .zReason = "Massive Spam"),false;
6663
6664 else if(P_DATA[playerid][SpamMSG] > MINIMUM_SPAM)
6665 {
6666 P_DATA[playerid][Muted] = 1;
6667 P_DATA[playerid][MutedTime] = 1;
6668 SendClientMessage(playerid, Color:ORAN, "SERVER: "W"You have been muted "ORAN"1"W" minutes for spamming the chat!");
6669
6670 MuteTimer[playerid] = SetTimerEx("UnMutePlayer", 60_000, true, "i", playerid);
6671
6672 #if SAVE_MUTE == true
6673
6674 new pQue[256];
6675
6676 format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(playerid));
6677 new DBResult:R1 = DB::Query(_DB, pQue);
6678
6679 if(R1)
6680 {
6681 if(!DB::Valid(R1))
6682 {
6683 DB::Free(R1);
6684 format(pQue, sizeof (pQue), "INSERT INTO `Muted` (`IP`, `Muted`, `Time`, `RealName`) VALUES ('%s', '1', '1', '%s')", GetPlayerIPEx(playerid), Name(playerid));
6685 DB::Query(_DB, pQue);
6686 }
6687 else
6688 {
6689 DB::Free(R1);
6690 format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '2', `RealName` = '%s' WHERE `IP` = '%s'", Name(playerid), GetPlayerIPEx(playerid));
6691 DB::Query(_DB, pQue);
6692 }
6693 }
6694 #endif
6695 return 0;
6696 }
6697 }
6698 }
6699 if(S_DATA[AntiAD])
6700 {
6701 if(!P_DATA[playerid][Muted] || !P_DATA[playerid][MutedAll])
6702 {
6703 if(P_DATA[playerid][Vip] > 0)
6704 {
6705 if(text[0] == VIP_CHAT_SYMBOL || text[0] == VIP_CHAT_SYMBOL2)
6706 {
6707 if(!S_DATA[VipChat] && P_DATA[playerid][Level] < 4)
6708 return SendError(playerid, "Only the Owner and the Administrator of the server can use the VIP Chat.");
6709
6710 #if SAVE_IN_LOGS == true
6711 new
6712 Date[6];
6713 getdate(Date[0], Date[1], Date[2]);
6714 gettime(Date[3], Date[4], Date[5]);
6715 SaveInLog(VIPCHAT_LOG, "[%d:%d:%d | %d/%d/%d] %s: %s", Date[3], Date[4], Date[5], Date[2], Date[1], Date[0], Name(playerid), text[1]);
6716 #endif
6717
6718
6719 new
6720 iStr[160];
6721 format(iStr, sizeof (iStr), "#### "GREY"%s:"W" %s", Name(playerid), text[1]);
6722
6723 foreach(Player, i){
6724 if(P_DATA[i][Vip] > 0){
6725 SendClientMessage(i, Color:BLUE, iStr);
6726 }
6727 }
6728 return 0;
6729 }
6730 }
6731 if(P_DATA[playerid][Level] > 0)
6732 {
6733 if(text[0] == ADMIN_CHAT_SYMBOL || text[0] == ADMIN_CHAT_SYMBOL2)
6734 {
6735 if(!S_DATA[AdminChat] && P_DATA[playerid][Level] < 4)
6736 return SendError(playerid, "Only the Owner and the Administrator of the server can use the Admin Chat.");
6737
6738 #if SAVE_IN_LOGS == true
6739 new
6740 Date[6];
6741 getdate(Date[0], Date[1], Date[2]);
6742 gettime(Date[3], Date[4], Date[5]);
6743 SaveInLog(ADMINCHAT_LOG, "[%d:%d:%d | %d/%d/%d] %s: %s", Date[3], Date[4], Date[5], Date[2], Date[1], Date[0], Name(playerid), text[1]);
6744 #endif
6745
6746
6747 new
6748 iStr[160];
6749 format(iStr, sizeof (iStr), "#### "GREY"%s:"W" %s", Name(playerid), text[1]);
6750
6751 foreach(Player, i){
6752 if(P_DATA[i][Level] > 0){
6753 SendClientMessage(i, 0xFF0000FF, iStr);
6754 }
6755 }
6756 return 0;
6757 }
6758 }
6759 if(text[0] != ADMIN_CHAT_SYMBOL || text[0] != ADMIN_CHAT_SYMBOL2)
6760 {
6761 if(AntiIP(text) || AntiSite(text))
6762 {
6763 P_DATA[playerid][Warns]++;
6764
6765 SendPlayerMessageToPlayer(playerid, playerid, text);
6766 FormatMSG(playerid, Color:ORAN, "*** "GREY"You have been warned for advertising! ("ORAN"%d"GREY"/"ORAN""#MAX_P_WARNS""GREY")", P_DATA[playerid][Warns]);
6767
6768 if(P_DATA[playerid][Warns] >= MAX_P_WARNS)
6769 {
6770 SendClientMessage(playerid, Color:ORAN, "*** "GREY"You have been kicked from the server for advertising!");
6771
6772 foreach(Player, x)
6773 {
6774 if(x != playerid)
6775 {
6776 FormatMSG(x, Color:ORAN, "*** "GREY"%s has kicked from the server for advertising.", Name(playerid));
6777 }
6778 }
6779 P_DATA[playerid][Warns] = 0;
6780 KickEx(playerid, .zReason = "Advertising in the chat");
6781 }
6782 return 0;
6783 }
6784 SendPlayerMessageToAll(playerid, text);
6785 }
6786 }
6787
6788 }else SendPlayerMessageToAll(playerid, text);
6789
6790 return 0;
6791}
6792
6793public OnVehicleDeath(vehicleid)
6794{
6795 foreach(Player, InV)
6796 {
6797 if(vehicleid == P_DATA[InV][aCar])
6798 {
6799 SendError(InV, "Your admin car has been dstroyed!");
6800 P_DATA[InV][aCar] = -1;
6801 UpdatePlayer3DTextLabelText(InV, ZaAdminCar[InV], 0xFF0000FF, "Destroyed!\n{000000}--------------\n"W"You can spawn another one!");
6802 SetTimerEx("dLabel", 4000, false, "i", InV);
6803 }
6804 }
6805 return 1;
6806}
6807public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
6808{
6809 if(strlen(GPVSEx(playerid, "Type")))
6810 {
6811 if(PRESSED(KEY_FIRE) && !strcmp(GPVSEx(playerid, "Type"), "Unlimited", false))
6812 {
6813 if(!IsPlayerInVehicle(playerid, P_DATA[playerid][aCar])) return 0;
6814
6815 AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
6816 P_DATA[playerid][NosTimer] = SetTimerEx("UnlimitedNos",17 * 1000, true, "i", playerid);
6817
6818 }
6819 else if(RELEASED(KEY_FIRE) && !strcmp(GPVSEx(playerid, "Type"), "Unlimited", false))
6820 {
6821 KillTimer(P_DATA[playerid][NosTimer]),
6822 RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1010);
6823 }
6824
6825 if(PRESSED(KEY_FIRE) && strcmp(GPVSEx(playerid, "Type"), "Unlimited", false))
6826 {
6827 if(!IsPlayerInVehicle(playerid, P_DATA[playerid][aCar])) return 0;
6828
6829 AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
6830 GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~10~g~~h~x~b~~h~ nitro added!", 1500, 3);
6831 }
6832 }
6833 if(P_DATA[playerid][Vip] > 0)
6834 {
6835 if(newkeys & KEY_ACTION && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
6836 {
6837 new Float:V[3];
6838 GetVehicleVelocity(GetPlayerVehicleID(playerid), V[0], V[1], V[2]);
6839 if(floatabs(V[0]) < 3 && floatabs(V[1]) < 3 && floatabs(V[2]) < 3)
6840 {
6841 SetVehicleVelocity(GetPlayerVehicleID (playerid), V[0] * P_DATA[playerid][bSpeed], V[1] * P_DATA[playerid][bSpeed], V[2] * P_DATA[playerid][bSpeed] );
6842 }
6843 }
6844
6845 if(PRESSED(KEY_LOOK_BEHIND) && P_DATA[playerid][Spin] == 1 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
6846 {
6847 new Float:P[3];
6848 GetVehiclePos(GetPlayerVehicleID(playerid), P[0], P[1], P[2] );
6849 SetVehiclePos(GetPlayerVehicleID(playerid), P[0], P[1], P[2] +1 );
6850 SetVehicleAngularVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, 3.0);
6851 GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~WOOSH!", 600, 3);
6852 }
6853 }
6854 return 1;
6855}
6856CMD:bspeed(PARAMS)
6857{
6858 if(P_DATA[playerid][Vip] > 0)
6859 {
6860 if(!P_DATA[playerid][Boost])
6861 return SendError(playerid, "Speed Boost must be activated first! Activate it from "BLUE"/PCP");
6862
6863 new Speed;
6864 if(sscanf(params, "d", Speed))
6865 {
6866 SendUsage(playerid, "/bspeed "GREY"<speed> "W"(Speed is betwen 0-30)", "Wil change speed boost!");
6867 return 1;
6868 }
6869 else
6870 {
6871 switch(P_DATA[playerid][Vip])
6872 {
6873 case (1):
6874 {
6875 if(Speed < 0 || Speed > 10)
6876 return SendError(playerid, "Level 1 VIP Members are allowed only up to "BLUE"10"W".");
6877 }
6878 case (2):
6879 {
6880 if(Speed < 0 || Speed > 20)
6881 return SendError(playerid, "Level 2 VIP Members are allowed only up to "BLUE"20"W".");
6882 }
6883 case (3):
6884 {
6885 if(Speed < 0 || Speed > 30)
6886 return SendError(playerid, "Level 3 VIP Members are allowed only up to "BLUE"30"W".");
6887 }
6888 }
6889 new Float:Speed2 = Speed;
6890 P_DATA[playerid][bSpeed] = (Speed) ? (Speed2 / 2.367) : (0.0) ;
6891 P_DATA[playerid][Boost] = 1;
6892
6893 if(Speed)FormatMSG(playerid, ~1, "Speed Boost set to "BLUE"%d"W" ("BLUE"%.3f"W")", Speed, P_DATA[playerid][bSpeed]);
6894 else
6895 {
6896 P_DATA[playerid][Boost] = 0;
6897 P_DATA[playerid][bSpeed] = 0;
6898 SendClientMessage(playerid, Color:ORAN, "Speed Boost disabled!");
6899 }
6900 }
6901 }
6902 else
6903 {
6904 SendError(playerid, "Only VIP members allowed!");
6905 }
6906 return 1;
6907}
6908
6909FormatList(playerid)
6910{
6911 new Str[1024];
6912 strcat(Str, ""GREY"Name\n\
6913 "GREY"Money\n\
6914 "GREY"Score\n\
6915 "GREY"Cookies\n\
6916 "GREY"Respect\n\
6917 "GREY"Kills\n\
6918 "GREY"Deaths\n\
6919 "GREY"Messages\n\
6920 "GREY"Commands\n\
6921 "GREY"Fail Commands\n\
6922 "GREY"Online Time\n\
6923 "GREY"Admin Level\n\
6924 "GREY"VIP Level\n\
6925 "GREY"Change Password", 1024);
6926
6927 if(playerid != GetPVarInt(playerid, "StatsOf"))
6928 {
6929 strcat(Str, "\n"ORAN"Ban Account\n\
6930 "ORAN"Delete Account", 1024);
6931 }
6932
6933 return Str;
6934}
6935
6936FormatInside(playerid, Player, what[] = "z", extra[] = " ", zelse[] =" ")
6937{
6938 new Str[256];
6939 if(strcmp(what, "z", true))
6940 {
6941 if(Player == playerid){
6942 format(Str, sizeof (Str), ""GREY"Changing "ORAN"your"GREY" %s\n\n"ORAN"%s", what, extra);}
6943 else{
6944 format(Str, sizeof (Str), ""GREY"Changing "ORAN"%s"GREY"'s %s\n\n"ORAN"%s", Name(Player), what, extra);}
6945 }
6946 else
6947 format(Str, sizeof (Str), ""GREY"%s "ORAN"%s"GREY"'s %s\n\n"ORAN"Are you sure you want to %s this account?", zelse, Name(Player), extra, zelse);
6948
6949 return Str;
6950}
6951NameExist(name[])
6952{
6953 foreach(Player, i)
6954 {
6955 if(!strcmp(name, Name(i), false)) return 1;
6956 }
6957 return 0;
6958}
6959public OnPlayerClickPlayer(playerid, clickedplayerid, source)
6960{
6961 if(playerid != clickedplayerid)
6962 {
6963 ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(clickedplayerid), ""BLUE"Send Personal Message\n\
6964 "BLUE"Give Respect\n\
6965 "BLUE"Give Money\n\
6966 "BLUE"See Stats\n\
6967 "ORAN"Report", "Select", "Exit");
6968 SetPVarInt(playerid, "ClickedTO", clickedplayerid);
6969 }else SendError(playerid, "Please select someone else other than you!");
6970}
6971public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
6972{
6973 new Query[500];
6974
6975 if(response)
6976 {
6977 iDialog<PCP>
6978 {
6979 switch(listitem)
6980 {
6981 case 1:
6982 {
6983 if(S_DATA[AutoLogin])
6984 {
6985 P_DATA[playerid][pAuto] = 1;
6986 SPD(playerid, Dialog:PCPBack, BOX, ""W"Auto-Login", ""BLUE"Auto-Login\n\n"W"This feature has been enabled!", "Back", "");
6987 }
6988 else
6989 {
6990 P_DATA[playerid][pAuto] = 0;
6991 SPD(playerid, Dialog:PCPBack, BOX, ""W"Auto-Login", ""BLUE"Auto-Login\n\n"W"This feature is not available!!", "Back", "");
6992 }
6993 }
6994 case 2:
6995 {
6996 P_DATA[playerid][BAPMs] = 1;
6997 SPD(playerid, Dialog:PCPBack, BOX, ""W"Block PM", ""BLUE"Block Personal Messages\n\n"W"This feature has been enabled!", "Back", "");
6998 }
6999 case 3:
7000 {
7001 cmd_stats(playerid,"");
7002 }
7003 case 4: cmd_pcp(playerid, "");
7004 case 5:
7005 {
7006 P_DATA[playerid][God] = 1;
7007 SPD(playerid, Dialog:PCPBack, BOX, ""W"Godlike", ""BLUE"Godlike\n\n"W"This feature has been enabled!\nYou won't loose health anymore.", "Back", "");
7008 }
7009 case 6:
7010 {
7011 P_DATA[playerid][CarGod] = 1;
7012 SPD(playerid, Dialog:PCPBack, BOX, ""W"Vehicle God", ""BLUE"Vehicle God\n\n"W"This feature has been enabled!\nYour vehicle won't be destroyed!", "Back", "");
7013 }
7014 case 7:
7015 {
7016 P_DATA[playerid][Boost] = 1;
7017 SPD(playerid, Dialog:PCPBack, BOX, ""W"Vehicle Boost", ""BLUE"Vehicle Boost\n\n"W"This feature has been enabled!\nPress "BLUE"Ctrl"W" to boost!\nUse "BLUE"/bspeed <value>"W" to change speed boost!", "Back", "");
7018 }
7019 case 8:
7020 {
7021 P_DATA[playerid][VIPTag] = 1;
7022 SPD(playerid, Dialog:PCPBack, BOX, ""W"Wear VIP Tag", ""BLUE"Wear VIP Tag\n\n"W"This feature has been enabled!\nYou have a "BLUE"VIP Member"W" label above head.", "Back", "");
7023
7024 Delete3DTextLabel(P_DATA[playerid][Tag3D]);
7025 P_DATA[playerid][Tag3D] = Create3DTextLabel("VIP Member", Color:BLUE, 0.0, 0.0, 0.0, 90.0, 0, 1);
7026 Attach3DTextLabelToPlayer(P_DATA[playerid][Tag3D], playerid, 0.0, 0.0, 1.2);
7027 }
7028 case 9: cmd_pcp(playerid, "");
7029 case 10:
7030 {
7031 P_DATA[playerid][Spin] = 1;
7032 SPD(playerid, Dialog:PCPBack, BOX, ""W"Vehicle Spin", ""BLUE"Vehicle Spin\n\n"W"This feature has been enabled!\nPress "BLUE"2(Submission Key)"W" to spin!", "Back", "");
7033 }
7034 case 11:
7035 {
7036 for(new i = 0; i < 5; i++)
7037 if(IsPlayerAttachedObjectSlotUsed(playerid, i))
7038 RemovePlayerAttachedObject(playerid, i);
7039
7040 P_DATA[playerid][Incred] = 1;
7041 SetPlayerAttachedObject(playerid, 0, 18693, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
7042 SetPlayerAttachedObject(playerid, 1, 18693, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
7043 SetPlayerAttachedObject(playerid, 2, 18703, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
7044 SetPlayerAttachedObject(playerid, 3, 18703, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
7045 SetPlayerAttachedObject(playerid, 4, 18965, 2, 0.111052, 0.021643, -0.000846, 92.280899, 92.752510, 358.071044, 1.200000, 1.283168, 1.200000 );
7046
7047 SPD(playerid, Dialog:PCPBack, BOX, ""W"Incredible", ""BLUE"Incredible\n\n"W"This feature has been enabled!\nCheck your character!", "Back", "");
7048 }
7049 case 12: cmd_pcp(playerid, "");
7050 case 13:
7051 {
7052 SPD(playerid, Dialog:PCPShout, INPUT, ""W"Shout to the server!", ""W"Insert the text you want to shout:", "Insert", "Back");
7053 }
7054 }
7055 }
7056 }
7057 else
7058 {
7059 iDialog<PCP>
7060 {
7061 switch(listitem)
7062 {
7063 case 1:
7064 {
7065 if(S_DATA[AutoLogin])
7066 {
7067 P_DATA[playerid][pAuto] = 0;
7068 SPD(playerid, Dialog:PCPBack, BOX, ""W"Auto-Login", ""BLUE"Auto-Login\n\n"W"This feature has been disabled!", "Back", "");
7069 }
7070 else
7071 {
7072 P_DATA[playerid][pAuto] = 0;
7073 SPD(playerid, Dialog:PCPBack, BOX, ""W"Auto-Login", ""BLUE"Auto-Login\n\n"W"This feature is not available!!", "Back", "");
7074 }
7075 }
7076 case 2:
7077 {
7078 P_DATA[playerid][BAPMs] = 0;
7079 SPD(playerid, Dialog:PCPBack, BOX, ""W"Block PM", ""BLUE"Block Personal Messages\n\n"W"This feature has been disabled!", "Back", "");
7080 }
7081 case 3:
7082 {
7083 cmd_stats(playerid,"");
7084 }
7085 case 4: cmd_pcp(playerid, "");
7086 case 5:
7087 {
7088 P_DATA[playerid][God] = 0;
7089 SPD(playerid, Dialog:PCPBack, BOX, ""W"Godlike", ""BLUE"Godlike\n\n"W"This feature has been disabled!\nYou will loose health.", "Back", "");
7090 }
7091 case 6:
7092 {
7093 P_DATA[playerid][CarGod] = 0;
7094 SPD(playerid, Dialog:PCPBack, BOX, ""W"Vehicle God", ""BLUE"Vehicle God\n\n"W"This feature has been disabled!\nYour vehicle can be destroyed!", "Back", "");
7095 }
7096 case 7:
7097 {
7098 P_DATA[playerid][Boost] = 0;
7099 SPD(playerid, Dialog:PCPBack, BOX, ""W"Vehicle Boost", ""BLUE"Vehicle Boost\n\n"W"This feature has been disabled!", "Back", "");
7100 }
7101 case 8:
7102 {
7103 P_DATA[playerid][VIPTag] = 0;
7104 SPD(playerid, Dialog:PCPBack, BOX, ""W"Wear VIP Tag", ""BLUE"Wear VIP Tag\n\n"W"This feature has been disabled!\nThe label has been deleted.", "Back", "");
7105
7106 Delete3DTextLabel(P_DATA[playerid][Tag3D]);
7107 }
7108 case 9: cmd_pcp(playerid, "");
7109 case 10:
7110 {
7111 P_DATA[playerid][Spin] = 0;
7112 SPD(playerid, Dialog:PCPBack, BOX, ""W"Vehicle Spin", ""BLUE"Vehicle Spin\n\n"W"This feature has been disabled!", "Back", "");
7113 }
7114 case 11:
7115 {
7116 for(new i = 0; i < 5; i++)
7117 if(IsPlayerAttachedObjectSlotUsed(playerid, i))
7118 RemovePlayerAttachedObject(playerid, i);
7119
7120 P_DATA[playerid][Incred] = 0;
7121
7122 SPD(playerid, Dialog:PCPBack, BOX, ""W"Incredible", ""BLUE"Incredible\n\n"W"This feature has been enabled!\nCheck your character!", "Back", "");
7123 }
7124 case 12: cmd_pcp(playerid, "");
7125 case 13:
7126 {
7127 SPD(playerid, Dialog:PCPShout, INPUT, ""W"Shout to the server!", ""W"Insert the text you want to shout:", "Insert", "Back");
7128 }
7129 }
7130 }
7131 }
7132
7133 iDialog<PCPBack>
7134 {
7135 cmd_pcp(playerid, "");
7136 }
7137 iDialog<PCPShout>
7138 {
7139 if(response)
7140 {
7141 if(strlen(inputtext))
7142 {
7143 SendClientMessageToAll(Color:BLUE, inputtext);
7144 }
7145 else SPD(playerid, Dialog:PCPShout, INPUT, ""W"Shout to the server!", ""W"Insert the text you want to shout:", "Insert", "Back");
7146 }
7147 else cmd_pcp(playerid, "");
7148 }
7149 iDialog<CLICK_REPORT>
7150 {
7151 if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
7152 {
7153 SendError(playerid, "Player is no longer connected to the server!");
7154 DeletePVar(playerid, "ClickedTO");
7155 return 1;
7156 }
7157 if(!response)
7158 return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
7159 "BLUE"Give Respect\n\
7160 "BLUE"Give Money\n\
7161 "BLUE"See Stats\n\
7162 "ORAN"Report", "Select", "Exit");
7163 new
7164 Report[256];
7165
7166 if(sscanf(inputtext, "s[256]", Report) || !strlen(Report))
7167 return SendError(playerid, "Please insert a reason!"),
7168 OnDialogResponse(playerid, Dialog:CLICK, 1, 4, "");
7169 else
7170 {
7171 if(strlen(Report) < 10)
7172 return SendError(playerid, "The reason must be at least "BLUE"10"GREY" characters long!"),
7173 OnDialogResponse(playerid, Dialog:CLICK, 1, 4, "");
7174 new
7175 Player = GetPVarInt(playerid, "ClickedTO"),
7176 Str[256];
7177
7178 format(Str, sizeof(Str), ""W"You reported player:\n"BLUE"%s"W" ID: "BLUE"%d\n\n"ORAN"Reason: "W"%s\n\n\n"GREY"* A log of this report has been created.", Name(Player), Player, Report);
7179 SPD(playerid, Dialog:Empty, BOX, ""W"Player reported!", Str, "Close", "");
7180
7181 foreach(Player, i)
7182 {
7183 if(P_DATA[i][Level] > 2)
7184 {
7185 if(i != playerid)
7186 {
7187 FormatMSG(i, Color:BLUE, "REPORT: "GREY"Player "ORAN"%s[%i]"GREY" reported "ORAN"%s[%i]"GREY"", Name(playerid), playerid, Name(Player), Player);
7188 FormatMSG(i, Color:GREE, "MESSAGE:"GREY" %s", Report);
7189 }
7190 }
7191 }
7192
7193 format(Str, sizeof(Str), "\r\n---------------------------------------------------------\r\n\
7194 Reporter: %s\r\n\
7195 Reported: %s\r\n\
7196 Message: %s\r\n\
7197 Date: %s\r\n\
7198 ---------------------------------------------------------\r\n",
7199 Name(playerid),
7200 Name(Player),
7201 Report,
7202 zDate());
7203 new
7204 File: ReportLog = fopen(REPORT_LOG, io_append);
7205
7206 if(ReportLog)
7207 {
7208 fwrite(ReportLog, Str);
7209 fclose(ReportLog);
7210 }
7211 }
7212 }
7213
7214 iDialog<CLICK_MONEY>
7215 {
7216 if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
7217 {
7218 SendError(playerid, "Player is no longer connected to the server!");
7219 DeletePVar(playerid, "ClickedTO");
7220 return 1;
7221 }
7222 if(!response)
7223 return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
7224 "BLUE"Give Respect\n\
7225 "BLUE"Give Money\n\
7226 "BLUE"See Stats\n\
7227 "ORAN"Report", "Select", "Exit");
7228 new
7229 pMoney;
7230 if(sscanf(inputtext, "i", pMoney) || !pMoney)
7231 return SendError(playerid, "Please insert a correct value!"),
7232 OnDialogResponse(playerid, Dialog:CLICK, 1, 2, "");
7233 else
7234 {
7235 new
7236 Player = GetPVarInt(playerid, "ClickedTO"),
7237 Str[256];
7238
7239 if(GetPlayerMoney(playerid) < pMoney)
7240 return SendError(playerid, "Not enough money to send!"),
7241 OnDialogResponse(playerid, Dialog:CLICK, 1, 2, "");
7242
7243 GivePlayerMoney(Player, pMoney);
7244 GivePlayerMoney(playerid, -pMoney);
7245
7246 format(Str, sizeof(Str), ""W"You gave a "GREE"$%d"W" to:\n"BLUE"%s"W" ID: "BLUE"%d", pMoney, Name(Player), Player);
7247 SPD(playerid, Dialog:Empty, BOX, ""W"Money sent!", Str, "Close", "");
7248 FormatMSG(Player, Color:BLUE, "***"GREY" You received "GREE"$%d"GREY" from player "BLUE"%s[%i]", pMoney, Name(playerid), playerid);
7249 }
7250 }
7251 iDialog<CLICK_RP>
7252 {
7253 if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
7254 {
7255 SendError(playerid, "Player is no longer connected to the server!");
7256 DeletePVar(playerid, "ClickedTO");
7257 return 1;
7258 }
7259 if(!response)
7260 return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
7261 "BLUE"Give Respect\n\
7262 "BLUE"Give Money\n\
7263 "BLUE"See Stats\n\
7264 "ORAN"Report", "Select", "Exit");
7265 new
7266 Player = GetPVarInt(playerid, "ClickedTO"),
7267 Str[256],
7268 Time[5];
7269 switch(listitem)
7270 {
7271 case (0):
7272 {
7273 if(P_DATA[playerid][Vip] != 3)
7274 {
7275 format(Query, 256, "SELECT `Key` FROM `Positive` WHERE `Name` = '%s'", Name(playerid));
7276
7277 new
7278 DBResult:R2 = DB::Query(_DB, Query);
7279
7280 gettime(Time[0], Time[1]);
7281 getdate(.day = Time[2]);
7282
7283 if(R2)
7284 {
7285 if(DB::Valid(R2))
7286 {
7287 new
7288 Field[64],
7289 T2[3];
7290
7291 DB::GetField(R2, "Expiration", Field, sizeof (Field));
7292 DB::Free(R2);
7293 if(!isnull(Field))
7294 {
7295 sscanf(Field, "p<|>iii", Time[2], Time[0], Time[1]);
7296
7297 gettime(T2[0], T2[1]);
7298 getdate(.day = T2[2]);
7299
7300 if(Time[0] == 0) Time[0] = 24;
7301 if(T2[2] == Time[2])
7302 {
7303 if(T2[0] == Time[0])
7304 {
7305 if(T2[1] < Time[1])
7306 {
7307 SendError(playerid, "You are allowed to give only one "GREE"+"GREY" respect per hour!");
7308 FormatMSG(playerid, Color:GREY, "You can repeat the process after "BLUE"%d"GREY":"BLUE"%d "GREY"!", Time[0], Time[1]);
7309 return 1;
7310 }
7311 }
7312 else if(T2[0] < Time[0])
7313 {
7314 SendError(playerid, "You are allowed to give only one "GREE"+"GREY" respect per hour!");
7315 FormatMSG(playerid, Color:GREY, "You can repeat the process after "BLUE"%d"GREY":"BLUE"%d "GREY"!", Time[0], Time[1]);
7316 return 1;
7317 }
7318 }
7319 }
7320
7321 format(Query, sizeof (Query), "UPDATE `Positive` SET `Expiration` = '%d|%d|%d' WHERE `Name` = '%s'", Time[2], (Time[0] == 23) ? (0) : (Time[0] + 1), Time[1], Name(playerid));
7322 DB::Query(_DB, Query);
7323 }
7324 else
7325 {
7326 DB::Free(R2);
7327 format(Query, sizeof (Query), "INSERT INTO `Positive` (`Name`, `Expiration`) VALUES ('%s', '%d|%d|%d')", Name(playerid), Time[2], (Time[0] == 23) ? (0) : (Time[0] + 1), Time[1]);
7328 DB::Query(_DB, Query);
7329 }
7330 }
7331
7332 format(Str, sizeof (Str), ""W"You gave a "GREE"Positive Respect"W" to:\n"BLUE"%s"W" ID: "BLUE"%d\n\n"GREY"You must wait an hour before giving\nany other "GREE"+"GREY" respect to anybody!", Name(Player), Player);
7333 }else format(Str, sizeof (Str), ""W"You gave a "GREE"Positive Respect"W" to:\n"BLUE"%s"W" ID: "BLUE"%d", Name(Player), Player);
7334
7335 P_DATA[Player][Positive] += 1;
7336 SetPVarInt(Player, "0_Positive", P_DATA[Player][Positive]);
7337 FormatMSG(Player, Color:ORAN, "*** "GREY"You received a "GREE"+1"GREY" respect from "BLUE"%s[%i]", Name(playerid), playerid);
7338
7339 SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Respect given", Str, "Close", "");
7340 }
7341 case (1):
7342 {
7343 if(P_DATA[playerid][Vip] != 3)
7344 {
7345 format(Query, 256, "SELECT `Key` FROM `Negative` WHERE `Name` = '%s'", Name(playerid));
7346
7347 new
7348 DBResult:R2 = DB::Query(_DB, Query);
7349
7350 gettime(Time[0], Time[1]);
7351 getdate(.day = Time[2]);
7352
7353 if(R2)
7354 {
7355 if(DB::Valid(R2))
7356 {
7357 new
7358 Field[64],
7359 T2[3];
7360
7361 DB::GetField(R2, "Expiration", Field, sizeof (Field));
7362 DB::Free(R2);
7363 if(!isnull(Field))
7364 {
7365 sscanf(Field, "p<|>iii", Time[2], Time[0], Time[1]);
7366
7367 gettime(T2[0], T2[1]);
7368 getdate(.day = T2[2]);
7369
7370 if(Time[0] == 0) Time[0] = 24;
7371 if(T2[2] == Time[2])
7372 {
7373 if(T2[0] == Time[0])
7374 {
7375 if(T2[1] < Time[1])
7376 {
7377 SendError(playerid, "You are allowed to give only one "ORAN"-"GREY" respect per hour!");
7378 FormatMSG(playerid, Color:GREY, "You can repeat the process after "BLUE"%d"GREY":"BLUE"%d "GREY"!", Time[0], Time[1]);
7379 return 1;
7380 }
7381 }
7382 else if(T2[0] < Time[0])
7383 {
7384 SendError(playerid, "You are allowed to give only one "ORAN"-"GREY" respect per hour!");
7385 FormatMSG(playerid, Color:GREY, "You can repeat the process after "BLUE"%d"GREY":"BLUE"%d "GREY"!", Time[0], Time[1]);
7386 return 1;
7387 }
7388 }
7389 }
7390
7391 format(Query, sizeof (Query), "UPDATE `Negative` SET `Expiration` = '%d|%d|%d' WHERE `Name` = '%s'", Time[2], (Time[0] == 23) ? (0) : (Time[0] + 1), Time[1], Name(playerid));
7392 DB::Query(_DB, Query);
7393 }
7394 else
7395 {
7396 DB::Free(R2);
7397 format(Query, sizeof (Query), "INSERT INTO `Negative` (`Name`, `Expiration`) VALUES ('%s', '%d|%d|%d')", Name(playerid), Time[2], (Time[0] == 23) ? (0) : (Time[0] + 1), Time[1]);
7398 DB::Query(_DB, Query);
7399 }
7400 }
7401 format(Str, sizeof (Str), ""W"You gave a "ORAN"Negative Respect"W" to:\n"BLUE"%s"W" ID: "BLUE"%d\n\n"GREY"You must wait an hour before giving\nany other "ORAN"-"GREY" respect to anybody!", Name(Player), Player);
7402 }else format(Str, sizeof (Str), ""W"You gave a "ORAN"Negative Respect"W" to:\n"BLUE"%s"W" ID: "BLUE"%d", Name(Player), Player);
7403
7404 P_DATA[Player][Negative] += 1;
7405 SetPVarInt(Player, "0_Negative", P_DATA[Player][Negative]);
7406
7407 FormatMSG(Player, Color:ORAN, "*** "GREY"You received a "ORAN"-1"GREY" respect from "BLUE"%s[%i]", Name(playerid), playerid);
7408 SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Respect given", Str, "Close", "");
7409 }
7410 }
7411 }
7412 iDialog<CLICK_PM>
7413 {
7414 if(!response)
7415 return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
7416 "BLUE"Give Respect\n\
7417 "BLUE"Give Money\n\
7418 "BLUE"See Stats\n\
7419 "ORAN"Report", "Select", "Exit");
7420
7421 if(P_DATA[playerid][Muted])
7422 return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
7423 "BLUE"Give Respect\n\
7424 "BLUE"Give Money\n\
7425 "BLUE"See Stats\n\
7426 "ORAN"Report", "Select", "Exit"),
7427 SendError(playerid, "You are still muted! Check with "ORAN"/mutecheck"GREY" to see when it will be lifted!");
7428
7429 if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
7430 {
7431 SendError(playerid, "Player is no longer connected to the server!");
7432 DeletePVar(playerid, "ClickedTO");
7433 return 1;
7434 }
7435 new
7436 Message[140];
7437 if(sscanf(inputtext, "s[140]", Message))
7438 return OnDialogResponse(playerid, Dialog:CLICK, 1, 0, ""),
7439 SendError(playerid, "Please enter a message to send!");
7440 else
7441 {
7442 if(strlen(Message) < 5)
7443 return OnDialogResponse(playerid, Dialog:CLICK, 1, 0, ""),
7444 SendError(playerid, "Message must be at least "BLUE"5"GREY" characters long.");
7445
7446 new
7447 Player = GetPVarInt(playerid, "ClickedTO");
7448
7449 FormatMSG(Player, Color:GREY, "From "BLUE"%s[%i]"W": %s", Name(playerid), playerid, Message);
7450 FormatMSG(playerid, Color:GREY, "PM Sent to "BLUE"%s[%i]"W": %s", Name(Player), Player, Message);
7451
7452 if(S_DATA[ReadPM])
7453 {
7454 SendAdminCMD(playerid, "PM Detected: "BLUE"%s[%i] "GREY"to"BLUE" %s[%i]", Name(playerid), playerid, Name(Player), Player);
7455 SendAdminCMD(playerid, "Message: "BLUE"%s", Message);
7456 }
7457 }
7458 }
7459
7460 iDialog<CLICK>
7461 {
7462 if(!response)
7463 return DeletePVar(playerid, "ClickedTO"),
7464 false;
7465
7466 if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
7467 {
7468 SendError(playerid, "Player is no longer connected to the server!");
7469 DeletePVar(playerid, "ClickedTO");
7470 return 1;
7471 }
7472 switch(listitem)
7473 {
7474 case (0):
7475 {
7476 new
7477 Player = GetPVarInt(playerid, "ClickedTO"),
7478 Str[129];
7479
7480 format(Str, 129, ""W"Send a personal message to:\n"BLUE"%s"W" ID: "BLUE"%d\n\n\n"GREY"Please insert the message:", Name(Player), Player);
7481
7482 SPD(playerid, Dialog:CLICK_PM, INPUT, "{FFFFFF}Send a Personal Message", Str, "Send", "Back");
7483 }
7484 case (1): SPD(playerid, Dialog:CLICK_RP, LIST, "{FFFFFF}Select Rspect type", ""GREE"Positive\n"ORAN"Negative", "Select", "Back");
7485 case (2):
7486 {
7487 new
7488 Player = GetPVarInt(playerid, "ClickedTO"),
7489 Str[129];
7490
7491 format(Str, 129, ""W"Sending money to:\n"BLUE"%s"W" ID: "BLUE"%d\n\n\n"GREY"Please insert the amount of money:", Name(Player), Player);
7492
7493 SPD(playerid, Dialog:CLICK_MONEY, INPUT, "{FFFFFF}Send money", Str, "Send", "Back");
7494 }
7495 case (3):
7496 {
7497 format(WhosStats, sizeof (WhosStats), ""ORAN"%s{FFFFFF}'s stats", Name(GetPVarInt(playerid, "ClickedTO")));
7498 FormatStats(GetPVarInt(playerid, "ClickedTO"));
7499 }
7500 case (4):
7501 {
7502 new
7503 Player = GetPVarInt(playerid, "ClickedTO"),
7504 Str[129];
7505
7506 format(Str, 129, ""W"Reporting player:\n"BLUE"%s"W" ID: "BLUE"%d\n\n\n"GREY"Please insert the reason for this report:", Name(Player), Player);
7507
7508 SPD(playerid, Dialog:CLICK_REPORT, INPUT, "{FFFFFF}Reporting player", Str, "Send", "Back");
7509 }
7510 }
7511 }
7512
7513 iDialog<TOP>
7514 {
7515 return cmd_top(playerid, "");
7516 }
7517 iDialog<TOP_RESPECT>
7518 {
7519
7520 if(!response) cmd_top(playerid, "");
7521 else
7522 {
7523 switch(listitem)
7524 {
7525 case 0: ShowTopStats(playerid, "Positive", "Respected Players");
7526 case 1: ShowTopStats(playerid, "Negative", "Disrespected Players");
7527 }
7528 }
7529 }
7530 iDialog<TOP_SELECT>
7531 {
7532 if(!response) return 1;
7533 else
7534 {
7535 switch(listitem)
7536 {
7537 case 0: ShowTopStats(playerid, "Kills", "Killers");
7538 case 1: ShowTopStats(playerid, "Deaths", "Deaths");
7539 case 2: ShowTopStats(playerid, "Rank", "Ranked");
7540 case 3: SPD(playerid, Dialog:TOP_RESPECT, LIST, "{FFFFFF}Select type", ""W"Positive\n"W"Negative", "Select", "Back");
7541 case 4: ShowTopStats(playerid, "Hours", "Hours");
7542 case 5:
7543 {
7544 new Speed = GetTickCount(),
7545 DialString[3_0_0_0],
7546 String[2][128],
7547 sQuery[2][256],
7548 DBResult:Result1;
7549
7550 format(sQuery[0], 256, "SELECT `Name` FROM `Top` ORDER BY (`Ratio` * 1) DESC limit %d", MAX_TOP_LIMIT);
7551
7552 Result1 = DB::Query(_DB, sQuery[0]);
7553
7554 format(DialString, sizeof (DialString), "{FFFFFF}Server top "ORAN" Kills/Deaths ratio\n\n\n"W"Pos. Player = Ratio");
7555 for (new Qr; Qr < DB::Valid(Result1); Qr++)
7556 {
7557 db_get_field(Result1, 0, String[0], 128);
7558
7559 format(sQuery[1], 256, "SELECT `Ratio` FROM `Top` WHERE `Name` = '%s'", String[0]);
7560
7561 new DBResult:Result2 = DB::Query(_DB, sQuery[1]);
7562 db_get_field(Result2, 0, String[1], 128);
7563
7564 format(DialString, sizeof (DialString), "%s\n"BLUE"%d."GREY" %s "W": %s", DialString, Qr + 1, String[0], String[1]);
7565
7566 db_next_row(Result1);
7567 DB::Free(Result2);
7568 }
7569 DB::Free(Result1);
7570 format(DialString, sizeof (DialString), "%s\n\n"W"Top list generated in "ORAN"%d "W"ms.", DialString, GetTickCount() - Speed);
7571 SPD(playerid, Dialog:TOP, BOX, ""W"TOP PLAYERS", DialString, "Close", "");
7572 }
7573 }
7574 }
7575 }
7576
7577 switch(dialogid)
7578 {
7579 CaseDialog<NAME>
7580 {
7581 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7582
7583 new
7584 NewName[MAX_PLAYER_NAME];
7585 if(sscanf(inputtext, "s["#MAX_PLAYER_NAME"]", NewName))
7586 {
7587 OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, NAME, "");
7588 return 1;
7589 }
7590 else
7591 {
7592 if(strlen(NewName) > MAX_PLAYER_NAME || strlen(NewName) < 5)
7593 return SendError(playerid, "Invalid name length! Max: "ORAN""#MAX_PLAYER_NAME""GREY" Min: "ORAN"5"),
7594 OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, NAME, "");
7595
7596 new
7597 Player = GetPVarInt(playerid, "StatsOf");
7598
7599 if(Player == 0xFFFF)
7600 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
7601
7602 if(NameExist(NewName))
7603 return SendError(playerid, "The name entered is already used by someone else!"),
7604 OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, NAME, "");
7605
7606 if(Player != playerid)
7607 {
7608 FormatMSG(playerid, Color:GREY, "You changed the name of "ORAN"%s"GREY" to "ORAN"%s"GREY"", Name(Player), NewName);
7609 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" changed your name to "ORAN"%s"GREY"", Name(playerid), playerid, NewName);
7610 }
7611 else{FormatMSG(playerid, Color:GREY, "You changed your name to "ORAN"%s"GREY" ", NewName);SendClientMessage(playerid, Color:ORAN, "WARNING: "GREY"Stats saving won't work properly!");}
7612 SetPlayerName(Player, NewName);
7613
7614 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7615 }
7616 }
7617 CaseDialog<MONEY>
7618 {
7619 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7620
7621 if(sscanf(inputtext, "d", inputtext[0]))
7622 {
7623 OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, MONEY, "");
7624 return 1;
7625 }
7626 else
7627 {
7628 new
7629 Player = GetPVarInt(playerid, "StatsOf");
7630
7631 if(Player == 0xFFFF)
7632 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
7633
7634 ResetPlayerMoney(Player), GivePlayerMoney(Player, inputtext[0]);
7635 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7636
7637 if(Player != playerid)
7638 {
7639 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s money to "ORAN"$%d"GREY"", Name(Player), inputtext[0]);
7640 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your money to "ORAN"$%d"GREY"", Name(playerid), playerid, inputtext[0]);
7641 }
7642 else
7643 FormatMSG(playerid, Color:GREY, "You set your money to "ORAN"$%d"GREY" ", inputtext[0]);
7644
7645 }
7646 }
7647 CaseDialog<SCORE>
7648 {
7649 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7650
7651 if(sscanf(inputtext, "d", inputtext[0]))
7652 {
7653 OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, SCORE, "");
7654 return 1;
7655 }
7656 else
7657 {
7658 new
7659 Player = GetPVarInt(playerid, "StatsOf");
7660
7661 if(Player == 0xFFFF)
7662 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
7663
7664 SetPlayerScore(Player, inputtext[0]);
7665 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7666
7667 if(Player != playerid)
7668 {
7669 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s score to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
7670 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your score to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
7671 }
7672 else
7673 FormatMSG(playerid, Color:GREY, "You set your score to "ORAN"%d"GREY" ", inputtext[0]);
7674
7675 }
7676 }
7677 CaseDialog<COOKIES>
7678 {
7679 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7680
7681 if(sscanf(inputtext, "d", inputtext[0]))
7682 {
7683 OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, COOKIES, "");
7684 return 1;
7685 }
7686 else
7687 {
7688 new
7689 Player = GetPVarInt(playerid, "StatsOf");
7690
7691 if(Player == 0xFFFF)
7692 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
7693
7694 SetPVarInt(Player, "0_Cookies", inputtext[0]);
7695 P_DATA[Player][Cookies] = inputtext[0];
7696
7697 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7698
7699 if(Player != playerid)
7700 {
7701 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s cookies to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
7702 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your cookies to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
7703 }
7704 else
7705 FormatMSG(playerid, Color:GREY, "You set your cookies to "ORAN"%d"GREY" ", inputtext[0]);
7706
7707 }
7708 }
7709 CaseDialog<RESPECT>
7710 {
7711 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7712
7713 new
7714 _2DS[2][129],
7715 _Dialog,
7716 Player = GetPVarInt(playerid, "StatsOf");
7717
7718 if(Player == 0xFFFF)
7719 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
7720
7721 switch(listitem)
7722 {
7723 case 0:{ if(Player != playerid)format(_2DS[0], 129, "Changing "ORAN"%s"GREY"'s Positive Respect\nPlease insert your respect value:", Name(Player));
7724 else _2DS[0] = "Changing "ORAN"your"GREY"'s Positive Respect\nPlease insert your respect value:";
7725 _2DS[1] = "{FFFFFF}Changing Positive"; _Dialog = Dialog:RESPECT_POS;}
7726
7727
7728 case 1:{ if(Player != playerid)format(_2DS[0], 129, "Changing "ORAN"%s"GREY"'s Negative Respect\nPlease insert your respect value:", Name(Player));
7729 else _2DS[0] = "Changing "ORAN"your"GREY"'s Positive Respect\nPlease insert your respect value:";
7730 _2DS[1] = "{FFFFFF}Changing Negative" ; _Dialog = Dialog:RESPECT_NEG;}
7731 }
7732 SPD(playerid, _Dialog, INPUT, _2DS[1], _2DS[0], "Set", "Back");
7733 }
7734 CaseDialog<RESPECT_POS>
7735 {
7736 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7737
7738 if(sscanf(inputtext, "d", inputtext[0]))
7739 {
7740 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, 0, "");
7741 return 1;
7742 }
7743 else
7744 {
7745 new
7746 Player = GetPVarInt(playerid, "StatsOf");
7747
7748 if(Player == 0xFFFF)
7749 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
7750
7751 SetPVarInt(Player, "0_Positive", inputtext[0]);
7752 P_DATA[Player][Positive] = inputtext[0];
7753
7754 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7755
7756 if(Player != playerid)
7757 {
7758 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s Positive Respect to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
7759 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your Positive Respect to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
7760 }
7761 else
7762 FormatMSG(playerid, Color:GREY, "You set your Positive Respect to "ORAN"%d"GREY" ", inputtext[0]);
7763
7764 #if UPDATE_TOP_ALWAYS == true
7765 new DBResult: R1;
7766 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
7767 R1 = DB::Query(_DB, Query);
7768
7769 if(R1)
7770 {
7771 if(DB::Valid(R1))
7772 {
7773 DB::Free(R1);
7774 format(Query, sizeof(Query), "UPDATE `Top` SET `Positive` = '%d' WHERE `Name` = '%s'", inputtext[0], Name(Player));
7775 DB::Query(_DB, Query);
7776 }
7777 else
7778 {
7779 DB::Free(R1);
7780 format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Positive`) VALUES('%s','%d')", Name(Player), inputtext[0]);
7781 DB::Query(_DB, Query);
7782 }
7783 }
7784 #endif
7785 }
7786 }
7787 CaseDialog<RESPECT_NEG>
7788 {
7789 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7790
7791 if(sscanf(inputtext, "d", inputtext[0]))
7792 {
7793 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, 1, "");
7794 return 1;
7795 }
7796 else
7797 {
7798 new
7799 Player = GetPVarInt(playerid, "StatsOf");
7800
7801 if(Player == 0xFFFF)
7802 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
7803
7804 SetPVarInt(Player, "0_Negative", inputtext[0]);
7805 P_DATA[Player][Negative] = inputtext[0];
7806
7807 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7808
7809 if(Player != playerid)
7810 {
7811 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s Negative Respect to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
7812 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your Negative Respect to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
7813 }
7814 else
7815 FormatMSG(playerid, Color:GREY, "You set your Negative Respect to "ORAN"%d"GREY" ", inputtext[0]);
7816
7817 #if UPDATE_TOP_ALWAYS == true
7818 new DBResult: R1;
7819
7820 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
7821 R1 = DB::Query(_DB, Query);
7822
7823 if(R1)
7824 {
7825 if(DB::Valid(R1))
7826 {
7827 DB::Free(R1);
7828 format(Query, sizeof(Query), "UPDATE `Top` SET `Negative` = '%d' WHERE `Name` = '%s'", inputtext[0], Name(Player));
7829 DB::Query(_DB, Query);
7830 }
7831 else
7832 {
7833 DB::Free(R1);
7834 format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Negative`) VALUES('%s','%d')", Name(Player),inputtext[0]);
7835 DB::Query(_DB, Query);
7836 }
7837 }
7838 #endif
7839 }
7840 }
7841 CaseDialog<KILLS>
7842 {
7843 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7844
7845 if(sscanf(inputtext, "d", inputtext[0]))
7846 {
7847 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, KILLS, "");
7848 return 1;
7849 }
7850 else
7851 {
7852 new
7853 Player = GetPVarInt(playerid, "StatsOf");
7854
7855 if(Player == 0xFFFF)
7856 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
7857
7858 SetPVarInt(Player, "0_Kills", inputtext[0]);
7859 P_DATA[Player][Kills] = inputtext[0];
7860
7861 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7862
7863 if(Player != playerid)
7864 {
7865 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s kills to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
7866 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your kills to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
7867 }
7868 else
7869 FormatMSG(playerid, Color:GREY, "You set your kills to "ORAN"%d"GREY" ", inputtext[0]);
7870
7871 #if UPDATE_TOP_ALWAYS == true
7872 new DBResult: R1;
7873
7874 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
7875 R1 = DB::Query(_DB, Query);
7876
7877 if(R1)
7878 {
7879 if(DB::Valid(R1))
7880 {
7881 DB::Free(R1);
7882 format(Query, sizeof(Query), "UPDATE `Top` SET `Kills` = '%d', `Ratio` = '%f' WHERE `Name` = '%s'", inputtext[0], (Float:P_DATA[Player][Kills] / Float:P_DATA[Player][Deaths]), Name(Player));
7883 DB::Query(_DB, Query);
7884 }
7885 else
7886 {
7887 DB::Free(R1);
7888 format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `Deaths`,`Ratio`) VALUES('%s','%d','%f')",Name(Player), inputtext[0], (Float:P_DATA[Player][Kills] / Float:P_DATA[Player][Deaths]));
7889 DB::Query(_DB, Query);
7890 }
7891 }
7892 #endif
7893 }
7894 }
7895 CaseDialog<DEATHS>
7896 {
7897 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7898
7899 if(sscanf(inputtext, "d", inputtext[0]))
7900 {
7901 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, DEATHS, "");
7902 return 1;
7903 }
7904 else
7905 {
7906 new
7907 Player = GetPVarInt(playerid, "StatsOf");
7908
7909 if(Player == 0xFFFF)
7910 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
7911
7912 SetPVarInt(Player, "0_Deaths", inputtext[0]);
7913 P_DATA[Player][Deaths] = inputtext[0];
7914
7915 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7916
7917 if(Player != playerid)
7918 {
7919 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s deaths to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
7920 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your deaths to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
7921 }
7922 else
7923 FormatMSG(playerid, Color:GREY, "You set your deaths to "ORAN"%d"GREY" ", inputtext[0]);
7924
7925 #if UPDATE_TOP_ALWAYS == true
7926 new DBResult: R1;
7927
7928 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
7929 R1 = DB::Query(_DB, Query);
7930
7931 if(R1)
7932 {
7933 if(DB::Valid(R1))
7934 {
7935 DB::Free(R1);
7936 format(Query, sizeof(Query), "UPDATE `Top` SET `Deaths` = '%d', `Ratio` = '%f' WHERE `Name` = '%s'", inputtext[0], (Float:P_DATA[Player][Kills] / Float:P_DATA[Player][Deaths]), Name(Player));
7937 DB::Query(_DB, Query);
7938 }
7939 else
7940 {
7941 DB::Free(R1);
7942 format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `Deaths`,`Ratio`) VALUES('%s','%d','%f')",Name(Player), inputtext[0], (Float:P_DATA[playerid][Kills] / Float:P_DATA[playerid][Deaths]));
7943 DB::Query(_DB, Query);
7944 }
7945 }
7946 #endif
7947 }
7948 }
7949 CaseDialog<MESSAGES>
7950 {
7951 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7952
7953 if(sscanf(inputtext, "d", inputtext[0]))
7954 {
7955 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, MESSAGES, "");
7956 return 1;
7957 }
7958 else
7959 {
7960 new
7961 Player = GetPVarInt(playerid, "StatsOf");
7962
7963 if(Player == 0xFFFF)
7964 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
7965
7966 SetPVarInt(Player, "0_Messages", inputtext[0]);
7967 P_DATA[Player][Msgs] = inputtext[0];
7968
7969 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7970
7971 if(Player != playerid)
7972 {
7973 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s sent messages to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
7974 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your sent messages to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
7975 }
7976 else
7977 FormatMSG(playerid, Color:GREY, "You set your sent messages to "ORAN"%d"GREY" ", inputtext[0]);
7978
7979 }
7980 }
7981 CaseDialog<COMMANDS>
7982 {
7983 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7984
7985 if(sscanf(inputtext, "d", inputtext[0]))
7986 {
7987 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, COMMANDS, "");
7988 return 1;
7989 }
7990 else
7991 {
7992 new
7993 Player = GetPVarInt(playerid, "StatsOf");
7994
7995 if(Player == 0xFFFF)
7996 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
7997
7998 SetPVarInt(Player, "0_Commands", inputtext[0]);
7999 P_DATA[Player][Cmds] = inputtext[0];
8000
8001 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8002
8003 if(Player != playerid)
8004 {
8005 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s used commands to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
8006 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your used commands to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
8007 }
8008 else
8009 FormatMSG(playerid, Color:GREY, "You set your used commands to "ORAN"%d"GREY" ", inputtext[0]);
8010
8011 }
8012 }
8013 CaseDialog<FCOMMANDS>
8014 {
8015 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8016
8017 if(sscanf(inputtext, "d", inputtext[0]))
8018 {
8019 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, FCOMMANDS, "");
8020 return 1;
8021 }
8022 else
8023 {
8024 new
8025 Player = GetPVarInt(playerid, "StatsOf");
8026
8027 if(Player == 0xFFFF)
8028 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
8029
8030 SetPVarInt(Player, "0_Fail_Commands", inputtext[0]);
8031 P_DATA[Player][fCmds] = inputtext[0];
8032
8033 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8034
8035 if(Player != playerid)
8036 {
8037 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s fail commands to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
8038 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your fail commands to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
8039 }
8040 else
8041 FormatMSG(playerid, Color:GREY, "You set your fail commands to "ORAN"%d"GREY" ", inputtext[0]);
8042
8043 }
8044 }
8045 CaseDialog<ONLINE>
8046 {
8047 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8048
8049 new
8050 _2DS2[2][129],
8051 _Dialog,
8052 Player = GetPVarInt(playerid, "StatsOf");
8053
8054 if(Player == 0xFFFF)
8055 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
8056
8057 switch(listitem)
8058 {
8059 case 0:{ if(Player != playerid)format(_2DS2[0], 129, ""GREY"Changing "ORAN"%s"GREY"'s Hours\nPlease insert the hour value:", Name(Player));
8060 else _2DS2[0] = ""GREY"Changing "ORAN"your"GREY" Hours\nPlease insert the hour value:";
8061 _2DS2[1] = "{FFFFFF}Changing Hours" ; _Dialog = Dialog:ONLINE_H; }
8062
8063 case 1:{ if(Player != playerid)format(_2DS2[0], 129, ""GREY"Changing "ORAN"%s"GREY"'s Minutes\nPlease insert the hour value:", Name(Player));
8064 else _2DS2[0] = ""GREY"Changing "ORAN"your"GREY" Minutes\nPlease insert the hour value:";
8065 _2DS2[1] = "{FFFFFF}Changing Minutes" ; _Dialog = Dialog:ONLINE_M;}
8066
8067 case 2:{ if(Player != playerid)format(_2DS2[0], 129, ""GREY"Changing "ORAN"%s"GREY"'s Seconds\nPlease insert the hour value:", Name(Player));
8068 else _2DS2[0] = ""GREY"Changing "ORAN"your"GREY" Seconds\nPlease insert the hour value:";
8069 _2DS2[1] = "{FFFFFF}Changing Seconds" ; _Dialog = Dialog:ONLINE_S;}
8070 }
8071 SPD(playerid, _Dialog, INPUT, _2DS2[1], _2DS2[0], "Set", "Back");
8072 }
8073 CaseDialog<ONLINE_H>
8074 {
8075 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
8076
8077 if(sscanf(inputtext, "d", inputtext[0]))
8078 {
8079 OnDialogResponse(playerid, Dialog:ONLINE, true, 0, "");
8080 return 1;
8081 }
8082 else
8083 {
8084 new
8085 Player = GetPVarInt(playerid, "StatsOf");
8086
8087 if(Player == 0xFFFF)
8088 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
8089
8090 P_DATA[Player][Hours] = inputtext[0];
8091 P_DATA[Player][ConnTime] = gettime();
8092
8093 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
8094
8095 if(Player != playerid)
8096 {
8097 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s online hours to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
8098 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your online hours to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
8099 }
8100 else
8101 FormatMSG(playerid, Color:GREY, "You set your online hours to "ORAN"%d"GREY" ", inputtext[0]);
8102
8103 #if UPDATE_TOP_ALWAYS == true
8104 new DBResult: R1;
8105
8106 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
8107 R1 = DB::Query(_DB, Query);
8108
8109 if(R1)
8110 {
8111 if(DB::Valid(R1))
8112 {
8113 DB::Free(R1);
8114 format(Query, sizeof(Query), "UPDATE `Top` SET `Hours` = '%d' WHERE `Name` = '%s'", inputtext[0], Name(Player));
8115 DB::Query(_DB, Query);
8116 }
8117 else
8118 {
8119 DB::Free(R1);
8120 format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `Hours`) VALUES('%s','%d')",Name(Player), inputtext[0]);
8121 DB::Query(_DB, Query);
8122 }
8123 }
8124 #endif
8125
8126 }
8127 }
8128 CaseDialog<ONLINE_M>
8129 {
8130 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
8131
8132 if(sscanf(inputtext, "d", inputtext[0]))
8133 {
8134 OnDialogResponse(playerid, Dialog:ONLINE, true, 1, "");
8135 return 1;
8136 }
8137 else
8138 {
8139 if(inputtext[0] > 60 || inputtext[0] < 0)
8140 return OnDialogResponse(playerid, Dialog:ONLINE, true, 1, ""),
8141 SendError(playerid, "Minutes must be from "ORAN"0"GREY" to "ORAN"60"GREY".");
8142 new
8143 Player = GetPVarInt(playerid, "StatsOf");
8144
8145 if(Player == 0xFFFF)
8146 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
8147
8148 P_DATA[Player][Minutes] = inputtext[0];
8149 P_DATA[Player][ConnTime] = gettime();
8150
8151 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
8152
8153 if(Player != playerid)
8154 {
8155 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s online minutes to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
8156 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your online minutes to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
8157 }
8158 else
8159 FormatMSG(playerid, Color:GREY, "You set your online minutes to "ORAN"%d"GREY" ", inputtext[0]);
8160
8161 }
8162 }
8163 CaseDialog<ONLINE_S>
8164 {
8165 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
8166
8167 if(sscanf(inputtext, "d", inputtext[0]))
8168 {
8169 OnDialogResponse(playerid, Dialog:ONLINE, true, 2, "");
8170 return 1;
8171 }
8172 else
8173 {
8174 if(inputtext[0] > 60 || inputtext[0] < 0)
8175 return OnDialogResponse(playerid, Dialog:ONLINE, true, 2, ""),
8176 SendError(playerid, "Seconds must be from "ORAN"0"GREY" to "ORAN"60"GREY".");
8177 new
8178 Player = GetPVarInt(playerid, "StatsOf");
8179
8180 if(Player == 0xFFFF)
8181 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
8182
8183 P_DATA[Player][Seconds] = inputtext[0];
8184 P_DATA[Player][ConnTime] = gettime();
8185
8186 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
8187
8188 if(Player != playerid)
8189 {
8190 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s online seonds to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
8191 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your online seonds to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
8192 }
8193 else
8194 FormatMSG(playerid, Color:GREY, "You set your online seonds to "ORAN"%d"GREY" ", inputtext[0]);
8195
8196 }
8197 }
8198 CaseDialog<LEVEL>
8199 {
8200 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8201
8202 if(sscanf(inputtext, "d", inputtext[0]))
8203 {
8204 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, LEVEL, "");
8205 return 1;
8206 }
8207 else
8208 {
8209 new
8210 Player = GetPVarInt(playerid, "StatsOf");
8211
8212 if(Player == 0xFFFF)
8213 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
8214
8215 if(inputtext[0] < 0 || inputtext[0] > 5)
8216 return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, LEVEL, ""),
8217 SendError(playerid, "Invalid level! Min. "ORAN"0"GREY" Max. "ORAN"5");
8218
8219 SetPVarInt(Player, "0_Level", inputtext[0]);
8220 P_DATA[Player][Level] = inputtext[0];
8221
8222 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8223
8224 if(Player != playerid)
8225 {
8226 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY" as "ORAN"%s"GREY" of the server!", Name(Player), LevelName(inputtext[0]));
8227 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s"GREY" set you as "ORAN"%s"GREY" of the server!", Name(playerid), playerid, LevelName(inputtext[0]));
8228 }
8229 else
8230 FormatMSG(playerid, Color:GREY, "You set yourself as "ORAN"%s"GREY" of the server!", LevelName(inputtext[0]));
8231
8232 }
8233 }
8234 CaseDialog<VLEVEL>
8235 {
8236 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8237
8238 if(sscanf(inputtext, "d", inputtext[0]))
8239 {
8240 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, VLEVEL, "");
8241 return 1;
8242 }
8243 else
8244 {
8245 new
8246 Player = GetPVarInt(playerid, "StatsOf");
8247
8248 if(Player == 0xFFFF)
8249 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
8250
8251 if(inputtext[0] < 0 || inputtext[0] > 3)
8252 return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, LEVEL, ""),
8253 SendError(playerid, "Invalid level! Min. "ORAN"0"GREY" Max. "ORAN"3");
8254
8255 SetPVarInt(Player, "0_Vip", inputtext[0]);
8256 P_DATA[Player][Vip] = inputtext[0];
8257
8258 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8259
8260 if(Player != playerid)
8261 {
8262 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s VIP Level to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
8263 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your VIP Level to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
8264 }
8265 else
8266 FormatMSG(playerid, Color:GREY, "You set your VIP Level to "ORAN"%d"GREY" ", inputtext[0]);
8267
8268 }
8269 }
8270 CaseDialog<CPASS>
8271 {
8272 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8273
8274 new NewPass[30];
8275 if(sscanf(inputtext, "s[30]", NewPass))
8276 {
8277 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, CPASS, "");
8278 return 1;
8279 }
8280 else
8281 {
8282 new
8283 Player = GetPVarInt(playerid, "StatsOf");
8284
8285 if(Player == 0xFFFF)
8286 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
8287
8288 if(strlen(NewPass) < MIN_PASS_LEN || strlen(NewPass) > MAX_PASS_LEN)
8289 return SendError(playerid, "An error has occured. Invalid Password length!"),
8290 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, CPASS, "");
8291
8292 new Buf[129];
8293
8294 WP_Hash(Buf, (129), NewPass);
8295 format(Query, 280, "UPDATE `Accounts` SET `Password` = '%s' WHERE `Name` = '%s'", Buf, Name(Player));
8296 DB::Query(_DB, Query);
8297
8298
8299 if(Player != playerid)
8300 FormatMSG(playerid, Color:GREY, "You changed "ORAN"%s"GREY"'s password to "ORAN"%s", Name(Player), NewPass);
8301 else
8302 FormatMSG(playerid, Color:GREY, "You changed your password to "ORAN"%s", NewPass);
8303 }
8304 }
8305 CaseDialog<BACCOUNT>
8306 {
8307 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8308
8309 new Reason[129];
8310 if(sscanf(inputtext, "s[129]", Reason))
8311 {
8312 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, BACCOUNT, "");
8313 return 1;
8314 }
8315 else
8316 {
8317 if(strlen(Reason) < 5 || strlen(Reason) > 129)
8318 return SendError(playerid, "The reason must be Min. "ORAN"5"GREY" Max. "ORAN"129"GREY" characters long!"),
8319 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, BACCOUNT, "");
8320
8321 new
8322 Player = GetPVarInt(playerid, "StatsOf");
8323
8324 if(Player == 0xFFFF)
8325 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
8326
8327 format(Query, 129, "INSERT INTO `Banlist` VALUES('%s', '%s', '%s', '%s', '%s')", GetPlayerIPEx(Player), Name(Player), Reason, Name(playerid), zDate());
8328 DB::Query(_DB, Query);
8329
8330 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8331
8332 if(Player != playerid)
8333 {
8334 FormatMSG(playerid, Color:GREY, "You banned "ORAN"%s"GREY"'s account with reason "ORAN"%s", Name(Player), Reason);
8335 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s"GREY" banned your account with reason:", Name(playerid));
8336 FormatMSG(Player, Color:GREY, "REASON: "ORAN"%s",Reason);
8337 }
8338 else
8339 return 0;
8340
8341 KickEx(Player, "System", "Account banned with [/setstats]", false);
8342 }
8343 }
8344 CaseDialog<DACCOUNT>
8345 {
8346 if(!response)
8347 return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8348
8349 new
8350 Player = GetPVarInt(playerid, "StatsOf");
8351
8352 if(Player == 0xFFFF)
8353 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
8354
8355 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8356
8357 if(Player != playerid)
8358 {
8359 FormatMSG(playerid, Color:GREY, "You deleted "ORAN"%s"GREY"'s account.", Name(Player));
8360 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s"GREY" deleted your account", Name(playerid));
8361 SendClientMessage(Player, Color:GREY, "You will be kicked in 2 seconds!");
8362 SendClientMessage(Player, Color:GREY, "Later you can come back without an account.");
8363
8364 format(Query, 120, "DELETE FROM `Accounts` WHERE `Name` = '%s'", Name(Player));
8365 DB::Query(_DB, Query);
8366 }
8367 else
8368 return 0;
8369
8370 KickEx(Player, "System", "Account banned with [/setstats]", false);
8371 }
8372 }
8373
8374 iDialog<SetStatsTrue>
8375 {
8376 if(response)
8377 {
8378 new id = GetPVarInt(playerid, "StatsOf");
8379 switch(listitem)
8380 {
8381 case NAME: \
8382 SPD(playerid, Dialog:NAME, INPUT, "{FFFFFF}Changing Name", \
8383 FormatInside(playerid, id, "Name", "Please insert the new name!"), "Insert", "Back");
8384
8385
8386 case MONEY: \
8387 SPD(playerid, Dialog:MONEY, INPUT, "{FFFFFF}Changing Money", \
8388 FormatInside(playerid, id, "Money", "Please insert the new money value!"),"Insert", "Back");
8389
8390
8391 case SCORE: \
8392 SPD(playerid, Dialog:SCORE, INPUT, "{FFFFFF}Changing Score", \
8393 FormatInside(playerid, id, "Score", "Please insert the new score!"),"Insert", "Back");
8394
8395
8396 case COOKIES: \
8397 SPD(playerid, Dialog:COOKIES, INPUT, "{FFFFFF}Changing Cookies", \
8398 FormatInside(playerid, id, "Cookies", "Please insert the new cookies!"), "Insert", "Back");
8399
8400
8401 case RESPECT: \
8402 SPD(playerid, Dialog:RESPECT, LIST, "{FFFFFF}Changing Respect", \
8403 "Positive\nNegative", "Select", "Back");
8404
8405
8406
8407 case KILLS: \
8408 SPD(playerid, Dialog:KILLS, INPUT, "{FFFFFF}Changing Kills", \
8409 FormatInside(playerid, id, "Kills", "Please insert the new kills!"), "Insert", "Back");
8410
8411
8412 case DEATHS: \
8413 SPD(playerid, Dialog:DEATHS, INPUT, "{FFFFFF}Changing Deaths", \
8414 FormatInside(playerid, id, "Deaths", "Please insert the new deaths!"), "Insert", "Back");
8415
8416
8417 case MESSAGES: \
8418 SPD(playerid, Dialog:MESSAGES, INPUT, "{FFFFFF}Changing Messages Sent", \
8419 FormatInside(playerid, id, "Messages", "Please insert the new messages!"), "Insert", "Back");
8420
8421
8422 case COMMANDS: \
8423 SPD(playerid, Dialog:COMMANDS, INPUT, "{FFFFFF}Changing Commands Used", \
8424 FormatInside(playerid, id, "Used Commands", "Please insert the new used commands value!"), "Insert", "Back");
8425
8426
8427 case FCOMMANDS: \
8428 SPD(playerid, Dialog:FCOMMANDS,INPUT, "{FFFFFF}Changing Fail Commands", \
8429 FormatInside(playerid, id, "Fail Commands", "Please insert the new failed commands value !"), "Insert", "Back");
8430
8431
8432 case ONLINE: \
8433 SPD(playerid, Dialog:ONLINE, LIST, "{FFFFFF}Changing Online Time", \
8434 "Hours\nMinutes\nSeconds", "Select", "Back");
8435
8436
8437 case LEVEL: \
8438 SPD(playerid, Dialog:LEVEL, INPUT, "{FFFFFF}Changing Admin Level", \
8439 FormatInside(playerid, id, "Admin Level", "Please insert the new admin level!"), "Insert", "Back");
8440
8441
8442 case VLEVEL: \
8443 SPD(playerid, Dialog:VLEVEL, INPUT, "{FFFFFF}Changing VIP Level", \
8444 FormatInside(playerid, id, "VIP Level", "Please insert the new VIP level!"), "Insert", "Back");
8445
8446
8447 case CPASS: \
8448 SPD(playerid, Dialog:CPASS, INPUT, "{FFFFFF}Changing Password", \
8449 FormatInside(playerid, id, "Password", "Please insert the new password!"), "Insert", "Back");
8450
8451
8452 case BACCOUNT: \
8453 SPD(playerid, Dialog:BACCOUNT, INPUT, "{FFFFFF}Banning Account", \
8454 FormatInside(playerid, id, .zelse = "Banning", .extra = "Account"), "Yes" , "Back");
8455
8456
8457 case DACCOUNT: \
8458 SPD(playerid, Dialog:DACCOUNT, BOX, "{FFFFFF}Deleting Account", \
8459 FormatInside(playerid, id, .zelse = "Deleting", .extra = "Account"), "Yes" , "Back");
8460 }
8461 }else DeletePVar(playerid, "StatsOf");
8462 }
8463 iDialog<SetStatsSure>
8464 {
8465 if(response)
8466 {
8467 new zStr[30];
8468 format(zStr, 30, "%s", Name(GetPVarInt(playerid, "StatsOf")));
8469 ShowPlayerDialog(playerid, Dialog:SetStatsTrue, LIST, zStr, FormatList(playerid), "Change", "Exit");
8470
8471 }else DeletePVar(playerid, "StatsOf");
8472 }
8473 iDialog<cPanel_Back> cmd_acp(playerid, "");
8474
8475 iDialog<ACCP_LOAD>
8476 {
8477 if(!response)
8478 return cmd_accp(playerid, "");
8479
8480 new Accp_String[16], Accp_Vars[6], DBResult:Result;
8481 format(Query, sizeof(Query), "SELECT `ACCP` FROM `Accounts` WHERE `Name` = '%s'", Name(playerid));
8482 Result = DB::Query(_DB, Query);
8483
8484 if(Result)
8485 {
8486 if(DB::Valid(Result))
8487 {
8488 new Field[50];
8489 DB::GetField(Result, "ACCP", Field, sizeof(Field));
8490 SetPVarString(playerid, "ACCP_DATA", Field);
8491
8492 DB::Free(Result);
8493
8494 if(!sscanf(GPVSEx(playerid, "ACCP_DATA"), "p<:>s[16]iiiiii",Accp_String,
8495 Accp_Vars[0],
8496 Accp_Vars[1],
8497 Accp_Vars[2],
8498 Accp_Vars[3],
8499 Accp_Vars[4],
8500 Accp_Vars[5]))
8501 {
8502 SetPVarString(playerid, "Type", Accp_String);
8503 P_DATA[playerid][A_Component1] = Accp_Vars[0];
8504 P_DATA[playerid][A_Component2] = Accp_Vars[1];
8505 P_DATA[playerid][A_Component3] = Accp_Vars[2];
8506 P_DATA[playerid][A_Component4] = Accp_Vars[3];
8507 P_DATA[playerid][A_Wheels] = Accp_Vars[4];
8508 P_DATA[playerid][A_Color ] = Accp_Vars[5];
8509
8510 }
8511
8512 if(P_DATA[playerid][A_Component1] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component1]);
8513 if(P_DATA[playerid][A_Component2] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component2]);
8514 if(P_DATA[playerid][A_Component3] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component3]);
8515 if(P_DATA[playerid][A_Component4] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component4]);
8516 if(P_DATA[playerid][A_Wheels] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Wheels]);
8517 if(P_DATA[playerid][A_Color] != 0)ChangeVehicleColor(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Color], P_DATA[playerid][A_Color]);
8518
8519 SendClientMessage(playerid, Color:GREY, "The components of your Admin Vehicle have been loaded!");
8520 }
8521 else
8522 {
8523 SendClientMessage(playerid, Color:GREY, "Failed to load the components from the database!");
8524 }
8525 }
8526 }
8527 iDialog<ACCP_DISCARD>
8528 {
8529 if(!response)
8530 return cmd_accp(playerid, "");
8531
8532 if(P_DATA[playerid][A_Component1] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component1]);
8533 if(P_DATA[playerid][A_Component2] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component2]);
8534 if(P_DATA[playerid][A_Component3] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component3]);
8535 if(P_DATA[playerid][A_Component4] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component4]);
8536 if(P_DATA[playerid][A_Wheels] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Wheels]);
8537 if(P_DATA[playerid][A_Color] != 0)ChangeVehicleColor(GetPlayerVehicleID(playerid), 0, 0);
8538
8539 P_DATA[playerid][A_Component1] = 0;
8540 P_DATA[playerid][A_Component2] = 0;
8541 P_DATA[playerid][A_Component3] = 0;
8542 P_DATA[playerid][A_Component4] = 0;
8543 P_DATA[playerid][A_Wheels] = 0;
8544 P_DATA[playerid][A_Color] = 0;
8545
8546 SendClientMessage(playerid, Color:GREY, "The components of your Admin Vehicle have been discarted! You can "BLUE"Save Changes"GREY" from Admin Car cPanel again!");
8547
8548 }
8549 iDialog<ACCP_SAVE>
8550 {
8551 if(!response) return cmd_accp(playerid, "");
8552
8553 CheckComponents(playerid,"No changes have been made to your Admin Car!");
8554
8555 new zQuery[300];
8556 format(zQuery, 300, "UPDATE `Accounts` SET ACCP = '%s:%d:%d:%d:%d:%d:%d', ACCPSav = '1' WHERE `Name` = '%s'",
8557 (strlen(GPVSEx(playerid, "Type")) ? (GPVSEx(playerid, "Type")) : ("None")),
8558 (P_DATA[playerid][A_Component1]) ? (P_DATA[playerid][A_Component1]) : (0),
8559 (P_DATA[playerid][A_Component2]) ? (P_DATA[playerid][A_Component2]) : (0),
8560 (P_DATA[playerid][A_Component3]) ? (P_DATA[playerid][A_Component3]) : (0),
8561 (P_DATA[playerid][A_Component4]) ? (P_DATA[playerid][A_Component4]) : (0),
8562 (P_DATA[playerid][A_Wheels]) ? (P_DATA[playerid][A_Wheels]) : (0) ,
8563 (P_DATA[playerid][A_Color]) ? (P_DATA[playerid][A_Color]) : (0),
8564 Name(playerid));
8565 DB::Query(_DB, zQuery);
8566
8567
8568 P_DATA[playerid][Accp_Saved] = 1;
8569
8570 SendClientMessage(playerid, Color:GREY, "The components of Admin Vehicle have been saved! Later select "BLUE"Load Changes"GREY" from Admin Car cPanel!");
8571
8572 }
8573 iDialog<ACCP_COMPS>
8574 {
8575 if(!response) return OnDialogResponse(playerid, Dialog:ACCP, 1, 2, "");
8576
8577 AddVehicleComponent(GetPlayerVehicleID(playerid), ACCP_Components[listitem][iComponent]);
8578 FormatMSG(playerid, Color:GREY, "You added "ORAN"%s"GREY" on your Admin Car!", ACCP_Components[listitem][icName]);
8579
8580 switch(listitem)
8581 {
8582 case 0,1: P_DATA[playerid][A_Component1] = ACCP_Components[listitem][iComponent];
8583 case 2,3,4: P_DATA[playerid][A_Component2] = ACCP_Components[listitem][iComponent];
8584 case 5: P_DATA[playerid][A_Component3] = ACCP_Components[listitem][iComponent];
8585 case 6: P_DATA[playerid][A_Component4] = ACCP_Components[listitem][iComponent];
8586 }
8587
8588 return cmd_accp(playerid,"");
8589 }
8590
8591 iDialog<ACCP_WHEELS>
8592 {
8593 if(!response) return OnDialogResponse(playerid, Dialog:ACCP, 1, 2, "");
8594
8595 AddVehicleComponent(GetPlayerVehicleID(playerid), Wheels[listitem][iWheel]);
8596 FormatMSG(playerid, Color:GREY, "You added wheels "ORAN"%s"GREY" on your Admin Car!",Wheels[listitem][iwName]);
8597
8598 P_DATA[playerid][A_Wheels] = Wheels[listitem][iWheel];
8599
8600 return cmd_accp(playerid,"");
8601 }
8602
8603 iDialog<ACCP_COLORS>
8604 {
8605 if(!response) return cmd_accp(playerid,"");
8606
8607 ChangeVehicleColor(GetPlayerVehicleID(playerid),ACCP_Colors[listitem][ivColor], ACCP_Colors[listitem][ivColor]);
8608 FormatMSG(playerid, Color:GREY, "You changed your vehicle's color to color to %s%s!", ACCP_Colors[listitem][ivcRGB], ACCP_Colors[listitem][ivcName]);
8609
8610 P_DATA[playerid][A_Color] = ACCP_Colors[listitem][ivColor];
8611
8612 return cmd_accp(playerid,"");
8613 }
8614
8615 iDialog<ACCP_C_C>
8616 {
8617 if(!response) return cmd_accp(playerid,"");
8618
8619 switch(listitem)
8620 {
8621 case (0):
8622 {
8623 new Str[1024];
8624 for (new c = 0; c < sizeof(Wheels); c++)
8625 {format(Str, sizeof (Str), "%s"GREY"ID: "ORAN"%d "GREY" NAME: "ORAN"%s\n",Str, Wheels[c][iWheel], Wheels[c][iwName]);}
8626
8627 SPD(playerid, Dialog:ACCP_WHEELS, LIST, "Change: "ORAN"Wheels", Str, "Change", "Back");
8628 }
8629 case (1):
8630 {
8631 new Str[1024];
8632 for (new c = 0; c < sizeof(ACCP_Components); c++)
8633 {format(Str, sizeof (Str), "%s"GREY"%s\n",Str, ACCP_Components[c][icName]);}
8634
8635 SPD(playerid, Dialog:ACCP_COMPS, LIST, "Add: "ORAN"Components", Str, "Change", "Back");
8636 }
8637 }
8638 }
8639
8640 iDialog<ACCP>
8641 {
8642 if(response)
8643 {
8644 switch(listitem)
8645 {
8646 case (0): SPD(playerid, Dialog:ACCP_NOS, LIST, "Add: "ORAN"Nos", ""GREY"2x\n\
8647 "GREY"5x\n\
8648 "GREY"10x\n\
8649 "GREY"Unlimited\n\
8650 "ORAN"Remove Nos", "Add", "Back");
8651
8652 case (1):
8653 {
8654 new Str[512];
8655 for (new c = 0; c < sizeof(ACCP_Colors); c++)
8656 { format(Str, sizeof (Str), "%s%s%s\n", Str, ACCP_Colors[c][ivcRGB], ACCP_Colors[c][ivcName]); }
8657
8658 SPD(playerid, Dialog:ACCP_COLORS, LIST, "Change: "ORAN"Colors", Str, "Change", "Back");
8659 }
8660 case (2): SPD(playerid, Dialog:ACCP_C_C, LIST, "Add: "ORAN"Components", ""GREY"Wheels\n\
8661 "GREY"Components", "Add", "Back");
8662
8663 case (3):
8664 {
8665
8666 CheckComponents(playerid, "There are no changes to save!");
8667
8668 SPD(playerid, Dialog:ACCP_SAVE, BOX, "Save: "ORAN"Changes!", ""GREY"Saving changes made to your vehicle can be used everytime, anywhere!\n\
8669 Changes will be saved into your account.\n\
8670 Later select the "BLUE"Load Changes"GREY" item on your Admin Car cPanel.\n\
8671 It's totally free and usable anytime!\n\n\
8672 Want to "ORAN"save"GREY" or go "ORAN"back"GREY" ?", "Save", "Back");
8673 }
8674 case (4):
8675 {
8676 if(!P_DATA[playerid][Accp_Saved])
8677 return SendError(playerid, "You didn't save any changes to your vehicle!"), cmd_accp(playerid, "");
8678
8679 SPD(playerid, Dialog:ACCP_LOAD, BOX, "Load: "ORAN"Changes!", ""GREY"With this you will load the changes you saved last time\n\
8680 If you want to remove the changes select the "ORAN"Discard Changes"GREY" from Admin Car cPanel!\n\n\
8681 Want to "ORAN"load"GREY" or go "ORAN"back"GREY" ?", "Load", "Back");
8682 }
8683 case (5):
8684 {
8685 CheckComponents(playerid, "There are no changes to discard due to the fact that there aren't any!");
8686
8687 SPD(playerid, Dialog:ACCP_DISCARD, BOX, "Discard: "ORAN"Changes!", ""GREY"You are about to discard the changes made to your vehicle!\n\
8688 Ani component, nos type, wheels, colors selected for your Admin Car WILL BE DELETED!!\n\n\
8689 Want to "ORAN"discard"GREY" or go "ORAN"back"GREY" ?", "Discard", "Back");
8690 }
8691 }
8692 }
8693 }
8694 iDialog<ACCP_NOS>
8695 {
8696 if(!response) return cmd_accp(playerid,"");
8697 switch(listitem)
8698 {
8699 case (0): AddVehicleComponent(GetPlayerVehicleID(playerid), 1009),SetPVarString(playerid, "Type", "2x");
8700 case (1): AddVehicleComponent(GetPlayerVehicleID(playerid), 1008),SetPVarString(playerid, "Type", "5x");
8701 case (2): AddVehicleComponent(GetPlayerVehicleID(playerid), 1010),SetPVarString(playerid, "Type", "10x");
8702 case (3): AddVehicleComponent(GetPlayerVehicleID(playerid), 1010),SetPVarString(playerid, "Type", "Unlimited");
8703 case (4):
8704 {
8705 if(!strcmp(GPVSEx(playerid, "Type"), "None", false))
8706 return SendError(playerid, "You don't have NOS installed!"),
8707 OnDialogResponse(playerid, Dialog:ACCP, 1, 0, "");
8708
8709 SendClientMessage(playerid, Color:ORAN, "ACCP: "GREY"You removed your Nitro from vehicle!");
8710
8711 RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1010),
8712 RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1009),
8713 RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1008),
8714 SetPVarString(playerid, "Type", "None");
8715 }
8716 }
8717 if(listitem != 4)
8718 {
8719 FormatMSG(playerid, Color:ORAN, "ACCP: "GREY" You have added "ORAN"%s"GREY" nitro to your vehicle!", GPVSEx(playerid, "Type"));
8720
8721 if(!strcmp(GPVSEx(playerid, "Type"), "Unlimited", false))
8722 SendClientMessage(playerid, Color:ORAN, "NOTE:"GREY" Hold your left mouse button for unlimited nos!");
8723
8724 else
8725 SendClientMessage(playerid, Color:ORAN, "NOTE:"GREY" Press "ORAN"2"GREY" or "ORAN"Left Mouse Button"GREY" to recharge when exhausted!");
8726
8727 return cmd_accp(playerid,"");
8728 }
8729 }
8730 iDialog<cPanel_Ping>
8731 {
8732 if(!response)
8733 {
8734 S_DATA[Ping] = 0;
8735
8736 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Ping Kicker",
8737 ""W"Feature "ORAN"\"Ping Kicker\""W" has been disabled!\n\
8738 Players won't be kicked from the server for high ping.", "Back", "");
8739 }
8740 else
8741 {
8742 new sPing[10];
8743 if(sscanf(inputtext, "s[10]", sPing)) return OnDialogResponse(playerid, Dialog:cPanel, 1, 2, "");
8744 else
8745 {
8746 if(!IsNumeric(sPing))
8747 {
8748 if(!strcmp(sPing, "off", true))
8749 {
8750 S_DATA[Ping] = 0;
8751 new INI:
8752 ServerData = INI_Open(SERVER_FILE);
8753 INI_WriteInt(ServerData, INI_Server_Info[2][isName], 0);
8754 INI_Close(ServerData);
8755 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Ping Kicker", \
8756 ""W"Feature "ORAN"\"Ping Kicker\""W" has been disabled!\n\
8757 Players won't be kicked if they have a high ping", "Back", "");
8758 return 0;
8759 }
8760 else
8761 {
8762 SPD(playerid, Dialog:cPanel_Ping, INPUT, ""W"cPanel: "ORAN"Ping Kicker","\n\n\
8763 "GREY"Please write down the ping needed for the player to get kicked.\n\
8764 If you write "ORAN"OFF"GREY" the "ORAN"Ping Kicker"GREY" will be disabled.", "Enter", "Disable");
8765 }
8766 }
8767 else
8768 {
8769 if(strval(sPing) < MIN_PING_LIMIT || strval(sPing) > MAX_PING_LIMIT)
8770 return SPD(playerid, Dialog:cPanel_Ping, INPUT, ""W"cPanel: "ORAN"Ping Kicker",
8771 ""ORAN"ERROR:"W" Min. Ping: "ORAN""#MIN_PING_LIMIT" "W"| Max. Ping: "ORAN""#MAX_PING_LIMIT"\n\n\
8772 "GREY"Please write down the ping needed for the player to get kicked.\n\
8773 If you write "ORAN"OFF"GREY" the "ORAN"Ping Kicker"GREY" will be disabled.", "Enter", "Disable");
8774
8775 S_DATA[Ping] = strval(sPing);
8776
8777 new INI: ServerData = INI_Open(SERVER_FILE);
8778 INI_WriteInt(ServerData, INI_Server_Info[2][isName], strval(sPing));
8779 INI_Close(ServerData);
8780
8781 new zStr[256];
8782 format(zStr, sizeof (zStr), ""W"Feature "ORAN"\"Ping Kicker\""W" has been enabled!\n\
8783 Players will be kicked if they exceed the "ORAN"%d"W" ping limit!", strval(sPing));
8784 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Ping Kicker", zStr, "Back", "");
8785
8786 }
8787 }
8788 }
8789 }
8790 iDialog<cPanel>
8791 {
8792 if(response)
8793 {
8794 new INI:
8795 ServerData = INI_Open(SERVER_FILE);
8796 switch(listitem)
8797 {
8798 case 0:
8799 {
8800 INI_WriteInt(ServerData, INI_Server_Info[0][isName], 1);
8801 S_DATA[AntiSpam] = 1;
8802 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti-Spam",\
8803 ""W"Feature "ORAN"\"Anti-Spam\""W" has been enabled!\n\
8804 Players won't be able to spam the chat and will be kicked for abuse.", "Back", "");
8805 }
8806 case 1:
8807 {
8808 INI_WriteInt(ServerData, INI_Server_Info[1][isName], 1);
8809 S_DATA[AntiCSpam] = 1;
8810 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Command Spam",\
8811 ""W"Feature "ORAN"\"Anti Command Spam\""W" has been enabled!\n\
8812 Players won't be able to spam the chat with commands.", "Back", "");
8813 }
8814 case 2:
8815 {
8816 SPD(playerid, Dialog:cPanel_Ping, INPUT, ""W"cPanel: "ORAN"Ping Kicker","\n\n\
8817 "GREY"Please write down the ping needed for the player to get kicked.\n\
8818 If you write "ORAN"OFF"GREY" the "ORAN"Ping Kicker"GREY" will be disabled.", "Enter", "Disable");
8819 }
8820 case 3:
8821 {
8822 INI_WriteInt(ServerData, INI_Server_Info[3][isName], 1);
8823 S_DATA[RCONProt] = 1;
8824 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"RCON Protection",\
8825 ""W"Feature "ORAN"\"Rcon Protection\""W" has been enabled!\n\
8826 After "ORAN""#MAX_RCON_ATTEMPTS" attempts players will be banned\n\
8827 from the server for repeated login attempts", "Back", "");
8828 }
8829 case 4:
8830 {
8831 INI_WriteInt(ServerData, INI_Server_Info[4][isName], 1);
8832 S_DATA[TellPlayer] = 1;
8833 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Tell Player",\
8834 ""W"Feature "ORAN"\"Tell Player\""W" has been enabled!\n\
8835 Players will receive a message when typing an admin command\n\
8836 telling them that their admin level is not high enough!", "Back", "");
8837 }
8838 case 5:
8839 {
8840 INI_WriteInt(ServerData, INI_Server_Info[5][isName], 0);
8841 S_DATA[Chat] = 0;
8842 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Block Chat",\
8843 ""W"The "ORAN"Chat"W" has been unblocked!\n\
8844 Players are able to speak in the chat!", "Back", "");
8845 }
8846
8847 case 6:
8848 {
8849 INI_WriteInt(ServerData, INI_Server_Info[6][isName], 1);
8850 S_DATA[ReadPM] = 1;
8851 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Read Personal Messages",\
8852 ""W"Feature "ORAN"\"Read PMs\""W" has been enabled!\n\
8853 Administrators will be able to see the messages\n\
8854 sent by members to others!", "Back", "");
8855 }
8856 case 7:
8857 {
8858 INI_WriteInt(ServerData, INI_Server_Info[7][isName], 1);
8859 S_DATA[ReadCMD] = 1;
8860 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Read Commands",\
8861 ""W"Feature "ORAN"\"Read Commands\""W" has been enabled!\n\
8862 Administrators will be able to see the commands a player used!", "Back", "");
8863 }
8864 case 8:
8865 {
8866 INI_WriteInt(ServerData, INI_Server_Info[8][isName], 1);
8867 S_DATA[AKA] = 1;
8868 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"AKA",\
8869 ""W"Feature "ORAN"\"AKA\""W" has been enabled!\n\
8870 Admins will see the AKA names of a player!", "Back", "");
8871 }
8872
8873 case 9:
8874 {
8875 SPD(playerid, Dialog:cPanel2, LIST, ""ORAN"Server Control Panel"W" Page: 2", cPanel2(), "Enable", "Disable");
8876 }
8877 }
8878 INI_Close(ServerData);
8879 }
8880 else
8881 {
8882 new INI:
8883 ServerData = INI_Open(SERVER_FILE);
8884 switch(listitem)
8885 {
8886 case 0:
8887 {
8888 INI_WriteInt(ServerData, INI_Server_Info[0][isName], 0);
8889 S_DATA[AntiSpam] = 0;
8890 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti-Spam",\
8891 ""W"Feature "ORAN"\"Anti-Spam\""W" has been disabled!\n\
8892 Players will be able to spam the chat.", "Back", "");
8893 }
8894 case 1:
8895 {
8896 INI_WriteInt(ServerData, INI_Server_Info[1][isName], 0);
8897 S_DATA[AntiCSpam] = 0;
8898 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Command Spam",\
8899 ""W"Feature "ORAN"\"Anti Command Spam\""W" has been disabled!\n\
8900 Players will be able to spam the chat with commands.", "Back", "");
8901 }
8902 case 2:
8903 {
8904 INI_WriteInt(ServerData, INI_Server_Info[2][isName], 0);
8905 S_DATA[Ping] = 0;
8906 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Ping Kicker",\
8907 ""W"Feature "ORAN"\"Ping Kicker\""W" has been disabled!\n\
8908 Players won't be kicked for a high ping.", "Back", "");
8909 }
8910 case 3:
8911 {
8912 INI_WriteInt(ServerData, INI_Server_Info[3][isName], 0);
8913 S_DATA[RCONProt] = 0;
8914 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"RCON Protection",\
8915 ""W"Feature "ORAN"\"Rcon Protection\""W" has been disabled!\n\
8916 Players won't be banned from the server for RCON login attempts.", "Back", "");
8917 }
8918 case 4:
8919 {
8920 INI_WriteInt(ServerData, INI_Server_Info[4][isName], 0);
8921 S_DATA[TellPlayer] = 0;
8922 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Tell Player",\
8923 ""W"Feature "ORAN"\"Tell Player\""W" has been disabled!\n\
8924 Players won't be informed that their level is not high enough\n\
8925 to execute the admin command, actually, no message will be sent.", "Back", "");
8926 }
8927 case 5:
8928 {
8929 INI_WriteInt(ServerData, INI_Server_Info[5][isName], 1);
8930 S_DATA[Chat] = 1;
8931 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Block Chat",\
8932 ""W"The "ORAN"Chat"W" has been blocked!\n\
8933 Players won't be able to speak in the chat", "Back", "");
8934 }
8935 case 6:
8936 {
8937 INI_WriteInt(ServerData, INI_Server_Info[6][isName], 0);
8938 S_DATA[ReadPM] = 0;
8939 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Read Personal Messages",\
8940 ""W"Feature "ORAN"\"Read PMs\""W" has been disabled!\n\
8941 Personal Messages are now PERSONAL!", "Back", "");
8942 }
8943 case 7:
8944 {
8945 INI_WriteInt(ServerData, INI_Server_Info[7][isName], 0);
8946 S_DATA[ReadCMD] = 0;
8947 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Read Commands",\
8948 ""W"Feature "ORAN"\"Read Commands\""W" has been disabled!\n\
8949 Reading Commands is now disabled, Admins won't see.!", "Back", "");
8950 }
8951 case 8:
8952 {
8953 INI_WriteInt(ServerData, INI_Server_Info[8][isName], 0);
8954 S_DATA[AKA] = 0;
8955 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"AKA",\
8956 ""W"Feature "ORAN"\"AKA\""W" has been disabled!\n\
8957 Admins won't see the AKA the players logged with!", "Back", "");
8958 }
8959 }
8960 INI_Close(ServerData);
8961 }
8962 }
8963 iDialog<cPanel2>
8964 {
8965 if(response)
8966 {
8967 new INI:
8968 ServerData = INI_Open(SERVER_FILE);
8969 switch(listitem)
8970 {
8971 case 0:
8972 {
8973 INI_WriteInt(ServerData, INI_Server_Info[9][isName], 1);
8974 S_DATA[ShowFunction] = 1;
8975 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Show Function",\
8976 ""W"Feature "ORAN"\"Show Function\""W" has been enabled!\n\
8977 When admins type an admin command, they will see the \""ORAN"Function: "W"blabla\"", "Back", "");
8978 }
8979 case 1:
8980 {
8981 INI_WriteInt(ServerData, INI_Server_Info[10][isName], 1);
8982 S_DATA[AntiRepeat] = 1;
8983 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Message Repeat",\
8984 ""W"Feature "ORAN"\"Anti Message Repeat\""W" has been enabled!\n\
8985 Players will be warned if they continue to send same message in the chat!", "Back", "");
8986 }
8987 case 2:
8988 {
8989 INI_WriteInt(ServerData, INI_Server_Info[11][isName], 1);
8990 S_DATA[AutoLogin] = 1;
8991 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Auto Login",\
8992 ""W"Feature "ORAN"\"Auto Login\""W" has been enabled!\n\
8993 When players connect and the IP with which they left matches\n\
8994 the one they connected with and the name is same they will\n\
8995 auto login into their account without password request\n\n\
8996 "ORAN"# Could be unsafe! Use carfully!", "Back", "");
8997 }
8998 case 3:
8999 {
9000 #if USE_RANKS == true
9001
9002 INI_WriteInt(ServerData, INI_Server_Info[12][isName], 1);
9003 S_DATA[AnnRank] = 1;
9004 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Announce Rank",\
9005 ""W"Feature "ORAN"\"Announce Rank\""W" has been enabled!\n\
9006 When a player will rank up, will tell to the whole server\n\
9007 This feature can get frustrating when the server is crowded!", "Back", "");
9008
9009 #else
9010
9011 cmd_acp(playerid, "");
9012 SendError(playerid, "Using Ranks is disabled from script!");
9013
9014 #endif
9015 }
9016 case 4:
9017 {
9018 INI_WriteInt(ServerData, INI_Server_Info[13][isName], 1);
9019 S_DATA[AntiAD] = 1;
9020 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
9021 ""W"Feature "ORAN"\"Anti Advertising\""W" has been enabled!\n\
9022 Players that will advertise will be warned then kicked!", "Back", "");
9023 }
9024 case 5:
9025 {
9026 INI_WriteInt(ServerData, INI_Server_Info[14][isName], 0);
9027 S_DATA[AdminChat] = 1;
9028 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
9029 ""W"Feature "ORAN"\"Bloch Admin Chat\""W" has been enabled!\n\
9030 All admins will be able to chat trough Admin Chat", "Back", "");
9031 }
9032 case 6:
9033 {
9034 INI_WriteInt(ServerData, INI_Server_Info[15][isName], 0);
9035 S_DATA[VipChat] = 1;
9036 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
9037 ""W"Feature "ORAN"\"Block VIP Chat\""W" has been enabled!\n\
9038 VIP members can now chat freely trough VIP Chat.", "Back", "");
9039 }
9040 case 7:
9041 {
9042 cmd_acp(playerid, "");
9043 }
9044 }
9045 INI_Close(ServerData);
9046 }
9047 else
9048 {
9049 new INI:
9050 ServerData = INI_Open(SERVER_FILE);
9051
9052 switch(listitem)
9053 {
9054 case 0:
9055 {
9056 INI_WriteInt(ServerData, INI_Server_Info[9][isName], 0);
9057 S_DATA[ShowFunction] = 0;
9058 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Show Function",\
9059 ""W"Feature "ORAN"\"Show Function\""W" has been disabled!\n\
9060 When admins type an admin command, they won't see the \"Function: blabla\"", "Back", "");
9061 }
9062 case 1:
9063 {
9064 INI_WriteInt(ServerData, INI_Server_Info[10][isName], 0);
9065 S_DATA[AntiRepeat] = 0;
9066 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Message Repeat",\
9067 ""W"Feature "ORAN"\"Anti Message Repeat\""W" has been disabled!\n\
9068 Players are now allowed to repeate themselves in the chat!", "Back", "");
9069 }
9070 case 2:
9071 {
9072 INI_WriteInt(ServerData, INI_Server_Info[11][isName], 0);
9073 S_DATA[AutoLogin] = 0;
9074 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Auto Login",\
9075 ""W"Feature "ORAN"\"Auto Login\""W" has been disabled!\n\
9076 On connection player will need to enter their passwords\n\
9077 to enter their accounts!\n\n\
9078 "GREE"# Safest Way!", "Back", "");
9079 }
9080 case 3:
9081 {
9082 #if USE_RANKS == true
9083
9084 INI_WriteInt(ServerData, INI_Server_Info[12][isName], 0);
9085 S_DATA[AnnRank] = 0;
9086 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Announce Rank",\
9087 ""W"Feature "ORAN"\"Announce Rank\""W" has been disabled!\n\
9088 Only the ranked up player will see the message!", "Back", "");
9089
9090 #else
9091
9092 cmd_acp(playerid, "");
9093 SendError(playerid, "Using Ranks is disabled from script!");
9094
9095 #endif
9096 }
9097 case 4:
9098 {
9099 INI_WriteInt(ServerData, INI_Server_Info[13][isName], 0);
9100 S_DATA[AntiAD] = 0;
9101 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
9102 ""W"Feature "ORAN"\"Anti Advertising\""W" has been disabled!\n\
9103 Players will now be able to send IP in chat!!!", "Back", "");
9104 }
9105 case 5:
9106 {
9107 INI_WriteInt(ServerData, INI_Server_Info[14][isName], 0);
9108 S_DATA[AdminChat] = 0;
9109 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
9110 ""W"Feature "ORAN"\"Bloch Admin Chat\""W" has been disabled!\n\
9111 Only Administrators and Owners will be able to Admin Chat", "Back", "");
9112 }
9113 case 6:
9114 {
9115 INI_WriteInt(ServerData, INI_Server_Info[15][isName], 0);
9116 S_DATA[VipChat] = 0;
9117 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
9118 ""W"Feature "ORAN"\"Block VIP Chat\""W" has been disabled!\n\
9119 VIP members won't be able to chat trough VIP Chat.", "Back", "");
9120 }
9121 case 7:
9122 {
9123 cmd_acp(playerid, "");
9124 }
9125 }
9126 INI_Close(ServerData);
9127 }
9128 }
9129
9130 switch(dialogid)
9131 {
9132 CaseDialog<Register1> if(response)RegisterPlayer(playerid, Dialog:Register1, inputtext);
9133 CaseDialog<Login>
9134 {
9135 #if SECURITY_QUESTION == true
9136
9137 SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""W"Please write your password!", "Login", "Forg. Pass");
9138
9139 #else
9140
9141 SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""W"Please write your password!", "Login", "Kick");
9142
9143 #endif
9144 }
9145 CaseDialog<Register>
9146 {
9147 if(! response) return KickEx(playerid, .zReason = "Not registering", .tell = true);
9148
9149 if(strlen(inputtext))
9150 {
9151 if(strlen(inputtext) < MIN_PASS_LEN || strlen(inputtext) > MAX_PASS_LEN)
9152 return ShowPlayerDialog
9153 (
9154 playerid,
9155 Dialog:Register,
9156 DIALOG_STYLE_INPUT,
9157 ""W"Register an account",
9158 ""ORAN"ERROR:"W" An error has occured while trying to register the account, please try again!!\n\n\
9159 Please write your desired password.", "Register", "Kick");
9160
9161 #if SECURITY_QUESTION == false
9162
9163 RegisterPlayer(playerid, Dialog:Register, inputtext);
9164
9165 #else
9166
9167 SetPVarString(playerid, "TempPass", inputtext);
9168 SPD(playerid, Dialog:SQuestion, INPUT, ""W"Secret Question", ""W"Please write your secret question!\nThis secret question will be used later\nwhen you want to retrieve your password!", "Insert", "");
9169
9170 #endif
9171 }
9172 else
9173 {
9174 new zStr[256];
9175 format(zStr, sizeof (zStr), "{FF0000}Please write a password!\n\n"W"Please write your desired password", Name(playerid), GetServerHostName());
9176 ShowPlayerDialog(playerid, Dialog:Register, DIALOG_STYLE_INPUT, ""W"Register an account", zStr, "Register", "Kick");
9177 }
9178 }
9179 CaseDialog<SQuestion>
9180 {
9181 if(response || !response)
9182 {
9183 if(strlen(inputtext))
9184 {
9185 if(strlen(inputtext) > 10 && strlen(inputtext) < 90)
9186 {
9187 if(strfind(inputtext, "?", true) != -1)
9188 {
9189 SetPVarString(playerid, "Question", inputtext);
9190 new Str[190];
9191 format(Str, 190, ""W"Your secret question is:\n "BLUE"%s\n\n"W"Please insert the answer:", inputtext);
9192 SPD(playerid, Dialog:SAnswer, INPUT, ""W"Secret Answer",Str, "Insert", "Back");
9193 }
9194 else SPD(playerid, Dialog:SQuestion, INPUT, ""W"Secret Question", ""ORAN"That was not a question! Try again!\n\n"W"Please write your secret question!\nThis secret question will be used later\nwhen you want to retrieve your password!", "Insert", "");
9195 }
9196 else SPD(playerid, Dialog:SQuestion, INPUT, ""W"Secret Question", ""ORAN"Insert a longer question!\n\n"W"Please write your secret question!\nThis secret question will be used later\nwhen you want to retrieve your password!", "Insert", "");
9197 }
9198 else SPD(playerid, Dialog:SQuestion, INPUT, ""W"Secret Question", ""ORAN"Insert a longer question!\n\n"W"Please write your secret question!\nThis secret question will be used later\nwhen you want to retrieve your password!", "Insert", "");
9199 }
9200 }
9201 CaseDialog<SAnswer2>
9202 {
9203 RegisterPlayer(playerid, Dialog:Register1, GPVSEx(playerid, "TempPass"));
9204 }
9205 CaseDialog<SAnswer>
9206 {
9207 if(response)
9208 {
9209 new Str[190];
9210 if(strlen(inputtext))
9211 {
9212 if(strlen(inputtext) > 4 && strlen(inputtext) < 90)
9213 {
9214 SetPVarString(playerid, "Answer", inputtext);
9215
9216 format(Str, 190, ""W"Process finished!\n\n"W"QUESTION: "BLUE"%s\n"W"ANSWER: "BLUE"%s"W"\n\n{FF0000}REMEMBER THE ANSWER!!\n"GREY"Procees with login.", GPVSEx(playerid, "Question"),inputtext);
9217 SPD(playerid, Dialog:SAnswer2, BOX, ""W"Account login",Str, "Continue", "");
9218
9219 format(Query, 200, "UPDATE `Accounts` SET `Question` = '%s', `Answer` = '%s' WHERE `Name` = '%s'", GPVSEx(playerid, "Question"), inputtext, Name(playerid));
9220 DB::Query(_DB, Query);
9221 }
9222 else
9223 {
9224 format(Str, 190, ""ORAN"Insert a longer answer!\n\n"W"Your secret question is:\n"BLUE"%s\n\n"W"Please insert the answer:", GPVSEx(playerid, "Question"));
9225 SPD(playerid, Dialog:SAnswer, INPUT, ""W"Secret Answer",Str, "Insert", "Back");
9226 }
9227 }
9228 else
9229 {
9230 format(Str, 190, ""ORAN"Insert a longer answer!\n\n"W"Your secret question is:\n"BLUE"%s\n\n"W"Please insert the answer:", GPVSEx(playerid, "Question"));
9231 SPD(playerid, Dialog:SAnswer, INPUT, ""W"Secret Answer",Str, "Insert", "Back");
9232 }
9233 }
9234 else
9235 {
9236 DeletePVar(playerid, "Question");
9237 SPD(playerid, Dialog:SQuestion, INPUT, ""W"Secret Question", ""W"Please write your secret question!\nThis secret question will be used later\nwhen you want to retrieve your password!", "Insert", "");
9238 }
9239 }
9240 CaseDialog<Login2>
9241 {
9242 if(response)
9243 {
9244 if(strlen(inputtext))LoginPlayer(playerid, inputtext);
9245 else
9246 {
9247 #if SECURITY_QUESTION == true
9248
9249 SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""ORAN"ERROR:"W" No password entered!\n\n"W"Please write your password!", "Login", "Forg. Pass");
9250
9251 #else
9252
9253 SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""ORAN"ERROR:"W" No password entered!\n\n"W"Please write your password!", "Login", "Kick");
9254
9255 #endif
9256 }
9257
9258 }
9259 else
9260 {
9261 #if SECURITY_QUESTION == true
9262
9263 SPD(playerid, Dialog:ForgPass, INPUT, ""W"Forgot Password", ""W"Please insert the answer to your secret question for password retrival", "Insert", "Back");
9264
9265 #else
9266
9267 KickEx(playerid, "System", "Not logging in");
9268
9269 #endif
9270 }
9271 }
9272 CaseDialog<ForgPass>
9273 {
9274 if(response)
9275 {
9276 if(strlen(inputtext))
9277 {
9278 new DBResult:Result;
9279 format(Query, 200, "SELECT `Question`, `Answer`, `RPassword` FROM `Accounts` WHERE `Name` = '%s';", Name(playerid));
9280 Result = DB::Query(_DB, Query);
9281
9282 if(Result)
9283 {
9284 if(DB::Valid(Result))
9285 {
9286 new Field[129];
9287
9288 DB::GetField(Result, "Answer", Field, sizeof(Field));
9289 SetPVarString(playerid, "TempAnswer", Field);
9290
9291 DB::GetField(Result, "Question", Field, sizeof(Field));
9292 SetPVarString(playerid, "Question", Field);
9293
9294 if(!strcmp(GPVSEx(playerid, "TempAnswer"), inputtext, false))
9295 {
9296 DB::GetField(Result, "RPassword", Field, sizeof(Field));
9297
9298 new Str[100];
9299 format(Str, 100, ""W"The answer is correct!\n\nYour password is:"BLUE" %s", Field);
9300 SPD(playerid, Dialog:Login2, INPUT, ""W"Correct answer!", "You answered correct to your question:\n"BLUE"%s\n\n\nPlease insert your password to continue!", "Login", "");
9301
9302 DB::Free(Result);
9303
9304 DeletePVar(playerid, "TempAnswer");
9305 }
9306 else
9307 {
9308 DB::Free(Result);
9309 SPD(playerid, Dialog:ForgPass, INPUT, ""W"Forgot Password", "{FF0000}Incorrect answer! Try again!\n\n"W"Please insert the answer to your secret question for password retrival", "Insert", "Back");
9310 }
9311 }
9312 }
9313 }else SPD(playerid, Dialog:ForgPass, INPUT, ""W"Forgot Password", ""W"Please insert the answer to your secret question for password retrival", "Insert", "Back");
9314 }
9315 else
9316 {
9317 #if SECURITY_QUESTION == true
9318
9319 SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""W"Please write your password!", "Login", "Forg. Pass");
9320
9321 #else
9322
9323 SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""W"Please write your password!", "Login", "Kick");
9324
9325 #endif
9326 }
9327
9328 }
9329
9330 CaseDialog<Login3>
9331 {
9332 if(response)
9333 {
9334 if(strlen(inputtext)) LoginPlayer(playerid, inputtext);
9335 else
9336 {
9337 #if SECURITY_QUESTION == true
9338
9339 SPD(playerid, Dialog:Login3, INPUT, ""W"Account login", ""ORAN"ERROR:"W" No password entered!\n\n"W"Please write your password!", "Login", "Forg. Pass");
9340
9341 #else
9342
9343 SPD(playerid, Dialog:Login3, INPUT, ""W"Account login", ""ORAN"ERROR:"W" No password entered!\n\n"W"Please write your password!", "Login", "Kick");
9344
9345 #endif
9346 }
9347 }
9348 }
9349 }
9350 return 0;
9351}
9352
9353Public:dLabel(InV) return DeletePlayer3DTextLabel(InV, ZaAdminCar[InV]);
9354Public:UnlimitedNos(playerid)AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
9355
9356Public:LoadAKA(playerid, name[], value[])
9357{
9358 new pIP[30];
9359 GetPlayerIp(playerid, pIP, 30);
9360 if(!strcmp(name, pIP)) SetPVarString(playerid, "pAKA", value);
9361}
9362Public:PingKick()
9363{
9364 foreach(Player, i)
9365 {
9366 if(S_DATA[Ping] != 0)
9367 {
9368 if(GetPlayerPing(i) > S_DATA[Ping] && P_DATA[i][Level] < IPGKICK)
9369 {
9370 new Str[30];
9371 format(Str, sizeof (Str), "Exceeding Ping Limit of %d", S_DATA[Ping]);
9372 KickEx(i, .zAdmin = "System", .zReason = Str, .tell = true);
9373 }
9374 }
9375 }
9376}
9377Public:BlockChat(playerid)
9378{
9379 if(S_DATA[Chat]) return SendError(playerid, "Chat already blocked!");
9380 S_DATA[Chat] = 1;
9381 SendAdminCMD(-1, "Admin "ORAN"%s[%i]"GREY" blocked the chat.", Name(playerid), playerid);
9382 SendClientMessage(playerid, Color:GREY, "You blocked the chat.");
9383
9384 foreach(Player, i)
9385 {
9386 if(P_DATA[i][Level] <= 0)
9387 {
9388 SendClientMessage(i, -1, "- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *");
9389 FormatMSG(i, -1, "Chat has been disabled by the Owner: %s", Name(playerid));
9390 SendClientMessage(i, -1, "- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *");
9391 }
9392 }
9393 return 1;
9394}
9395
9396Public:JailPlayer(playerid)
9397{
9398 KillTimer(JailTimer[playerid]);
9399
9400 UnFreeze(playerid);
9401
9402 SetPlayerPos(playerid, 197.6661, 173.8179, 1003.0234);
9403 SetPlayerInterior(playerid,3);
9404 SetCameraBehindPlayer(playerid);
9405
9406 if(P_DATA[playerid][Frozen])
9407 {
9408 Freeze(playerid);
9409 }
9410 JailTimer[playerid] = SetTimerEx("UnjailPlayer", 60_000, true, "d", playerid);
9411 P_DATA[playerid][Jailed] = 1;
9412}
9413Public:UnjailPlayer(playerid)
9414{
9415
9416 --P_DATA[playerid][JailTime];
9417
9418
9419 if(!P_DATA[playerid][JailTime])
9420 {
9421 KillTimer(JailTimer[playerid]);
9422 UnjailPlayer(playerid);
9423
9424 P_DATA[playerid][Jailed] = 0;
9425 P_DATA[playerid][JailTime] = 0;
9426
9427 SetPlayerInterior(playerid, 0);
9428 SetPlayerPos(playerid, 0.0, 0.0, 0.0);
9429 PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
9430
9431 SpawnPlayer(playerid);
9432 SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You have been un-jailed by the system!");
9433
9434 #if SAVE_JAIL == true
9435 new
9436 Query[256];
9437 format(Query, 256, "DELETE FROM `Jailed` WHERE `IP` = '%s'", GetPlayerIPEx(playerid));
9438 DB::Query(_DB, Query);
9439 #endif
9440 }
9441 else if(P_DATA[playerid][JailTime] == 1){
9442 GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~b~~h~JAIL INFO~n~~b~~h~One~w~ minute left", 10000, 3);}
9443
9444 else if(P_DATA[playerid][JailTime] > 1)
9445 {
9446 new Str[129];
9447 format(Str, 129, "~n~~n~~n~~n~~n~~n~~b~~h~JAIL INFO~n~~b~~h~%d~w~ minutes left", P_DATA[playerid][JailTime]);
9448 GameTextForPlayer(playerid, Str, 10000, 3);
9449 }
9450
9451 return 1;
9452}
9453
9454PcPanel(playerid)
9455{
9456
9457 new Str[2_0_0_0];
9458
9459 format(Str, sizeof (Str), ""ORAN"Exit cPanel\n\
9460 "W"Auto-Login\t\t%s\n\
9461 "W"Block PMs\t\t%s\n\
9462 "W"My stats",
9463 (S_DATA[AutoLogin] && P_DATA[playerid][pAuto]) ? (""GREE"Enabled") : (""ORAN"Disabled"),
9464 P_DATA[playerid][BAPMs] ? (""GREE"Enabled") : (""ORAN"Disabled"));
9465
9466 switch(P_DATA[playerid][Vip])
9467 {
9468 case 1:
9469 {
9470 format(Str, sizeof (Str), "%s\n"BLUE"VIP LEVEL 1\n\
9471 "W"Godlike\t\t%s\n\
9472 "W"Vehicle God\t\t%s\n\
9473 "W"Vehicle Boost\t\t%s\n\
9474 "W"Wear VIP Tag\t\t%s",
9475 Str,
9476 P_DATA[playerid][God] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9477 P_DATA[playerid][CarGod] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9478 P_DATA[playerid][Boost] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9479 P_DATA[playerid][VIPTag] ? (""GREE"Enabled") : (""ORAN"Disabled"));
9480 }
9481 case 2:
9482 {
9483 format(Str, sizeof (Str), "%s\n"BLUE"VIP LEVEL 1\n\
9484 "W"Godlike\t\t\t%s\n\
9485 "W"Vehicle God\t\t%s\n\
9486 "W"Vehicle Boost\t\t%s\n\
9487 "W"Wear VIP Tag\t\t%s\n\
9488 "BLUE"VIP LEVEL 2\n\
9489 "W"Vehicle Spin\t\t%s\n\
9490 "W"Incredible\t\t%s",
9491 Str,
9492 P_DATA[playerid][God] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9493 P_DATA[playerid][CarGod] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9494 P_DATA[playerid][Boost] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9495 P_DATA[playerid][VIPTag] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9496 P_DATA[playerid][Spin] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9497 P_DATA[playerid][Incred] ? (""GREE"Enabled") : (""ORAN"Disabled"));
9498 }
9499 case 3:
9500 {
9501 format(Str, sizeof (Str), "%s\n"BLUE"VIP LEVEL 1\n\
9502 "W"Godlike\t\t\t%s\n\
9503 "W"Vehicle God\t\t%s\n\
9504 "W"Vehicle Boost\t\t%s\n\
9505 "W"Wear VIP Tag\t\t%s\n\
9506 "BLUE"VIP LEVEL 2\n\
9507 "W"Vehicle Spin\t\t%s\n\
9508 "W"Incredible\t\t%s\n\
9509 "BLUE"VIP LEVEL 3\n\
9510 "W"Shout",
9511 Str,
9512 P_DATA[playerid][God] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9513 P_DATA[playerid][CarGod] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9514 P_DATA[playerid][Boost] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9515 P_DATA[playerid][VIPTag] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9516 P_DATA[playerid][Spin] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9517 P_DATA[playerid][Incred] ? (""GREE"Enabled") : (""ORAN"Disabled"));
9518 }
9519 }
9520 return Str;
9521}
9522cPanel()
9523{
9524 new PingString[50], Str[1024];
9525 if(S_DATA[Ping] != 0) format(PingString, sizeof (PingString), ""GREE"Enabled"W"\tPing Limit: "ORAN"%d", S_DATA[Ping]); else PingString = ""ORAN"Disabled";
9526 format(Str, sizeof (Str), ""W"Anti Spam\t\t%s\n\
9527 "W"Anti Command Spam\t%s\n\
9528 "W"Ping Kicker\t\t%s\n\
9529 "W"RCON Protection\t%s\n\
9530 "W"Tell Player\t\t%s\n\
9531 "W"Chat\t\t\t%s\n\
9532 "W"Read Commands\t%s\n\
9533 "W"Read PMs\t\t%s\n\
9534 "W"AKA\t\t\t%s\n\
9535 "GREY"..: Page 2\n\
9536 "ORAN"..: Exit",
9537 S_DATA[AntiSpam] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9538 S_DATA[AntiCSpam] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9539 PingString,
9540 S_DATA[RCONProt] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9541 S_DATA[TellPlayer] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9542 S_DATA[Chat] ? (""ORAN"Blocked") : (""GREE"Free to chat"),
9543 S_DATA[ReadPM] ? (""GREE"Reading") : (""ORAN"Not Reading"),
9544 S_DATA[ReadCMD] ? (""GREE"Reading") : (""ORAN"Not Reading"),
9545 S_DATA[AKA] ? (""GREE"Enabled") : (""ORAN"Disabled"));
9546
9547
9548
9549 return Str;
9550}
9551cPanel2()
9552{
9553 new Str[512];
9554 format(Str, sizeof (Str), ""W"Show Function\t\t%s\n\
9555 "W"Anti Message Repeat\t%s\n\
9556 "W"Autologin\t\t%s\n\
9557 "W"Announce Rank-Up\t%s\n\
9558 "W"Anti Advertising\t%s\n\
9559 "W"Admin Chat\t\t%s\n\
9560 "W"VIP Chat\t\t%s\n\
9561 "GREY"..: Back\n\
9562 "ORAN"..: Exit",
9563 S_DATA[ShowFunction] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9564 S_DATA[AntiRepeat] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9565 S_DATA[AutoLogin] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9566 S_DATA[AnnRank] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9567 S_DATA[AntiAD] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9568 S_DATA[AdminChat] ? (""GREE"Allowed") : (""ORAN"Not Allowed"),
9569 S_DATA[VipChat] ? (""GREE"Allowed") : (""ORAN"Not Allowed"));
9570
9571
9572
9573 return Str;
9574}
9575OnlineCheck(type[], C)
9576{
9577 new cS[126];
9578 if(!strcmp(type, "Admins"))
9579 {
9580 if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" Administrators online!\n\n", C);
9581 else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" Administrator online!\n\n");
9582 }
9583 else if(!strcmp(type, "Vips"))
9584 {
9585 if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" VIP Members online!\n\n", C);
9586 else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" VIP Member online!\n\n");
9587 }
9588 else if(!strcmp(type, "Jailed"))
9589 {
9590 if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" Jailed players online!\n\n", C);
9591 else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" Jailed player online!\n\n");
9592 }
9593 else if(!strcmp(type, "Muted"))
9594 {
9595 if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" Muted players online!\n\n", C);
9596 else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" Muted player online!\n\n");
9597 }
9598 else if(!strcmp(type, "Frozen"))
9599 {
9600 if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" Frozen players online!\n\n", C);
9601 else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" Frozen player online!\n\n");
9602 }
9603 return cS;
9604}
9605Public: LowerSpam()
9606{
9607 foreach(Player, playerid)
9608 {
9609 if(P_DATA[playerid][SpamMSG] > 0) P_DATA[playerid][SpamMSG]--;
9610 if(P_DATA[playerid][cSpam] > 0) P_DATA[playerid][cSpam]--;
9611 }
9612}
9613
9614fNMB(nmb)
9615{
9616 new Str[4];
9617 format(Str, sizeof (Str), "%d", nmb);
9618 return Str;
9619}
9620
9621
9622FormatStats(playerid)
9623{
9624 #if USE_RANKS == true
9625 format(StatsString, sizeof (StatsString), "\n"W"Viewing %s\n\n\
9626 "W"Level: "ORAN"%s\n\
9627 "W"Vip: "ORAN"%s\n\
9628 "W"Kills: "ORAN"%d\n\
9629 "W"Deaths: "ORAN"%d\n\
9630 "W"Ratio: "ORAN"%.3f\n\
9631 "W"Rank: "ORAN"%s\n\
9632 "W"Cookies: "ORAN"%d\n\
9633 "W"Respect: "GREE"+%d"W"/"ORAN"-%d\n",
9634 WhosStats,
9635 LevelName(GetPVarInt(playerid, "0_Level")),
9636 (GetPVarInt(playerid, "0_Vip")) ? (fNMB(GetPVarInt(playerid, "0_Vip"))) : ("NO!"),
9637 GetPVarInt(playerid, "0_Kills"),
9638 GetPVarInt(playerid, "0_Deaths"),
9639 (Float:GetPVarInt(playerid, "0_Kills") / Float:GetPVarInt(playerid, "0_Deaths")),
9640 RankName(GetPVarInt(playerid, "0_Rank")),
9641 GetPVarInt(playerid, "0_Cookies"),
9642 GetPVarInt(playerid, "0_Positive"),
9643 GetPVarInt(playerid, "0_Negative"));
9644 #else
9645 format(StatsString, sizeof (StatsString), "\n"W"Viewing %s\n\n\
9646 "W"Level: "ORAN"%s\n\
9647 "W"Vip: "ORAN"%s\n\
9648 "W"Kills: "ORAN"%d\n\
9649 "W"Deaths: "ORAN"%d\n\
9650 "W"Ratio: "ORAN"%.3f\n\
9651 "W"Cookies: "ORAN"%d\n\
9652 "W"Respect: "GREE"+%d"W"/"ORAN"-%d\n",
9653 WhosStats,
9654 LevelName(GetPVarInt(playerid, "0_Level")),
9655 (GetPVarInt(playerid, "0_Vip")) ? (fNMB(GetPVarInt(playerid, "0_Vip"))) : ("NO!"),
9656 GetPVarInt(playerid, "0_Kills"),
9657 GetPVarInt(playerid, "0_Deaths"),
9658 (Float:GetPVarInt(playerid, "0_Kills") / Float:GetPVarInt(playerid, "0_Deaths")),
9659 GetPVarInt(playerid, "0_Cookies"),
9660 GetPVarInt(playerid, "0_Positive"),
9661 GetPVarInt(playerid, "0_Negative"));
9662 #endif
9663 format(StatsString, sizeof (StatsString), "%s\
9664 "W"Money: "ORAN"%d\n\
9665 "W"Score: "ORAN"%d\n\
9666 "W"Online: "ORAN"%s\n\
9667 "W"Commands: "ORAN"%d\n\
9668 "W"Fail Cmds: "ORAN"%d\n\
9669 "W"Messages: "ORAN"%d\n\
9670 "W"Kicks: "ORAN"%d\n\
9671 "W"Account date: "ORAN"%s\n\
9672 "W"Account ID: "ORAN"%d\n\n",
9673 StatsString,
9674 GetPlayerMoney(playerid),
9675 GetPlayerScore(playerid),
9676 FormatOnline(playerid),
9677 P_DATA[playerid][Cmds],
9678 P_DATA[playerid][fCmds],
9679 P_DATA[playerid][Msgs],
9680 P_DATA[playerid][Kicks],
9681 GPVSEx(playerid, "AccountDate"),
9682 P_DATA[playerid][AccID]);
9683 return 1;
9684}
9685#if USE_RANKS == true
9686 RankName(rank) return _RankNames[rank];
9687
9688#endif
9689LevelName(iLevel)
9690{
9691 new zLevel[35];
9692 if (iLevel == 0) format(zLevel, 35, "%s", _Levels[0]);
9693 else if(iLevel == 1) format(zLevel, 35, "%s", _Levels[1]);
9694 else if(iLevel == 2) format(zLevel, 35, "%s", _Levels[2]);
9695 else if(iLevel == 3) format(zLevel, 35, "%s", _Levels[3]);
9696 else if(iLevel == 4) format(zLevel, 35, "%s", _Levels[4]);
9697 else if(iLevel >= 5) format(zLevel, 35, "%s", _Levels[5]);
9698 else zLevel = "<< Error >>";
9699 return zLevel;
9700}
9701
9702LoginPlayer(playerid, const pPass[], pAutoLogin = false)
9703{
9704
9705 new Buf[129], Query[280], DBResult:Result;
9706 WP_Hash(Buf, (129), pPass);
9707
9708 format(Query, 280, "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s' AND `Password` = '%s'", Name(playerid), Buf);
9709 Result = DB::Query(_DB, Query);
9710
9711 if(Result)
9712 {
9713 if(DB::Valid(Result))
9714 {
9715 DB::Free(Result);
9716 new Accp_String[16], Accp_Vars[6], Str[256];
9717
9718 LoadPlayerData(playerid);
9719 P_DATA[playerid][Logged] = 1;
9720
9721
9722 sscanf(GPVSEx(playerid, "Online"), "p<:>iii", P_DATA[playerid][Hours],P_DATA[playerid][Minutes],P_DATA[playerid][Seconds]);
9723
9724 if(!sscanf(GPVSEx(playerid, "ACCP_DATA"), "p<:>s[16]iiiiii",Accp_String,
9725 Accp_Vars[0],
9726 Accp_Vars[1],
9727 Accp_Vars[2],
9728 Accp_Vars[3],
9729 Accp_Vars[4],
9730 Accp_Vars[5]))
9731 {
9732 SetPVarString(playerid, "Type", Accp_String);
9733 P_DATA[playerid][A_Component1] = Accp_Vars[0];
9734 P_DATA[playerid][A_Component2] = Accp_Vars[1];
9735 P_DATA[playerid][A_Component3] = Accp_Vars[2];
9736 P_DATA[playerid][A_Component4] = Accp_Vars[2];
9737 P_DATA[playerid][A_Wheels] = Accp_Vars[3];
9738 P_DATA[playerid][A_Color] = Accp_Vars[4];
9739 }
9740 else
9741 {
9742 SetPVarString(playerid, "Type", "None");
9743 P_DATA[playerid][A_Component1] = 0;
9744 P_DATA[playerid][A_Component2] = 0;
9745 P_DATA[playerid][A_Component3] = 0;
9746 P_DATA[playerid][A_Component4] = 0;
9747 P_DATA[playerid][A_Wheels] = 0;
9748 P_DATA[playerid][A_Color] = 0;
9749 }
9750 SetPVarInt(playerid, "0_Level", P_DATA[playerid][Level]);
9751 SetPVarInt(playerid, "0_Vip", P_DATA[playerid][Vip]);
9752 SetPVarInt(playerid, "0_Kills", P_DATA[playerid][Kills]);
9753 SetPVarInt(playerid, "0_Deaths", P_DATA[playerid][Deaths]);
9754 SetPVarInt(playerid, "0_Messages", P_DATA[playerid][Msgs]);
9755 SetPVarInt(playerid, "0_Commands", P_DATA[playerid][Cmds]);
9756 SetPVarInt(playerid, "0_Fail_Commands", P_DATA[playerid][fCmds]);
9757 SetPVarInt(playerid, "0_Cookies", P_DATA[playerid][Cookies]);
9758 SetPVarInt(playerid, "0_God", P_DATA[playerid][God]);
9759 SetPVarInt(playerid, "0_CarGod", P_DATA[playerid][CarGod]);
9760 SetPVarInt(playerid, "0_Positive", P_DATA[playerid][Positive]);
9761 SetPVarInt(playerid, "0_Negative", P_DATA[playerid][Negative]);
9762 SetPVarInt(playerid, "0_Rank", P_DATA[playerid][Rank]);
9763
9764
9765 if(!pAutoLogin)
9766 {
9767
9768 if(P_DATA[playerid][Level] > 0 && P_DATA[playerid][Vip] > 0)
9769 {
9770 format(Str, sizeof (Str), ""W"Welcome "ORAN"%s.\n\n"W"-------------------\nAdmin: "ORAN"%s\n"W"VIP: "ORAN"%d",Name(playerid), LevelName(P_DATA[playerid][Level]), P_DATA[playerid][Vip]);
9771 if(P_DATA[playerid][VIPTag])
9772 {
9773 Delete3DTextLabel(P_DATA[playerid][Tag3D]);
9774 P_DATA[playerid][Tag3D] = Create3DTextLabel("VIP Member", Color:BLUE, 0.0, 0.0, 0.0, 90.0, 0, 1);
9775
9776 }
9777 }
9778 else if(P_DATA[playerid][Level] > 0 && P_DATA[playerid][Vip] <= 0)
9779 format(Str, sizeof (Str), ""W"Welcome "ORAN"%s.\n\n"W"-------------------\nAdmin: "ORAN"%s",Name(playerid), LevelName(P_DATA[playerid][Level]));
9780
9781 else if(P_DATA[playerid][Level] <= 0 && P_DATA[playerid][Vip] > 0)
9782 {
9783 format(Str, sizeof (Str), ""W"Welcome "ORAN"%s.\n\n"W"-------------------\nVIP: "ORAN"%d",Name(playerid), P_DATA[playerid][Vip]);
9784
9785 if(P_DATA[playerid][VIPTag])
9786 {
9787 Delete3DTextLabel(P_DATA[playerid][Tag3D]);
9788 P_DATA[playerid][Tag3D] = Create3DTextLabel("VIP Member", Color:BLUE, 0.0, 0.0, 0.0, 90.0, 0, 1);
9789
9790 }
9791 }
9792 else if(P_DATA[playerid][Level] == 0 && P_DATA[playerid][Vip] == 0)
9793 format(Str, sizeof (Str), ""W"Welcome "ORAN"%s.\n\n"W"-------------------",Name(playerid));
9794
9795 format(Str, sizeof (Str), "%s\n"W"Online: "ORAN"%s\n"W"Kills: "ORAN"%d\n"W"Deaths: "ORAN"%d"W"\n-------------------\n",
9796 Str,
9797 FormatOnline(playerid),
9798 P_DATA[playerid][Kills],
9799 P_DATA[playerid][Deaths]);
9800
9801 SPD(playerid, 9000, BOX, ""W"Succesfully logged in!", Str, "Close", "");
9802 }
9803 else
9804 {
9805 format(Str, sizeof (Str), ""BLUE"Auto-Login:\n\n"W"You have been succesfully logged in by the system!\nYou can disable the Auto-Login from the cPanel("BLUE"/PCP"W")");
9806 SPD(playerid, 9000, BOX, ""W"Succesfully logged in!", Str, "Close", "");
9807 }
9808 }
9809 else
9810 {
9811 --P_DATA[playerid][LogFail];
9812
9813 new zStr[256];
9814
9815 if(P_DATA[playerid][LogFail] != 0)
9816 {
9817 format(zStr, sizeof (zStr), ""ORAN"ERROR:"W" Wrong password! You have "ORAN"%d"W" tries left!\n\n"W"Please write your password!", P_DATA[playerid][LogFail]);
9818
9819 #if SECURITY_QUESTION == true
9820
9821 SPD(playerid, Dialog:Login2, INPUT, ""W"Account login error", zStr, "Login", "Forg. Pass");
9822
9823 #else
9824
9825 SPD(playerid, Dialog:Login2, INPUT, ""W"Account login error", zStr, "Login", "Kick");
9826
9827 #endif
9828 }
9829 else if(P_DATA[playerid][LogFail] <= 0)
9830 {
9831 GameTextForPlayer(playerid, "~r~Kicked from the server~n~~w~REASON: ~g~Exceeding login fails.", 60000, 3);
9832 KickEx(playerid, .zReason = "Exceeding login tries", .tell = true);
9833 }
9834 }
9835 }
9836}
9837
9838CMD:mutecheck(PARAMS)
9839{
9840 if(!P_DATA[playerid][Muted]) return SendClientMessage(playerid, Color:ORAN, "SERVER: "W"You are not muted!");
9841
9842 if(P_DATA[playerid][MutedTime] > 0)
9843 {
9844 FormatMSG(playerid, Color:ORAN, "SERVER:"W" You will be unmuted after "ORAN"%d"W" seconds!", P_DATA[playerid][MutedTime]);
9845 }
9846 else if(P_DATA[playerid][MutedTime] == 0)
9847 {
9848 SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You will never be unmuted automatically! (Even after connect!)");
9849 }
9850 return 1;
9851}
9852
9853Public:GodLike()
9854{
9855 foreach(Player, i)
9856 {
9857 if(GetPVarInt(i, "0_God") == 1 || P_DATA[i][God])
9858 {
9859 new Float: H;
9860 GetPlayerHealth(i, H);
9861 if(H < 300) SetPlayerHealth(i, 9999);
9862 }
9863 if(GetPVarInt(i, "0_CarGod") == 1 || P_DATA[i][CarGod])
9864 {
9865 if(IsPlayerInAnyVehicle(i))
9866 {
9867 SetVehicleHealth(GetPlayerVehicleID(i), 1000);
9868 RepairVehicle(GetPlayerVehicleID(i));
9869 }
9870 }
9871 }
9872}
9873GetPlayerIPEx(playerid)
9874{
9875 new pIP[30];
9876 GetPlayerIp(playerid, pIP, sizeof(pIP));
9877 return pIP;
9878}
9879
9880SavePlayerData(playerid)
9881{
9882 new Query[700];
9883 if(AccountExist(Name(playerid)))
9884 {
9885 format(Query, sizeof(Query), "UPDATE `Accounts` SET \
9886 `Online` = '%s', \
9887 `Level` = '%d', \
9888 `VIP` = '%d', \
9889 `Rank` = '%d', \
9890 `Autologin` = '%d', \
9891 `Money` = '%d', \
9892 `Score` = '%d', \
9893 `Kills` = '%d', \
9894 `Deaths` = '%d', \
9895 `Cookies` = '%d', \
9896 `Positive` = '%d', \
9897 `Negative` = '%d' WHERE `Name` = '%s'",
9898 FormatOnline(playerid),
9899 P_DATA[playerid][Level],
9900 P_DATA[playerid][Vip],
9901 P_DATA[playerid][Rank],
9902 P_DATA[playerid][pAuto],
9903 GetPlayerMoney(playerid),
9904 GetPlayerScore(playerid),
9905 P_DATA[playerid][Kills],
9906 P_DATA[playerid][Deaths],
9907 P_DATA[playerid][Cookies],
9908 P_DATA[playerid][Positive],
9909 P_DATA[playerid][Negative],
9910 Name(playerid));
9911 DB::Query(_DB, Query);
9912 format(Query, sizeof(Query), "UPDATE `Accounts` SET \
9913 `Messages` = '%d', \
9914 `Commands` = '%d', \
9915 `fCommands` = '%d', \
9916 `Warns` = '%d', \
9917 `Kicks` = '%d', \
9918 `God` = '%d', \
9919 `Cargod` = '%d', \
9920 `ACCPSav` = '%d', \
9921 `BlockPM` = '%d', \
9922 `Boost` = '%d', \
9923 `bSpeed` = '%f', \
9924 `WearTag` = '%d', \
9925 `Incred` = '%d', \
9926 `Spin` = '%d' WHERE `Name` = '%s'",
9927 P_DATA[playerid][Msgs],
9928 P_DATA[playerid][Cmds],
9929 P_DATA[playerid][fCmds],
9930 P_DATA[playerid][Warns],
9931 P_DATA[playerid][Kicks],
9932 P_DATA[playerid][God],
9933 P_DATA[playerid][CarGod],
9934 P_DATA[playerid][Accp_Saved],
9935 P_DATA[playerid][BAPMs],
9936 P_DATA[playerid][Boost],
9937 Float:P_DATA[playerid][bSpeed],
9938 P_DATA[playerid][VIPTag],
9939 P_DATA[playerid][Incred],
9940 P_DATA[playerid][Spin],
9941 Name(playerid));
9942 DB::Query(_DB, Query);
9943 }
9944 else
9945 {
9946 printf("Account: %s doesn't exist! Server tried to save data on it!", Name(playerid));
9947 }
9948
9949
9950 format(Query, sizeof (Query),"SELECT `Key` FROM `Top` WHERE `Name` = '%s' LIMIT 1", Name(playerid));
9951
9952 new DBResult:Q_RESULT;
9953 Q_RESULT = DB::Query(_DB, Query);
9954 if(DB::Valid(Q_RESULT))
9955 {
9956 DB::Free(Q_RESULT);
9957 format(Query, sizeof (Query),"UPDATE `Top` SET `Kills` = '%d',`Deaths` = '%d',`Hours` = '%d',`Rank` = '%d',`Ratio` = '%f',`Negative` = '%d',`Positive` = '%d' WHERE `Name` = '%s'",
9958 P_DATA[playerid][Kills],
9959 P_DATA[playerid][Deaths],
9960 P_DATA[playerid][Hours],
9961 P_DATA[playerid][Rank],
9962 (Float:P_DATA[playerid][Kills] / Float:P_DATA[playerid][Deaths]),
9963 P_DATA[playerid][Negative],
9964 P_DATA[playerid][Positive],
9965 Name(playerid));
9966 DB::Free(Q_RESULT);
9967 DB::Query(_DB, Query);
9968
9969 }
9970 else
9971 {
9972 format(Query, sizeof (Query), "INSERT INTO `Top` (`Name`,`Kills`,`Deaths`,`Hours`,`Rank`,`Ratio`,`Negative`,`Positive`) VALUES('%s','%d','%d','%d','%d','%f','%d','%d')",
9973 Name(playerid),
9974 P_DATA[playerid][Kills],
9975 P_DATA[playerid][Deaths],
9976 P_DATA[playerid][Hours],
9977 P_DATA[playerid][Rank],
9978 (Float:P_DATA[playerid][Kills] / Float:P_DATA[playerid][Deaths]),
9979 P_DATA[playerid][Negative],
9980 P_DATA[playerid][Positive]);
9981
9982 DB::Query(_DB, Query);
9983
9984 }
9985 #if TRACK_ACCOUNTS == true
9986
9987 new
9988 Str[24],fStr[2_0_0_0], Player = playerid;
9989
9990 format(Str, sizeof(Str) + strlen(STATS_LOC), ""#STATS_LOC"%s.ini", Name(Player));
9991
9992 new
9993 Online[3];
9994 TotalGameTime(Player, Online[0], Online[1], Online[2]);
9995 format(fStr, 2_0_0_0, "Date: %s (saved on disconnect)\r\n------------------------------------------\r\n\
9996 Registration Date: %s\r\n\
9997 IP: %s\r\n\
9998 Account ID: %d\r\n\
9999 Level: %d\r\n\
10000 VIP: %d\r\n\
10001 Rank: %d\r\n\
10002 Commands Used: %d\r\n\
10003 Failed Commands: %d\r\n\
10004 Messages Sent: %d\r\n\
10005 Cookies: %d\r\n",
10006 zDate (),
10007 GPVSEx(Player, "AccountDate"),
10008 PlayerIP[Player],
10009 P_DATA[Player][AccID],
10010 P_DATA[Player][Level],
10011 P_DATA[Player][Vip],
10012 P_DATA[Player][Rank],
10013 P_DATA[Player][Cmds],
10014 P_DATA[Player][fCmds],
10015 P_DATA[Player][Msgs],
10016 P_DATA[Player][Cookies]);
10017 format(fStr, 2_0_0_0, "%s\
10018 Online: %d:%d:%d\r\n\
10019 Respect: %d/-%d\r\n\
10020 Money: %d\r\n\
10021 Score: %d\r\n\
10022 Deaths: %d\r\n\
10023 Kills: %d\r\n\
10024 Ratio: %.3f\r\n\
10025 Kicks Received: %d\r\n",
10026 fStr,
10027 Online[0], Online[1], Online[2],
10028 P_DATA[Player][Positive],
10029 P_DATA[Player][Negative],
10030 GetPlayerMoney(Player),
10031 GetPlayerScore(Player),
10032 P_DATA[Player][Deaths],
10033 P_DATA[Player][Kills],
10034 (Float:P_DATA[Player][Deaths] / Float:P_DATA[Player][Kills]),
10035 P_DATA[Player][Kicks]);
10036
10037 new
10038 File:Stats = fopen(Str, io_append);
10039
10040 if(Stats)
10041 {
10042 if(fexist(Str)) fwrite(Stats, "\r\n\r\n\r\n");
10043 fwrite(Stats, fStr);
10044 fclose(Stats);
10045 }
10046
10047 #endif
10048 return 1;
10049}
10050
10051RegisterPlayer(playerid, returndialog, inputtext[])
10052{
10053 if(!strlen(inputtext) || strlen(inputtext) < MIN_PASS_LEN || strlen(inputtext) > MAX_PASS_LEN)
10054 return ShowPlayerDialog
10055 (
10056 playerid,
10057 returndialog,
10058 DIALOG_STYLE_INPUT,
10059 ""W"Register an account",
10060 ""ORAN"ERROR:"W" An error has occured while trying to register the account, please try again!!\n\n\
10061 Please write your desired password.", "Register", "Kick");
10062
10063 new Buf[129], Query[500], zStr[450];
10064
10065 WP_Hash(Buf, (129), inputtext);
10066 format(Query, sizeof(Query), "INSERT INTO `Accounts` \
10067 VALUES(NULL, '%s', '%s', '%s', '00:00:00', '%s', '0', '0', \
10068 '0', '0', '2000', '0', '0', '0', '0', '0', '0', \
10069 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', \
10070 '0', '0', '%s', '%s', '%s', '0', '0', '0')", GetPlayerIPEx(playerid), Name(playerid), Buf, zDate(), inputtext, GPVSEx(playerid, "Question"), GPVSEx(playerid, "Answer"));
10071 DB::Query(_DB, Query);
10072 format(Query, sizeof(Query), "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s'", Name(playerid));
10073 new DBResult:Result = DB::Query(_DB, Query);
10074
10075 if(Result)
10076 {
10077 if(DB::Valid(Result))
10078 {
10079 new Field[15];
10080 DB::GetField(Result, "Key", Field, sizeof(Field));
10081 S_DATA[sAccounts] = strval(Field);
10082 P_DATA[playerid][AccID] = strval(Field);
10083
10084 DB::Free(Result);
10085 }
10086 }
10087
10088 #if SECURITY_QUESTION == true
10089
10090 format(zStr, sizeof (zStr), ""W"Account succesfully created!\n\n\
10091 "ORAN"["W" Account Information "ORAN"]\n\
10092 "W"Account: "BLUE"%s\n\
10093 "W"Password: "BLUE"%s\n\
10094 "W"Account ID: "BLUE"%d\n\
10095 "W"Created On: "BLUE"%s\n", Name(playerid), inputtext, S_DATA[sAccounts], zDate());
10096
10097 format(zStr, sizeof (zStr), "%s\
10098 "W"Secret Question: "BLUE"%s\n\
10099 "W"Secret Answer: "BLUE"%s\n\n\n\
10100 Thanks for registering an account.\n\
10101 Please procceed with login.", zStr, GPVSEx(playerid, "Question"), GPVSEx(playerid, "Answer"));
10102
10103 #else
10104
10105 format(zStr, sizeof (zStr), ""W"Account succesfully created!\n\n\
10106 "ORAN"["W" Account Information "ORAN"]\n\
10107 "W"Account: "BLUE"%s\n\
10108 "W"Password: "BLUE"%s\n\
10109 "W"Account ID: "BLUE"%d\n\
10110 "W"Created On: "BLUE"%s\n\n\
10111 Thanks for registering an account.\n\
10112 Please procceed with login.", Name(playerid), inputtext, S_DATA[sAccounts], zDate());
10113
10114 #endif
10115 SPD(playerid, Dialog:Login, BOX, ""W"Account Information", zStr, "Continue", "");
10116
10117 new INI:
10118 Accounts = INI_Open(USER_ID);
10119 INI_WriteInt(Accounts, "Accounts_Created", S_DATA[sAccounts]);
10120 INI_WriteString(Accounts, "Last_Account", Name(playerid));
10121 INI_WriteString(Accounts, "Last_Account_Date", zDate());
10122 INI_Close(Accounts);
10123 return 1;
10124}
10125FormatOnline(playerid)
10126{
10127 new zStr[15], T[3];
10128 TotalGameTime(playerid, T[0], T[1], T[2]);
10129 format(zStr, sizeof (zStr), "%d:%d:%d", T[0], T[1], T[2]);
10130 return zStr;
10131}
10132ClearVars(playerid)
10133{
10134 DestroyVehicle(P_DATA[playerid][GiveCar]);
10135 Delete3DTextLabel(P_DATA[playerid][Tag3D]);
10136
10137 P_DATA[playerid][Kills] = 0;
10138 P_DATA[playerid][Deaths] = 0;
10139 P_DATA[playerid][Hours] = 0;
10140 P_DATA[playerid][Rank] = 0;
10141 P_DATA[playerid][Msgs] = 0;
10142 P_DATA[playerid][Cmds] = 0;
10143 P_DATA[playerid][fCmds] = 0;
10144 P_DATA[playerid][Cookies] = 0;
10145 P_DATA[playerid][Negative] = 0;
10146 P_DATA[playerid][Positive] = 0;
10147 P_DATA[playerid][Money] = 0;
10148 P_DATA[playerid][Score] = 0;
10149 P_DATA[playerid][Banned] = 0;
10150 P_DATA[playerid][Kicks] = 0;
10151 P_DATA[playerid][Logged] = 0;
10152 P_DATA[playerid][Muted] = 0;
10153 P_DATA[playerid][Frozen] = 0;
10154 P_DATA[playerid][Jailed] = 0;
10155 P_DATA[playerid][MutedTime] = 0;
10156 P_DATA[playerid][JailTime] = 0;
10157 P_DATA[playerid][tLevel] = 0;
10158 P_DATA[playerid][PMSent] = 0;
10159 P_DATA[playerid][RepMSG] = EOS;
10160 P_DATA[playerid][Warns] = 0;
10161 P_DATA[playerid][aCar] = -1;
10162 P_DATA[playerid][pAuto] = 0;
10163 P_DATA[playerid][MutedAll] = 0;
10164 P_DATA[playerid][Accp_Saved] = 0;
10165 P_DATA[playerid][A_Color] = 0;
10166 P_DATA[playerid][A_Component1] = 0;
10167 P_DATA[playerid][A_Component2] = 0;
10168 P_DATA[playerid][A_Component3] = 0;
10169 P_DATA[playerid][A_Component4] = 0;
10170 P_DATA[playerid][A_Wheels] = 0;
10171 P_DATA[playerid][Spin] = 0;
10172 P_DATA[playerid][VIPTag] = 0;
10173
10174 P_DATA[playerid][Spec_ID] = 0xFFFF;
10175 P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_NONE;
10176}
10177
10178Public:ParseUserID(name[], value[])if(!strcmp(name, "Accounts_Created")) S_DATA[sAccounts] = strval(value);
10179
10180Public:LoadServerData(name[], value[])
10181{
10182 if(!strcmp(name, INI_Server_Info[0][isName])) S_DATA[AntiSpam] = strval(value);
10183 if(!strcmp(name, INI_Server_Info[1][isName])) S_DATA[AntiCSpam] = strval(value);
10184 if(!strcmp(name, INI_Server_Info[2][isName])) S_DATA[Ping] = strval(value);
10185 if(!strcmp(name, INI_Server_Info[3][isName])) S_DATA[RCONProt] = strval(value);
10186 if(!strcmp(name, INI_Server_Info[4][isName])) S_DATA[TellPlayer] = strval(value);
10187 if(!strcmp(name, INI_Server_Info[5][isName])) S_DATA[Chat] = strval(value);
10188 if(!strcmp(name, INI_Server_Info[6][isName])) S_DATA[ReadPM] = strval(value);
10189 if(!strcmp(name, INI_Server_Info[7][isName])) S_DATA[ReadCMD] = strval(value);
10190 if(!strcmp(name, INI_Server_Info[8][isName])) S_DATA[AKA] = strval(value);
10191 if(!strcmp(name, INI_Server_Info[9][isName])) S_DATA[ShowFunction] = strval(value);
10192 if(!strcmp(name, INI_Server_Info[10][isName])) S_DATA[AntiRepeat] = strval(value);
10193 if(!strcmp(name, INI_Server_Info[11][isName])) S_DATA[AutoLogin] = strval(value);
10194 if(!strcmp(name, INI_Server_Info[12][isName])) S_DATA[AnnRank] = strval(value);
10195 if(!strcmp(name, INI_Server_Info[13][isName])) S_DATA[AntiAD] = strval(value);
10196 if(!strcmp(name, INI_Server_Info[14][isName])) S_DATA[AdminChat] = strval(value);
10197 if(!strcmp(name, INI_Server_Info[15][isName])) S_DATA[VipChat] = strval(value);
10198}
10199
10200
10201Public:LoadPlayerData(playerid)
10202{
10203 new Query[750], DBResult:Result;
10204
10205 format(Query, 750, "SELECT `IP`, `Level`, `VIP`, \
10206 `Rank`, `Money`, `Score`, \
10207 `Kills`, `Deaths`, `Cookies`, \
10208 `Positive`, `Negative`, `Messages`, \
10209 `Commands`, `fCommands`, `Warns`, \
10210 `Kicks`, `God`, `Cargod`, \
10211 `ACCP`, `ACCPSav`, `BlockPM`, \
10212 `Key`, `Boost`, `bSpeed` `JoinDate`, `Online`, \
10213 `Spin`, `WearTAG`, `Incred` FROM `Accounts` WHERE `Name` = '%s';", Name(playerid));
10214 Result = DB::Query(_DB, Query);
10215
10216 if(Result)
10217 {
10218 if(DB::Valid(Result))
10219 {
10220 new Field[30];
10221
10222 _GetField<"Key">Store<AccID>
10223 _GetField<"Level">Store<Level>
10224 _GetField<"VIP">Store<Vip>
10225 _GetField<"Rank">Store<Rank>
10226 _GetField<"Kills">Store<Kills>
10227 _GetField<"Deaths">Store<Deaths>
10228 _GetField<"Cookies">Store<Cookies>
10229 _GetField<"Positive">Store<Positive>
10230 _GetField<"Negative">Store<Negative>
10231 _GetField<"Messages">Store<Msgs>
10232 _GetField<"Commands">Store<Cmds>
10233 _GetField<"fCommands">Store<fCmds>
10234 _GetField<"Warns">Store<Warns>
10235 _GetField<"Kicks">Store<Kicks>
10236 _GetField<"God">Store<God>
10237 _GetField<"Cargod">Store<CarGod>
10238 _GetField<"ACCPSav">Store<Accp_Saved>
10239 _GetField<"BlockPM">Store<BAPMs>
10240 _GetField<"Boost">Store<Boost>
10241 _GetField<"Spin">Store<Spin>
10242 _GetField<"WearTAG">Store<VIPTag>
10243 _GetField<"Incred">Store<Incred>
10244
10245 DB::GetField(Result, "bSpeed", Field, sizeof(Field));
10246 P_DATA[playerid][bSpeed] = floatstr(Field);
10247
10248 DB::GetField(Result, "IP", Field, sizeof(Field));
10249 PlayerIP[playerid] = Field;
10250
10251 DB::GetField(Result, "Money", Field, sizeof(Field));
10252 GivePlayerMoney(playerid, strval(Field));
10253
10254 DB::GetField(Result, "Score", Field, sizeof(Field));
10255 SetPlayerScore(playerid, GetPlayerScore(playerid) + strval(Field));
10256
10257 DB::GetField(Result, "ACCP", Field, sizeof(Field));
10258 SetPVarString(playerid, "ACCP_DATA", Field);
10259
10260 DB::GetField(Result, "Online", Field, sizeof(Field));
10261 SetPVarString(playerid, "Online", Field);
10262
10263 DB::GetField(Result, "JoinDate", Field, sizeof(Field));
10264 SetPVarString(playerid, "AccountDate", Field);
10265
10266 DB::Free(Result);
10267 }
10268 }
10269}
10270
10271Public:UnMutePlayer(playerid)
10272{
10273 --P_DATA[playerid][MutedTime];
10274
10275 if(!P_DATA[playerid][MutedTime])
10276 {
10277 KillTimer(MuteTimer[playerid]);
10278 UnMutePlayer(playerid);
10279 P_DATA[playerid][MutedTime] = 0;
10280 P_DATA[playerid][Muted] = 0;
10281
10282 SendClientMessage(playerid, -1, ""ORAN"SERVER:"W" You have been unmuted by the system!");
10283 #if SAVE_MUTE == true
10284
10285 new
10286 Query[256];
10287 format(Query, 256, "DELETE FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(playerid));
10288 DB::Query(_DB, Query);
10289
10290 #endif
10291 }
10292 else if(P_DATA[playerid][MutedTime] == 1){
10293 GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~r~~h~MUTE INFO~n~~r~~h~One~w~ minute left", 10000, 3);}
10294
10295 else if(P_DATA[playerid][MutedTime] > 1)
10296 {
10297 new Str[129];
10298 format(Str, 129, "~n~~n~~n~~n~~n~~n~~n~~n~~r~~h~MUTE INFO~n~~r~~h~%d~w~ minutes left", P_DATA[playerid][JailTime]);
10299 GameTextForPlayer(playerid, Str, 10000, 3);
10300 }
10301 return 1;
10302}
10303GPVSEx(playerid, zPVSTR[] )
10304{
10305 new zStr[129];
10306 GetPVarString(playerid, zPVSTR, zStr, 129);
10307 return zStr;
10308}
10309
10310BanEx2(playerid, zAdmin[] = "System", zReason[] = "No Reason")
10311{
10312 new
10313 zStr[256];
10314 #if SAVE_IN_LOGS == true
10315 new
10316 File:zFile;
10317
10318 format(zStr, sizeof (zStr), "Player: %s[%i] has been banned by \"%s\" with reason \"%s\" on %s\r\n",
10319 Name(playerid),
10320 playerid,
10321 zAdmin,
10322 zReason,
10323 zDate());
10324
10325
10326 zFile = fopen(BAN_LOG, io_append);
10327 if(zFile)
10328 {
10329 fwrite(zFile, zStr);
10330 fclose(zFile);
10331 }
10332 #else
10333 #pragma unused zAdmin
10334 #endif
10335
10336
10337 new Query[129];
10338 format(Query, 129, "INSERT INTO `Banlist` VALUES('%s', '%s', '%s', '%s', '%s')", GetPlayerIPEx(playerid), Name(playerid), zReason, zAdmin, zDate());
10339 FormatMSG(playerid, Color:ORAN, "SERVER:"W" You have been banned from this server! "W"["GREY" %s"W"]", zReason);
10340 KickAfter(playerid);
10341
10342
10343
10344 return 1;
10345}
10346
10347
10348
10349Public:KickAfterTimer(playerid) return Kick(playerid);
10350KickAfter(playerid, time = 1200 ){ SetTimerEx("KickAfterTimer", time, false, "i", playerid);}
10351
10352BadRcon(zIP[], zPassword[], zAdmin[] = "System", zReason[] = "RCON Login Attempt")
10353{
10354 new
10355 zStr[256];
10356 #if SAVE_IN_LOGS == true
10357 new
10358 File:zFile;
10359
10360 format(zStr, sizeof (zStr), "IP \"%s\" has been banned by \"%s\" with reason \"%s\" and password \"%s\" on %s\r\n",
10361 zIP,
10362 zAdmin,
10363 zReason,
10364 zPassword,
10365 zDate());
10366
10367
10368 zFile = fopen(RCON_LOG, io_append);
10369 if(zFile)
10370 {
10371 fwrite(zFile, zStr);
10372 fclose(zFile);
10373 }
10374 #else
10375 #pragma unused zPassword
10376 #endif
10377 format(zStr, sizeof (zStr), ""ORAN"Ban Info: "W"IP "ORAN"\"%s\""W" has been IP banned by "ORAN"\"%s\" "W"with reason"ORAN" \"%s\"",
10378 zIP,
10379 zAdmin,
10380 zReason);
10381
10382 SendMessageToAdmins(.zMessage = zStr);
10383
10384
10385 format(zStr, sizeof (zStr), "banip %s", zIP);
10386 SendRconCommand(zStr);
10387 return 1;
10388}
10389KickEx(playerid, zAdmin[] = "System", zReason[] = "No Reason", tell = true)
10390{
10391 new zStr[256];
10392 #if SAVE_IN_LOGS == true
10393 new
10394 File:zFile;
10395
10396 format(zStr, sizeof (zStr), "Player: %s[%i] has been kicked by \"%s\" with reason \"%s\" on %s\r\n",
10397 Name(playerid),
10398 playerid,
10399 zAdmin,
10400 zReason,
10401 zDate());
10402
10403
10404 zFile = fopen(KICK_LOG, io_append);
10405 if(zFile)
10406 {
10407 fwrite(zFile, zStr);
10408 fclose(zFile);
10409 }
10410 #endif
10411 if(tell)
10412 {
10413
10414 format(zStr, sizeof (zStr), ""ORAN"Kick Info: "W"Player "ORAN"%s[%i]"W" has been kicked by "ORAN"\"%s\" "W"with reason"ORAN" \"%s\"",
10415 Name(playerid),
10416 playerid,
10417 zAdmin,
10418 zReason);
10419
10420 SendMessageToAdmins(.zMessage = zStr);
10421
10422 }
10423
10424 P_DATA[playerid][Kicks] += 1;
10425
10426 new Query[120];
10427
10428 if(AccountExist(Name(playerid)))
10429 {
10430 format(Query, 120, "UPDATE `Accounts` SET `Kicks` = '%d' WHERE `Name` = '%s'", P_DATA[playerid][Kicks], Name(playerid));
10431 DB::Query(_DB, Query);
10432 }
10433
10434
10435 KickAfter(playerid);
10436 return 1;
10437}
10438
10439SendMessageToAdmins(zColor = -1, zMessage[], level = 1)
10440{
10441 foreach(Player, A)
10442 {
10443 if(P_DATA[A][Level] >= level)
10444 {
10445 SendClientMessage(A, zColor, zMessage);
10446 }
10447 }
10448 return 1;
10449}
10450
10451zDate(ms = false)
10452{
10453 new zStr[30];
10454 if(ms)
10455 {
10456 new Date[6];
10457 getdate(Date[0], Date[1], Date[2]);
10458 gettime(Date[3], Date[4], Date[5]);
10459 format(zStr, sizeof (zStr), "%d/%d/%d %d:%d:%d", Date[2], Date[1], Date[0], Date[3], Date[4], Date[5]);
10460 }
10461 else
10462 {
10463 new Date[5];
10464 getdate(Date[0], Date[1], Date[2]);
10465 gettime(Date[3], Date[4]);
10466 format(zStr, sizeof (zStr), "%d/%d/%d %d:%d", Date[2], Date[1], Date[0], Date[3], Date[4]);
10467 }
10468 return zStr;
10469}
10470
10471
10472Name(playerid)
10473{
10474 new zName[MAX_PLAYER_NAME];
10475 GetPlayerName(playerid, zName, MAX_PLAYER_NAME);
10476 return zName;
10477}
10478
10479TotalGameTime(playerid, &h=0, &m=0, &s=0)
10480{
10481 P_DATA[playerid][TotalTime] = ((gettime() - P_DATA[playerid][ConnTime]) + (P_DATA[playerid][Hours]*60*60) + (P_DATA[playerid][Minutes]*60) + (P_DATA[playerid][Seconds]));
10482
10483 h = floatround(P_DATA[playerid][TotalTime] / 3600, floatround_floor);
10484 m = floatround(P_DATA[playerid][TotalTime] / 60, floatround_floor) % 60;
10485 s = floatround(P_DATA[playerid][TotalTime] % 60, floatround_floor);
10486
10487 return P_DATA[playerid][TotalTime];
10488}
10489
10490
10491Public:VehicleOccupied(v)
10492{
10493 foreach(Player, i)
10494 {
10495 if(IsPlayerInVehicle(i, v)) return 1;
10496 }
10497 return 0;
10498}
10499SendError(playerid, error[])
10500{
10501 new Str[256];
10502 format(Str, sizeof (Str), "* "GREY"%s", error);
10503 SendClientMessage(playerid, Color:ORAN, Str);
10504 return 1;
10505}
10506SendUsage(playerid, usage[], function[] = "don't send function" )
10507{
10508 new Str[256];
10509 format(Str, sizeof (Str), "Usage: {FFFFFF} %s", usage);
10510 SendClientMessage(playerid, Color:GREE, Str);
10511 if(strcmp(function, "don't send function") && S_DATA[ShowFunction])
10512 {
10513 format(Str, sizeof (Str), "Function: {FFFFFF} %s", function);
10514 SendClientMessage(playerid, Color:FUNC, Str);
10515 }
10516
10517 return 1;
10518}
10519MiniFormat(number, extra[] = ";")
10520{
10521 new fStr[256];
10522 if(strcmp(extra, ";"))format(fStr, sizeof (fStr), "%d %s", number, extra);
10523 else format(fStr, sizeof (fStr), "%d", number);
10524 return fStr;
10525}
10526
10527EX(ex)
10528{
10529 new ex2[10];
10530 format(ex2, sizeof (ex2), "Yes | %d", ex);
10531 return ex2;
10532}
10533stock IsValidSkin(SkinID)
10534{
10535 switch(SkinID)
10536 {
10537 case 0..41: return 1; case 43..64: return 1; case 66..73: return 1;
10538 case 75..85: return 1; case 87..118: return 1; case 120..148: return 1;
10539 case 150..207: return 1; case 209..264: return 1; case 274..288: return 1;
10540 case 290..299: return 1;
10541 default: return 0;
10542 }
10543 return 0;
10544}
10545IsValidWeapon(weaponid)
10546{
10547 switch(weaponid)
10548 {
10549 case 1..18: return 1;
10550 case 22..46: return 1;
10551 }
10552 return 0;
10553}
10554GetVModelFromName(vName[])
10555{
10556 for (new i = 400; i <= 611; i++)
10557 if(strfind(vNames[i - 400], vName, true) != -1)
10558 return i;
10559
10560 return -1;
10561}
10562GetWeaponIDFromName(WeaponName[])
10563{
10564 if(strfind("molotov", WeaponName, true) !=-1) return 18;
10565 for (new i = 0; i <= 46; i++)
10566 {
10567 switch(i)
10568 {
10569 case 0, 19, 20, 21, 44, 45: continue;
10570 default:
10571 {
10572 new name[32]; GetWeaponName(i, name, 32);
10573 if(strfind(name, WeaponName, true) != -1)
10574 return i;
10575 }
10576 }
10577 }
10578 return -1;
10579}
10580stock GetServerHostName()
10581{
10582 new gString[128];
10583 GetServerVarAsString("hostname", gString, sizeof(gString));
10584 return gString;
10585}
10586stock IsNumeric(string[])
10587{
10588 for (new i = 0, j = strlen(string);i < j; i++)
10589 {
10590 if(string[i] > '9' || string[i] < '0')
10591 return 0;
10592 }
10593 return 1;
10594}
10595stock
10596 FormatNumber(
10597 { _, Float, Text3D, Menu, Text, DB, DBResult, bool, File, hex, bit, bit_byte, Bit }:xVariable, iDecimals = -1, iThousandSeparator = ',', iDecimalPoint = '.', iTag = tagof(xVariable))
10598{
10599 static
10600 s_szReturn[32],
10601 s_szThousandSeparator[2] = { ' ', EOS },
10602 s_iDecimalPos,
10603 s_iChar,
10604 s_iSepPos
10605 ;
10606
10607 if(iTag == tagof(bool:))
10608 {
10609 if(xVariable)
10610 memcpy(s_szReturn, "true", 0, 5 * (cellbits / 8));
10611 else
10612 memcpy(s_szReturn, "false", 0, 6 * (cellbits / 8));
10613
10614 return s_szReturn;
10615 }
10616 else if(iTag == tagof(Float:))
10617 {
10618 if(iDecimals == -1)
10619 iDecimals = 8;
10620
10621 format(s_szReturn, sizeof(s_szReturn), "%.*f", iDecimals, xVariable);
10622 }
10623 else if(iTag == tagof(hex:) || iTag == tagof(Hex:))
10624 {
10625 format(s_szReturn, sizeof(s_szReturn), "0x" "%04h%04h", (xVariable & (0xFFFF0000)) >>> 16, xVariable & (0x0000FFFF));
10626
10627 return s_szReturn;
10628 }
10629 else if(iTag == tagof(bit:) || iTag == tagof(Bit:))
10630 {
10631 format(s_szReturn, sizeof(s_szReturn), "0b" "%08b%08b%08b%08b", (xVariable & 0xFF000000) >>> 24, (xVariable & 0x00FF0000) >>> 16, (xVariable & 0x0000FF00) >>> 8, (xVariable & 0x000000FF));
10632
10633 return s_szReturn;
10634 }
10635 else if(iTag == tagof(bit_byte:))
10636 {
10637 format(s_szReturn, sizeof(s_szReturn), "0b" "%08b", (xVariable & 0x000000FF));
10638
10639 return s_szReturn;
10640 }
10641 else
10642 {
10643 format(s_szReturn, sizeof(s_szReturn), "%d", xVariable);
10644
10645 if(iDecimals > 0)
10646 {
10647 strcat(s_szReturn, ".");
10648
10649 while (iDecimals--)
10650 strcat(s_szReturn, "0");
10651 }
10652 }
10653
10654 s_iDecimalPos = strfind(s_szReturn, ".");
10655
10656 if(s_iDecimalPos == -1)
10657 s_iDecimalPos = strlen(s_szReturn);
10658 else
10659 s_szReturn[s_iDecimalPos] = iDecimalPoint;
10660
10661 if(s_iDecimalPos >= 4 && iThousandSeparator)
10662 {
10663 s_szThousandSeparator[0] = iThousandSeparator;
10664
10665 s_iChar = s_iDecimalPos;
10666 s_iSepPos = 0;
10667
10668 while (--s_iChar > 0)
10669 {
10670 if(++s_iSepPos == 3)
10671 {
10672 strins(s_szReturn, s_szThousandSeparator, s_iChar);
10673
10674 s_iSepPos = 0;
10675 }
10676 }
10677 }
10678 return s_szReturn;
10679}
10680
10681stock AccountExist(name[])
10682{
10683 new Buffer[240], Entry, DBResult:Result;
10684
10685 format(Buffer, sizeof(Buffer), "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s'",name);
10686 Result = DB::Query(_DB, Buffer);
10687
10688 if(Result)
10689 {
10690 if(DB::Valid(Result))
10691 {
10692 Entry = 1;
10693 DB::Free(Result);
10694 }
10695 else Entry = 0;
10696 }
10697 return Entry;
10698}
10699Public:Display()
10700{
10701 print("\n\n\n\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124");
10702 print("\124\124\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\124\124");
10703 print("\124\124\t \48\65\100\109\105\110 \118"#Version"\t\t\124\124");
10704 print("\124\124\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\124\124");
10705 print("\124\124\t\t\t\t\124\124");
10706 print("\124\124\t\77\97\100\101 \98\121 \90\104\51\114\48\t\t\124\124");
10707 print("\124\124\t\t\t\t\124\124");
10708 print("\124\124\t\76\111\97\100\101\100 \83\117\99\99\101\115\102\117\108\108\121\t\124\124");
10709 print("\124\124\t\t\t\t\124\124");
10710 printf("\124\124\t%s\t\t\124\124", zDate());
10711 print("\124\124\t\t\t\t\124\124");
10712 print("\124\124\t\84\121\112\101 \33\104\101\108\112 \105\110 \99\111\110\115\111\108\101\t\124\124");
10713 print("\124\124\t\t\t\t\124\124");
10714 print("\124\124\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\t\124\124");
10715 print("\124\124 \75\101\101\112 \116\104\101 \99\114\101\100\105\116\115\33 \124\t\124\124");
10716 print("\124\124\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\t\124\124");
10717 print("\124\124\t\t\t\t\124\124");
10718 print("\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\n\n\n");
10719}