· 9 years ago · Aug 18, 2017, 03:02 PM
1#if defined _0_A_d_m_i_n_
2
3 =======================================================================
4/* 0Admin - Administration filterscript.
5 Created over a period of 2 months.
6 With the most unique features ever. */
7
8
9 - 0Admin was planned to be the most unique admin script ever, beating the
10 existing one on performance and realiability.
11 The goal was achieved, I've used the best ways to build this script.
12 It uses SQLite, and Y_Ini in the same time for performance.
13 The command processor is ZCMD and I've used SSCANF to gain the best
14 performance you could get at the moment.
15 Using Regular Expresions(RegEx) for a better search. Examples are the:
16 Anti-Advertising functions.
17
18 **************
19 ** You may not sell this script under any circumstances.
20 For personal use only.
21 ** You may edit this script on your like. But don't claim it as yours.
22 ** Do whatever YOU LIKE! But don't sell or change credits.
23 ** Respect these rules!
24 **************
25 =======================================================================
26
27------------------------------(Level 0 [Member])--------------------------------/*
28 - The member, is just a player playing on without any
29 superior abilities. */
30
31 /register - Register an account in the database.
32 /login - Login into account.
33 /stats - View your stats.
34 /pm - Send a personal message.
35 /admins - View online Administrators.
36 /vips - View online VIP Members.
37 /top - View the top. Best kills, deaths, most hours online etc.
38 /cookies - Show your current cookies amount.
39 /buycookiejar - Buy some cookies!
40 /eatcookie - Eat cookie, gain health.
41 /giftcookie - Gift a cookie to a player!
42 /cookieshelp - More information about the cookies system.
43
44----------------------------(Level 1 [Helper])----------------------------------/*
45 - The Helper has the role to maintain PLEASURE on server.
46 - To ensure players got what they need, as time, weather. */
47
48 /goto - Go to someone's position.
49 /gotopos - Go to the position set, x, y, z.
50 /getip - Get someone's IP Adress.
51 /settime - Set someone's time.
52 /spawn - Spawn a player.
53 /acar - Spawn your personal Admin car.
54 /accp - Tune your admin car. Components, colors, nitro.
55 Save coponents, load components, discard components.
56 /jailed - View jailed players and the jail time.
57 /frozen - View frozem players.
58 /muted - View muted players and the mute time.
59
60------------------------(Level 2 [Mini Moderator])------------------------------/*
61 - The mini moderator serves as help when the superiors are offline.
62 - His job is to keep quiet if there's a fight.
63 - To keep away hackers by disarming them or removing money. */
64
65 /disarm - Remove someone's weapons.
66 /bankrupt - Remove someone's money.
67 /tplayer - Teleport a player to another player.
68 /eject - Eject a player from the vehicle.
69 /heal - Heal yourself.
70 /spec - Spectate a player.
71 /specoff - Stop spectating a player.
72 /show - Send a game text to the specified player.
73 /setskin - Set someone's skin.
74 /[un]freeze - Freeze or unfreeze the specified player.
75 /[un]mute - Mute or unmute a player with specified time.
76 /aweapons - Give yourself the best weapons.
77 /healcar - Heal someone's car.
78 /setvhealth - Set someone's vehicle health.
79 /carcolor - Change someone's vehicle colors.
80
81----------------------------(Level 3 [Moderator])-------------------------------/*
82 - The Moderator has the role to keep clean. Clean from idiots and
83 spammers, make sure the chat is CLEAR when someone fights.
84 - The moderator can warn a player for bad behaviour.
85 - He can jail or Unjail a specified player.
86 - He can manipulate players data, cookies, score, money, skin etc.. */
87
88 /giveweapon - Give someone a weapon with specified ammo.
89 /warn - Warn a player, at 3 warns player will be kicked!
90 /healall - Heall all players on the server.
91 /heal - Heal a specified player.
92 /aweapons - Give yourself some weapons.
93 /givecar - Give someone a car.
94 /write - Write something in the chat, without name in front.
95 /destroyv - Destroy a vehicle ID.
96 /[un]jail - Jail or Unjail a specified player.
97 /slap - Slap a player make him loose -25 health.
98 /clearchat - Clear the chat.
99 /akill - Kill a player.
100 /explode - Explode a player.
101 /setalltime - Set everyone's time.
102 /setallweather - Set everyone's weather.
103
104 - The below commands are self explanatory.
105 /set(cookies|health|armour|score|cash|skin|time|weather|world|interior|drunk|respect|wanted)
106
107--------------------------(Level 4 [Administrator])-----------------------------/*
108 - Doesn't have a specified role, he can pretty much do whatever he likes.
109 - His actions may not be judged.
110 - Can manipulate everyone's data. */
111
112 - Set everyone's x .
113 /setall(health|armour|score|cash|skin|world|interior|drunk|cookies|respect|wanted)
114
115 - Give everyone x.
116 /giveall(health|armour|score|cash|cookies|wanted|weapon)
117
118 /kick - Kick a player from the server.
119 /wcheck - Check a player's weapons.
120 /setdeaths - Set someone's deaths.
121 /setkills - Set someone's kills.
122 /2012 - Fuck up someone's game, 0 money, 0 score, 0 everything.
123 /resetallrespect- Change everyone's respect. Negatie and Positive.
124 /killall - Kill everyone on the server.
125 /[un]muteall - Mute/Unmute everyone, this mute won't save!
126 /[un]freezeall - Freeze/Unfreeze all, this freeze won't save!
127 /spawnall - Spawn all players.
128 /2012all - Fuck up everyone's game!
129 /chat - You can manipulate the chat. Spam it, clear it, [un]block it.
130 /slapall - Slap everyone!
131 /disarmall - Disarm everyone in the server.
132 /explodeall - Explode everone.
133
134-------------------------------(Level 5 [Owner])--------------------------------/*
135 - He is the boss, the boss of everyone, he can do whatever he likes!!!
136 - He can ban you, LIKE A BOSS!
137 - He can change you, LIKE A BOSS!
138 - He can delete you, LIKE A BOSS! */
139
140 /setlevel - Change someone's level.
141 /settemplevel - Set someone's temporary level, on disconnect, level will be reseted.
142 /ban - Ban a player.
143 /unban - Unban a player, remove his name from the banlist in the database.
144 /acp - Open a dialog where you can manipulate server features. Such as, antispam, anti-ad etc.
145 /respawncars - Respawn all unoccupied vehicles in the server.
146 /removeacc - Delete a player's account from the database.
147 /setonline - Change someone's online time.
148 /setstat - Open a dialog where you can manipulate a specified ID.
149 /fake - Show the fake list commands.
150 /fakechat - Send a fake chat of a certain user.
151 /fakecmd - Send a fake command, or make him execute a command.
152 /fakecon - Send a face connection to the server.
153 /fakedisc - Send a fake disconnection from the server.
154 /fakedeath - Send a fake death.
155 /kickall - Kick everyone from the server.
156
157#endif
158//Main Include
159#include <a_samp>
160
161
162 /*-----------------------------------------------
163 Don't change this otherwise whirlpool won't work!*/
164 #define MAX_INI_ENTRY_TEXT 130
165 #undef MAX_PLAYER_NAME
166 #define MAX_PLAYER_NAME 24
167 /*-----------------------------------------------*/
168
169//Includes
170#include < YSI/Y_ini >
171#include < sscanf2 >
172#include < zcmd >
173#include < foreach >
174#include < regex >
175#include <0Admin_F>
176//#include YSI/y_scripting
177
178//Version of the script.
179#define Version "1.0"
180
181#pragma dynamic 46500
182//Colors:
183#define ORAN "{FF5500}"
184#define GREE "{94ED40}"
185#define BLUE "{4097ED}"
186#define W "{FFFFFF}"
187#define red 0xFF0000AA
188#define GREY "{C3C3C3}"
189
190
191//Tags:
192#define Dialog: _:DIALOG_
193#define Color: _:COL_
194
195
196//Shortcuts
197#define D: = 906 //If you have Dialog Problems, please change here, the higher, the better!
198#define PARAMS playerid, params[]
199#define SPD ShowPlayerDialog
200#define LIST DIALOG_STYLE_LIST
201#define INPUT DIALOG_STYLE_INPUT
202#define BOX DIALOG_STYLE_MSGBOX
203#define CaseDialog<%0> case(Dialog:%0):
204#define iDialog<%0> if(dialogid == Dialog:%0)
205#define GetVehicleName(%0) vNames[(%0) - 400]
206#define Freeze(%0) TogglePlayerControllable((%0), false)
207#define UnFreeze(%0) TogglePlayerControllable((%0), true)
208#define Col(%0,%1) ChangeVehicleColor(GetPlayerVehicleID(playerid), (%0), ((%0) & (zC = %1)))
209#define db_GetField DB::get_field_assoc
210#define db_Query DB::query
211#define db_Free DB::free_result
212#define db_Valid DB::num_rows
213#define DB:: db_
214
215/*
216=======================================
217==| Bellow choose your own settings |==
218=======================================
219*/
220
221//-*------
222#define SAVE_IN_LOGS true /*true - It will save on file when player gets kicked/banned/muted etc..
223 false - It won't save.*/
224//-*------
225#define SAVE_MUTE true /*true - Mute with mute time will be saved and on connect it will be re-applied!
226 false - Mute won't be saved and it will be disabled on connect/disconnect*/
227//-*------
228#define SAVE_FREEZE true /*true - Player will be frozen after re-connect
229 false - Player will be able to move after reconnection.*/
230//-*------
231#define SAVE_JAIL true /*true - Player after reconection will be jailed for the amount of time set
232 false - Player after reconnection won't go to jail!*/
233//-*------
234#define USE_RANKS true /*true - Tell player when reaching x kills his new rank!
235 false - Don't use ransk at all!*/
236//-*------
237#define PRINT_RANKS false /* true - Will print the created rank names in the console.
238 false - Will do the opposite! Won't show them in console!*/
239//-*------
240#define UPDATE_TOP_ALWAYS true /*true - The top x players file will be update once a kill/death or whatever stat is, has occured.
241 false - It will update only on disconnect.*/
242//-*------
243#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
244 false - Not gonna happen! Only when admin uses !stats <id> in console or /rcon !stats id in game.*/
245
246//ATTENTION: KEEP THE SYMBOM INSIDE ' '.
247#define ADMIN_CHAT_SYMBOL '@' //Choose symbol1 to let vip members talk among them. Use same symbol on both for 1 usage.
248#define ADMIN_CHAT_SYMBOL2 '#' //Choose symbol2 to let vip members talk among them. Use same symbol on both for 1 usage.
249#define VIP_CHAT_SYMBOL '*' //Choose symbol1 to let Admins talk among them. Use same symbol on both for 1 usage.
250#define VIP_CHAT_SYMBOL2 '$' //Choose symbol2 to let Admins talk among them. Use same symbol on both for 1 usage.
251
252//Start defining here the way you like!
253#define MIN_PASS_LEN (4) //Minimum characters a password must have. (On register)
254#define MAX_PASS_LEN (20) //Maximum characters a password must have. (On register)
255#define MAX_PASS_FAIL (4) //Define how many tries a player has to login.
256#define MAX_RCON_ATTEMPTS 3 //Define how many tries a player must have to enter the right RCON Password.
257#define MIN_PING_LIMIT 100 //Minimum ping an admin must enter on the cPanel, category, "Ping Kicker"
258#define MAX_PING_LIMIT 3000 //Maximum ping an admin must enter on the cPanel, category, "Ping Kicker"
259#define IPGKICK 1 //Minimun level for admin to not be kicked by the Ping Kicker.
260#define LOW_SPAM_RATE (1300) //Each how many seconds the spam rate drops
261#define GOD_TICK_RATE (500) //Once every x ms/seconds the god will update. (If causes lag increase number)
262#define MINIMUM_SPAM (5) //Minimum spam message for the anti-spam to be triggered!
263#define MEDIUM_SPAM (10) //Medium spam messages for the player to be kicked for spamming.
264#define MAXIMUM_SPAM (16) //Maximum spam messages for the player to be BANNED for spamming.
265#define MIN_CMD_SPAM (7) //Minimun commands spam for the player to be kicked for commands spamming.
266#define MAX_CMD_SPAM (16) //Maximum commands spam for the player to be BANNED for commands spamming
267#define MAX_COOKIE_COST 95 //How much a cookie costs!
268#define MAX_P_WARNS 3 //Max warns for the player to achieve to get kicked!
269#define MAX_TOP_LIMIT 15 //Max how many players will be shown in the top x players!
270#define MAX_SHOW_PER_ROW 6 //Define here how many players should be shoed on /vips /admins /muted etc per row!
271#define MAX_RANK_LEN (50) //Define here the max rank name lenght!
272#define EXTRA_MINUTES 15 /*Define how many +minutes of mute or jail the player will receive
273 after evading with a different IP but same name, or same IP but different name*/
274//Files
275#define LOGS_LOC "0Admin/Logs/" //The location where the server will print a log of a ban/kick
276#define KICK_LOG "0Admin/Logs/KickLog.ini" //Naming the Kick Log
277#define BAN_LOG "0Admin/Logs/BanLog.ini" //Naming the Ban Log
278#define RCON_LOG "0Admin/Logs/RCONFails.ini" //Printing in the log what IP tried to break the RCON and with what password!
279#define REPORT_LOG "0Admin/Logs/Reports.ini" //Where the report logs will be saved
280#define SETRANK_LOG "0Admin/Logs/SetRank.ini" //A log where it will store the player that has changed rank etc..
281#define SETLEVEL_LOG "0Admin/Logs/SetLevel.ini" //A log where it will store the player that has changed level etc..
282#define SETVIP_LOG "0Admin/Logs/SetVip.ini" //A log where it will store the player that has changed vip etc..
283#define PMS_LOG "0Admin/Logs/PMs.ini" //Where all Personal Messages will be stored!
284#define WARNS_LOG "0Admin/Logs/Warns.ini" //Where the warns will be stored!
285#define VIPCHAT_LOG "0Admin/Logs/VIP Chat.ini" //Here saves everything admins chat trough the Admin Chat.
286#define ADMINCHAT_LOG "0Admin/Logs/Admin Chat.ini" //Here stores all the messages sent by VIP members
287#define USER_ID "0Admin/Account_ID.ini" //Saving how many accounts have been created and which was the last one
288#define AKA_FILE "0Admin/AKA.ini" //Sacing the AKA(Also Known As) of a player!
289#define SERVER_FILE "0Admin/SVSettings.ini" //The server data, where Autologin Antispam anti whatever will asve!
290#define DATABASE_LOC "0Admin/Database.db" //Define here where the database with the top x players and muted/jaled/frozen
291#define STATS_LOC "0Admin/Stats/" //Where the file of the player creates when admins uses !stats <id> in console.
292
293//For the /SETSTAT command
294#define NAME 0
295#define MONEY 1
296#define SCORE 2
297#define COOKIES 3
298#define RESPECT 4
299#define KILLS 5
300#define DEATHS 6
301#define MESSAGES 7
302#define COMMANDS 8
303#define FCOMMANDS 9
304#define ONLINE 10
305#define LEVEL 11
306#define VLEVEL 12
307#define CPASS 13
308#define BACCOUNT 14
309#define DACCOUNT 15
310
311#define ADMIN_SPEC_TYPE_NONE 0
312#define ADMIN_SPEC_TYPE_PLAYER 1
313#define ADMIN_SPEC_TYPE_VEHICLE 2
314
315
316//Shortcuts
317
318#define CreateTable(%0,%1,%2)\
319 DB::Query((%0), "CREATE TABLE IF NOT EXISTS " "`"%1"`" %2)
320
321
322//----------------------------------------
323#define Public:%0(%1) forward %0(%1);\
324 public %0(%1)
325
326//----------------------------------------
327#define FormatMSG(%0,%1,%2,%3)\
328 do{\
329 format(_S_T_R_, sizeof (_S_T_R_), (%2), %3);\
330 SendClientMessage((%0),(%1), _S_T_R_);\
331 }\
332 while (False)
333
334//----------------------------------------
335#define SendAdminCMD(%0,%1,%2)\
336 do{\
337 foreach(Player, zI){\
338 if(P_DATA[zI][Level]> 1){\
339 if(zI != (%0)){\
340 format(_S_T_R_, sizeof (_S_T_R_), (%1), %2);\
341 SendClientMessage(zI,Color:GREY, _S_T_R_);\
342 }\
343 }\
344 }\
345 }\
346 while (False)
347
348//----------------------------------------
349#define LevelCheck(%0,%1)\
350 do{\
351 if(P_DATA[(%0)][Level] < (%1) && !IsPlayerAdmin((%0))){\
352 if(S_DATA[TellPlayer]){\
353 new Str[256];\
354 format(Str, 256, "SERVER:"W" You must be an admin level "ORAN"%d"W" to use this command!", (%1));\
355 return SendClientMessage((%0), Color:ORAN, Str);\
356 }else return 0;\
357 }\
358 }\
359 while(False)
360
361//----------------------------------------
362#define LoginCheck(%0) \
363 do{\
364 if(!P_DATA[(%0)][Logged])\
365 {\
366 if(S_DATA[TellPlayer])\
367 {\
368 if(!P_DATA[%0][Registered])return SendClientMessage((%0), Color:ORAN, "SERVER:"W" You must have an account in to use this command!");\
369 else return SendClientMessage((%0), Color:ORAN, "SERVER:"W" You must be logged in to use this command!");\
370 }else return 0;\
371 }\
372 }\
373 while(False)
374
375//----------------------------------------
376#define SaveInLog(%0,%1,%2) \
377 do\
378 {\
379 new File:_File = fopen((%0), io_append);\
380 format(_S_T_R_, sizeof (_S_T_R_), %1 "\r\n", %2);\
381 if((_File))\
382 {\
383 fwrite((_File), _S_T_R_);\
384 fclose((_File));\
385 }\
386 }\
387 while(False)
388
389//----------------------------------------
390#define FileExist(%0);\
391 if(!fexist(%0))\
392 {\
393 printf("MISSING FILE: \"%s\" doesn't exist, created by the system", %0);\
394 new File:uFile = fopen(%0, io_write); fclose(uFile);\
395 Fail = true;\
396 }
397
398//----------------------------------------
399#define CheckImune(%0,%1); \
400 if(P_DATA[(%0)][Level] < P_DATA[(%1)][Level]) \
401 return SendError(%0, "You are not allowed to use this command on this admin!");
402
403//----------------------------------------
404#define VipCheck(%0, %1); \
405 if(P_DATA[(%0)][Vip] < %1 && !IsPlayerAdmin(%0)) \
406 return format(_S_T_R_, 256, "SERVER:"W" You must be a VIP level "ORAN"%d"W" to use this command!", %0),\
407 SendClientMessage((%0), Color:ORAN, _S_T_R_);
408
409//----------------------------------------
410#define CheckComponents(%0,%1)\
411 if(!strcmp(GPVSEx((%0), "Type"), "None") && !P_DATA[(%0)][A_Component1] &&\
412 !P_DATA[(%0)][A_Component2] && !P_DATA[(%0)][A_Component3] &&\
413 !P_DATA[(%0)][A_Component4] && !P_DATA[(%0)][A_Wheels] &&\
414 !P_DATA[(%0)][A_Color])\
415 return SendError((%0), %1),cmd_accp((%0), "")
416
417//----------------------------------------
418#define PRESSED(%0) \
419 (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
420
421//----------------------------------------
422#define RELEASED(%0) \
423 (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
424
425//----------------------------------------
426#define OpenWriteClose(%0,%1,%2,%3);\
427 {\
428 new INI:%1 = INI_Open((%0));\
429 INI_WriteInt((%1), %2, (%3));\
430 INI_Close((%1));\
431 }
432//----------------------------------------
433#define _0CMD(%0) \
434 if(!strcmp(cmd, "!0" %0, true))
435
436//----------------------------------------
437#define Triadic(%0)\
438 (%0) ? ("Enabled") : ("Disabled")
439
440//----------------------------------------
441#define CONSOLE(%0) \
442 if(!strcmp(cmd, (%0), true, .length = strlen((%0))))
443
444//----------------------------------------
445#define PrintError(%0) \
446 print("\n----------------\n" %0 "\n----------------\n")
447
448//----------------------------------------
449#define PrintErrorEx(%0,%1) \
450 printf("\n----------------\n" %0 "\n----------------\n", %1)
451
452//----------------------------------------
453#define loop(%0,%1) \
454 for(new _%0; (_%0) != (%1); (_%0)++)
455
456//----------------------------------------
457#define _GetField<%0>Store<%1>\
458 DB::GetField(Result, %0, (Field), sizeof((Field)));\
459 P_DATA[playerid][%1] = strval(Field);
460
461//----------------------------------------
462#define Show(%0) \
463 ShowPlayerDialog(playerid, Dialog:Empty, BOX, ""W"Your Commands:", (%0), "Close", "")
464
465//----------------------------------------
466#define Detour<%0,%1> \
467 CMD:%0(PARAMS) return cmd_%1(playerid, "");
468
469native WP_Hash(buffer[], len, const str[]);
470
471stock
472 bool:False = false,
473 _S_T_R_[256];
474
475enum
476 Colors
477 {
478 COL_ORAN = 0xFF5500FF,
479 COL_GREY = 0xC3C3C3FF,
480 COL_GREE = 0xADEB50FF,
481 COL_FUNC = 0xFFA640FF,
482 COL_BLUE = 0x4097EDFF,
483 COL_WHITE = -1
484 };
485
486enum
487 Dialogs
488 {
489 Dialog:Register D:+1, Dialog:Register1 D:+2,
490 Dialog:Login D:+3, Dialog:Login2 D:+4,
491 Dialog:Login3 D:+5, Dialog:Stats D:+6,
492 Dialog:cPanel D:+7, Dialog:cPanel_Back D:+8,
493 Dialog:cPanel_Ping D:+9, Dialog:cPanel2 D:+10,
494 Dialog:Empty D:+11, Dialog:ACCP D:+12,
495 Dialog:ACCP_NOS D:+13, Dialog:ACCP_COLORS D:+14,
496 Dialog:ACCP_C_C D:+15, Dialog:ACCP_WHEELS D:+16,
497 Dialog:ACCP_COMPS D:+17, Dialog:ACCP_SAVE D:+18,
498 Dialog:ACCP_LOAD D:+19, Dialog:ACCP_DISCARD D:+20,
499 Dialog:SetStatsSure D:+21, Dialog:SetStatsTrue D:+22,
500 Dialog:TOP D:+23, Dialog:TOP_SELECT D:+24,
501 Dialog:TOP_RESPECT D:+25, Dialog:CLICK D:+26,
502 Dialog:CLICK_PM D:+27, Dialog:CLICK_RP D:+28,
503 Dialog:CLICK_MONEY D:+29, Dialog:CLICK_REPORT D:+30,
504 Dialog:PCP D:+31, Dialog:NAME D:+32,
505 Dialog:MONEY D:+33, Dialog:SCORE D:+34,
506 Dialog:COOKIES D:+35, Dialog:RESPECT D:+36,
507 Dialog:KILLS D:+37, Dialog:DEATHS D:+38,
508 Dialog:MESSAGES D:+39, Dialog:COMMANDS D:+40,
509 Dialog:FCOMMANDS D:+41, Dialog:ONLINE D:+42,
510 Dialog:LEVEL D:+43, Dialog:VLEVEL D:+44,
511 Dialog:CPASS D:+45, Dialog:BACCOUNT D:+46,
512 Dialog:DACCOUNT D:+47, Dialog:RESPECT_NEG D:+48,
513 Dialog:RESPECT_POS D:+49, Dialog:ONLINE_H D:+50,
514 Dialog:ONLINE_M D:+51, Dialog:ONLINE_S D:+52,
515 Dialog:SAnswer D:+53, Dialog:SAnswer2 D:+54,
516 Dialog:SQuestion D:+55, Dialog:ForgPass D:+56,
517 Dialog:PCPBack D:+57, Dialog:PCPShout D:+58
518
519 };
520enum
521 P_ENUM_DATA
522 {
523 Money, Score, MutedAll, Level,
524 Vip, Rank, Msgs, Cmds,
525 fCmds, Kills, Deaths, Negative,
526 Positive, God, CarGod, Boost,
527 Banned, Kicks, LogFail, Logged,
528 Muted, Frozen, Jailed, cmgddon,
529 Hours, Minutes, Seconds, TotalTime,
530 ConnTime, AccID, MutedTime, JailTime,
531 SpamMSG, cSpam, tLevel, PMSent,
532 RepMSG[128], Warns, Cookies, aCar,
533 pAuto, GiveCar, Spec_ID, Spec_Type,
534 NosTimer, Accp_Saved, A_Color, Spin,
535 A_Component1, A_Component2, A_Component3, A_Component4,
536 A_Wheels, Incred, BAPMs, Registered,
537 VIPTag, Text3D:Tag3D, Float:bSpeed
538 };
539enum
540 S_ENUM_DATA
541 {
542 AntiSpam, AntiCSpam, Ping, sAccounts,
543 RconFails, RCONProt, TellPlayer, Chat,
544 ReadPM, ReadCMD, AKA, ShowFunction,
545 AntiRepeat, AutoLogin, AnnRank, AntiAD,
546 sCMDS, sMSGS, sCrashes, sDisc,
547 sConn, sKB, sPlayers, sRecord,
548 sD, sM, sY, RecordBy[MAX_PLAYER_NAME],
549 sH, sMi, sS, VipChat,
550 AdminChat
551 };
552
553enum INI_Enum_NV { iName[15], iValue };
554enum INI_Server_Enum_NV { isName[15], isValue };
555enum WHEELS_E { iWheel, iwName[15] };
556enum vCOLORS_E { ivColor, ivcRGB[9], ivcName[15] };
557enum vCOMPONENTS_E { iComponent, icName[20] };
558enum RANKS_E { iRank, irName[MAX_RANK_LEN] };
559
560
561new
562 bool:Fail = false;
563
564
565new
566 DB:_DB,
567 PlayerIP[MAX_PLAYERS][50],
568 P_DATA[MAX_PLAYERS][P_ENUM_DATA],
569 S_DATA[S_ENUM_DATA],
570 MuteTimer[MAX_PLAYERS],
571 JailTimer[MAX_PLAYERS],
572 PlayerText3D:ZaAdminCar[MAX_PLAYERS],
573 StatsString[800],
574 WhosStats[129],
575
576 _Levels[][] =
577 {
578 { "Member" },
579 { "Helper" },
580 { "Mini Moderator" },
581 { "Moderator" },
582 { "Administrator" },
583 { "Owner" }
584 },
585
586 #if USE_RANKS == true
587
588 //When you add/remove a rank, count each rank and insert here the number:
589 #define TOTAL_RANKS (12)
590
591 _Ranks[TOTAL_RANKS][RANKS_E] =
592 {
593/* Kills Rank Name */
594 { 0, "Looser" },
595 { 25, "Easy Killa'" },
596 { 50, "Baby Killer" },
597 { 75, "e-Gangsta" },
598 { 100, "Boss" },
599 { 150, "Lil' Psycho" },
600 { 200, "Psycho" },
601 { 300, "Unstopable" },
602 { 400, "Elite Killer" },
603 { 600, "Godlike killer!" },
604 { 800, "INSANE KILLER" },
605 { 1000, "The God of Deathmatch" }//Last row must NOT have the ','
606 },
607 #endif
608
609 ACCP_Components[7][vCOMPONENTS_E] =
610 {
611/* Model Component Name */
612 { 1019, "Twin Exhaust" },
613 { 1018, "Upswept Exhaust" },
614 { 1001, "Win Spoiler" },
615 { 1023, "Fury Spoiler" },
616 { 1003, "Alpha Spoiler" },
617 { 1087, "Hydraulics" },
618 { 1017, "Skirt" }
619 },
620
621 ACCP_Colors[16][vCOLORS_E] =
622 {
623/* CarCol RRGGBB Color Name */
624 { 1, "{FFFFFF}", "White" },
625 { 0, "{000000}", "Black" },
626 { 2, "{2a77a1}", "Light Blue" },
627 { 3, "{840510}", "Dark Red" },
628 { 25, "{253739}", "Dark Grey" },
629 { 85, "{87446f}", "Soft Magenta" },
630 { 6, "{d68f11}", "Orange" },
631 { 109, "{bdbdc5}", "Grey" },
632 { 49, "{d6dbd5}", "White Grey" },
633 { 86, "{34603f}", "Green" },
634 { 113, "{5f272a}", "Brown" },
635 { 126, "{ed6aae}", "Pinky" },
636 { 51, "{305045}", "Dark Green" },
637 { 12, "{5e7e8d}", "Soft Blue" },
638 { 102, "{ab9d83}", "Easy Color" },
639 { 65, "{8f8c47}", "Ugly Green" }
640 },
641
642
643 Wheels[17][WHEELS_E] =
644 {
645/* Model Wheel Name */
646 { 1_025, "Offroad" },
647 { 1_073, "Shadow" },
648 { 1_074, "Mega" },
649 { 1_075, "Rimshine" },
650 { 1_076, "Wires" },
651 { 1_077, "Classic" },
652 { 1_078, "Twist" },
653 { 1_079, "Cutter" },
654 { 1_080, "Switch" },
655 { 1_081, "Grove" },
656 { 1_082, "Import" },
657 { 1_083, "Dollar" },
658 { 1_084, "Trance" },
659 { 1_085, "Atomic" },
660 { 1_096, "Ahab" },
661 { 1_097, "Virtual" },
662 { 1_098, "Access" }
663 },
664 SpamColors[35] =
665 {
666 0xFBBA00FF, 0xB4B5B7AA, 0xAFAFAFAA, 0x0000BBAA, 0x800080AA,
667 0x000000AA, 0x33AA33AA, 0xA52A2AAA, 0xFFA00AFF, 0xFF560AFF,
668 0xFFD8B0FF, 0xFFD876FF, 0xFFBF3BFF, 0xFFC628FF, 0xFF4D28FF,
669 0xFFFF28FF, 0xC0C0C0AA, 0xFFDD80FF, 0x00DD37FF, 0x2C2727AA,
670 0xC968FCFF, 0xC9C0FCFF, 0xA790FCFF, 0x0097FFFF, 0xFF6463FF,
671 0x00DDFFFF, 0x00DDFF15, 0xC500FFFF, 0x33AA33AA, 0x00DD37FF
672 },
673 INI_Server_Info[16][INI_Server_Enum_NV] =
674 {
675/* Feature Value */
676 { "AntiSpam", 1 },
677 { "AntiCMDSpam", 1 },
678 { "MaxPing", 750 },
679 { "RconProtect", 1 },
680 { "TellPlayer", 1 },
681 { "BlockChat", 0 },
682 { "ReadPMs", 0 },
683 { "ReadCommands", 0 },
684 { "AKA", 1 },
685 { "ShowFunction", 1 },
686 { "AntiRepeat", 1 },
687 { "AutoLogin", 0 },
688 { "AnnRank", 1 },
689 { "AntiAdv", 1 },
690 { "AdminChat", 1 },
691 { "VipChat", 1 }
692 },
693 vNames[212][] =
694 {
695 {"Landstalker"}, {"Bravura"}, {"Buffalo"}, {"Linerunner"}, {"Perrenial"}, {"Sentinel"}, {"Dumper"},
696 {"Firetruck"}, {"Trashmaster"}, {"Stretch"}, {"Manana"}, {"Infernus"}, {"Voodoo"}, {"Pony"}, {"Mule"},
697 {"Cheetah"}, {"Ambulance"}, {"Leviathan"}, {"Moonbeam"}, {"Esperanto"}, {"Taxi"}, {"Washington"},
698 {"Bobcat"}, {"Mr Whoopee"}, {"BF Injection"}, {"Hunter"}, {"Premier"}, {"Enforcer"}, {"Securicar"},
699 {"Banshee"}, {"Predator"}, {"Bus"},{"Rhino"}, {"Barracks"}, {"Hotknife"}, {"Trailer 1"}, {"Previon"},
700 {"Coach"}, {"Cabbie"}, {"Stallion"}, {"Rumpo"}, {"RC Bandit"}, {"Romero"}, {"Packer"}, {"Monster"},
701 {"Admiral"}, {"Squalo"}, {"Seasparrow"}, {"Pizzaboy"}, {"Tram"}, {"Trailer 2"}, {"Turismo"},
702 {"Speeder"}, {"Reefer"}, {"Tropic"}, {"Flatbed"}, {"Yankee"}, {"Caddy"}, {"Solair"}, {"Berkley's RC Van"},
703 {"Skimmer"}, {"PCJ-6_0_0"}, {"Faggio"}, {"Freeway"}, {"RC Baron"}, {"RC Raider"}, {"Glendale"}, {"Oceanic"},
704 {"Sanchez"}, {"Sparrow"}, {"Patriot"}, {"Quad"}, {"Coastguard"}, {"Dinghy"}, {"Hermes"}, {"Sabre"},
705 {"Rustler"}, {"ZR-3_5_0"}, {"Walton"}, {"Regina"}, {"Comet"},{"BMX"}, {"Burrito"}, {"Camper"}, {"Marquis"},
706 {"Baggage"}, {"Dozer"}, {"Maverick"}, {"News Chopper"}, {"Rancher"}, {"FBI Rancher"}, {"Virgo"}, {"Greenwood"},
707 {"Jetmax"}, {"Hotring"}, {"Sandking"}, {"Blista Compact"}, {"Police Maverick"},{"Boxville"}, {"Benson"},
708 {"Mesa"}, {"RC Goblin"}, {"Hotring Racer A"}, {"Hotring Racer B"},{"Bloodring Banger"},{"Rancher"},
709 {"Super GT"}, {"Elegant"}, {"Journey"}, {"Bike"}, {"Mountain Bike"}, {"Beagle"}, {"Cropdust"}, {"Stunt"},
710 {"Tanker"}, {"Roadtrain"}, {"Nebula"}, {"Majestic"}, {"Buccaneer"}, {"Shamal"}, {"Hydra"}, {"FCR-900"},
711 {"NRG-500"}, {"HPV1000"}, {"Cement Truck"}, {"Tow Truck"}, {"Fortune"}, {"Cadrona"}, {"FBI Truck"},
712 {"Willard"}, {"Forklift"}, {"Tractor"}, {"Combine"}, {"Feltzer"}, {"Remington"}, {"Slamvan"},
713 {"Blade"}, {"Freight"}, {"Streak"}, {"Vortex"}, {"Vincent"}, {"Bullet"}, {"Clover"}, {"Sadler"},
714 {"Firetruck LA"}, {"Hustler"}, {"Intruder"}, {"Primo"}, {"Cargobob"}, {"Tampa"}, {"Sunrise"}, {"Merit"},
715 {"Utility"}, {"Nevada"}, {"Yosemite"}, {"Windsor"}, {"Monster A"}, {"Monster B"}, {"Uranus"}, {"Jester"},
716 {"Sultan"}, {"Stratum"}, {"Elegy"}, {"Raindance"}, {"RC Tiger"}, {"Flash"}, {"Tahoma"}, {"Savanna"},
717 {"Bandito"}, {"Freight Flat"}, {"Streak Carriage"}, {"Kart"}, {"Mower"}, {"Duneride"}, {"Sweeper"},
718 {"Broadway"}, {"Tornado"}, {"AT-400"}, {"DFT-30"}, {"Huntley"}, {"Stafford"}, {"BF-400"}, {"Newsvan"},
719 {"Tug"}, {"Trailer 3"}, {"Emperor"}, {"Wayfarer"}, {"Euros"}, {"Hotdog"}, {"Club"}, {"Freight Carriage"},
720 {"Trailer 3"}, {"Andromada"}, {"Dodo"}, {"RC Cam"}, {"Launch"}, {"Police Car LSPD"},{"Police Car SFPD"},
721 {"Police _LVPD"}, {"Police Ranger"}, {"Picador"}, {"SWAT. Van"}, {"Alpha"}, {"Phoenix"}, {"Glendale"},
722 {"Sadler"}, {"Luggage Trailer A"}, {"Luggage Trailer B"}, {"Stair Trailer"},{"Boxville"}, {"Farm Plow"},
723 {"Utility Trailer"}
724
725 };
726 #if USE_RANKS == true
727
728 new
729 _RankNames[sizeof(_Ranks)][MAX_RANK_LEN];
730
731 #endif
732
733
734
735public OnFilterScriptInit()
736{
737 if(fexist("0Admin/"))
738 {
739 #if SAVE_IN_LOGS == true
740 if(fexist(LOGS_LOC))
741 {
742 FileExist(VIPCHAT_LOG);
743 FileExist(ADMINCHAT_LOG);
744 FileExist(WARNS_LOG);
745 FileExist(PMS_LOG);
746 FileExist(SETRANK_LOG);
747 FileExist(SETLEVEL_LOG);
748 FileExist(SETVIP_LOG);
749 FileExist(KICK_LOG);
750 FileExist(BAN_LOG);
751 FileExist(RCON_LOG);
752 FileExist(REPORT_LOG);
753 }
754 else print("MISSING FOLDER: Folder \""#LOGS_LOC"\" doesn't exist! Please create it!"),
755 Fail = true;
756
757 #endif
758
759 FileExist(AKA_FILE);
760 if(!fexist(USER_ID))
761 {
762 printf("MISSING FILE: \""#USER_ID"\" doesn't exist, created by the system");
763 new File:uFile = fopen(USER_ID, io_append);
764 if(uFile)
765 {
766 fwrite(uFile, "Accounts_Created = 0\r\nLast_Account = None\r\nLast_Account_Date = Never");
767 fclose(uFile);
768 }
769 Fail = true;
770 }
771
772 if(!fexist(STATS_LOC))
773 {
774 print("MISSING FOLDER: Folder \""#STATS_LOC"\" doesn't exist! Please create it!");
775 Fail = true;
776 }
777 }else print("MISSING FOLDER: The main folder \"/0Admin/\" is missing from the \"scriptfiles\""),
778 Fail = true;
779
780 _DB = db_open(DATABASE_LOC);
781
782 new String[750];
783 strcat(String, "CREATE TABLE IF NOT EXISTS `Accounts` ", 750);
784 strcat(String, "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, \
785 `IP` TEXT, \
786 `Name` TEXT, \
787 `Password` TEXT, \
788 `Online` TEXT, \
789 `JoinDate` TEXT, \
790 `Level` NUMERIC, \
791 `VIP` NUMERIC, \
792 `Rank` NUMERIC, \
793 `Autologin` NUMERIC, \
794 `Money` NUMERIC, \
795 `Score` NUMERIC, \
796 `Kills` NUMERIC, \
797 `Deaths` NUMERIC, \
798 `Cookies` NUMERIC, \
799 `Positive` NUMERIC, \
800 `Negative` NUMERIC, \
801 `Messages` NUMERIC, \
802 `Commands` NUMERIC, \
803 `fCommands` NUMERIC, \
804 `Warns` NUMERIC, \
805 `Kicks` NUMERIC, \
806 `God` NUMERIC, \
807 `Cargod` NUMERIC,", 750);
808
809 strcat(String, " `ACCP` NUMERIC, \
810 `ACCPSav` TEXT, \
811 `BlockPM` NUMERIC, \
812 `Boost` NUMERIC, \
813 `bSpeed` NUMERIC, \
814 `RPassword` TEXT, \
815 `Question` TEXT, \
816 `Answer` TEXT, \
817 `Registered` NUMERIC,\
818 `WearTAG` NUMERIC, \
819 `Spin` NUMERIC, \
820 `Incred` NUMERIC)", 750);
821
822 DB::Query(_DB, String);
823 CreateTable(_DB, "Top", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `Name` TEXT,`Kills` NUMERIC,`Deaths` NUMERIC,`Hours` NUMERIC,`Rank` NUMERIC,`Ratio` TEXT,`Negative` NUMERIC,`Positive` NUMERIC)");
824
825 #if SAVE_MUTE == true
826 CreateTable(_DB, "Muted", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `IP` TEXT,`Muted` NUMERIC,`Time` NUMERIC,`RealName` TEXT)");
827 #endif
828
829 #if SAVE_JAIL == true
830 CreateTable(_DB, "Jailed", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `IP` TEXT,`Jailed` NUMERIC,`Time` NUMERIC,`RealName` TEXT)");
831 #endif
832
833 #if SAVE_FREEZE == true
834 CreateTable(_DB, "Frozen", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `IP` TEXT,`Frozen` NUMERIC,`RealName` TEXT)");
835 #endif
836
837 CreateTable(_DB, "Banlist", "(`IP` TEXT,`Name` TEXT, `Reason` TEXT, `Admin` TEXT, `BanDate` TEXT)");
838 CreateTable(_DB, "Positive", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `Name` TEXT,`Expiration` TEXT)");
839 CreateTable(_DB, "Negative", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `Name` TEXT,`Expiration` TEXT)");
840 CreateTable(_DB, "ServerStats", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `Commands`,`Messages`,`Crashes`,`Quits`,`Kicks/Bans`,`Connections`,`Uptime`)");
841 CreateTable(_DB, "Record", "(`Players`,`Date`,`Time`,`By`,`DateOLD`,`TimeOLD`,`ByOLD`)");
842
843 new
844 DBResult: R1;
845
846 R1 = DB::Query(_DB, "SELECT `Players`, `Date`, `Time`, `By` FROM `Record`");
847
848 if(R1)
849 {
850 if(DB::Valid(R1))
851 {
852 new Field[64];
853
854 DB::GetField(R1, "Players", Field, 64);
855 S_DATA[sRecord] = strval(Field);
856
857 DB::GetField(R1, "Date", Field, 64);
858 sscanf(Field, "p</>iii", S_DATA[sD], S_DATA[sM], S_DATA[sY]);
859
860 DB::GetField(R1, "Time", Field, 64);
861 sscanf(Field, "p<:>iii", S_DATA[sH], S_DATA[sMi], S_DATA[sS]);
862
863 DB::GetField(R1, "By", Field, 64);
864 format(S_DATA[RecordBy], MAX_PLAYER_NAME, "%s", Field);
865
866 DB::Free(R1);
867 }
868 else
869 {
870 DB::Free(R1);
871 DB::Query(_DB, "INSERT INTO `Record` VALUES('0','0/0/0','0:0:0','Nobody','0/0/0','0:0:0','Nobody')");
872 }
873 }
874 SetTimer("PingKick", 2000, true);
875 SetTimer("LowerSpam", LOW_SPAM_RATE, true);
876 SetTimer("GodLike", GOD_TICK_RATE, true);
877
878
879 INI_ParseFile(USER_ID, "ParseUserID" );
880 INI_ParseFile(SERVER_FILE, "LoadServerData");
881
882 if(S_DATA[Ping] < 100 && S_DATA[Ping] != 0)
883 {
884 new RandomPing = 600 + random(300);
885 printf("WARNING: Ping Kicker was under 100, randomly set to: %d", RandomPing);
886 S_DATA[Ping] = (RandomPing);
887 }
888 #if USE_RANKS == true
889
890 #if PRINT_RANKS == true
891
892 print("Ranks created succesfully!\n----------------------------");
893
894 #endif
895 for (new r = 0; r < sizeof(_Ranks); r++)
896 {
897 format(_RankNames[r], MAX_RANK_LEN, "%s", _Ranks[r][irName]);
898 #if PRINT_RANKS == true
899
900 printf("Rank: %s | Kills requiered: %d", _RankNames[r], _Ranks[r][iRank]);
901
902 #endif
903 }
904
905 #endif
906
907 if(Fail == true)
908 {
909 print(#\n\n\nWARNING:);
910 print(#----------------\n- When a file is missing","# the system will create it.);
911 print(#- However","# if you get a folder error","# you must create the folder on your own!);
912 print(#- If a folder or a file is deleted while the server runs","# problems may occur!\n\n);
913 }
914 if(fexist("/0Admin/"))
915 {
916 if(!fexist(SERVER_FILE))
917 {
918 printf("MISSING FILE: \""#SERVER_FILE"\" doesn't exist, created by the system");
919 print("Thew following atributions have been added to the following features:");
920
921 new INI:ServerFile = INI_Open(SERVER_FILE),
922 pStr[512];
923 print("\n==========================================");
924 print("||\tFeature\t\tState\tValue\t||");
925 print("||--------------------------------------||");
926
927 for(new i = 0; i < sizeof(INI_Server_Info); ++i)
928 {
929 INI_WriteInt(ServerFile, INI_Server_Info[i][isName], INI_Server_Info[i][isValue]);
930 format(pStr, sizeof (pStr), "||\t%s%s| %s%s",
931 INI_Server_Info[i][isName],
932 (i == 2 || i == 6 || i == 8 || i == 12 || i == 13 || i == 15) ? ("\t\t") : ("\t"),
933 (INI_Server_Info[i][isValue]) ? ((i == 2) ? (EX(INI_Server_Info[i][isValue])) : ("Yes")) : ("No"),
934 (INI_Server_Info[i][isValue]) ? ((i == 2) ? ("\t||") : ("\t\t||")) : ("\t\t||"));
935 print(pStr);
936 }
937
938 print("==================\t\t\t||");
939 print("\t\t|| Copyright jejemonerz123 2011 ||");
940 print("\t\t==========================\n\n\n");
941 INI_Close(ServerFile);
942 INI_ParseFile(SERVER_FILE, "LoadServerData");
943 }
944 }
945 if(!Fail) SetTimer("Display", 800, 0);
946
947
948 /*new
949 cmdBuffer[32],
950 commandCount;
951
952 for(new it = 0; it < Scripting_GetPublicsCount(); it++) {
953 Scripting_GetPublic(it, cmdBuffer);
954
955 if(!strcmp(cmdBuffer, "cmd_", false, 4)) {
956 strdel(cmdBuffer, 0, 4);
957 strins(cmdBuffer, "/", 0);
958 strins(cmdBuffer, "\r\n", strlen(cmdBuffer));
959 printf(#%d. %s, it - 47, cmdBuffer);
960 new File:F = fopen("Cmds.txt", io_append);
961
962 if(F)
963 {
964 fwrite(F, cmdBuffer);
965 fclose(F);
966 }
967
968 commandCount++;
969 }
970 }
971 printf(#A total of %d commands, commandCount);*/
972 return 1;
973}
974stock CountZCMDCmds() {
975 new
976 cmdBuffer[32],
977 commandCount;
978
979 for(new it = 0; it < Scripting_GetPublicsCount(); it++) {
980 Scripting_GetPublic(it, cmdBuffer);
981
982 if(!strcmp(cmdBuffer, "cmd_", false, 4)) {
983 commandCount++;
984 }
985 }
986
987 return commandCount;
988}
989public OnFilterScriptExit()
990{
991
992 db_close(_DB);
993
994 if(fexist(SERVER_FILE))
995 {
996 new INI:ServerFile = INI_Open(SERVER_FILE);
997
998 INI_WriteInt(ServerFile, INI_Server_Info[0][isName], S_DATA[AntiSpam]);
999 INI_WriteInt(ServerFile, INI_Server_Info[1][isName], S_DATA[AntiCSpam]);
1000 INI_WriteInt(ServerFile, INI_Server_Info[2][isName], S_DATA[Ping]);
1001 INI_WriteInt(ServerFile, INI_Server_Info[3][isName], S_DATA[RCONProt]);
1002 INI_WriteInt(ServerFile, INI_Server_Info[4][isName], S_DATA[TellPlayer]);
1003 INI_WriteInt(ServerFile, INI_Server_Info[5][isName], S_DATA[Chat]);
1004 INI_WriteInt(ServerFile, INI_Server_Info[6][isName], S_DATA[ReadPM]);
1005 INI_WriteInt(ServerFile, INI_Server_Info[7][isName], S_DATA[ReadCMD]);
1006 INI_WriteInt(ServerFile, INI_Server_Info[8][isName], S_DATA[AKA]);
1007 INI_WriteInt(ServerFile, INI_Server_Info[9][isName], S_DATA[ShowFunction]);
1008 INI_WriteInt(ServerFile, INI_Server_Info[10][isName], S_DATA[AntiRepeat]);
1009 INI_WriteInt(ServerFile, INI_Server_Info[11][isName], S_DATA[AutoLogin]);
1010 INI_WriteInt(ServerFile, INI_Server_Info[12][isName], S_DATA[AnnRank]);
1011 INI_WriteInt(ServerFile, INI_Server_Info[13][isName], S_DATA[AntiAD]);
1012 INI_WriteInt(ServerFile, INI_Server_Info[14][isName], S_DATA[AdminChat]);
1013 INI_WriteInt(ServerFile, INI_Server_Info[15][isName], S_DATA[VipChat]);
1014 INI_Close(ServerFile);
1015 }
1016 return 1;
1017}
1018public OnRconCommand(cmd[])
1019{
1020 new
1021 Player, P2, Reason[129];
1022
1023
1024 if(!strcmp(cmd, ">", true, .length = 1))
1025 {
1026 if(!sscanf(cmd[1], "s[129]", Reason))
1027 {
1028 FormatMSG(0, Color:BLUE, "SG: "W"%s", Reason);
1029 }
1030 }
1031 CONSOLE("!stats")
1032 {
1033 if(!sscanf(cmd[6], "uD(0)", Player, P2))
1034 {
1035 if(Player != (0xFFFF))
1036 {
1037 new
1038 Str[24],fStr[500];
1039
1040 format(Str, sizeof(Str) + strlen(STATS_LOC), ""#STATS_LOC"%s.ini", Name(Player));
1041
1042
1043 format(fStr, sizeof (fStr), "Date: %s\r\n------------------------------------------\r\n\
1044 Registration Date: %s\r\n\
1045 IP: %s\r\n\
1046 Account ID: %d\r\n\
1047 Level: %d\r\n\
1048 VIP: %d\r\n\
1049 Rank: %d\r\n\
1050 Commands Used: %d\r\n\
1051 Failed Commands: %d\r\n\
1052 Messages Sent: %d\r\n\
1053 Cookies: %d\r\n\
1054 Online: %s\r\n\
1055 Respect: %d/-%d\r\n\
1056 Money: %d\r\n\
1057 Score: %d\r\n\
1058 Deaths: %d\r\n\
1059 Kills: %d\r\n\
1060 Ratio: %.3f\r\n\
1061 Kicks Received: %d\r\n",
1062 zDate (),
1063 GPVSEx(Player, "AccountDate"),
1064 PlayerIP[Player],
1065 P_DATA[Player][AccID],
1066 P_DATA[Player][Level],
1067 P_DATA[Player][Vip],
1068 P_DATA[Player][Rank],
1069 P_DATA[Player][Cmds],
1070 P_DATA[Player][fCmds],
1071 P_DATA[Player][Msgs],
1072 P_DATA[Player][Cookies],
1073 FormatOnline(Player),
1074 P_DATA[Player][Positive],
1075 P_DATA[Player][Negative],
1076 GetPlayerMoney(Player),
1077 GetPlayerScore(Player),
1078 P_DATA[Player][Deaths],
1079 P_DATA[Player][Kills],
1080 (Float:P_DATA[Player][Deaths] / Float:P_DATA[Player][Kills]),
1081 P_DATA[Player][Kicks]);
1082
1083
1084
1085 if(P2 > 0) print(fStr);
1086 printf("\n---------------------------------------------------------------------\n\
1087 # %s's stats saved inside\n\n# "STATS_LOC"%s.ini\n\n# Open for his account details.\n\
1088 ---------------------------------------------------------------------\n\
1089 Type !stats <id> 1 to see them in the console.", Name(Player), Name(Player));
1090 new
1091 File:Stats = fopen(Str, io_append);
1092
1093 if(Stats)
1094 {
1095 if(fexist(Str)) fwrite(Stats, "\r\n\r\n\r\n");
1096 fwrite(Stats, fStr);
1097 fclose(Stats);
1098 }
1099 }
1100 else PrintError("Player not connected!");
1101 }
1102 else PrintError("Invalid Syntax");
1103 }
1104 CONSOLE("!warn")
1105 {
1106 if(!sscanf(cmd[5], "u", Player))
1107 {
1108 if(Player != (0xFFFF))
1109 {
1110 ++P_DATA[Player][Warns];
1111
1112 if(P_DATA[Player][Warns] != MAX_P_WARNS){
1113 printf(" >>> You warned %s. (Warn Level: %d/"#MAX_P_WARNS")", Name(Player), P_DATA[Player][Warns]);}
1114
1115 else if(P_DATA[Player][Warns] >= MAX_P_WARNS){
1116 P_DATA[Player][Warns] = 0,
1117 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]);}
1118
1119 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]);
1120 SendAdminCMD(Player, "Owner of the server warned player %s. ("ORAN"%d"GREY"/"ORAN""#MAX_P_WARNS")", Name(Player), P_DATA[Player][Warns]);
1121 }
1122 else PrintError("Player not connected!");
1123 }
1124 else PrintError("Invalid Syntax");
1125 }
1126 CONSOLE("!2012")
1127 {
1128 if(!sscanf(cmd[5], "u", Player))
1129 {
1130 if(Player != (0xFFFF))
1131 {
1132 for (new w = 0; w < 11; w++)
1133 {SetPlayerSkillLevel(Player, w, 0);}
1134
1135 SetPlayerHealth(Player, 0.1); SetPlayerArmour(Player, 0.0);
1136 SetPlayerTime(Player, 0, 0); SetPlayerWeather(Player, -66);
1137 SetPlayerWantedLevel(Player, 6); SetPlayerSkin(Player, 159);
1138 ResetPlayerWeapons(Player); GivePlayerWeapon(Player, 10, 1);
1139 ResetPlayerMoney(Player); SetPlayerScore(Player, 0);
1140 SetPlayerDrunkLevel(Player, 99999);
1141
1142 printf(" >>> You fucked up %s's game!.", Name(Player));
1143 SendClientMessage(Player, Color:GREY, "You have been fucked up by the owner of the server!");
1144 SendAdminCMD(Player, "Owner of the server fucked up player %s", Name(Player));
1145
1146 new
1147 String[MAX_PLAYER_NAME];
1148
1149 format(String, MAX_PLAYER_NAME, "[NUB]%s", Name(Player));
1150 if(strfind(Name(Player), "[NUB]", false, 0)) SetPlayerName(Player, String);
1151 }
1152 else PrintError("Player not connected!");
1153 }
1154 else PrintError("Invalid Syntax");
1155 }
1156 CONSOLE("!kill")
1157 {
1158 if(!sscanf(cmd[5], "u", Player))
1159 {
1160 if(Player != (0xFFFF))
1161 {
1162 SetPlayerHealth(Player, 0.0);
1163
1164 printf(" >>> You killed %s.", Name(Player));
1165 SendClientMessage(Player, Color:GREY, "You have been killed by the owner of the server!");
1166 SendAdminCMD(Player, "Owner of the server killed player %s", Name(Player));
1167 }
1168 else PrintError("Player not connected!");
1169 }
1170 else PrintError("Invalid Syntax");
1171 }
1172 CONSOLE("!setonline")
1173 {
1174 new
1175 T[3];
1176 if(!sscanf(cmd[10], "udD(0)D(0)", Player, T[0], T[1], T[2]))
1177 {
1178 if(Player != (0xFFFF))
1179 {
1180 if(T[1] > 60 || T[1] < 0) return PrintError("Invalid minutes!");
1181 if(T[2] > 60 || T[2] < 0) return PrintError("Invalid seconds!");
1182
1183 P_DATA[Player][Hours] = T[0];
1184 P_DATA[Player][Minutes] = T[1];
1185 P_DATA[Player][Seconds] = T[2];
1186
1187 P_DATA[Player][ConnTime] = gettime();
1188
1189 printf(" >>> You set %s's online time to %d:%d:%d.",Name(Player), T[0], T[1], T[2]);
1190 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]);
1191 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]);
1192 }
1193 else PrintError("Player not connected!");
1194 }
1195 else PrintError("Invalid Syntax");
1196 }
1197 CONSOLE("!spawn")
1198 {
1199 if(!sscanf(cmd[6], "u", Player))
1200 {
1201 if(Player != (0xFFFF))
1202 {
1203 SpawnPlayer(Player);
1204
1205 printf(" >>> You spawned %s.", Name(Player));
1206 SendClientMessage(Player, Color:GREY, "You have been spawned by the owner of the server!");
1207 SendAdminCMD(Player, "Owner of the server spawned player %s", Name(Player));
1208 }
1209 else PrintError("Player not connected!");
1210 }
1211 else PrintError("Invalid Syntax");
1212 }
1213 CONSOLE("!unfreeze")
1214 {
1215 if(!sscanf(cmd[9], "u", Player))
1216 {
1217 if(Player != (0xFFFF))
1218 {
1219 if(P_DATA[Player][Frozen])
1220 {
1221 P_DATA[Player][Frozen] = 0;
1222 UnFreeze(Player);
1223
1224 #if SAVE_FREEZE == true
1225
1226 new Query[256], DBResult:Result;
1227 format(Query, 256, "SELECT `Key` FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
1228 Result = DB::Query(_DB, Query);
1229
1230 if(Result)
1231 {
1232 if(DB::Valid(Result))
1233 {
1234 DB::Free(Result);
1235 format(Query, 256, "DELETE FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
1236 DB::Query(_DB, Query);
1237 }
1238 else DB::Free(Result);
1239 }
1240
1241 #endif
1242
1243 printf(" >>> You unfroze %s.", Name(Player));
1244 SendClientMessage(Player, Color:GREY, "You have been unfrozen by the owner of the server!");
1245 SendAdminCMD(Player, "Owner of the server unfrozen player %s", Name(Player));
1246 }
1247 else PrintError("Player is is not frozen!");
1248 }
1249 else PrintError("Player not connected!");
1250 }
1251 else PrintError("Invalid Syntax");
1252 }
1253 CONSOLE("!freeze")
1254 {
1255 if(!sscanf(cmd[7], "u", Player))
1256 {
1257 if(Player != (0xFFFF))
1258 {
1259 if(!P_DATA[Player][Frozen])
1260 {
1261 P_DATA[Player][Frozen] = 1;
1262 Freeze(Player);
1263
1264 #if SAVE_FREEZE == true
1265
1266 new
1267 Query[256],
1268 DBResult:R1;
1269 format(Query, sizeof(Query), "SELECT `Key` FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
1270 R1 = DB::Query(_DB, Query);
1271
1272 if(R1)
1273 {
1274 if(!DB::Valid(R1))
1275 {
1276 DB::Free(R1);
1277 format(Query, sizeof(Query), "INSERT INTO `Frozen` VALUES(NULL, '%s', '1', '%s')",GetPlayerIPEx(Player), Name(Player));
1278 DB::Query(_DB, Query);
1279 }
1280 else
1281 {
1282 DB::Free(R1);
1283 format(Query, sizeof(Query), "UPDATE `Frozen` SET `Frozen` = '1', `RealName` = '%s' WHERE `IP` = '%s'", Name(Player), GetPlayerIPEx(Player));
1284 DB::Query(_DB, Query);
1285 }
1286 }
1287
1288 #endif
1289
1290 printf(" >>> You froze %s.", Name(Player));
1291 SendClientMessage(Player, Color:GREY, "You have been frozen by the owner of the server!");
1292 SendAdminCMD(Player, "Owner of the server froze player %s", Name(Player));
1293 }
1294 else PrintError("Player is already frozen!");
1295 }
1296 else PrintError("Player not connected!");
1297 }
1298 else PrintError("Invalid Syntax");
1299 }
1300 CONSOLE("!unmute")
1301 {
1302 if(!sscanf(cmd[7], "u", Player))
1303 {
1304 if(Player != (0xFFFF))
1305 {
1306 if(P_DATA[Player][Muted])
1307 {
1308 P_DATA[Player][Muted] = 0;
1309 P_DATA[Player][MutedTime] = 0;
1310
1311 KillTimer(MuteTimer[Player]);
1312
1313 #if SAVE_MUTE == true
1314
1315 new
1316 Query[256];
1317 format(Query, 256, "DELETE FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
1318 DB::Query(_DB, Query);
1319
1320 #endif
1321
1322 printf(" >>> You unmuted %s.", Name(Player));
1323 SendClientMessage(Player, Color:GREY, "You have been unmuted by the owner of the server!");
1324 SendAdminCMD(Player, "Owner of the server unmuted player %s", Name(Player));
1325 }
1326 else PrintError("Player is not muted!");
1327 }
1328 else PrintError("Player not connected!");
1329 }
1330 else PrintError("Invalid Syntax");
1331 }
1332 CONSOLE("!mute")
1333 {
1334 if(!sscanf(cmd[5], "uD(0)", Player, P2))
1335 {
1336 if(Player != (0xFFFF))
1337 {
1338 if(!P_DATA[Player][Muted])
1339 {
1340
1341 if(!P2)
1342 {
1343 P_DATA[Player][Muted] = 1;
1344 P_DATA[Player][MutedTime] = 0;
1345
1346
1347 #if SAVE_MUTE == true
1348
1349 new
1350 pQue[256];
1351
1352 format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
1353 new DBResult:R1 = DB::Query(_DB, pQue);
1354
1355 if(R1)
1356 {
1357 if(!DB::Valid(R1))
1358 {
1359 DB::Free(R1);
1360 format(pQue, sizeof (pQue), "INSERT INTO `Muted` VALUES(NULL, '%s', '1', '0', '%s')", GetPlayerIPEx(Player), Name(Player));
1361 DB::Query(_DB, pQue);
1362 }
1363 else
1364 {
1365 DB::Free(R1);
1366 format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '0', `RealName` = '%s' WHERE `IP` = '%s'", Name(Player), GetPlayerIPEx(Player));
1367 DB::Query(_DB, pQue);
1368 }
1369 }
1370
1371 #endif
1372 printf(" >>> You muted %s forever", Name(Player));
1373 SendAdminCMD(INVALID_PLAYER_ID, "The owner of the server muted player "ORAN"%s[%i]"GREY" forever.", Name(Player), Player);
1374 SendClientMessage(Player, Color:GREY, "You have been muted forever by the owner of the server!");
1375 }
1376 else
1377 {
1378 P_DATA[Player][Muted] = 1;
1379
1380 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);
1381 FormatMSG(Player, Color:GREY, "You have been muted by the owner of the server! "W"["GREE"Time: "W"%d"GREY" seconds"W"]", P2);
1382
1383 #if SAVE_MUTE == true
1384
1385 new
1386 pQue[256];
1387
1388 format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
1389 new DBResult:R1 = DB::Query(_DB, pQue);
1390
1391 if(R1)
1392 {
1393 if(!DB::Valid(R1))
1394 {
1395 DB::Free(R1);
1396 format(pQue, sizeof (pQue), "INSERT INTO `Muted` VALUES(NULL, '%s', '1', '%d', '%s')", GetPlayerIPEx(Player), P2, Name(Player));
1397 DB::Query(_DB, pQue);
1398 }
1399 else
1400 {
1401 DB::Free(R1);
1402 format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '%d', `RealName` = '%s' WHERE `IP` = '%s'", P2, Name(Player), GetPlayerIPEx(Player));
1403 DB::Query(_DB, pQue);
1404 }
1405 }
1406
1407 #endif
1408 printf(" >>> You muted %s for %d seconds!", Name(Player), P2);
1409
1410 KillTimer(MuteTimer[Player]);
1411 MuteTimer[Player] = SetTimerEx("UnMutePlayer", P2, true, "i", Player);
1412 P_DATA[Player][MutedTime] = P2;
1413 }
1414 }else PrintError("Player is already muted!");
1415 }
1416 else PrintError("Player not connected!");
1417 }
1418 else PrintError("Invalid Syntax");
1419 }
1420 CONSOLE("!ban")
1421 {
1422 if(!sscanf(cmd[4], "uS(No Reason)[129]", Player, Reason))
1423 {
1424 if(Player != (0xFFFF))
1425 {
1426 printf(" >>> You banned %s from the server", Name(Player));
1427 printf(" >>> REASON: %s", Reason);
1428 SendClientMessage(Player, Color:GREY, " * You have been banned from the server by the owner. ");
1429 FormatMSG(Player, Color:BLUE, "REASON: "W"%s", Reason);
1430 SendAdminCMD(INVALID_PLAYER_ID, ""BLUE"%s"GREY" has been banned from the server by the server owner!", Name(Player));
1431 BanEx2(Player, "CONSOLE OWNER", Reason);
1432 }
1433 else PrintError("Player not connected!");
1434 }
1435 else PrintError("Invalid Syntax");
1436 return 1;
1437 }
1438 CONSOLE("!kick")
1439 {
1440 if(!sscanf(cmd[5], "uS(No Reason)[129]", Player, Reason))
1441 {
1442 if(Player != (0xFFFF))
1443 {
1444 printf(" >>> You kicked %s from the server", Name(Player));
1445 printf(" >>> REASON: %s", Reason);
1446 SendClientMessage(Player, Color:GREY, " * You have been kicked from the server by the owner. ");
1447 FormatMSG(Player, Color:BLUE, "REASON: "W"%s", Reason);
1448 KickEx(Player, "CONSOLE OWNER", Reason, false);
1449 SendAdminCMD(INVALID_PLAYER_ID, ""BLUE"%s"GREY" has been kicked from the server by the server owner!", Name(Player));
1450 }
1451 else PrintError("Player not connected!");
1452 }
1453 else PrintError("Invalid Syntax");
1454 return 1;
1455 }
1456 CONSOLE("!setrank")
1457 {
1458 if(!sscanf(cmd[8], "ud", Player, P2))
1459 {
1460 if(Player != (0xFFFF))
1461 {
1462 if(P2 > 0 || P2 < sizeof(_Ranks) - 1)
1463 {
1464 #if SAVE_IN_LOGS == true
1465 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());
1466 #endif
1467
1468 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));
1469
1470 printf(" >>> You %s %s to rank to %d | %s.", (P_DATA[Player][Rank] < P2) ? ("promoved") : ("demoted"), Name(Player), P2, RankName(P2));
1471
1472 P_DATA[Player][Rank] = P2;
1473 }
1474 else PrintErrorEx("Maximu rank level is: %d", sizeof(_Ranks) - 1);
1475 }
1476 else PrintError("Player not connected!");
1477 }
1478 else PrintError("Invalid Syntax");
1479 return 1;
1480 }
1481 CONSOLE("!setvip")
1482 {
1483 if(!sscanf(cmd[7], "ud", Player, P2))
1484 {
1485 if(Player != (0xFFFF))
1486 {
1487 if(P2 < 5 || P2 > 0)
1488 {
1489 #if SAVE_IN_LOGS == true
1490
1491 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());
1492 #endif
1493 P_DATA[Player][Vip] = P2;
1494 printf(" >>> You %s %s's VIP level to %d.",(P_DATA[Player][Vip] < P2) ? ("promoved") : ("demoted"), Name(Player), P2);
1495 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);
1496 }
1497 else PrintError("Min. VIP: 0 | Max. VIP: 3");
1498 }
1499 else PrintError("Player not connected!");
1500 }
1501 else PrintError("Invalid Syntax");
1502 return 1;
1503 }
1504 CONSOLE("!setlevel")
1505 {
1506 if(!sscanf(cmd[9], "ud", Player, P2))
1507 {
1508 if(Player != (0xFFFF))
1509 {
1510 if(P2 < 5 || P2 > 0)
1511 {
1512 #if SAVE_IN_LOGS == true
1513 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());
1514 #endif
1515
1516 printf(" >>> You %s %s as %s of the server! (Level: %d)", (P_DATA[Player][Level] < P2) ? ("promoved") : ("demoted"), Name(Player), LevelName(P2), P2);
1517
1518 P_DATA[Player][Level] = P2;
1519 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);
1520 }
1521 else PrintError("Min. level: 0 | Max. level: 5");
1522 }
1523 else PrintError("Player not connected!");
1524 }
1525 else PrintError("Invalid Syntax");
1526 return 1;
1527 }
1528 _0CMD("cmds")
1529 {
1530 print("Commands trough console of 0Admin System V"#Version"");
1531 print("------------------------------------------------------\n");
1532 print(" !setlevel <id> <level>\t!setvip <id> <vip>" );
1533 print(" !setrank <id> <rank>\t\t!ranks <no params>");
1534 print(" !kick <id> <reason>\t\t!ban <id> <reason>");
1535 print(" ![un]mute <id> <time>\t\t![un]freeze <id>");
1536 print(" ![un]jail <id> <time>\t\t!spawn <id>" );
1537 print(" !setonline <id> <h> <m> <s>\t!kill <id>" );
1538 print(" !2012 <id>\t\t\t!stats <id>" );
1539 }
1540 _0CMD("features")
1541 {
1542
1543 new
1544 pStr[1_5];
1545
1546 if(!S_DATA[Ping]) pStr = "\tN/A"; else format(pStr, 1_5, "\t\t%d", S_DATA[Ping]);
1547 print ("-------------------------------------------------");
1548 print ("| Feature\t\tState\t\tValue\t|" );
1549 print ("-------------------------------------------------");
1550
1551 printf("| Anti Spam\t\t%s%sN/A\t|\n\
1552 | Anti CMD Spam\t%s%sN/A\t|\n\
1553 | Ping Kicker\t\t%s%s\t|\n\
1554 | RCON Protection\t%s%sN/A\t|\n\
1555 | Tell Player\t\t%s%sN/A\t|\n\
1556 | Block Chat\t\t%s%sN/A\t|\n\
1557 | Read PM\t\t%s%sN/A\t|\n\
1558 | Read Commands\t%s\tN/A\t|",
1559 Triadic(S_DATA[AntiSpam] ),
1560 S_DATA[AntiSpam] ? ("\t\t") :("\t"),
1561 Triadic(S_DATA[AntiCSpam]),
1562 S_DATA[AntiCSpam] ? ("\t\t") :("\t"),
1563 Triadic(S_DATA[Ping] ),pStr,
1564 Triadic(S_DATA[RCONProt] ),
1565 S_DATA[RCONProt] ? ("\t\t") :("\t"),
1566 Triadic(S_DATA[TellPlayer]),
1567 S_DATA[TellPlayer] ? ("\t\t") :("\t"),
1568 Triadic(S_DATA[Chat] ),
1569 S_DATA[Chat] ? ("\t\t") :("\t"),
1570 Triadic(S_DATA[ReadPM] ),
1571 S_DATA[ReadPM] ? ("\t\t") :("\t"),
1572 Triadic(S_DATA[ReadCMD] ));
1573
1574 printf("| AKA\t\t\t%s%sN/A\t|\n\
1575 | Show Function\t%s%sN/A\t|\n\
1576 | Anti Repeat\t\t%s%sN/A\t|\n\
1577 | Auto Login\t\t%s%sN/A\t|\n\
1578 | Announce Rank\t%s%sN/A\t|\n\
1579 | Anti Advertising\t%s%sN/A\t|",
1580 Triadic(S_DATA[AKA] ),
1581 S_DATA[AKA] ? ("\t\t") :("\t"),
1582 Triadic(S_DATA[ShowFunction]),
1583 S_DATA[ShowFunction] ? ("\t\t") :("\t"),
1584 Triadic(S_DATA[AntiRepeat] ),
1585 S_DATA[AntiRepeat] ? ("\t\t") :("\t"),
1586 Triadic(S_DATA[AutoLogin] ),
1587 S_DATA[AutoLogin] ? ("\t\t") :("\t"),
1588 Triadic(S_DATA[AnnRank] ),
1589 S_DATA[AnnRank] ? ("\t\t") :("\t"),
1590 Triadic(S_DATA[AntiAD] ),
1591 S_DATA[AntiAD] ? ("\t\t") :("\t"));
1592 print ("-------------------------------------------------");
1593 }
1594 _0CMD("info")
1595 {
1596 print("\n\n\n");
1597 print("Informations about 0Admin System V"#Version"");
1598 print("------------------------------------------------------\n");
1599 print(" - The idea of creating a new and optimised Admin System came\n\
1600 to me when i was seeing all these new and old fashioned admin\n\
1601 scripts with the oldest functions and less optimisation.\n\
1602 So i decided to start working on a new and unique admin script\n\
1603 that everyone will enjoy no mather what server you own,\n\
1604 Stunt, RP, Freeroam, Trucking, etc.\n");
1605 print(" - The system is provided with the fastest functions like sscanf\n\
1606 ZCMD - the almost fastest command processor and of course\n\
1607 using Regular Expresions to detect an advertising in chat.\n\n \
1608 - The system is mostly based on dialogs, for example Control Panel\n\
1609 which is available for Admins and VIP or regular members to control\n\
1610 and use them whenever they need with a vast ease.\n");
1611 print(" - The basic idea was to let all kind of people that don't know\n\
1612 the basics or it's new into this kind of game. That's the main\n\
1613 reason for using so many dialogs, because many don't really know\n\
1614 or forgot commands name, so I decidede to pack everything up\n\
1615 and insert it into a dialog.\n");
1616 print(" - The story ends here, main reason was told. ");
1617 print("------------------------------------------------------\n");
1618
1619 }
1620 if(!strcmp(cmd, "!help", true))
1621 {
1622 print("\n\n\n");
1623 print("Help for 0Admin System V"#Version"");
1624 print("--------------------------------------------------------");
1625 print(" # Type !0cmds to use a command inside a server." );
1626 print(" # Type !0credits to see the credits." );
1627 print(" # Type !0info to see informations about this system." );
1628 print(" # Type !0FAQ for answers to your problems." );
1629 print(" # Type !0svstats to see the stats of the server." );
1630 print(" # Type !0features to see enabled/disabled features." );
1631 print("--------------------------------------------------------");
1632 print(" > Check often the forums for new updates!");
1633 print("------");
1634 }
1635 if(!strcmp(cmd, "reload0", true))
1636 {
1637 SendRconCommand("reloadfs 0Admin");
1638 print("Reloading 0Admin!");
1639 }
1640 return 1;
1641}
1642
1643#if USE_RANKS == true
1644 CheckRank(killer, rank)
1645 {
1646 if(P_DATA[killer][Kills] == _Ranks[rank][iRank])
1647 return 1;
1648
1649 return 0;
1650 }
1651 AnnounceRank(killer, rank)
1652 {
1653 new Str[256];
1654 format(Str, sizeof (Str), "RANK UP: "GREY" You are now a member with Rank "ORAN"%d"GREY" |"ORAN" %s", rank, RankName(rank));
1655 SendClientMessage(killer, Color:ORAN, Str);
1656 SetPVarInt(killer, "0_Rank", rank);
1657 P_DATA[killer][Rank] = rank;
1658 if(S_DATA[AnnRank])
1659 {
1660 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));
1661 foreach(Player, k){
1662 if(k != killer){
1663 SendClientMessage(k, Color:GREY, Str);
1664 }
1665 }
1666 }
1667 #if UPDATE_TOP_ALWAYS == true
1668
1669 new
1670 Query[256],
1671 DBResult: R1;
1672
1673
1674 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(killer));
1675 R1 = DB::Query(_DB, Query);
1676
1677 if(R1)
1678 {
1679 if(DB::Valid(R1))
1680 {
1681 DB::Free(R1);
1682 format(Query, sizeof(Query), "UPDATE `Top` SET `Rank` = '%d' WHERE `Name` = '%s'", rank, Name(killer));
1683 DB::Query(_DB, Query);
1684 }
1685 else
1686 {
1687 DB::Free(R1);
1688 format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `Rank`) VALUES('%s','%d')", Name(killer), rank);
1689 DB::Query(_DB, Query);
1690 }
1691 }
1692 #endif
1693 }
1694#endif
1695
1696public OnPlayerDeath(playerid, killerid, reason)
1697{
1698 if(killerid != INVALID_PLAYER_ID)P_DATA[killerid][Kills]++;
1699 P_DATA[playerid][Deaths]++;
1700 if(killerid != INVALID_PLAYER_ID)SetPVarInt(killerid, "0_Kills", P_DATA[killerid][Kills]);
1701 SetPVarInt(playerid, "0_Deaths", P_DATA[playerid][Deaths]);
1702
1703 #if UPDATE_TOP_ALWAYS == true
1704
1705 new
1706 Query[256],
1707 DBResult:R1;
1708
1709
1710 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(playerid));
1711 R1 = DB::Query(_DB, Query);
1712
1713 if(R1)
1714 {
1715 if(DB::Valid(R1))
1716 {
1717 DB::Free(R1);
1718 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));
1719 DB::Query(_DB, Query);
1720 }
1721 else
1722 {
1723 DB::Free(R1);
1724 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]));
1725 DB::Query(_DB, Query);
1726 }
1727 }
1728 if(killerid != (0xFFFF))
1729 {
1730 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(killerid));
1731 R1 = DB::Query(_DB, Query);
1732
1733 if(R1)
1734 {
1735 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));
1736 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]));
1737
1738 DB::Free(R1);
1739 DB::Query(_DB, Query);
1740 }
1741 }
1742
1743
1744 #endif
1745
1746 #if USE_RANKS == true
1747
1748 if (CheckRank(killerid, 1))AnnounceRank(killerid, 1);
1749 else if(CheckRank(killerid, 2))AnnounceRank(killerid, 2);
1750 else if(CheckRank(killerid, 3))AnnounceRank(killerid, 3);
1751 else if(CheckRank(killerid, 4))AnnounceRank(killerid, 4);
1752 else if(CheckRank(killerid, 5))AnnounceRank(killerid, 5);
1753 else if(CheckRank(killerid, 6))AnnounceRank(killerid, 6);
1754 else if(CheckRank(killerid, 7))AnnounceRank(killerid, 7);
1755 else if(CheckRank(killerid, 8))AnnounceRank(killerid, 8);
1756
1757 #endif
1758 return 1;
1759}
1760
1761
1762CMD:arules(PARAMS)
1763{
1764 LoginCheck(playerid);
1765
1766 new String[2_000];
1767
1768 switch(P_DATA[playerid][Level])
1769 {
1770 case 0:
1771 {
1772 strcat(String, ""W"["BLUE"0"W"] "BLUE"Member"W"\n\
1773 - Don't do anything stupid.\n\
1774 - You are just a player under rules!", 2_000);
1775 }
1776 case 1:
1777 {
1778 strcat(String, ""W"["BLUE"1"W"] "BLUE"Helper"W"\n\
1779 - Make sure players have what they need, like time, weather.\n\
1780 - Make sure when a player asks for help to give them the appropriate response.\n\
1781 - You are just a helper! Don't act cocky! Act like a helper!\n\
1782 - Dealing with players that surpass your abillities? Ask for help to the superiors!\n\n", 2_000);
1783 }
1784 case 2:
1785 {
1786 strcat(String, "["BLUE"2"W"] "BLUE"Mini Moderator"W"\n\
1787 - You have somewhat control over the players. You can mute/freeze them.\n\
1788 - If you notice a hacker or someone with illegal weapons, use "BLUE"/disarm"W".\n\
1789 - When a players asks for something, do it, like change skin, heal car etc..\n\
1790 - Use "BLUE"/bankrupt"W" to remove player's money if you they hack.\n\n", 2_000);
1791 }
1792 case 3:
1793 {
1794 strcat(String, "["BLUE"3"W"] "BLUE"Moderator"W"\n\
1795 - You are a full moderator, your job is to take care of the server while superiors are offline\n\
1796 - Make sure nobody spams the chat, use "BLUE"/clearchat"W" to clear the chat just in case.\n\
1797 - You can manipulate player's account, like set his time,skin,cookies,money,score,kills etc..\n\
1798 - Your abilities are high enough! Use with caution!\n\n", 2_000);
1799 }
1800 case 4:
1801 {
1802 strcat(String, "["BLUE"4"W"] "BLUE"Administrator"W"\n\
1803 - No proper rules for you.\n\
1804 - Do whatever you think it's right.\n\
1805 - Lower level member may not judge your actions.\n\n", 2_000);
1806 }
1807 case 5:
1808 {
1809 strcat(String, "["BLUE"5"W"] "BLUE"Owner"W"\n\
1810 - Lower level member may not judge your actions.\n\
1811 - Do whatever you want.", 2_000);
1812 }
1813 }
1814
1815 Show(String);
1816 return 1;
1817}
1818CMD:aacmds(PARAMS)
1819{
1820 LoginCheck(playerid);
1821
1822 new String[2_000];
1823
1824 if(P_DATA[playerid][Level] < 1)
1825 {
1826 strcat(String, ""BLUE"Normal Member"W"\n\
1827 /register /login /stats /pm /admins /vips /top\n\
1828 /cookies /buycookiejar /eatcookie /giftcookie /cookieshelp\n\nYou are not allowed to view the rest of the list.",2_000);
1829 }
1830 else
1831 {
1832 strcat(String, ""BLUE"Helper"W"\n\
1833 /goto /gotopos /getip /settime /spawn /acar /jailed /frozen\n\
1834 /muted /car /acar /accp /unblock /cargod /god\n\n", 2_000);
1835
1836
1837 strcat(String, ""BLUE"Mini Moderator"W"\n\
1838 /disarm /bankrupt /tplayer /eject /heal /spec /show /setskin\n\
1839 /[un]freeze /[un]mute /aweapons /healcar /setvhealth /carcolor\n\n", 2_000);
1840
1841 strcat(String, ""BLUE"Moderator"W"\n\
1842 /giveweapon /warn /healall /heal /aweapons /givecar /write /destroyv\n\
1843 /[un]jail /slap /clearchat /akill /explode /setalltime /setallweather\n\
1844 /set(cookies|health|armour|score|cash|skin|time|weather|world|interior|drunk|respect|wanted)\n\n", 2_000);
1845
1846 strcat(String, ""BLUE"Administrator"W"\n\
1847 /setall(health|armour|score|cash|skin|world|interior|drunk|cookies|respect|wanted)\n\
1848 /giveall(h(ealth)|armour|score|cash|cookies|wanted|weapon)\n\
1849 /kick /wcheck /setdeaths /setkills /2012 /resetallrespect /killall\n", 2_000);
1850
1851 strcat(String, "/[un]muteall /[un]freezeall /spawnall /2012all /chat /slapall\n\
1852 /disarmall /explodeall\n\n\
1853 "BLUE"Remember to read the rules at "BLUE"/arules!", 2_000);
1854
1855 strcat(String, ""BLUE"Owner"W"\n\
1856 {FF0000}The owner commands are private!", 2_000);
1857 }
1858 Show(String);
1859
1860 return 1;
1861}
1862CMD:acmds(PARAMS)
1863{
1864 LoginCheck(playerid);
1865
1866
1867 switch(P_DATA[playerid][Level])
1868 {
1869 case 0:
1870 {
1871 Show(""BLUE"Normal Member"W"\n\
1872 /register /login /stats /pm /admins /vips /top\n\
1873 /cookies /buycookiejar /eatcookie /giftcookie /cookieshelp\n\n\
1874 "BLUE"Remember to read the rules of your level!!");
1875
1876 }
1877 case 1:
1878 {
1879 Show(""BLUE"Helper"W"\n\
1880 /goto /gotopos /getip /settime /spawn /acar /jailed /frozen\n\
1881 /muted /car /acar /accp /unblock /cargod /god\n\n\
1882 "BLUE"Remember to read the rules at "BLUE"/arules!");
1883 }
1884 case 2:
1885 {
1886 Show(""BLUE"Mini Moderator"W"\n\
1887 /disarm /bankrupt /tplayer /eject /heal /spec /show /setskin\n\
1888 /[un]freeze /[un]mute /aweapons /healcar /setvhealth /carcolor\n\n\
1889 "BLUE"Remember to read the rules at "BLUE"/arules!");
1890 }
1891 case 3:
1892 {
1893 Show(""BLUE"Moderator"W"\n\
1894 /giveweapon /warn /healall /heal /aweapons /givecar /write /destroyv\n\
1895 /[un]jail /slap /clearchat /akill /explode /setalltime /setallweather\n\
1896 /set(cookies|health|armour|score|cash|skin|time|weather|world|interior|drunk|respect|wanted)\n\n\
1897 "BLUE"Remember to read the rules at "BLUE"/arules!");
1898 }
1899 case 4:
1900 {
1901 new Str[600];
1902 strcat(Str, \
1903 ""BLUE"Administrator"W"\n\
1904 /setall(health|armour|score|cash|skin|world|interior|drunk|cookies|respect|wanted)\n\
1905 /giveall(h(ealth)|armour|score|cash|cookies|wanted|weapon)\n\
1906 /kick /wcheck /setdeaths /setkills /2012 /resetallrespect /killall\n", 600);
1907
1908 strcat(Str, \
1909 "/[un]muteall /[un]freezeall /spawnall /2012all /chat /slapall\n\
1910 /disarmall /explodeall\n\n\
1911 "BLUE"Remember to read the rules at "BLUE"/arules!", 600);
1912
1913 Show(Str);
1914 }
1915 case 5:
1916 {
1917 Show(""BLUE"Owner"W"\n\
1918 /setlevel /settemplevel /ban /unban /acp /respawncars /removeacc\n\
1919 /setonline /setstat /fake /fakechat /fakecmd /fakecon /fakedisc /fakedeath\n\
1920 /kickall\n\n\
1921 "BLUE"Remember to read the rules at "BLUE"/arules!");
1922
1923 }
1924 }
1925
1926 SendClientMessage(playerid, Color:BLUE, "If you want to view a list of all Non/Admin commands use "W"/aacmds");
1927 return 1;
1928}
1929CMD:unblock(PARAMS)
1930{
1931 LoginCheck(playerid);
1932 LevelCheck(playerid, 1);
1933
1934 new Player;
1935 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/unblock "GREY"<id>", "Will unstuck a player");
1936 else
1937 {
1938 TogglePlayerControllable(Player, true);
1939
1940 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unblocked player "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
1941 FormatMSG(playerid, Color:GREY, "You unstucked player "ORAN"%s[%i]", Name(Player), Player);
1942 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" unblocked you", Name(playerid), playerid);
1943 }
1944 return 1;
1945}
1946CMD:time(PARAMS)
1947{
1948 LoginCheck(playerid);
1949
1950 new T[2], Str[10];
1951 gettime(T[0], T[1]);
1952 format(Str, 10, "~r~%d~w~:~r~%d", T[0], T[1]);
1953 GameTextForPlayer(playerid, Str, 3000, 1);
1954
1955 return 1;
1956}
1957CMD:cargod(PARAMS)
1958{
1959 LoginCheck(playerid);
1960 LevelCheck(playerid, 1);
1961
1962 switch(P_DATA[playerid][CarGod])
1963 {
1964 case false:
1965 {
1966 P_DATA[playerid][CarGod] = 1;
1967 SetPVarInt(playerid, "0_CarGod", 1);
1968 SendClientMessage(playerid, Color:GREY, "Vehicle God has been activated!");
1969 }
1970 case true:
1971 {
1972 P_DATA[playerid][CarGod] = 0;
1973 SetPVarInt(playerid, "0_CarGod", 0);
1974 SendClientMessage(playerid, Color:GREY, "Vehicle God has been deactivated!");
1975
1976 }
1977 }
1978 return 1;
1979}
1980CMD:god(PARAMS)
1981{
1982 LoginCheck(playerid);
1983 LevelCheck(playerid, 1);
1984
1985 switch(P_DATA[playerid][God])
1986 {
1987 case false:
1988 {
1989 P_DATA[playerid][God] = 1;
1990 SetPVarInt(playerid, "0_God", 1);
1991 SendClientMessage(playerid, Color:GREY, "Godlike has been activated!");
1992 }
1993 case true:
1994 {
1995 P_DATA[playerid][God] = 0;
1996 SetPVarInt(playerid, "0_God", 0);
1997 SendClientMessage(playerid, Color:GREY, "Godlike has been deactivated!");
1998
1999 }
2000 }
2001 return 1;
2002}
2003
2004
2005CMD:pcp(PARAMS)
2006{
2007 LoginCheck(playerid);
2008
2009 SPD(playerid, Dialog:PCP, LIST, "Player control panel", PcPanel(playerid), "ON/Select", "OFF/Exit");
2010 return 1;
2011}
2012
2013CMD:record(playerid)
2014{
2015 LoginCheck(playerid);
2016
2017 new
2018 Str[1024];
2019 format(Str, sizeof (Str), ""W"Record details:\n\n\
2020 "GREE"NEW RECORD:\n\
2021 "GREY"Broken by: "BLUE"%s\n\
2022 "GREY"Date: "BLUE"%d/%d/%d\n\
2023 "GREY"Time: "BLUE"%d:%d:%d\n\
2024 "GREY"Record: "BLUE"%d "GREY"players",
2025 S_DATA[RecordBy],
2026 S_DATA[sD], S_DATA[sM], S_DATA[sY],
2027 S_DATA[sH], S_DATA[sMi], S_DATA[sS],
2028 S_DATA[sRecord]);
2029
2030 new
2031 Field[4][64],
2032 DBResult: R1;
2033
2034 R1 = DB::Query(_DB, "SELECT `ByOLD`, `DateOLD`, `TimeOLD` FROM `Record`;");
2035 if(DB::Valid(R1))
2036 {
2037 DB::GetField(R1, "ByOLD", Field[0], 64);
2038 DB::GetField(R1, "DateOLD", Field[1], 64);
2039 DB::GetField(R1, "TimeOLD", Field[2], 64);
2040 DB::Free(R1);
2041 }
2042 else
2043 {
2044 DB::Free(R1);
2045 Field[0] = "Nobody"; Field[1] = "Never"; Field[2] = "Never";
2046 }
2047 format(Str, sizeof (Str), "%s\n\n{FF0000}OLD RECORD:\n\
2048 "GREY"Broken by: "ORAN"%s\n\
2049 "GREY"Date: "ORAN"%s\n\
2050 "GREY"Time: "ORAN"%s\n\
2051 "GREY"Record: "ORAN"%d "GREY"players",
2052 Str,
2053 Field[0], Field[1], Field[2], S_DATA[sRecord] - 1);
2054 SPD(playerid, Dialog:Empty, BOX, ""W"Players record!", Str, "Close", "");
2055 return 1;
2056}
2057
2058public OnPlayerConnect(playerid)
2059{
2060 if(IsPlayerNPC(playerid)) return 1;
2061
2062 new DBResult:bResult, bQuery[129];
2063 format(bQuery, 129, "SELECT `IP`, `Reason`, `Admin`, `BanDate` FROM `Banlist` WHERE `Name` = '%s';", Name(playerid));
2064 bResult = DB::Query(_DB, bQuery);
2065
2066 new bField[4][129], Field[50];
2067 if(bResult)
2068 {
2069 if(DB::Valid(bResult))
2070 {
2071 DB::GetField(bResult, "Reason", bField[0], 129);
2072 DB::GetField(bResult, "Admin", bField[1], 129);
2073 DB::GetField(bResult, "BanDate", bField[2], 129);
2074
2075 DB::Free(bResult);
2076 for (new i = 0; i < 10; i++)SendClientMessage(playerid, -1, " ");
2077
2078 SendClientMessage(playerid, Color:ORAN, "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *");
2079 SendClientMessage(playerid, Color:ORAN, "BANNED:"W" Sorry to inform you, but this account is "ORAN"banned"W" from this server!");
2080 FormatMSG(playerid, ~1, "You were banned by Administrator "ORAN"%s"W" on "ORAN"%s"W" with the following reason:", bField[1], bField[2]);
2081 SendClientMessage(playerid, Color:ORAN, bField[0]);
2082
2083 KickEx(playerid, "System", "Banned Account", true);
2084
2085 return 0;
2086 }
2087 else
2088 {
2089 DB::Free(bResult);
2090
2091 new DBResult:bResult2;
2092 format(bQuery, 129, "SELECT `IP`, `Name`, `Reason`, `Admin`, `BanDate` FROM `Banlist` WHERE `IP` = '%s';", GetPlayerIPEx(playerid));
2093 bResult2 = DB::Query(_DB, bQuery);
2094
2095 if(bResult2)
2096 {
2097 if(DB::Valid(bResult2))
2098 {
2099 loop(i, 4){ bField[_i][0] = '\0'; }
2100 DB::GetField(bResult2, "IP", bField[3], 129);
2101 if(!strcmp(GetPlayerIPEx(playerid), bField[3]))
2102 {
2103 //new Field[3][129];
2104 DB::GetField(bResult2, "Reason", bField[0], 129);
2105 DB::GetField(bResult2, "Admin", bField[1], 129);
2106 DB::GetField(bResult2, "BanDate", bField[2], 129);
2107
2108 DB::Free(bResult2);
2109 loop(o, 10){ SendClientMessage(playerid, -1, " "); }
2110
2111 SendClientMessage(playerid, Color:ORAN, "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *");
2112 SendClientMessage(playerid, Color:ORAN, "BANNED:"W" Sorry to inform you, but this account is "ORAN"banned"W" from this server!");
2113 FormatMSG(playerid, -1, "You were banned by Administrator "ORAN"%s"W" on "ORAN"%s"W" with the following reason:", bField[1], bField[2]);
2114 SendClientMessage(playerid, Color:ORAN, bField[0]);
2115
2116 KickEx(playerid, "System", "Banned Account", true);
2117 return 0;
2118 }
2119 }else DB::Free(bResult2);
2120 }
2121 }
2122 }
2123
2124 S_DATA[sPlayers] ++;
2125
2126 if(S_DATA[sRecord] < S_DATA[sPlayers])
2127 {
2128 new
2129 Date[6],
2130 Query[256];
2131
2132 getdate(Date[2], Date[1], Date[0]);
2133 gettime(Date[3], Date[4], Date[5]);
2134
2135 if(!strlen(S_DATA[RecordBy])) format(S_DATA[RecordBy], MAX_PLAYER_NAME, "Nobody");
2136 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'",\
2137 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]);
2138
2139 DB::Query(_DB, Query);
2140
2141 getdate(S_DATA[sY], S_DATA[sM], S_DATA[sD]);
2142 gettime(S_DATA[sH], S_DATA[sMi], S_DATA[sS]);
2143
2144
2145 SendClientMessage(playerid, -1, " ");
2146 SendClientMessage(playerid, -1, " ");
2147 SendClientMessage(playerid, -1, " ");
2148 SendClientMessage(playerid, Color:BLUE, "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ");
2149 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]);
2150 SendClientMessage(playerid, Color:GREY, "Use "BLUE"/record"GREY" to check more details!");
2151 SendClientMessage(playerid, Color:BLUE, "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ");
2152 SendClientMessage(playerid, -1, " ");
2153 SendClientMessage(playerid, -1, " ");
2154 foreach(Player, i)
2155 {
2156 if(i != playerid)
2157 {
2158 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]);
2159 SendClientMessage(i, Color:GREY, "Use "BLUE"/record"GREY" to check more details!");
2160 }
2161 }
2162 format(S_DATA[RecordBy], MAX_PLAYER_NAME, "%s", Name(playerid));
2163 S_DATA[sRecord] = S_DATA[sPlayers];
2164 }
2165
2166 //Format player's IP for a later use.
2167 format(PlayerIP[playerid], 50, "%s", GetPlayerIPEx(playerid));
2168
2169 SetPVarInt(playerid, "FirstConnection", 1);
2170 new String[256];
2171
2172 if(!S_DATA[AKA])
2173 {
2174 format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined Stunter's God!", Name(playerid), playerid);
2175 SendClientMessageToAll(Color:ORAN, String);
2176 }
2177 else
2178 {
2179 INI_ParseFile(AKA_FILE, "LoadAKA", .bExtra = true, .extra = playerid);
2180
2181
2182 if(strlen(GPVSEx(playerid, "pAKA")) < 3)
2183 {
2184 format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined Stunter's God!", Name(playerid), playerid);
2185 }
2186 else if(!strcmp(GPVSEx(playerid, "pAKA"), Name(playerid), true))
2187 {
2188 format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined Stunter's God!", Name(playerid), playerid);
2189 }
2190 else format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined Stunter's God!"GREY"[AKA:"W" %s"GREY"]",Name(playerid), playerid, GPVSEx(playerid, "pAKA"));
2191
2192 foreach(Player, i)
2193 {
2194 if(P_DATA[i][Level] > 2)
2195 {
2196 if(i != playerid)SendClientMessage(i, Color:ORAN, String);
2197 }
2198 else
2199 {
2200 format(String, sizeof (String),"%s["W"%i"ORAN"]"W" Has joined Stunter's God!", Name(playerid), playerid);
2201 SendClientMessage(i, Color:ORAN, String);
2202 }
2203 }
2204
2205 new pIP[30];
2206 GetPlayerIp(playerid, pIP, 30);
2207
2208
2209 INI_ParseFile(AKA_FILE, "LoadAKA", .bExtra = true, .extra = playerid);
2210 if(!strlen(GPVSEx(playerid, "pAKA")))
2211 {
2212 new INI: pAka = INI_Open(AKA_FILE);
2213 INI_WriteString(pAka, pIP, Name(playerid));
2214 INI_Close(pAka);
2215 }
2216 else
2217 {
2218 if(strfind(GPVSEx(playerid, "pAKA"), Name(playerid), true) == -1)
2219 {
2220 new Str[256];
2221 format (Str, 256, "%s,%s", GPVSEx(playerid, "pAKA"), Name(playerid));
2222 new INI: pAka = INI_Open(AKA_FILE);
2223 INI_WriteString(pAka, pIP, Str);
2224 INI_Close(pAka);
2225 }
2226 }
2227 }
2228 P_DATA[playerid][ConnTime] = gettime();
2229 P_DATA[playerid][LogFail] = MAX_PASS_FAIL;
2230 P_DATA[playerid][Spec_ID] = 0xFFFF;
2231 P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_NONE;
2232
2233 ClearVars(playerid);
2234
2235
2236 #if SAVE_FREEZE == true
2237
2238 new Query[256];
2239
2240 format(Query, sizeof (Query), "SELECT `Key`, `Frozen`, `RealName` FROM `Frozen` WHERE `IP` = '%s';", GetPlayerIPEx(playerid));
2241 new DBResult:Result1 = DB::Query(_DB, Query);
2242
2243 if(Result1)
2244 {
2245 if(DB::Valid(Result1))
2246 {
2247 new xField[64];
2248
2249 DB::GetField(Result1, "RealName", xField, 64);
2250 SetPVarString(playerid, "FreezeName", xField);
2251
2252 DB::GetField(Result1, "Frozen", xField, 64);
2253 P_DATA[playerid][Frozen] = strval(xField);
2254
2255 DB::Free(Result1);
2256 }
2257 else
2258 {
2259 DB::Free(Result1);
2260 format(Query, 256, "SELECT `IP`, `Frozen`, `RealName` FROM `Frozen` WHERE `RealName` = '%s';", Name(playerid));
2261 new DBResult:Result2 = DB::Query(_DB, Query);
2262
2263 if(Result2)
2264 {
2265 if(DB::Valid(Result2))
2266 {
2267 DB::GetField(Result2, "IP", Field, sizeof (Field));
2268 SetPVarString(playerid, "FalseIP", Field);
2269
2270 if(strcmp(GetPlayerIPEx(playerid), Field))
2271 {
2272 DB::GetField(Result2, "Frozen", Field, sizeof (Field));
2273 P_DATA[playerid][Frozen] = strval(Field);
2274
2275 DB::GetField(Result2, "RealName", Field, sizeof (Field));
2276 SetPVarString(playerid, "FreezeName", Field);
2277
2278 DB::GetField(Result2, "IP", Field, sizeof (Field));
2279 SetPVarString(playerid, "FalseIP", Field);
2280 }
2281 DB::Free(Result2);
2282 }
2283 else
2284 {
2285 DB::Free(Result2);
2286 SetPVarString(playerid, "FreezeName", "5;6:2:6:*:$:^");
2287 }
2288 }
2289 }
2290
2291 }
2292
2293 if(P_DATA[playerid][Frozen])
2294 {
2295 if(strcmp(GPVSEx(playerid, "FreezeName"), Name(playerid), false))
2296 {
2297 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2298 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"));
2299 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2300
2301 P_DATA[playerid][Warns] += 2;
2302
2303 SetPlayerName(playerid, GPVSEx(playerid, "FreezeName"));
2304 }
2305 else if(strcmp(GPVSEx(playerid, "FalseIP"), GetPlayerIPEx(playerid)))
2306 {
2307 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2308 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"));
2309 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2310
2311 P_DATA[playerid][Warns] += 2;
2312
2313 SetPlayerName(playerid, GPVSEx(playerid, "FreezeName"));
2314 }
2315
2316 format(Query, 256, "UPDATE `Frozen` SET `IP` = '%s', `Frozen` = '1', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "FreezeName"));
2317 DB::Query(_DB, Query);
2318
2319 if(P_DATA[playerid][Warns] >= MAX_P_WARNS)
2320 {
2321 SendClientMessage(playerid, Color:GREY, "You have been kicked from the server for exceeding warnings!");
2322 KickEx(playerid, "System", "Exceeding Warnings");
2323 return 0;
2324 }
2325 }
2326 #endif
2327
2328 #if SAVE_MUTE == true
2329
2330 new Query2[256],
2331 DBResult:Result3;
2332
2333 format(Query2, sizeof (Query2), "SELECT `Muted`, `Time`, `RealName` FROM `Muted` WHERE `IP` = '%s';", GetPlayerIPEx(playerid));
2334 Result3 = DB::Query(_DB, Query2);
2335
2336 if(Result3)
2337 {
2338 if(DB::Valid(Result3))
2339 {
2340 DB::GetField(Result3, "Muted", Field, sizeof (Field));
2341 P_DATA[playerid][Muted] = strval(Field);
2342
2343 DB::GetField(Result3, "Time", Field, sizeof (Field));
2344 P_DATA[playerid][MutedTime] = strval(Field);
2345
2346 DB::GetField(Result3, "RealName", Field, sizeof (Field));
2347 SetPVarString(playerid, "MuteName", Field);
2348
2349 DB::Free(Result3);
2350 GameTextForPlayer(playerid, "~r~You have been cought freeze evading the system!~n~You have been punished!", 7600, 3);
2351 }
2352 else
2353 {
2354 DB::Free(Result3);
2355 format(Query2, sizeof(Query2), "SELECT `IP`, `Muted`, `RealName`, `Time` FROM `Muted` WHERE `RealName` = '%s';", Name(playerid));
2356 new DBResult:Result4 = DB::Query(_DB, Query2);
2357
2358 if(Result4)
2359 {
2360 if(DB::Valid(Result4))
2361 {
2362 DB::GetField(Result4, "IP", Field, sizeof (Field));
2363 if(strcmp(GetPlayerIPEx(playerid), Field))
2364 {
2365 DB::GetField(Result4, "Muted", Field, sizeof (Field));
2366 P_DATA[playerid][Muted] = strval(Field);
2367
2368 DB::GetField(Result4, "Time", Field, sizeof (Field));
2369 P_DATA[playerid][MutedTime] = strval(Field);
2370
2371 DB::GetField(Result4, "RealName", Field, sizeof (Field));
2372 SetPVarString(playerid, "MuteName", Field);
2373
2374 DB::GetField(Result4, "IP", Field, sizeof (Field));
2375 SetPVarString(playerid, "FalseIP", Field);
2376
2377 GameTextForPlayer(playerid, "~r~You have been cought mute evading the system!~n~You have been punished!", 7600, 3);
2378 }
2379 DB::Free(Result4);
2380 }
2381 else
2382 {
2383 DB::Free(Result4);
2384 SetPVarString(playerid, "MuteName", "5;6:2:6:*:$:^");
2385 SetPVarString(playerid, "FalseIP", "5;6:2:6:*:$:^");
2386 }
2387 }
2388 }
2389 }
2390
2391 if(P_DATA[playerid][MutedTime] > 0)
2392 {
2393 if(strcmp(GPVSEx(playerid, "MuteName"), Name(playerid), false))
2394 {
2395 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2396 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"));
2397 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2398
2399 SetPlayerName(playerid, GPVSEx(playerid, "MuteName"));
2400
2401 P_DATA[playerid][MutedTime] += (EXTRA_MINUTES);
2402 }
2403 else if(strcmp(GPVSEx(playerid, "FalseIP"), GetPlayerIPEx(playerid)))
2404 {
2405 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2406 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"));
2407 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2408
2409 SetPlayerName(playerid, GPVSEx(playerid, "MuteName"));
2410
2411 P_DATA[playerid][MutedTime] += (EXTRA_MINUTES);
2412 }
2413 P_DATA[playerid][Muted] = 1;
2414
2415 FormatMSG(playerid, Color:ORAN, "SERVER:"W" You are still muted! "ORAN"["GREY"Aprox. "W"%d minutes"ORAN"]", P_DATA[playerid][MutedTime]);
2416 MuteTimer[playerid] = SetTimerEx("UnMutePlayer", 60_000, true, "i", playerid);
2417
2418 new pQ[129];
2419 format(pQ, sizeof (pQ), "UPDATE `Muted` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "MuteName"));
2420 DB::Query(_DB, pQ);
2421
2422 }
2423 else if(P_DATA[playerid][Muted] && !P_DATA[playerid][MutedTime])
2424 {
2425 if(strcmp(GPVSEx(playerid, "MuteName"), Name(playerid), false))
2426 {
2427 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2428 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"));
2429 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2430
2431 SetPlayerName(playerid, GPVSEx(playerid, "MuteName"));
2432
2433 P_DATA[playerid][Warns] += 2;
2434
2435 new pQ[129];
2436 format(pQ, sizeof (pQ), "UPDATE `Muted` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "MuteName"));
2437 DB::Query(_DB, pQ);
2438 }
2439 else if(strcmp(GPVSEx(playerid, "FalseIP"), GetPlayerIPEx(playerid)))
2440 {
2441 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2442 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"));
2443 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2444
2445 SetPlayerName(playerid, GPVSEx(playerid, "MuteName"));
2446
2447 P_DATA[playerid][Warns] += 2;
2448
2449 format(Query2, sizeof (Query2), "UPDATE `Muted` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "MuteName"));
2450 DB::Query(_DB, Query2);
2451 }
2452 SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You are still muted! "ORAN"["GREY"Mute time: "W"Forever"ORAN"]");
2453 }
2454 if(P_DATA[playerid][Warns] == MAX_P_WARNS)
2455 {
2456 SendClientMessage(playerid, Color:GREY, "You have been kicked from the server for exceeding warnings!");
2457 KickEx(playerid, "System", "Exceeding Warnings");
2458 return 0;
2459 }
2460
2461 #endif
2462
2463
2464 new pQuery[512], DBResult:pResult;
2465 format(pQuery, 512, "SELECT `Registered`, `Autologin` FROM `Accounts` WHERE `Name` = '%s';", Name(playerid));
2466 pResult = DB::Query(_DB, pQuery);
2467 new pField[60];
2468
2469 if(pResult)
2470 {
2471 if(DB::Valid(pResult))
2472 {
2473 DB::GetField(pResult, "Registered", pField, sizeof(pField));
2474 P_DATA[playerid][Registered] = strval(pField);
2475
2476 DB::GetField(pResult, "Autologin", pField, sizeof(pField));
2477 P_DATA[playerid][pAuto] = strval(pField);
2478
2479 DB::Free(pResult);
2480 if(P_DATA[playerid][pAuto])
2481 {
2482 new DBResult:pResult2;
2483 format(pQuery, 512, "SELECT `IP`, `RPassword` FROM `Accounts` WHERE `Name` = '%s';", Name(playerid));
2484 pResult2 = DB::Query(_DB, pQuery);
2485
2486 if(pResult2)
2487 {
2488 if(DB::Valid(pResult2))
2489 {
2490 DB::GetField(pResult2, "IP", pField, sizeof(pField));
2491 if(!strcmp(pField, GetPlayerIPEx(playerid), false))
2492 {
2493 DB::GetField(pResult2, "RPassword", pField, sizeof(pField));
2494 LoginPlayer(playerid, pField, .pAutoLogin = true);
2495 }
2496 else SendLogin(playerid);
2497 }
2498 else SendLogin(playerid);
2499 }
2500 } else SendLogin(playerid);
2501 }
2502 else
2503 {
2504 new zStr[256];
2505 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());
2506 ShowPlayerDialog(playerid, Dialog:Register, DIALOG_STYLE_INPUT, ""W"Register an account", zStr, "Register", "Kick");
2507 }
2508 }
2509 return 1;
2510}
2511SendLogin(playerid)
2512{
2513 new zStr[150];
2514 format(zStr, sizeof (zStr), ""W"Welcome back "GREE"%s"W"\n\nPlease login into your account:", Name(playerid));
2515 SPD(playerid, Dialog:Login2, INPUT, ""W"Welcome back", zStr, "Login", "Forg. Pass");
2516
2517}
2518public OnPlayerDisconnect(playerid, reason)
2519{
2520 S_DATA[sPlayers] --;
2521
2522 DeletePlayer3DTextLabel(playerid, ZaAdminCar[playerid]);
2523
2524 if(P_DATA[playerid][tLevel])
2525 {
2526 P_DATA[playerid][Level] = 0;
2527 }
2528
2529 DestroyVehicle(P_DATA[playerid][aCar]);
2530
2531 new zStr[256];
2532 switch(reason)
2533 {
2534 case 0: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[CRASH]", Name(playerid), playerid);
2535 case 1: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[LEAVING]", Name(playerid), playerid);
2536 case 2: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[KICK"W"/"ORAN"BAN]", Name(playerid), playerid);
2537
2538 }
2539 SendClientMessageToAll(Color:ORAN, zStr);
2540
2541 if(P_DATA[playerid][Logged]) { SavePlayerData(playerid); }
2542
2543 new Query[129];
2544
2545 #if !SAVE_JAIL && !SAVE_MUTE
2546 #pragma unused Query
2547 #endif
2548
2549 #if SAVE_JAIL == true
2550
2551 if(P_DATA[playerid][JailTime] > 0 )
2552 {
2553 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]);
2554 DB::Query(_DB, Query);
2555 }
2556 else if(!P_DATA[playerid][JailTime] && P_DATA[playerid][Jailed])
2557 {
2558 format(Query, 129, "SELECT `Key` FROM `Jailed` WHERE `IP` = '%s';", PlayerIP[playerid]);
2559 new DBResult:Result = DB::Query(_DB, Query);
2560
2561 if(Result)
2562 {
2563 if(!DB::Valid(Result))
2564 {
2565 DB::Free(Result);
2566 format(Query, 129, "DELETE FROM `Jailed` WHERE `IP` = '%s'", PlayerIP[playerid]);
2567 DB::Query(_DB, Query);
2568 }
2569 }
2570 }
2571
2572 #endif
2573
2574 #if SAVE_MUTE == true
2575
2576
2577 if(P_DATA[playerid][MutedTime] > 0)
2578 {
2579 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]);
2580 DB::Query(_DB, Query);
2581 }
2582 else if(!P_DATA[playerid][MutedTime] && P_DATA[playerid][Muted])
2583 {
2584 format(Query, 129, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", PlayerIP[playerid]);
2585 new DBResult:Result = DB::Query(_DB, Query);
2586
2587 if(Result)
2588 {
2589 if(!DB::Valid(Result))
2590 {
2591 DB::Free(Result);
2592 format(Query, 129, "DELETE FROM `Muted` WHERE `IP` = '%s'", PlayerIP[playerid]);
2593 DB::Query(_DB, Query);
2594 }
2595 }
2596 }
2597
2598 #endif
2599 for(new i = 0; i < 5; i++)
2600 {
2601 if(IsPlayerAttachedObjectSlotUsed(playerid, i))
2602 {
2603 RemovePlayerAttachedObject(playerid, i);
2604 }
2605 }
2606
2607
2608 KillTimer(MuteTimer[playerid] );
2609 KillTimer(JailTimer[playerid] );
2610 KillTimer(P_DATA[playerid][NosTimer] );
2611 P_DATA[playerid][LogFail] = 0;
2612 ClearVars(playerid);
2613
2614 return 1;
2615}
2616public OnPlayerCommandPerformed(playerid, cmdtext[], success)
2617{
2618
2619 if(success)
2620 {
2621 P_DATA[playerid][Cmds]++;
2622 SetPVarInt(playerid, "0_Commands", P_DATA[playerid][Cmds]);
2623
2624 if(S_DATA[ReadCMD])
2625 {
2626 SendAdminCMD(playerid, ""GREY"[CMD] %s[%i] "W"used command{FF0000} %s", Name(playerid), playerid, cmdtext);
2627 printf(#[%s] %s - %s, zDate(), Name(playerid), cmdtext);
2628 }
2629 }
2630 else
2631 {
2632 P_DATA[playerid][fCmds]++;
2633 SetPVarInt(playerid, "0_Fail_Commands", P_DATA[playerid][fCmds]) ;
2634 return 0;
2635 }
2636 return 1;
2637}
2638public OnPlayerCommandReceived(playerid, cmdtext[])
2639{
2640 P_DATA[playerid][cSpam]++;
2641 if(S_DATA[AntiCSpam] && (!IsPlayerAdmin(playerid) || P_DATA[playerid][Level] != 5))
2642 {
2643 if(P_DATA[playerid][cSpam] > MAX_CMD_SPAM && !IsPlayerAdmin(playerid))
2644 {
2645 BanEx2(playerid, .zReason = "Extreme command spam");
2646 return 0;
2647 }
2648 else if(P_DATA[playerid][cSpam] > MIN_CMD_SPAM)
2649 {
2650 KickEx(playerid, .zReason = "Command spam");
2651 return 0;
2652 }
2653 }
2654 if(P_DATA[playerid][Jailed] && !P_DATA[playerid][JailTime] && P_DATA[playerid][Level] != 5 && !IsPlayerAdmin(playerid))
2655 {
2656 SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You are not allowed to use any commands while jailed! "GREY"[Jail Time: "ORAN"Forever"GREY"]");
2657 return 0;
2658 }
2659 else if(P_DATA[playerid][Jailed] && P_DATA[playerid][JailTime] > 0 && P_DATA[playerid][Level] != 5 && !IsPlayerAdmin(playerid))
2660 {
2661 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]);
2662 return 0;
2663 }
2664 return 1;
2665}
2666
2667public OnPlayerSpawn(playerid)
2668{
2669 if(IsPlayerNPC(playerid)) return 1;
2670 #if SAVE_JAIL == true
2671
2672 if(GetPVarType(playerid, "FirstConnection"))
2673 {
2674 if(P_DATA[playerid][Incred])
2675 {
2676 for(new i = 0; i < 5; i++)
2677 if(IsPlayerAttachedObjectSlotUsed(playerid, i))
2678 RemovePlayerAttachedObject(playerid, i);
2679
2680 SetPlayerAttachedObject(playerid, 0, 18693, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
2681 SetPlayerAttachedObject(playerid, 1, 18693, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
2682 SetPlayerAttachedObject(playerid, 2, 18703, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
2683 SetPlayerAttachedObject(playerid, 3, 18703, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
2684 SetPlayerAttachedObject(playerid, 4, 18965, 2, 0.111052, 0.021643, -0.000846, 92.280899, 92.752510, 358.071044, 1.200000, 1.283168, 1.200000 );
2685 }
2686 if(P_DATA[playerid][VIPTag])
2687 {
2688 if(P_DATA[playerid][Tag3D])
2689 {
2690 Attach3DTextLabelToPlayer(P_DATA[playerid][Tag3D], playerid, 0.0, 0.0, 1.2);
2691 }
2692 }
2693 DeletePVar(playerid, "FirstConnection");
2694 new Query[256],
2695 DBResult:Result1;
2696
2697 format(Query, sizeof (Query), "SELECT `Key`, `Jailed`, `Time`, `RealName` FROM `Jailed` WHERE `IP` = '%s';", GetPlayerIPEx(playerid));
2698 Result1 = DB::Query(_DB, Query);
2699
2700 if(Result1)
2701 {
2702 if(DB::Valid(Result1))
2703 {
2704 new Field[30];
2705
2706 DB::GetField(Result1, "Jailed", Field, sizeof (Field));
2707 P_DATA[playerid][Jailed] = strval(Field);
2708
2709 DB::GetField(Result1, "Time", Field, sizeof (Field));
2710 P_DATA[playerid][JailTime] = strval(Field);
2711
2712 DB::GetField(Result1, "RealName", Field, sizeof (Field));
2713 SetPVarString(playerid, "JailName", Field);
2714
2715 DB::Free(Result1);
2716 }
2717 else
2718 {
2719 DB::Free(Result1);
2720 format(Query, 256, "SELECT `IP` FROM `Jailed` WHERE `RealName` = '%s'", Name(playerid));
2721 new DBResult:Result2 = DB::Query(_DB, Query);
2722
2723 if(Result2)
2724 {
2725 if(DB::Valid(Result2))
2726 {
2727 new Field[64];
2728 DB::GetField(Result2, "IP", Field, sizeof (Field));
2729 if(strcmp(GetPlayerIPEx(playerid), Field))
2730 {
2731 format(Query, sizeof (Query), "SELECT `Key`, `Jailed`, `Time`, `RealName`, `IP` FROM `Jailed` WHERE `RealName` = '%s';", Name(playerid));
2732 Result1 = DB::Query(_DB, Query);
2733
2734 DB::GetField(Result2, "Jailed", Field, sizeof (Field));
2735 P_DATA[playerid][Jailed] = strval(Field);
2736
2737 DB::GetField(Result2, "Time", Field, sizeof (Field));
2738 P_DATA[playerid][JailTime] = strval(Field);
2739
2740 DB::GetField(Result2, "RealName", Field, sizeof (Field));
2741 SetPVarString(playerid, "JailName", Field);
2742
2743 DB::GetField(Result2, "IP", Field, sizeof (Field));
2744 SetPVarString(playerid, "JFalseIP", Field);
2745
2746 DB::Free(Result2);
2747 }
2748 }
2749 else DB::Free(Result2);
2750
2751 }
2752 }
2753 }
2754
2755 if(P_DATA[playerid][JailTime] > 0)
2756 {
2757 if(strcmp(GPVSEx(playerid, "JailName"), Name(playerid), false))
2758 {
2759 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2760 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"));
2761 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2762
2763 SetPlayerName(playerid, GPVSEx(playerid, "JailName"));
2764 P_DATA[playerid][JailTime] += (EXTRA_MINUTES);
2765 }
2766 else if(strcmp(GPVSEx(playerid, "JFalseIP"), GetPlayerIPEx(playerid), false))
2767 {
2768 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2769 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"));
2770 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2771
2772 SetPlayerName(playerid, GPVSEx(playerid, "JailName"));
2773 P_DATA[playerid][JailTime] += (EXTRA_MINUTES);
2774 }
2775 P_DATA[playerid][Jailed] = 1;
2776
2777 FormatMSG(playerid, Color:ORAN, "SERVER:"W" You are still jailed! "ORAN"["GREY"Jail time: "W"%d minutes"ORAN"]", P_DATA[playerid][JailTime]);
2778
2779 SetTimerEx("JailPlayer", 1500, false, "i", playerid);
2780
2781 new pQ[129];
2782 format(pQ, sizeof (pQ), "UPDATE `Jailed` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "JailName"));
2783 DB::Query(_DB, pQ);
2784
2785 }
2786 else if(P_DATA[playerid][Jailed] && P_DATA[playerid][JailTime] == 0)
2787 {
2788 if(strcmp(GPVSEx(playerid, "JailName"), Name(playerid), false))
2789 {
2790 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2791 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"));
2792 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2793
2794 SetPlayerName(playerid, GPVSEx(playerid, "JailName"));
2795 P_DATA[playerid][Warns] += 2;
2796 }
2797 else if(strcmp(GPVSEx(playerid, "JFalseIP"), GetPlayerIPEx(playerid), false))
2798 {
2799 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2800 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"));
2801 SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
2802
2803 SetPlayerName(playerid, GPVSEx(playerid, "JailName"));
2804 P_DATA[playerid][Warns] += 2;
2805 }
2806 SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You are still jailed! "ORAN"["GREY"Jail time: "W"Forever"ORAN"]");
2807
2808 SetTimerEx("JailPlayer", 1500, false, "i", playerid);
2809
2810 new pQ[129];
2811 format(pQ, sizeof (pQ), "UPDATE `Jailed` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "JailName"));
2812 DB::Query(_DB, pQ);
2813
2814 if(P_DATA[playerid][Warns] == MAX_P_WARNS)
2815 {
2816 SendClientMessage(playerid, Color:GREY, "You have been kicked from the server for exceeding warnings!");
2817 KickEx(playerid, "System", "Exceeding Warnings");
2818 return 0;
2819 }
2820
2821 }
2822 }
2823 #endif
2824 if(P_DATA[playerid][Frozen])
2825 {
2826 Freeze(playerid);
2827 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!)");
2828 }
2829 return 1;
2830}
2831public OnRconLoginAttempt(ip[], password[], success)
2832{
2833 if(! success)
2834 {
2835 new zStr[180];
2836 if(S_DATA[RCONProt])
2837 {
2838 S_DATA[RconFails] += 1;
2839 if(S_DATA[RconFails] >= MAX_RCON_ATTEMPTS)
2840 {
2841 BadRcon(ip, password);
2842 S_DATA[RconFails] = 0;
2843 }
2844 else
2845 {
2846 format(zStr, sizeof (zStr), "*** RCON: "W"RCON Protection turned off, someone tried to break the RCON. (IP: %s| RCON: %s)", ip, password);
2847 SendMessageToAdmins(Color:GREY, zStr, 4);
2848 SendMessageToAdmins(Color:GREY, "Enable "ORAN"Rcon Protection"GREY" from the Admin Control Panel!", 4);
2849 }
2850 }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;
2851 }
2852 else
2853 {
2854 foreach(Player, i)
2855 {
2856 new zIP[16];
2857 GetPlayerIp(i, zIP, 16);
2858 if(!strcmp (zIP, ip, true))
2859 {
2860 SendClientMessage(i, -1, ""BLUE"RCON:"W" Welcome, RCON Admin.");
2861 }
2862 }
2863 }
2864 return 1;
2865}
2866
2867ShowTopStats(playerid, stats[], what[], limit = MAX_TOP_LIMIT)
2868{
2869 new Speed = GetTickCount(),
2870 DialString[3_0_0_0],
2871 String[2][128],
2872 Query[2][256],
2873 DBResult:Result1;
2874
2875 format(Query[0], 256, "SELECT `Name` FROM `Top` ORDER BY (`%s` * 1) DESC limit %d", stats, limit);
2876
2877 Result1 = DB::Query(_DB, Query[0]);
2878
2879 new cColor[12];
2880 if(!strcmp(stats, "Negative", false)) cColor = "{FF0000}";
2881 else if(!strcmp(stats, "Positive", false)) cColor = ""GREE"";
2882 else cColor = "{FFFFFF}";
2883
2884 format(DialString, sizeof (DialString), "{FFFFFF}Server top "ORAN"%s\n\n\n"W"Pos. Player = %s", what, stats);
2885 for (new Qr; Qr < DB::Valid(Result1); Qr++)
2886 {
2887 db_get_field(Result1, 0, String[0], 128);
2888
2889 format(Query[1], 256, "SELECT `%s` FROM `Top` WHERE `Name` = '%s'", stats, String[0]);
2890
2891 new DBResult:Result2 = DB::Query(_DB, Query[1]);
2892 db_get_field(Result2, 0, String[1], 128);
2893
2894 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])));
2895 else format(DialString, sizeof (DialString), "%s\n"BLUE"%d."GREY" %s "W": %s%s", DialString, Qr + 1, String[0], cColor, FormatNumber(strval(String[1])));
2896
2897
2898 db_next_row(Result1);
2899 DB::Free(Result2);
2900 }
2901 DB::Free(Result1);
2902
2903 format(DialString, sizeof (DialString), "%s\n\n"W"Top list generated in "ORAN"%d "W"ms.", DialString, GetTickCount() - Speed);
2904 SPD(playerid, Dialog:TOP, BOX, ""W"TOP PLAYERS", DialString, "Close", "");
2905}
2906CMD:top(playerid,params[])
2907{
2908 LoginCheck(playerid);
2909
2910 SPD(playerid, Dialog:TOP_SELECT, LIST, ""W"TOP PLAYERS", ""W"Top Killers\n\
2911 "W"Top Deaths\n\
2912 "W"Top Ranked\n\
2913 "W"Top Respected\n\
2914 "W"Top Online\n\
2915 "W"Kills/Deaths ratio", "Select", "Close");
2916
2917
2918 return 1;
2919}
2920CMD:stats(PARAMS)
2921{
2922 LoginCheck(playerid);
2923
2924 new Player;
2925 if(sscanf(params, "u", Player))
2926 {
2927 WhosStats = "your current stats";
2928 FormatStats(playerid);
2929 SendError(playerid, "You can also use "ORAN"/stats "W"<id>"GREY" to see someone else's stats!");
2930 }
2931 else
2932 { if(Player == playerid)
2933 {
2934 WhosStats = "your current stats";
2935 FormatStats(playerid);
2936 SendError(playerid, "You can also use "ORAN"/stats "W"<id>"GREY" to see someone else's stats!");
2937 }
2938 else
2939 {
2940 if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
2941
2942 format(WhosStats, sizeof (WhosStats), ""ORAN"%s{FFFFFF}'s stats", Name(Player));
2943 FormatStats(Player);
2944
2945 FormatMSG(Player, Color:GREY, "Player "ORAN"%s[%i]"GREY" is watching your stats!", Name(playerid), playerid);
2946 }
2947 }
2948 SPD(playerid, Dialog:Stats, BOX, ""W"Statistics:", StatsString, "Close", "");
2949 return 1;
2950}
2951CMD:specoff(PARAMS)
2952{
2953 LoginCheck(playerid);
2954 LevelCheck(playerid, 2);
2955
2956 if(P_DATA[playerid][Spec_Type] == ADMIN_SPEC_TYPE_NONE)
2957 return SendError(playerid, "You are not spectating!");
2958
2959 TogglePlayerSpectating(playerid, 0);
2960 P_DATA[playerid][Spec_ID] = 0xFFFF;
2961 P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_NONE;
2962
2963 foreach(Player, x)
2964 {
2965 if(P_DATA[x][Level] > 2)
2966 {
2967 FormatMSG(x, Color:GREY, "Admin "ORAN"%s[%i]"GREY" stopped spectating", Name(playerid), playerid);
2968 }
2969 }
2970 SendClientMessage(playerid, Color:GREY, "You stopped spectating");
2971 return 1;
2972}
2973CMD:specv(PARAMS)
2974{
2975 LoginCheck(playerid);
2976 LevelCheck(playerid, 2);
2977
2978 new VehicleID;
2979 if(sscanf(params, "u", VehicleID)) return SendUsage(playerid, "/specv "GREY"<vehicleid>", "Will spectatea certain vehicle!");
2980 else
2981 {
2982 if(VehicleID == (0xFFFF)) return SendError(playerid, "Invalid vehicle id");
2983
2984 if(VehicleID < MAX_VEHICLES)
2985 {
2986 TogglePlayerSpectating(playerid, 1);
2987 PlayerSpectateVehicle(playerid, VehicleID);
2988 P_DATA[playerid][Spec_ID] = VehicleID;
2989 P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_VEHICLE;
2990 }
2991 FormatMSG(playerid, Color:GREY, "You are now spectating vehicle id "ORAN"%i"GREY".", VehicleID);
2992
2993 foreach(Player, x)
2994 {
2995 if(P_DATA[x][Level] > 2)
2996 {
2997 FormatMSG(x, Color:GREY, "Admin "ORAN"%s[%i]"GREY" is spectating vehicle id "ORAN"%i"GREY".", Name(playerid), playerid, VehicleID);
2998 }
2999 }
3000 }
3001 return 1;
3002}
3003CMD:spec(PARAMS)
3004{
3005 LoginCheck(playerid);
3006 LevelCheck(playerid, 2);
3007
3008 new Player;
3009 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/spec "GREY"<id>", "Will spectate a certain player!");
3010 else
3011 {
3012 if(Player == 0xFFFF )
3013 return SendError(playerid, "Player not connected!");
3014
3015 if(Player == playerid)
3016 return SendError(playerid, "You cannot spectate yourself!");
3017
3018 if(P_DATA[playerid][Level] < P_DATA[Player][Level])
3019 return SendError(playerid, "You are not allowed to spectate this admin!");
3020
3021 TogglePlayerSpectating(playerid, 1);
3022 PlayerSpectatePlayer(playerid, Player);
3023 SetPlayerInterior(playerid, GetPlayerInterior(Player));
3024
3025 P_DATA[playerid][Spec_ID] = Player;
3026 P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_PLAYER;
3027
3028 FormatMSG(playerid, Color:GREY, "You are now spectating player "ORAN"%s[%i]"GREY".", Name(Player), Player);
3029 foreach(Player, x)
3030 {
3031 if(P_DATA[x][Level] > 2)
3032 {
3033 FormatMSG(x, Color:GREY, "Admin "ORAN"%s[%i]"GREY" is spectating "ORAN"%s[%i]"GREY".", Name(playerid), playerid, Name(Player), Player);
3034 }
3035 }
3036 }
3037 return 1;
3038}
3039CMD:2012all(PARAMS)
3040{
3041 LoginCheck(playerid);
3042 LevelCheck(playerid, 4);
3043
3044
3045 foreach(Player, Player)
3046 {
3047 if(P_DATA[Player][Level] < 1)
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 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" fucked up your and everyone's game!", Name(playerid), playerid);
3058 }
3059 }
3060 SendClientMessage(playerid, Color:GREY, "You fucked up everyone's game! (Admins are an exception!)");
3061 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" fucked up everyone's game!", Name(playerid), playerid);
3062 return 1;
3063}
3064CMD:2012(PARAMS)
3065{
3066 LoginCheck(playerid);
3067 LevelCheck(playerid, 4);
3068
3069 new Player;
3070 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");
3071 else
3072 {
3073 if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
3074 if(Player == playerid) return SendError(playerid, "Player entered is you!");
3075
3076 for (new w = 0; w < 11; w++)
3077 {SetPlayerSkillLevel(Player, w, 0);}
3078
3079 SetPlayerHealth(Player, 0.1); SetPlayerArmour(Player, 0.0 ); SetPlayerTime(Player, 0, 0);
3080 SetPlayerWeather(Player, -66); SetPlayerWantedLevel(Player, 6 ); SetPlayerSkin(Player, 159);
3081 ResetPlayerWeapons(Player ); GivePlayerWeapon(Player, 10, 1); ResetPlayerMoney(Player );
3082 SetPlayerScore(Player, 0 ); SetPlayerDrunkLevel(Player, 99999);
3083
3084 new String[MAX_PLAYER_NAME];
3085
3086 format(String, MAX_PLAYER_NAME, "[NUB]%s", Name(Player));
3087 if(strfind(Name(Player), "[NUB]", false, 0)) SetPlayerName(Player, String);
3088
3089 FormatMSG(playerid, Color:GREY, "You fucked up "ORAN"%s[%i]"GREY"'s game!", Name(Player), Player);
3090 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" fucked up your game!", Name(playerid), playerid);
3091 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" fucked up "ORAN"%s[%i]"GREY"'s game!", Name(playerid), playerid ,Name(Player), Player);
3092 }
3093 return 1;
3094}
3095CMD:eject(PARAMS)
3096{
3097 LoginCheck(playerid);
3098 LevelCheck(playerid, 2);
3099
3100 new Player;
3101 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/eject "GREY"<id>", "Will eject player from vehicle");
3102 else
3103 {
3104 if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
3105 if(Player == playerid) return SendError(playerid, "Player entered is you!");
3106 if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
3107
3108 RemovePlayerFromVehicle(Player);
3109
3110 FormatMSG(playerid, Color:GREY, "You ejected "ORAN"%s[%i]"GREY" from vehicle!", Name(Player), Player);
3111 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" ejected you from vehicle!", Name(playerid), playerid);
3112 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" ejected "ORAN"%s[%i]"GREY" from vehicle!", Name(playerid), playerid ,Name(Player), Player);
3113 }
3114 return 1;
3115}
3116CMD:setonline(PARAMS)
3117{
3118 LoginCheck(playerid);
3119 LevelCheck(playerid, 5);
3120
3121 new Player, Time[3];
3122 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");
3123 else
3124 {
3125 if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
3126 if(Time[1] > 60 || Time[1] < 0) return SendError(playerid, "Invalid minutes inserted!");
3127 if(Time[2] > 60 || Time[2] < 0) return SendError(playerid, "Invalid seconds inserted!");
3128
3129 P_DATA[Player][Hours] = Time[0]; P_DATA[Player][Minutes] = Time[1]; P_DATA[Player][Seconds] = Time[2];
3130 if(Player == playerid)
3131 {
3132 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]);
3133 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]);
3134 }
3135 else
3136 {
3137 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]);
3138 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]);
3139 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]);
3140 }
3141
3142 P_DATA[Player][ConnTime] = gettime();
3143 }
3144 return 1;
3145}
3146CMD:warn(PARAMS)
3147{
3148 LoginCheck(playerid);
3149 LevelCheck(playerid, 3);
3150
3151 new Player, Reason[80];
3152 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!");
3153 else
3154 {
3155 if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
3156 if(Player == playerid) return SendError(playerid, "Player entered is you!");
3157
3158 CheckImune(playerid, Player);
3159
3160 P_DATA[Player][Warns] += 1;
3161
3162 if(P_DATA[Player][Warns] != MAX_P_WARNS)
3163 {
3164 #if SAVE_IN_LOGS == true
3165 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 ());
3166 #endif
3167 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]);
3168 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]);
3169 GameTextForPlayer(Player, "~r~WARNED!", 3000, 3);
3170 }
3171 else if(P_DATA[Player][Warns] >= MAX_P_WARNS)
3172 {
3173 #if SAVE_IN_LOGS == true
3174 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 ());
3175 #endif
3176 P_DATA[Player][Warns] = 0;
3177 FormatMSG(Player, Color:GREY, "You have been warned by admin "ORAN"%s[%i]"GREY" for "ORAN" %s", Name(playerid), playerid, Reason);
3178 SendError(Player, "You have reached the maximum warns per player! "ORAN""#MAX_P_WARNS""W"/"#MAX_P_WARNS"");
3179 SendError(Player, "Kicked from the server!");
3180 KickEx(Player, Name(playerid), "Exceeding Warnings!", true);
3181 }
3182
3183 }
3184 return 1;
3185}
3186CMD:show(PARAMS)
3187{
3188 LoginCheck(playerid);
3189 LevelCheck(playerid, 2);
3190
3191 new Player, Show[129];
3192 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!");
3193 else
3194 {
3195 if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
3196 if(Player == playerid) return SendError(playerid, "Player entered is you!");
3197 CheckImune(playerid, Player);
3198
3199 GameTextForPlayer(Player, Show, 6000, 3);
3200
3201 FormatMSG(playerid, Color:GREY, "Screen text sent to "ORAN"%s[%i]", Name(Player), Player);
3202 }
3203 return 1;
3204}
3205CMD:cookies(PARAMS)
3206{
3207 LoginCheck(playerid);
3208
3209 if(!P_DATA[playerid][Cookies] )
3210 SendClientMessage(playerid, Color:GREY, "You currently have no cookies! Buy some with "ORAN"/buycookiejar");
3211 else if(P_DATA[playerid][Cookies] > 1)
3212 FormatMSG(playerid, Color:GREY, "You have "ORAN"%d"GREY" cookies! Eat them or gift them to somebody!", P_DATA[playerid][Cookies]);
3213 else if(P_DATA[playerid][Cookies] == 1)
3214 SendClientMessage(playerid, Color:GREY, "You have "ORAN"1"GREY" cookie! Eat it or gift it to somebody!");
3215 return 1;
3216}
3217
3218CMD:cookieshelp(PARAMS)
3219{
3220 LoginCheck(playerid);
3221
3222 new bStr[512];
3223 format(bStr, sizeof(bStr), "%s%s",\
3224 ""ORAN"Cookies Center!\n\n\
3225 "GREY"Use "ORAN"/cookies"GREY" to check how many cookies you have!\n\
3226 "GREY"Use "ORAN"/buycookiejar"GREY" to buy a jar of "ORAN"600"GREY" cookies!\n",
3227 ""GREY"Use "ORAN"/eatcookie"GREY" you will eat one cookie and gain 100 health!\n\
3228 "GREY"Use "ORAN"/givecookies"GREY" you will give cookies to your friends.\n\n\
3229 {FFFFFF}--------------------\nBe the cookie monster!");
3230
3231 SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Cookies!", bStr, "Close", "");
3232 return 1;
3233}
3234CMD:setcookies(PARAMS)
3235{
3236 LoginCheck(playerid);
3237 LevelCheck(playerid, 3);
3238
3239 new Player, Cookiz;
3240 if(sscanf(params, "ud", Player, Cookiz)) return SendUsage(playerid, "/setcookies <id> <cookies>", "Will set player's cookies!!");
3241 else
3242 {
3243 if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
3244
3245 P_DATA[Player][Cookies] = Cookiz;
3246
3247 if(playerid != Player)
3248 {
3249 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY" cookies to "ORAN"%d",Name(Player), Player, Cookiz);
3250 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"%s[%i]"GREY"'s cookies to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, Cookiz);
3251 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your cookies to "ORAN"%d"GREY"!", Name(playerid), playerid, Cookiz);
3252 }
3253 else
3254 {
3255 FormatMSG(playerid, Color:GREY, "You set your cookies to "ORAN"%d" ,Cookiz);
3256 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his cookies to "ORAN"%d", Name(playerid), playerid, Cookiz);
3257 }
3258 }
3259 return 1;
3260}
3261CMD:givecookies(PARAMS)
3262{
3263 LoginCheck(playerid);
3264
3265 new Player, Cookiz;
3266 if(sscanf(params, "ud", Player, Cookiz)) return SendUsage(playerid, "/giveookies <id> <cookies>", "Will gift cookies to specified player!");
3267 else
3268 {
3269 if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
3270 if(Player == playerid) return SendError(playerid, "Player entered is you!");
3271 if(P_DATA[playerid][Cookies] < Cookiz) return SendError(playerid, "You don't have enough cookies to gift!");
3272
3273 P_DATA[playerid][Cookies] -= Cookiz;
3274 P_DATA[Player][Cookies] += Cookiz;
3275
3276 FormatMSG(playerid, Color:GREY, "You given "ORAN"%d"GREY" cookies to "ORAN"%s[%i]"GREY"",Cookiz, Name(Player), Player);
3277 FormatMSG(Player, Color:GREY, "Player "ORAN"%s[%i]"GREY" gifted you "ORAN"%d"GREY" cookies!", Name(playerid), playerid, Cookiz);
3278
3279 new Str[60];
3280 format(Str, sizeof (Str), "~w~Cookies left:~n~~w~%d", P_DATA[playerid][Cookies]);
3281 GameTextForPlayer(playerid, Str, 4000, 1);
3282 format(Str, sizeof (Str), "~w~Cookies:~n~~w~%d", P_DATA[Player][Cookies]);
3283 GameTextForPlayer(Player, Str, 4000, 1);
3284 }
3285 return 1;
3286}
3287
3288CMD:buyweapons(PARAMS)
3289{
3290 LoginCheck(playerid);
3291
3292 if(!P_DATA[playerid][Cookies])
3293 return SendClientMessage(playerid, Color:GREY, "You don't have any cookies! Buy some with "ORAN"/buycookies");
3294
3295 P_DATA[playerid][Cookies]-= 30;
3296 GameTextForPlayer(playerid, "~r~You~w~Bought~r~Some~b~Guns", 5000, 1);
3297
3298 GivePlayerWeapon(playerid, 26, 1000); //Give playerid sawnoff shotgun with 500 ammo
3299 GivePlayerWeapon(playerid, 4, 4); //Give playerid sawnoff shotgun with 500 ammo
3300 GivePlayerWeapon(playerid, 17, 17); //Give playerid sawnoff shotgun with 500 ammo
3301 GivePlayerWeapon(playerid, 24, 1000); //Give playerid sawnoff shotgun with 500 ammo
3302 GivePlayerWeapon(playerid, 26, 1000); //Give playerid sawnoff shotgun with 500 ammo
3303 GivePlayerWeapon(playerid, 29, 1000); //Give playerid sawnoff shotgun with 500 ammo
3304 GivePlayerWeapon(playerid, 34, 1000); //Give playerid sawnoff shotgun with 500 ammo
3305 FormatMSG(playerid, Color:GREY, "Cookies left: "ORAN"%d", P_DATA[playerid][Cookies]);
3306 return 1;
3307}
3308
3309CMD:eatcookie(PARAMS)
3310{
3311 LoginCheck(playerid);
3312
3313 if(!P_DATA[playerid][Cookies])
3314 return SendClientMessage(playerid, Color:GREY, "You don't have any cookies! Buy some with "ORAN"/buycookiejar");
3315
3316 P_DATA[playerid][Cookies]-= 1;
3317 GameTextForPlayer(playerid, "~r~+~w~100~r~ Health", 5000, 1);
3318
3319 new Float:Health;
3320 GetPlayerHealth(playerid, Health );
3321 SetPlayerHealth(playerid,(Health + 100));
3322 FormatMSG(playerid, Color:GREY, "Cookies left: "ORAN"%d", P_DATA[playerid][Cookies]);
3323 return 1;
3324}
3325
3326CMD:buycookiejar(PARAMS)
3327{
3328 LoginCheck(playerid);
3329
3330 new Yes[4];
3331 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")");
3332 else
3333 {
3334 if(!strcmp(Yes, "yes"))
3335 {
3336 if(GetPlayerMoney(playerid) <= 600 * MAX_COOKIE_COST)
3337 {
3338 FormatMSG(playerid, Color:GREY, "Insufficient moneys! ("ORAN" 600 Cookies * "#MAX_COOKIE_COST" = "GREE"$%s"GREY")", FormatNumber(600 * MAX_COOKIE_COST));
3339 return 0;
3340 }
3341 else
3342 {
3343 GivePlayerMoney(playerid, - (999999999 * MAX_COOKIE_COST));
3344 P_DATA[playerid][Cookies] += 100;
3345 FormatMSG(playerid, Color:GREY, "You bought a jar of "ORAN"600"GREY" cookies and costed you "GREE"$%s", FormatNumber(600 * MAX_COOKIE_COST));
3346 }
3347 }else return SendUsage(playerid, "/buycookiejar <yes>", "Will buy a jar of 600 cookies. "ORAN"("GREY"600 * "GREE"$"#MAX_COOKIE_COST""ORAN")");
3348 }
3349 return 1;
3350}
3351public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
3352{
3353 new _X = 0;
3354 while (_X != MAX_PLAYERS)
3355 {
3356 if(IsPlayerConnected(_X) &&
3357 GetPlayerState(_X) == PLAYER_STATE_SPECTATING &&
3358 P_DATA[_X][Spec_ID] == playerid &&
3359 P_DATA[_X][Spec_Type] == ADMIN_SPEC_TYPE_PLAYER)
3360 {
3361 SetPlayerInterior(_X, newinteriorid);
3362 }
3363 _X++;
3364 }
3365}
3366public OnPlayerStateChange(playerid, newstate, oldstate)
3367{
3368
3369 return 1;
3370}
3371public OnPlayerEnterVehicle(playerid, vehicleid)
3372{
3373 if(vehicleid == P_DATA[playerid][aCar])
3374 return SendClientMessage(playerid, Color:GREY, " "GREY"Welcome back to your "ORAN"Admin Vehicle"GREY"!");
3375
3376 return 1;
3377}
3378
3379CreateVehicleEx(playerid, model, Float:x, Float:z, Float:y, Float:rot, color1, color2, respawn_time, inveh = true)
3380{
3381 DestroyVehicle(P_DATA[playerid][GiveCar]);
3382 P_DATA[playerid][GiveCar] = CreateVehicle(model, Float:x, Float:z, Float:y, Float:rot, color1, color2, respawn_time);
3383 if(inveh)PutPlayerInVehicle(playerid, P_DATA[playerid][GiveCar], 0);
3384}
3385CMD:accp(PARAMS)
3386{
3387 LoginCheck(playerid);
3388 LevelCheck(playerid, 1);
3389
3390 if(P_DATA[playerid][aCar] == -1)
3391 return SendError(playerid, "You didn't spawn any admin vehicle! Spawn it with "ORAN"/acar");
3392
3393 if(!IsPlayerInVehicle(playerid, P_DATA[playerid][aCar]))
3394 return SendError(playerid, "You must be in your "ORAN"Admin Vehicle"GREY" to use this command!");
3395
3396 SPD(playerid, Dialog:ACCP, LIST, ""W"Tune: "ORAN"Admin Car", ""GREY"Add nos\n\
3397 "GREY"Change colors\n\
3398 "GREY"Components\n\
3399 "BLUE"Save Changes\n\
3400 "GREE"Load Changes\n\
3401 "ORAN"Discard Changes", "Select", "Close");
3402 return 1;
3403}
3404CMD:acar(PARAMS)
3405{
3406 LoginCheck(playerid);
3407 LevelCheck(playerid, 1);
3408
3409 new Float:Pos[4];
3410 GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
3411
3412 if(IsPlayerInAnyVehicle(playerid))
3413 {
3414 GetVehicleZAngle(GetPlayerVehicleID(playerid), Pos[3]);
3415 GetPlayerFacingAngle(playerid, Pos[3]);
3416 SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]+2);
3417 }else GetPlayerFacingAngle(playerid, Pos[3]);
3418
3419 if(P_DATA[playerid][aCar] == -1)
3420 {
3421 DestroyVehicle(P_DATA[playerid][aCar]);
3422 P_DATA[playerid][aCar] = CreateVehicle(415, Pos[0], Pos[1], Pos[2], Pos [3], 0, 0, 90000);
3423 PutPlayerInVehicle(playerid, P_DATA[playerid][aCar], 0);
3424 SetVehicleHealth(P_DATA[playerid][aCar], 99999.0);
3425
3426 GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~Admin car created!", 3000, 3);
3427 ZaAdminCar[playerid] = CreatePlayer3DTextLabel(playerid, "Your Admin Car", Color:ORAN, 0.0, 0.0, 0.0, 120.0, (0xFFFF), P_DATA[playerid][aCar], 1);
3428 }
3429 else
3430 {
3431 GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~Admin car called!", 3000, 3);
3432
3433 SetVehiclePos(P_DATA[playerid][aCar], Pos[0], Pos[1], Pos[2]);
3434 SetVehicleZAngle(P_DATA[playerid][aCar], Pos[3]);
3435 PutPlayerInVehicle(playerid, P_DATA[playerid][aCar], 0);
3436 }
3437 SendClientMessage(playerid, Color:GREY, "Use "ORAN"/accp"GREY" to tune your admin vehicle!!");
3438
3439 return 1;
3440}
3441CMD:vips(PARAMS)
3442{
3443 LoginCheck(playerid);
3444
3445 new C, S[1024], cString[150];
3446
3447 foreach(Player, i){
3448 if(P_DATA[i][Vip] > 0){
3449 C++;
3450 }
3451 }
3452
3453 format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Vips", C)) : ("{FF0000}No VIP members online!")) ;
3454
3455 if(C == 1){
3456 foreach(Player, i){
3457 if(P_DATA[i][Vip] > 0){
3458 format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"L:%d|ID:%d"W"]",cString, Name(i), P_DATA[i][Vip],i);
3459 }
3460 }
3461 }
3462
3463 if(C > 1){
3464 foreach(Player, i){
3465 if(P_DATA[i][Vip] > 0){
3466 format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"L:%d|ID:%d"W"], ",S, Name(i), P_DATA[i][Vip],i);
3467
3468 if(!(i % MAX_SHOW_PER_ROW)){
3469 if(i != 0){
3470 strdel(S, strlen(S) - 2, strlen(S));
3471 strins(S, "\n", strlen(S));
3472 //S[0] = EOS;
3473 }
3474 }
3475 }
3476 }
3477 }
3478 if(!C) memcpy(S, cString, 0, 1024 );
3479 if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Online VIP members!", S, "Close", "");
3480 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", "");
3481 return 1;
3482}
3483CMD:muted(PARAMS)
3484{
3485 LoginCheck(playerid);
3486
3487 new C, S[1024], cString[150];
3488
3489 foreach(Player, i){
3490 if(P_DATA[i][Muted] > 0){
3491 C++;
3492 }
3493 }
3494
3495 format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Muted", C)) : (""W"--------------\n{FF0000}No Muted players online!\n"W"--------------\n")) ;
3496
3497 if(C == 1){
3498 foreach(Player, i){
3499 if(P_DATA[i][Muted] > 0){
3500 if(!P_DATA[i][MutedTime]){
3501 format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:Forever|ID:%d"W"]",cString, Name(i), i);
3502 }else{
3503 format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:%d|ID:%d"W"]",cString, Name(i), P_DATA[i][MutedTime],i);}
3504 }
3505 }
3506 }
3507
3508 if(C > 1){
3509 foreach(Player, i){
3510 if(P_DATA[i][Muted] > 0){
3511 if(!P_DATA[i][MutedTime]){
3512 format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:Forever|ID:%d"W"]",cString, Name(i), i);
3513 }else{
3514 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);}
3515 if(!(i % MAX_SHOW_PER_ROW)){
3516 if(i != 0){
3517 strdel(S, strlen(S) - 2, strlen(S));
3518 strins(S, "\n", strlen(S));
3519 }
3520 }
3521 }
3522 }
3523 }
3524 if(!C) format(S, sizeof (S), "%s", cString);
3525 if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Online Muted players!", S, "Close", "");
3526 if(strlen(S) > 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Online 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", "");
3527 return 1;
3528}
3529CMD:jailed(PARAMS)
3530{
3531 LoginCheck(playerid);
3532
3533 new C, S[1024], cString[150];
3534
3535 foreach(Player, i){
3536 if(P_DATA[i][Jailed] > 0){
3537 C++;
3538 }
3539 }
3540
3541 format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Jailed", C)) : (""W"--------------\n{FF0000}No Jailed players online!\n"W"--------------\n")) ;
3542
3543 if(C == 1){
3544 foreach(Player, i){
3545 if(P_DATA[i][Jailed] > 0){
3546 if(!P_DATA[i][JailTime]){
3547 format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:Forever|ID:%d"W"]",cString, Name(i), i);
3548 }else{
3549 format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:%d|ID:%d"W"]",cString, Name(i), P_DATA[i][JailTime],i);}
3550 }
3551 }
3552 }
3553
3554 if(C > 1){
3555 foreach(Player, i){
3556 if(P_DATA[i][Jailed] > 0){
3557 if(!P_DATA[i][JailTime]){
3558 format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:Forever|ID:%d"W"]",cString, Name(i), i);
3559 }else{
3560 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);}
3561 if(!(i % MAX_SHOW_PER_ROW)){
3562 if(i != 0){
3563 strdel(S, strlen(S) - 2, strlen(S));
3564 strins(S, "\n", strlen(S));
3565 }
3566 }
3567 }
3568 }
3569 }
3570 if(!C) format(S, sizeof (S), "%s", cString);
3571 if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Online Jailed players!", S, "Close", "");
3572 if(strlen(S) > 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Online 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", "");
3573 return 1;
3574}
3575CMD:frozen(PARAMS)
3576{
3577 LoginCheck(playerid);
3578 LevelCheck(playerid, 1);
3579
3580 new C, S[1024], cString[150];
3581
3582 foreach(Player, i){
3583 if(P_DATA[i][Vip] > 0){
3584 C++;
3585 }
3586 }
3587
3588 format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Frozen", C)) : ("{FF0000}No VIP members online!")) ;
3589
3590 if(C == 1){
3591 foreach(Player, i){
3592 if(P_DATA[i][Vip] > 0){
3593 format(S, sizeof (S), "%s"BLUE"%s",cString, Name(i));
3594 }
3595 }
3596 }
3597
3598 if(C > 1){
3599 foreach(Player, i){
3600 if(P_DATA[i][Vip] > 0){
3601 format(S, sizeof (S), "%s"BLUE"%s, ",S, Name(i));
3602
3603 if(!(i % MAX_SHOW_PER_ROW)){
3604 if(i != 0){
3605 strdel(S, strlen(S) - 2, strlen(S));
3606 strins(S, "\n", strlen(S));
3607 //S[0] = EOS;
3608 }
3609 }
3610 }
3611 }
3612 }
3613 if(!C) format(S, sizeof (S), "%s", cString);
3614 if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Frozen Players!", S, "Close", "");
3615 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", "");
3616 return 1;
3617}
3618CMD:admins(PARAMS)
3619{
3620 LoginCheck(playerid);
3621
3622 new C, S[1024], cString[150];
3623
3624 foreach(Player, i){
3625 if(P_DATA[i][Level] > 0){
3626 C++;
3627 }
3628 }
3629
3630 format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Vips", C)) : ("{FF0000}No Adminstrators online!")) ;
3631
3632 if(C == 1){
3633 foreach(Player, i){
3634 if(P_DATA[i][Level] > 0){
3635 format(S, sizeof (S), "%s"GREE"%s"W"["GREE"L:%d|ID:%d"W"]",cString, Name(i), P_DATA[i][Level],i);
3636 }
3637 }
3638 }
3639
3640 if(C > 1){
3641 foreach(Player, i){
3642 if(P_DATA[i][Level] > 0){
3643 format(S, sizeof (S), "%s"GREE"%s"W"["GREE"L:%d|ID:%d"W"], ",S, Name(i), P_DATA[i][Level],i);
3644
3645 if(!(i % MAX_SHOW_PER_ROW)){
3646 if(i != 0){
3647 strdel(S, strlen(S) - 2, strlen(S));
3648 strins(S, "\n", strlen(S));
3649 //S[0] = EOS;
3650 }
3651 }
3652 }
3653 }
3654 }
3655 if(!C) format(S, sizeof (S), "%s", cString);
3656 if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Online Administrators!", S, "Close", "");
3657 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", "");
3658 return 1;
3659}
3660
3661CMD:wcheck(PARAMS)
3662{
3663 LoginCheck(playerid);
3664 LevelCheck(playerid, 4);
3665
3666 new Player;
3667 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/wcheck <id>", "Will check player's weapon and ammo");
3668 else
3669 {
3670 if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
3671
3672 new Weapon, Ammo, WeaponName[20], String[715];
3673
3674 if(Player != playerid) format(String, sizeof String, ""ORAN"%s"GREY"'s weapons:\n\n", Name(Player));
3675 else String = "{FFFFFF}Checking your weapons\n";
3676
3677 for (new w = 0; w < 9; w++)
3678 {
3679 GetPlayerWeaponData(Player, w, Weapon, Ammo);
3680
3681 if(Ammo < 0) Ammo = 9999;
3682 if(Weapon != 0)
3683 {
3684 GetWeaponName(Weapon, WeaponName[w], 20);
3685 format(String, sizeof String, "%s"GREY"Weapon: "ORAN"%s"GREY" Ammo: "ORAN"%d\n", String, WeaponName[w], Ammo);
3686 }
3687 }
3688 SPD(playerid, Dialog:Empty, BOX, ""GREY"Checking Weapons!", String, "Close", "");
3689 }
3690 return 1;
3691}
3692CMD:fake(PARAMS)
3693{
3694 LoginCheck(playerid);
3695 LevelCheck(playerid, 5);
3696
3697 SendClientMessage(playerid, Color:GREY, "/fakechat /fakecmd /fakedeath /fakecon /fakedisc");
3698 return 1;
3699}
3700CMD:fakedisc(PARAMS)
3701{
3702 LoginCheck(playerid);
3703 LevelCheck(playerid, 5);
3704
3705 new Player, Reason;
3706 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")");
3707 else
3708 {
3709 if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
3710 if(Reason > 3 || Reason < 0) return SendError(playerid, "Invalid reason! ("ORAN" 0 - Crash | 1 - Leaving | 2 - Kick/Ban "GREY")");
3711 SendClientMessage(playerid, Color:GREY, "Fake command sent!");
3712
3713 new zStr[129];
3714 switch(Reason)
3715 {
3716 case 0: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[CRASH]", Name(playerid), playerid);
3717 case 1: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[LEAVING]", Name(playerid), playerid);
3718 case 2: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[KICK"W"/"ORAN"BAN]", Name(playerid), playerid);
3719 }
3720
3721 SendClientMessageToAll(Color:ORAN, zStr);
3722 }
3723 return 1;
3724}
3725CMD:fakecon(PARAMS)
3726{
3727 LoginCheck(playerid);
3728 LevelCheck(playerid, 5);
3729
3730 new Player;
3731 if(sscanf(params, "u",Player)) return SendUsage(playerid, "/fakecon "GREY"<id>", "Will send a fake connection of the player!");
3732 else
3733 {
3734 if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
3735
3736 SendClientMessage(playerid, Color:GREY, "Fake command sent!");
3737
3738 new String[256];
3739 format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined Stunter's God!", Name(Player), Player);
3740 SendClientMessageToAll(Color:ORAN, String);
3741 }
3742 return 1;
3743}
3744CMD:fakecmd(PARAMS)
3745{
3746 LoginCheck(playerid);
3747 LevelCheck(playerid, 5);
3748
3749 new Player, Command[129];
3750 if(sscanf(params, "us[129]",Player, Command)) return SendUsage(playerid, "/fakechat "GREY"<id> <command>", "Will send a fake command! The command must include the /.");
3751 else
3752 {
3753 if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
3754
3755 SendClientMessage(playerid, Color:GREY, "Fake command sent!");
3756
3757 CallRemoteFunction("OnPlayerCommandText", "is", Player, Command);
3758 }
3759 return 1;
3760}
3761CMD:fakemsg(PARAMS)
3762{
3763 LoginCheck(playerid);
3764 LevelCheck(playerid, 5);
3765
3766 new Player, xChat[129];
3767 if(sscanf(params, "us[129]",Player, xChat)) return SendUsage(playerid, "/fakemsg "GREY"<id> [message]", "Will send a fake message of the specified player!");
3768 else
3769 {
3770 if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
3771
3772 SendClientMessage(playerid, Color:GREY, "Fake chat sent!");
3773
3774 SendPlayerMessageToAll(Player, xChat);
3775 }
3776 return 1;
3777}
3778CMD:fakechat(PARAMS)
3779{
3780 LoginCheck(playerid);
3781 LevelCheck(playerid, 5);
3782
3783 new Player, xChat[129];
3784 if(sscanf(params, "us[129]",Player, xChat)) return SendUsage(playerid, "/fakechat "GREY"<id> [message]", "Will send a fake message of the specified player!");
3785 else
3786 {
3787 if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
3788
3789 SendClientMessage(playerid, Color:GREY, "Fake chat sent!");
3790
3791 SendPlayerMessageToAll(Player, xChat);
3792 }
3793 return 1;
3794}
3795CMD:fakedeath(PARAMS)
3796{
3797 LoginCheck(playerid);
3798 LevelCheck(playerid, 5);
3799
3800 #define Killer 0
3801 #define Killed 1
3802
3803 new Fake[2], Weapon;
3804 if(sscanf(params, "uuD(-1)", Fake[Killer], Fake[Killed], Weapon))
3805 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!)");
3806 else
3807 {
3808 if(Fake[Killer] == 0xFFFF) return SendError(playerid, "Killer is not connected!");
3809 if(Fake[Killed] == 0xFFFF) return SendError(playerid, "Killed is not connected!");
3810 if(Fake[Killer] == 0xFFFF && Fake[Killed] == 0xFFFF) return SendError(playerid, "Killer and Killed are both offline!");
3811
3812 if(Weapon == -1)
3813 {
3814 new rWeapon;
3815 switch (random(2))
3816 {
3817 case 0: rWeapon = random(19);
3818 case 1: rWeapon = 21 + random(26);
3819 default: rWeapon = 0;
3820 }
3821 Weapon = rWeapon;
3822 return SendDeathMessage(Fake[Killer], Fake[Killed], Weapon),
3823 SendClientMessage(playerid, Color:GREY, "Fake death sent!");
3824 }
3825
3826 if(!IsValidWeapon(Weapon))
3827 return SendError(playerid, "Invalid Weapon ID!");
3828
3829 SendDeathMessage(Fake[Killer], Fake[Killed], Weapon);
3830
3831 SendClientMessage(playerid, Color:GREY, "Fake death sent!");
3832 }
3833 return 1;
3834}
3835CMD:removeacc(PARAMS)
3836{
3837 LoginCheck(playerid);
3838 LevelCheck(playerid, 5);
3839
3840 new Account[MAX_PLAYER_NAME], Reason[100];
3841 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");
3842 else
3843 {
3844
3845 new Query[200], DBResult:Result;
3846 format(Query, 200, "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s'", Account);
3847 Result = DB::Query(_DB, Query);
3848
3849 if(Result)
3850 {
3851 if(DB::Valid(Result))
3852 {
3853 DB::Free(Result);
3854 if(!strcmp(Name(playerid), Account, false))
3855 return SendError(playerid, "You cannot delete your own account!");
3856
3857 format(Query, 200, "DELETE FROM `Accounts` WHERE `Name` = '%s'", Account);
3858 DB::Query(_DB, Query);
3859
3860 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" has deleted account: "ORAN"%s"GREY"["ORAN"Reason: %s"GREY"]", Name(playerid), playerid, Account, Reason);
3861 FormatMSG(playerid, Color:GREY, "Account "ORAN"%s"GREY" has been deleted!", Account);
3862 FormatMSG(playerid, Color:ORAN, "Reason: "GREY"%s", Reason);
3863 }
3864 else
3865 {
3866 SendError(playerid, "Account does not exist in the database!");
3867 DB::Free(Result);
3868 return 1;
3869 }
3870 }
3871 }
3872 return 1;
3873}
3874CMD:aweapons(PARAMS)
3875{
3876 LoginCheck(playerid);
3877 LevelCheck(playerid, 2);
3878
3879 GivePlayerWeapon(playerid, 24, 99999);
3880 GivePlayerWeapon(playerid, 26, 99999);
3881 GivePlayerWeapon(playerid, 29, 99999);
3882 GivePlayerWeapon(playerid, 31, 99999);
3883 GivePlayerWeapon(playerid, 33, 99999);
3884 GivePlayerWeapon(playerid, 38, 99999);
3885 GivePlayerWeapon(playerid, 9, 1);
3886 SendClientMessage(playerid, Color:GREY, ""ORAN"*"GREY" Admin weapons received!");
3887 return 1;
3888}
3889CMD:car(PARAMS)
3890{
3891 LoginCheck(playerid);
3892 LevelCheck(playerid, 1);
3893
3894 new Car[30], Color[2];
3895 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)");
3896 else
3897 {
3898 if(IsPlayerInAnyVehicle(playerid)) return SendError(playerid, "You are already in a vehicle!");
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
3906 if(Color[0] == -1) Color[0] = random(250);
3907 if(Color[1] == -1) Color[1] = random(250);
3908
3909 new Float: Pos[4];
3910 GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
3911 GetPlayerFacingAngle(playerid, Pos[3]);
3912 CreateVehicleEx(playerid, CarModel, Pos[0], Pos[1], Pos[2], Pos[3], Color[0], Color[1], 900000);
3913
3914 FormatMSG(playerid, Color:GREY, "You spawned "ORAN"%s"GREY" ("ORAN"Model: %d"GREY").", GetVehicleName(CarModel), CarModel);
3915 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" spawned a "ORAN"%s"GREY" ("ORAN"Model: %d"GREY").", Name(playerid), playerid, GetVehicleName(CarModel), CarModel);
3916 }
3917 return 1;
3918}
3919CMD:givecar(PARAMS)
3920{
3921 LoginCheck(playerid);
3922 LevelCheck(playerid, 3);
3923
3924 new Player, Car[30];
3925 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!");
3926 else
3927 {
3928 if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
3929 if(Player == playerid) return SendError(playerid, "Player entered is you! You can use "ORAN"/car"GREY" instead!");
3930 if(IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is already driving a vehicle!");
3931
3932 CheckImune(playerid, Player);
3933
3934 new CarModel;
3935 if(IsNumeric(Car)) CarModel = strval(Car);
3936 else CarModel = GetVModelFromName(Car);
3937
3938 if(CarModel < 400 || CarModel > 611) return SendError(playerid, "Invalid vehicle model/name!");
3939 new Float: Pos[4];
3940
3941 GetPlayerPos(Player, Pos[0], Pos[1], Pos[2]);
3942 GetPlayerFacingAngle(Player, Pos[3]);
3943 CreateVehicleEx(Player, CarModel, Pos[0], Pos[1], Pos[2], Pos[3], random(250), random(250), 900000);
3944
3945 FormatMSG(playerid, Color:GREY, "You gave "ORAN"%s[%i] "GREY"an"ORAN" %s"GREY" ("ORAN"Model: %d"GREY").", Name(Player), Player, GetVehicleName(CarModel), CarModel);
3946 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);
3947 }
3948 return 1;
3949}
3950CMD:giveallweapon(PARAMS)
3951{
3952 LoginCheck(playerid);
3953 LevelCheck(playerid, 4);
3954
3955 new Weapon[10], Ammo;
3956 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!");
3957 else
3958 {
3959 if(Ammo <= 0) return SendError(playerid, "Invalid ammo entered!");
3960
3961
3962 new WeaponID;
3963 if(IsNumeric(Weapon)) WeaponID = strval(Weapon);
3964 else WeaponID = GetWeaponIDFromName(Weapon);
3965
3966 if(!IsValidWeapon(WeaponID))
3967 return SendError(playerid, "Invalid weapon id/name inserted!");
3968
3969 new WeaponName[30];
3970
3971
3972 GetWeaponName(WeaponID, WeaponName, 30);
3973 foreach(Player, i)
3974 {
3975 if(P_DATA[i][Level] != 5)GivePlayerWeapon(i, WeaponID, Ammo);GameTextForPlayer(i, "~w~Weapon received!",3000,1);
3976 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);
3977 }
3978 FormatMSG(playerid, Color:GREY, "You gave everyone a "ORAN"%s(WID:%d)"GREY" with "ORAN"%d"GREY" ammo", WeaponName, WeaponID, Ammo);
3979 }
3980 return 1;
3981}
3982CMD:giveweapon(PARAMS)
3983{
3984 LoginCheck(playerid);
3985 LevelCheck(playerid, 3);
3986
3987 new Player, Weapon[10], Ammo;
3988 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!");
3989 else
3990 {
3991 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
3992 if(Ammo <= 0) return SendError(playerid, "Invalid ammo entered!");
3993 CheckImune(playerid, Player);
3994
3995 new WeaponID;
3996 if(IsNumeric(Weapon)) WeaponID = strval(Weapon);
3997 else WeaponID = GetWeaponIDFromName(Weapon);
3998
3999 if(!IsValidWeapon(WeaponID))
4000 return SendError(playerid, "Invalid weapon id/name inserted!");
4001
4002 new WeaponName[30];
4003 GetWeaponName(WeaponID, WeaponName, 30);
4004 GivePlayerWeapon(Player, WeaponID, Ammo);
4005
4006 if(Player == playerid)
4007 {
4008 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);
4009 FormatMSG(playerid, Color:GREY, "You gave yourself a "ORAN"%s(WID:%d)"GREY" with "ORAN"%d"GREY" ammo", WeaponName, WeaponID, Ammo);
4010 }
4011 else
4012 {
4013 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);
4014 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);
4015 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);
4016 }
4017 GameTextForPlayer(Player, "~w~Weapon received!",3000,1);
4018 }
4019 return 1;
4020}
4021
4022CMD:gotopos(PARAMS)
4023{
4024 LoginCheck(playerid);
4025 LevelCheck(playerid, 1);
4026
4027 new Float: Pos[3];
4028 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!");
4029 else
4030 {
4031 if(IsPlayerInAnyVehicle(playerid))SetVehiclePos(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
4032 else SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
4033
4034 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" teleported to coords: "ORAN"%.1f %.1f %.1f", Name(playerid), playerid, Pos[0], Pos[1], Pos[2]);
4035 FormatMSG(playerid, Color:GREY, "You teleported to coords: "ORAN"%.1f %.1f %.1f", Pos[0], Pos[1], Pos[2]);
4036 }
4037 return 1;
4038}
4039
4040CMD:akill(PARAMS)
4041{
4042 LoginCheck(playerid);
4043 LevelCheck(playerid, 3);
4044
4045 new Player;
4046 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/akill "GREY"<id>", "Will kill the specified player");
4047 else
4048 {
4049 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
4050 if(Player == playerid ) return SendError(playerid, "Player entered is you!");
4051 CheckImune(playerid, Player);
4052
4053 SetPlayerHealth(Player, 0.0);
4054
4055 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" killed "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
4056 FormatMSG(playerid, Color:GREY, "You killed "ORAN"%s[%i]", Name(Player), Player);
4057 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" killed you!", Name(playerid), playerid);
4058 }
4059 return 1;
4060}
4061
4062CMD:spawn(PARAMS)
4063{
4064 LoginCheck(playerid);
4065 LevelCheck(playerid, 1);
4066
4067 new Player;
4068 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/spawn "GREY"<id>", "It will spawn the player on the server's spawn points!");
4069 else
4070 {
4071 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
4072 if(Player == playerid ) return SendError(playerid, "Player entered is you!");
4073 CheckImune(playerid, Player);
4074
4075 SpawnPlayer(Player);
4076
4077 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" spawned "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
4078 FormatMSG(playerid, Color:GREY, "You spawned "ORAN"%s[%i]", Name(Player), Player);
4079 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" spawned you!", Name(playerid), playerid);
4080 }
4081 return 1;
4082}
4083CMD:explodeall(PARAMS)
4084{
4085 LoginCheck(playerid);
4086 LevelCheck(playerid, 4);
4087
4088 new
4089 Float:_P[3];
4090 foreach(Player, i)
4091 {
4092 if(P_DATA[i][Level] != 5)
4093 {
4094 if(i != playerid)
4095 {
4096 GetPlayerPos(i,_P[0], _P[1], _P[2]);CreateExplosion(_P[0], _P[1], _P[2], 7, 10.0);
4097 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" exploded you and everyone else!", Name(playerid), playerid);
4098 }
4099 }
4100 }
4101 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" exploded everyone!", Name(playerid), playerid);
4102 FormatMSG(playerid, Color:GREY, "You exploded everyone!",0);
4103
4104 return 1;
4105}
4106
4107CMD:disarmall(PARAMS)
4108{
4109 LoginCheck(playerid);
4110 LevelCheck(playerid, 4);
4111
4112 foreach(Player, i)
4113 {
4114 if(P_DATA[i][Level] != 5)
4115 {
4116 if(i != playerid)
4117 {
4118 ResetPlayerWeapons(i);
4119 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" disarmed you and everyone else!", Name(playerid), playerid);
4120 }
4121 }
4122 }
4123 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" disarmed everyone!", Name(playerid), playerid);
4124 FormatMSG(playerid, Color:GREY, "You disarmed everyone!",0);
4125
4126 return 1;
4127}
4128CMD:disarm(PARAMS)
4129{
4130 LoginCheck(playerid);
4131 LevelCheck(playerid, 2);
4132
4133 new Player;
4134 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/disarm "GREY"<id>", "Will remove all player's weapons.");
4135 else
4136 {
4137 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
4138 if(Player == playerid ) return SendError(playerid, "Player entered is you!");
4139 CheckImune(playerid, Player);
4140 ResetPlayerWeapons(Player);
4141
4142 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%s[%i]"GREY"'s weapons!", Name(playerid), playerid, Name(Player), Player);
4143 FormatMSG(playerid, Color:GREY, "You disarmed "ORAN"%s[%i]", Name(Player), Player);
4144 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" disarmed you!", Name(playerid), playerid);
4145 }
4146 return 1;
4147}
4148CMD:setstats(PARAMS)
4149{
4150 LoginCheck(playerid);
4151 LevelCheck(playerid, 5);
4152
4153 new Player;
4154 if(sscanf(params, "u", Player))
4155 {
4156 SetPVarInt(playerid, "StatsOf", playerid);
4157 ShowPlayerDialog(playerid, Dialog:SetStatsSure, BOX, "{FFFFFF}Information:", ""GREY"You are on your way to edit your stats!\n"W"Proceed?", "Yes", "Exit");
4158 return SendUsage(playerid, "/setstats "GREY"<id>", "Will open a dialog where you can set player's stats to the desired ones!");
4159 }
4160 else
4161 {
4162 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
4163 if(Player == playerid ) SetPVarInt(playerid, "StatsOf", playerid),
4164 ShowPlayerDialog(playerid, Dialog:SetStatsSure, BOX, "{FFFFFF}Information:", ""GREY"You are on your way to edit your stats!\n"W"Proceed?", "Yes", "Exit");
4165 else
4166 {
4167 new zStr[160];
4168 format(zStr, 160, ""GREY"You are on your way to edit "ORAN"%s"GREY"'s stats!\n"W"Proceed?", Name(Player));
4169 ShowPlayerDialog(playerid, Dialog:SetStatsSure, BOX, "{FFFFFF}Information:", zStr, "Yes", "Exit");
4170 SetPVarInt(playerid, "StatsOf", Player);
4171 }
4172 }
4173 return 1;
4174}
4175CMD:getip(PARAMS)
4176{
4177 LoginCheck(playerid);
4178 LevelCheck(playerid, 1);
4179
4180 new Player;
4181 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/getip "GREY"<id>", "Will get the IP of the specified player!");
4182 else
4183 {
4184 CheckImune(playerid, Player);
4185 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
4186 if(Player == playerid )
4187 {
4188 FormatMSG(playerid, Color:GREY, "Your IP is: "ORAN"%s"GREY" !", GetPlayerIPEx(playerid));
4189 return 1;
4190 }
4191 else
4192 {
4193 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" used command "ORAN"\"/getip\""GREY" on "ORAN"%s[%i]"GREY"", Name(playerid), playerid, Name(Player), Player);
4194 FormatMSG(playerid, Color:GREY, "Player: "ORAN"%s[%i]"GREY" IP: "ORAN"\"%s\"", Name(Player), Player, GetPlayerIPEx(Player));
4195 }
4196 }
4197 return 1;
4198}
4199
4200CMD:bankrupt(PARAMS)
4201{
4202 LoginCheck(playerid);
4203 LevelCheck(playerid, 2);
4204
4205 new Player;
4206 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/bankrupt "GREY"<id>", "Will remove player's cash!");
4207 else
4208 {
4209 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
4210 if(Player == playerid ) return SendError(playerid, "Player entered is you!");
4211 CheckImune(playerid, Player);
4212
4213 ResetPlayerMoney(Player);
4214
4215 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%s[%i]"GREY"'s cash!", Name(playerid), playerid, Name(Player), Player);
4216 FormatMSG(playerid, Color:GREY, "You removed"ORAN"%s[%i]"GREY"'s cash!", Name(Player), Player);
4217 }
4218 return 1;
4219}
4220
4221CMD:get(PARAMS)
4222{
4223 LoginCheck(playerid);
4224 LevelCheck(playerid, 3);
4225
4226 new Player;
4227 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/get "GREY"<id>", "Will teleport the specified player to your position");
4228 else
4229 {
4230 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
4231 if(Player == playerid ) return SendError(playerid, "Player entered is you!");
4232 CheckImune(playerid, Player);{}
4233
4234 new Float: Pos[4];
4235
4236 if(IsPlayerInAnyVehicle(Player))
4237 {
4238 LinkVehicleToInterior(GetPlayerVehicleID(Player), GetPlayerInterior(playerid));
4239 SetVehicleVirtualWorld(GetPlayerVehicleID(Player), GetPlayerVirtualWorld(playerid));
4240
4241 SetVehiclePos(GetPlayerVehicleID(Player), Pos[0] + 2, Pos[1] + 2, Pos[2] + 1);
4242 SetVehicleZAngle(GetPlayerVehicleID(Player), Pos[3]);
4243 }
4244 else
4245 {
4246 GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
4247 GetPlayerFacingAngle(playerid, Pos[3]);
4248
4249 SetPlayerPos(Player, Pos[0], Pos[1] + 2, Pos[2] + 0.5);
4250 SetPlayerFacingAngle(Player, Pos[3]);
4251 }
4252 SetPlayerVirtualWorld(Player, GetPlayerVirtualWorld(playerid));
4253 SetPlayerInterior(Player, GetPlayerInterior(playerid));
4254 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" teleported "ORAN"%s[%i]"GREY" to his location!", Name(playerid), playerid, Name(Player), Player);
4255 FormatMSG(playerid, Color:GREY, "You teleported to "ORAN"%s[%i]"GREY" to your location!", Name(Player), Player);
4256 }
4257 return 1;
4258}
4259
4260CMD:tplayer(PARAMS)
4261{
4262 LoginCheck(playerid);
4263 LevelCheck(playerid, 2);
4264
4265 new Player, Player2;
4266 if(sscanf(params, "uu", Player)) return SendUsage(playerid, "/tplayer "GREY"<id1> <id2>", "Will teleport a player to another player");
4267 else
4268 {
4269 if(Player == (0xFFFF)) return SendError(playerid, "Player1 not connected!");
4270 if(Player2 == (0xFFFF)) return SendError(playerid, "Player2 not connected!");
4271 if(Player == playerid ) return SendError(playerid, "Player1 entered is you!");
4272 if(Player2 == playerid ) return SendError(playerid, "Player2 entered is you!");
4273
4274 if(P_DATA[playerid][Level] < P_DATA[Player][Level])
4275 return SendError(playerid, "You are not allowed to use this command on this admin!");
4276
4277 if(P_DATA[playerid][Level] < P_DATA[Player2][Level])
4278 return SendError(playerid, "You are not allowed to use this command on this admin!");
4279
4280 new Float: Pos[4];
4281
4282 GetPlayerPos(Player2, Pos[0], Pos[1], Pos[2]);
4283 GetPlayerFacingAngle(Player2, Pos[3]);
4284 if(IsPlayerInAnyVehicle(Player))
4285 {
4286 LinkVehicleToInterior(GetPlayerVehicleID(Player), GetPlayerInterior(Player2));
4287 SetVehicleVirtualWorld(GetPlayerVehicleID(Player), GetPlayerVirtualWorld(Player2));
4288
4289 SetVehiclePos(GetPlayerVehicleID(Player), Pos[0] + 2, Pos[1] + 2, Pos[2] + 1);
4290 SetVehicleZAngle(GetPlayerVehicleID(Player), Pos[3]);
4291 }
4292 else
4293 {
4294 SetPlayerPos(Player, Pos[0], Pos[1] + 2, Pos[2] + 0.5);
4295 SetPlayerFacingAngle(Player, Pos[3]);
4296 }
4297
4298 SetPlayerVirtualWorld(Player, GetPlayerVirtualWorld(Player2));
4299 SetPlayerInterior(Player, GetPlayerInterior(Player2));
4300
4301 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);
4302 FormatMSG(playerid, Color:GREY, "You teleported "ORAN"%s[%i]"GREY" to "ORAN"%s[%i]", Name(Player), Player ,Name(Player2), Player2);
4303
4304 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" teleported you to "ORAN"%s[%i]"GREY"", Name(playerid), playerid ,Name(Player2), Player2);
4305 FormatMSG(Player2, Color:GREY, "Admin "ORAN"%s[%i]"GREY" teleported "ORAN"%s[%i]"GREY" to your position", Name(playerid), playerid ,Name(Player), Player);
4306 }
4307 return 1;
4308}
4309
4310CMD:goto(PARAMS)
4311{
4312 LoginCheck(playerid);
4313 LevelCheck(playerid, 1);
4314
4315 new Player;
4316 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/goto "GREY"<id>", "Will teleport you to the specified player");
4317 else
4318 {
4319 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
4320 if(Player == playerid ) return SendError(playerid, "Player entered is you!");
4321 CheckImune(playerid, Player);
4322
4323 new Float: Pos[4];
4324
4325 GetPlayerPos(Player, Pos[0], Pos[1], Pos[2]);
4326 GetPlayerFacingAngle(Player, Pos[3]);
4327
4328 if(IsPlayerInAnyVehicle(playerid))
4329 {
4330 LinkVehicleToInterior(GetPlayerVehicleID(playerid), GetPlayerInterior(Player));
4331 SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(Player));
4332
4333 SetVehiclePos(GetPlayerVehicleID(playerid), Pos[0] + 2, Pos[1] + 2, Pos[2] + 1);
4334 SetVehicleZAngle(GetPlayerVehicleID(playerid), Pos[3]);
4335 }
4336 else
4337 {
4338 SetPlayerPos(playerid, Pos[0], Pos[1] + 2, Pos[2] + 0.5);
4339 SetPlayerFacingAngle(playerid, Pos[3]);
4340 }
4341 SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(Player));
4342 SetPlayerInterior(playerid, GetPlayerInterior(Player));
4343 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" teleported to "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
4344 FormatMSG(playerid, Color:GREY, "You teleported to "ORAN"%s[%i]", Name(Player), Player);
4345 }
4346 return 1;
4347}
4348CMD:write(PARAMS)
4349{
4350 LoginCheck(playerid);
4351 LevelCheck(playerid, 3);
4352
4353 new Message[129];
4354 if(sscanf(params, "s[129]", Message)) return SendUsage(playerid, "/write "GREY"[message]", "Will send a message in the chat with grey color");
4355 else
4356 {
4357 SendClientMessageToAll(Color:GREY, Message);
4358 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" sent a message to the server.", Name(playerid), playerid);
4359 GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~g~~h~Message sent!", 3000, 3);
4360 }
4361 return 1;
4362}
4363CMD:giveallcash(PARAMS)
4364{
4365 LoginCheck(playerid);
4366 LevelCheck(playerid, 4);
4367
4368 new Cash;
4369 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")");
4370 else
4371 {
4372 foreach(Player, i)
4373 {
4374 if(P_DATA[i][Level] != 5)GivePlayerMoney(i, Cash);
4375 if(Cash > 0)
4376 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"$%d"GREY" cash!", Name(playerid), playerid, Cash);
4377 else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"$%d"GREY" cash from everyone!", Name(playerid), playerid, Cash);
4378 }
4379 }
4380 return 1;
4381}
4382CMD:setallcash(PARAMS)
4383{
4384 LoginCheck(playerid);
4385 LevelCheck(playerid, 4);
4386
4387 new Cash;
4388 if(sscanf(params, "i", Cash)) return SendUsage(playerid, "/setallcash "GREY"<cash>", "Will set everyone's cash to the amount set");
4389 else
4390 {
4391 foreach(Player, i)
4392 {
4393 if(P_DATA[i][Level] != 5)
4394 {
4395 ResetPlayerMoney(i);
4396 GivePlayerMoney(i, Cash);
4397 }
4398 if(Cash > 0)
4399 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's cash to "ORAN"%d", Name(playerid), playerid, Cash);
4400 else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed everyone's cash!", Name(playerid), playerid);
4401 }
4402 }
4403 return 1;
4404}
4405CMD:giveallarmour(PARAMS)
4406{
4407 LoginCheck(playerid);
4408 LevelCheck(playerid, 4);
4409
4410 new Armour;
4411 if(sscanf(params, "i", Armour)) return SendUsage(playerid, "/giveallarmour "GREY"<armour>", "Will give everyone armour("GREY"Negative numbers are not allowed! "W")");
4412 else
4413 {
4414 if(Armour < 1) return SendUsage(playerid, "/giveallarmour "GREY"<armour>", "Will give everyone armour("GREY"Negative numbers are not allowed! "W")");
4415 foreach(Player, i)
4416 {
4417 if(P_DATA[i][Level] != 5)
4418 {
4419 new Float:a;
4420 GetPlayerArmour(i, a);
4421 SetPlayerArmour(i, a + Armour);
4422 }
4423 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" armour!", Name(playerid), playerid, Armour);
4424 }
4425 }
4426 return 1;
4427}
4428CMD:setallarmour(PARAMS)
4429{
4430 LoginCheck(playerid);
4431 LevelCheck(playerid, 4);
4432
4433 new Armour;
4434 if(sscanf(params, "i", Armour)) return SendUsage(playerid, "/setallarmour "GREY"<armour>", "Will set everyone's armour");
4435 else
4436 {
4437 foreach(Player, i)
4438 {
4439 if(P_DATA[i][Level] != 5)
4440 {
4441 SetPlayerArmour(i, Armour);
4442 }
4443 if(Armour > 0)
4444 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's Armour to "ORAN"%d", Name(playerid), playerid, Armour);
4445 else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed everyone's armour!", Name(playerid), playerid);
4446 }
4447 }
4448 return 1;
4449}
4450CMD:giveallh(PARAMS)
4451{
4452 LoginCheck(playerid);
4453 LevelCheck(playerid, 4);
4454
4455 new Health;
4456 if(sscanf(params, "i", Health)) return SendUsage(playerid, "/giveallh "GREY"<health>", "Will give everyone health("GREY"Negative numbers are not allowed! "W")");
4457 else
4458 {
4459 if(Health < 1) return SendUsage(playerid, "/ah "GREY"<health>", "Will give everyone health("GREY"Negative numbers are not allowed! "W")");
4460 foreach(Player, i)
4461 {
4462 if(P_DATA[i][Level] != 5)
4463 {
4464 new Float:he;
4465 GetPlayerHealth(i, he),
4466 SetPlayerHealth(i, he + Health);
4467 }
4468 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" health!", Name(playerid), playerid, Health);
4469 }
4470 }
4471 return 1;
4472}
4473CMD:setallhealth(PARAMS)
4474{
4475 LoginCheck(playerid);
4476 LevelCheck(playerid, 4);
4477
4478 new Health;
4479 if(sscanf(params, "i", Health)) return SendUsage(playerid, "/setallhealth "GREY"<health>", "Will set everyone's health");
4480 else
4481 {
4482 foreach(Player, i)
4483 {
4484 if(P_DATA[i][Level] != 5)
4485 {
4486 SetPlayerHealth(i, Health);
4487 }
4488 if(Health > 0)
4489 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's health to "ORAN"%d", Name(playerid), playerid, Health);
4490 else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" killed everyone!", Name(playerid), playerid);
4491 }
4492 }
4493 return 1;
4494}
4495
4496CMD:setalldrunk(PARAMS)
4497{
4498 LoginCheck(playerid);
4499 LevelCheck(playerid, 4);
4500
4501 new Drunk;
4502 if(sscanf(params, "i", Drunk)) return SendUsage(playerid, "/setalldrunk "GREY"<level>", "Will make players get drunk! Use "ORAN"0"W" to remove drunkenness");
4503 else
4504 {
4505 foreach(Player, i)
4506 {
4507 if(P_DATA[i][Level] != 5)
4508 {
4509 if(Drunk != 0) SetPlayerDrunkLevel(i, 9999 + Drunk);
4510 else SetPlayerDrunkLevel(i, 0);
4511 }
4512 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's drunk level to "ORAN"%d", Name(playerid), playerid, Drunk);
4513 }
4514 }
4515 return 1;
4516}
4517
4518CMD:setallint(PARAMS)
4519{
4520 LoginCheck(playerid);
4521 LevelCheck(playerid, 4);
4522
4523 new Interior;
4524 if(sscanf(params, "i", Interior)) return SendUsage(playerid, "/setallint "GREY"<interior>", "Will set everyone's interior id to the sapecified interior");
4525 else
4526 {
4527 foreach(Player, i)
4528 {
4529 if(P_DATA[i][Level] != 5)
4530 {
4531 SetPlayerInterior(i, Interior);
4532 }
4533 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's interior to "ORAN"%d", Name(playerid), playerid, Interior);
4534 }
4535 }
4536 return 1;
4537}
4538
4539CMD:setallworld(PARAMS)
4540{
4541 LoginCheck(playerid);
4542 LevelCheck(playerid, 4);
4543
4544 new World;
4545 if(sscanf(params, "i", World)) return SendUsage(playerid, "/setallworld "GREY"<world>", "Will set everyone's Virtual World to the specified world");
4546 else
4547 {
4548 foreach(Player, i)
4549 {
4550 if(P_DATA[i][Level] != 5)
4551 {
4552 SetPlayerVirtualWorld(i, World);
4553 }
4554 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's virtual world to "ORAN"%d", Name(playerid), playerid, World);
4555 }
4556 }
4557 return 1;
4558}
4559CMD:giveallscore(PARAMS)
4560{
4561 LoginCheck(playerid);
4562 LevelCheck(playerid, 4);
4563
4564 new zScore;
4565 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")");
4566 else
4567 {
4568 foreach(Player, i)
4569 {
4570 if(P_DATA[i][Level] != 5)SetPlayerScore(i, (zScore) ? (GetPlayerScore(i) + zScore) : (GetPlayerScore(i) - zScore));
4571 if(zScore > 0)
4572 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" score!", Name(playerid), playerid, zScore);
4573 else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%d"GREY" score from everyone!", Name(playerid), playerid, zScore);
4574 }
4575 }
4576 return 1;
4577}
4578CMD:setallscore(PARAMS)
4579{
4580 LoginCheck(playerid);
4581 LevelCheck(playerid, 4);
4582
4583 new aScore;
4584 if(sscanf(params, "i", aScore)) return SendUsage(playerid, "/setallscore "GREY"<score>", "Will set everyone's score to the specified score");
4585 else
4586 {
4587 foreach(Player, i)
4588 {
4589 if(P_DATA[i][Level] != 5)
4590 {
4591 SetPlayerScore(i, aScore);
4592 }
4593 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's score to "ORAN"%d", Name(playerid), playerid, aScore);
4594 }
4595 }
4596 return 1;
4597}
4598CMD:giveallwanted(PARAMS)
4599{
4600 LoginCheck(playerid);
4601 LevelCheck(playerid, 4);
4602
4603 new Wanted;
4604 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")");
4605 else
4606 {
4607 foreach(Player, i)
4608 {
4609 if(P_DATA[i][Level] != 5)
4610 {
4611 if(GetPlayerWantedLevel(i) >= 0)
4612 {
4613 SetPlayerWantedLevel(i, (Wanted) ? (GetPlayerWantedLevel(i) + Wanted) : (GetPlayerWantedLevel(i) - Wanted));
4614 if(GetPlayerWantedLevel(i) < 0) SetPlayerWantedLevel(i, 0);
4615 }
4616 }
4617 if(Wanted > 0) FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" wanted stars!", Name(playerid), playerid, Wanted);
4618 else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%d"GREY" wanted stars from everyone!", Name(playerid), playerid, Wanted);
4619 }
4620 }
4621 return 1;
4622}
4623CMD:giveallcookies(PARAMS)
4624{
4625 LoginCheck(playerid);
4626 LevelCheck(playerid, 4);
4627
4628 new Cookiz;
4629 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")");
4630 else
4631 {
4632 new String[10];
4633 if(Cookiz < 0)
4634 {
4635 format(String, sizeof String, "%d", Cookiz);
4636 strdel(String, 0, 1);
4637 }
4638 foreach(Player, i)
4639 {
4640 if(P_DATA[i][Level] != 5)
4641 {
4642 if(Cookiz < 0)P_DATA[i][Cookies] -= strval(String);
4643 else P_DATA[i][Cookies] += Cookiz;
4644
4645
4646 if(P_DATA[i][Cookies] < 0) P_DATA[i][Cookies] = 0;
4647 }
4648 if(Cookiz > 0) FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" cookies!", Name(playerid), playerid, Cookiz);
4649 else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%d"GREY" cookies from everyone!", Name(playerid), playerid, Cookiz);
4650 }
4651 }
4652 return 1;
4653}
4654
4655CMD:setrespect(PARAMS)
4656{
4657 LoginCheck(playerid);
4658 LevelCheck(playerid, 3);
4659
4660 new Player, rType[2],Respect;
4661 if(sscanf(params, "us[2]i", Player, rType, Respect)) return SendUsage(playerid, "/setrespect "GREY"<id> <-/+> <respect>", "Will change player's negative/positive respect!");
4662 else
4663 {
4664 if(Respect < 0) return SendUsage(playerid, "/setrespect "GREY"<id> <-/+> <respect>", "Will change player's negative/positive respect!");
4665 if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
4666 CheckImune(playerid, Player);
4667
4668 if(!strcmp(rType, "+", false)) SetPVarInt(Player, "0_Positive", Respect);
4669 else if(!strcmp(rType, "-", false))SetPVarInt(Player, "0_Negative", Respect);
4670 else return SendError(playerid, "The first parameter must contain either '+' or '-' without '. (+ Positive respect | - Negative respect)");
4671
4672 if(playerid != Player)
4673 {
4674 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);
4675 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);
4676 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);
4677 }
4678 else
4679 {
4680 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his %s respect to "ORAN"%d!", Name(playerid), playerid, (strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Respect);
4681 FormatMSG(playerid, Color:GREY,"You set your %s respect to "ORAN"%d", (strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Respect);
4682 }
4683 #if UPDATE_TOP_ALWAYS == true
4684 new
4685 Query[256],
4686 DBResult: R1;
4687
4688 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
4689 R1 = DB::Query(_DB, Query);
4690
4691 if(R1)
4692 {
4693 if(DB::Valid(R1))
4694 {
4695 DB::Free(R1);
4696 format(Query, sizeof(Query), "UPDATE `Top` SET `%s` = '%d' WHERE `Name` = '%s'", (!strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Respect, Name(Player));
4697 DB::Query(_DB, Query);
4698 }
4699 else
4700 {
4701 DB::Free(R1);
4702 format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `%s`) VALUES('%s','%d')", (!strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Name(Player), Respect);
4703 DB::Query(_DB, Query);
4704 }
4705 }
4706 #endif
4707 }
4708 return 1;
4709}
4710CMD:giveallrespect(PARAMS)
4711{
4712 LoginCheck(playerid);
4713 LevelCheck(playerid, 4);
4714
4715 new rType[2],Respect;
4716 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)");
4717 else
4718 {
4719 if(Respect < 0) return SendUsage(playerid, "/giveallrespect "GREY"<-/+> <respect>", "Will give everyone respect(Either negative respect that even positive respect)");
4720 if(!strcmp(rType, "+", false))
4721 {
4722 foreach(Player, i)
4723 {
4724 if(P_DATA[i][Level] != 5)
4725 {
4726 SetPVarInt(i, "0_Positive", GetPVarInt(i, "0_Positive") + Respect);
4727 #if UPDATE_TOP_ALWAYS == true
4728 new
4729 Query[256],
4730 DBResult: R1;
4731
4732 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
4733 R1 = DB::Query(_DB, Query);
4734
4735 if(R1)
4736 {
4737 if(DB::Valid(R1))
4738 {
4739 DB::Free(R1);
4740 format(Query, sizeof(Query), "UPDATE `Top` SET `Positive` = '%d' WHERE `Name` = '%s'", GetPVarInt(i, "0_Positive"), Name(i));
4741 DB::Query(_DB, Query);
4742 }
4743 }
4744 #endif
4745 }
4746 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" positive respect!", Name(playerid), playerid, Respect);
4747 }
4748 }
4749 else if(!strcmp(rType, "-", false))
4750 {
4751 foreach(Player, i)
4752 {
4753 if(P_DATA[i][Level] != 5)
4754 {
4755 SetPVarInt(i, "0_Negative", GetPVarInt(i, "0_Negative") + Respect);
4756 #if UPDATE_TOP_ALWAYS == true
4757 new
4758 Query[256],
4759 DBResult: R1;
4760
4761 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
4762 R1 = DB::Query(_DB, Query);
4763
4764 if(R1)
4765 {
4766 if(DB::Valid(R1))
4767 {
4768 DB::Free(R1);
4769 format(Query, sizeof(Query), "UPDATE `Top` SET `Negative` = '%d' WHERE `Name` = '%s'", GetPVarInt(i, "0_Negative"), Name(i));
4770 DB::Query(_DB, Query);
4771 }else DB::Free(R1);
4772 }
4773 #endif
4774 }
4775 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" negative respect!", Name(playerid), playerid, Respect);
4776 }
4777 }
4778 else return SendError(playerid, "The first parameter must contain either '+' or '-' without '. (+ Positive respect | - Negative respect)");
4779 }
4780 return 1;
4781}
4782CMD:resetallrespect(PARAMS)
4783{
4784 LoginCheck(playerid);
4785 LevelCheck(playerid, 4);
4786
4787 new rType[2];
4788 if(sscanf(params, "s[2]", rType)) return SendUsage(playerid, "/resetallrespect "GREY" <-/+>", "Will reset everyone's positive/negative respect!");
4789 else
4790 {
4791 if(!strcmp(rType, "+", false))
4792 {
4793 foreach(Player, i)
4794 {
4795 if(P_DATA[i][Level] != 5)
4796 {
4797 #if UPDATE_TOP_ALWAYS == true
4798 new
4799 Query[256],
4800 DBResult: R1;
4801
4802 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
4803 R1 = DB::Query(_DB, Query);
4804
4805 if(R1)
4806 {
4807 if(DB::Valid(R1))
4808 {
4809 DB::Free(R1);
4810 format(Query, sizeof(Query), "UPDATE `Top` SET `Positive` = '0' WHERE `Name` = '%s'", Name(i));
4811 DB::Query(_DB, Query);
4812 }
4813 }
4814 #endif
4815 SetPVarInt(i, "0_Positive", 0);
4816 }
4817 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" reseted everyone's positive respect!", Name(playerid), playerid);
4818 }
4819 }
4820 else if(!strcmp(rType, "-", false))
4821 {
4822 foreach(Player, i)
4823 {
4824 if(P_DATA[i][Level] != 5)
4825 {
4826 #if UPDATE_TOP_ALWAYS == true
4827 new
4828 Query[256],
4829 DBResult: R1;
4830
4831 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
4832 R1 = DB::Query(_DB, Query);
4833
4834 if(R1)
4835 {
4836 if(DB::Valid(R1))
4837 {
4838 DB::Free(R1);
4839 format(Query, sizeof(Query), "UPDATE `Top` SET `Negative` = '0' WHERE `Name` = '%s'", Name(i));
4840 DB::Query(_DB, Query);
4841 }
4842 }
4843 #endif
4844 SetPVarInt(i, "0_Negative", 0);
4845 }
4846 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" reseted everyone's negative respect!", Name(playerid), playerid);
4847 }
4848 }
4849 }
4850 return 1;
4851}
4852CMD:setallrespect(PARAMS)
4853{
4854 LoginCheck(playerid);
4855 LevelCheck(playerid, 4);
4856
4857 new rType[2],Respect;
4858 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)");
4859 else
4860 {
4861 if(Respect < 0) return SendUsage(playerid, "/setallrespect "GREY"<-/+> <respect>", "Will set everyone's respect(Either negative respect that even positive respect)");
4862 if(!strcmp(rType, "+", false))
4863 {
4864 foreach(Player, i)
4865 {
4866 if(P_DATA[i][Level] != 5)
4867 {
4868 #if UPDATE_TOP_ALWAYS == true
4869 new
4870 Query[256],
4871 DBResult: R1;
4872
4873 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
4874 R1 = DB::Query(_DB, Query);
4875
4876 if(R1)
4877 {
4878 if(DB::Valid(R1))
4879 {
4880 DB::Free(R1);
4881 format(Query, sizeof(Query), "UPDATE `Top` SET `Positive` = '%d' WHERE `Name` = '%s'", Respect, Name(i));
4882 DB::Query(_DB, Query);
4883 }else DB::Free(R1);
4884 }
4885 #endif
4886 SetPVarInt(i, "0_Positive", Respect);
4887 }
4888 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's positive respect to "ORAN"%d", Name(playerid), playerid, Respect);
4889 }
4890 }
4891 else if(!strcmp(rType, "-", false))
4892 {
4893 foreach(Player, i)
4894 {
4895 if(P_DATA[i][Level] != 5)
4896 {
4897 #if UPDATE_TOP_ALWAYS == true
4898 new
4899 Query[256],
4900 DBResult: R1;
4901
4902 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
4903 R1 = DB::Query(_DB, Query);
4904
4905 if(R1)
4906 {
4907 if(DB::Valid(R1))
4908 {
4909 DB::Free(R1);
4910 format(Query, sizeof(Query), "UPDATE `Top` SET `Negative` = '%d' WHERE `Name` = '%s'", Respect, Name(i));
4911 DB::Query(_DB, Query);
4912 }else DB::Free(R1);
4913 }
4914
4915 #endif
4916 SetPVarInt(i, "0_Negative", Respect);
4917 }
4918 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's negative respect to "ORAN"%d", Name(playerid), playerid, Respect);
4919 }
4920 }
4921 else return SendError(playerid, "The first parameter must contain either '+' or '-' without '. (+ Positive respect | - Negative respect)");
4922 }
4923 return 1;
4924}
4925CMD:setallwanted(PARAMS)
4926{
4927 LoginCheck(playerid);
4928 LevelCheck(playerid, 4);
4929
4930 new Wanted;
4931 if(sscanf(params, "i", Wanted)) return SendUsage(playerid, "/setallwanted "GREY"<level>", "Will make a player wanted of the specified level");
4932 else
4933 {
4934 foreach(Player, i)
4935 {
4936 if(P_DATA[i][Level] != 5)
4937 {
4938 SetPlayerWantedLevel(i, Wanted);
4939 }
4940 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's wanted level to "ORAN"%d", Name(playerid), playerid, Wanted);
4941 }
4942 }
4943 return 1;
4944}
4945CMD:healcar(PARAMS)
4946{
4947 LoginCheck(playerid);
4948 LevelCheck(playerid, 2);
4949
4950 new Player;
4951 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/healcar "GREY"<id>", "Will heal a player's car!");
4952 else
4953 {
4954 if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
4955 if(Player == playerid) return SendError(playerid, "You can use "ORAN"/cargod"W" if you want!");
4956 if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
4957
4958 SetVehicleHealth(GetPlayerVehicleID(Player), 1200);
4959
4960 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" healed "ORAN"%s[%i]'s"GREY" vehicle!", Name(playerid), playerid, Name(Player), Player);
4961 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" healed your vehicle!", Name(playerid), playerid);
4962 FormatMSG(Player, Color:GREY, "You healed "ORAN"%s[%i]"GREY"'s vehicle!", Name(Player), Player);
4963 }
4964 return 1;
4965}
4966CMD:destroyv(PARAMS)
4967{
4968 LevelCheck(playerid, 3);
4969
4970 new Player;
4971
4972 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/destroyv "GREY"<id>", "Will destroy player's vehicle!");
4973 else
4974 {
4975 if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
4976 if(Player == playerid) return SendError(playerid, "Player entered is you!");
4977 if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
4978
4979 P_DATA[Player][CarGod] = 0;
4980 SetVehicleHealth(GetPlayerVehicleID(Player), 0);
4981
4982 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" destroyed "ORAN"%s[%i]'s"GREY" vehicle!", Name(playerid), playerid, Name(Player), Player);
4983 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" destroyed your vehicle!", Name(playerid), playerid);
4984 FormatMSG(Player, Color:GREY, "You destroyed "ORAN"%s[%i]"GREY"'s vehicle!", Name(Player), Player);
4985 }
4986 return 1;
4987}
4988
4989CMD:setvhealth(PARAMS)
4990{
4991 LoginCheck(playerid);
4992 LevelCheck(playerid, 2);
4993
4994 new Player, vHealth;
4995 if(sscanf(params, "ui", Player, vHealth)) return SendUsage(playerid, "/setvh "GREY"<id> <health>", "Will set player's vehicle health!");
4996 else
4997 {
4998 if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
4999 if(Player == playerid) return SendError(playerid, "Player entered is you!");
5000 if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
5001
5002 SetVehicleHealth(GetPlayerVehicleID(Player), vHealth);
5003
5004 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);
5005 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your vehicle's health to"ORAN"%d!", Name(playerid), playerid, vHealth);
5006 FormatMSG(Player, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s vehicle health to"ORAN"%d!", Name(Player), Player, vHealth);
5007 }
5008 return 1;
5009}
5010CMD:carcolor(PARAMS)
5011{
5012 LoginCheck(playerid);
5013 LevelCheck(playerid, 2);
5014
5015 new Player, vColor[2];
5016 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)");
5017 {
5018 if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
5019 if(Player == playerid) return SendError(playerid, "Player entered is you!");
5020 if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
5021
5022 if(!vColor[0]) vColor[0] = random(255);
5023 if(!vColor[1]) vColor[1] = random(255);
5024
5025 ChangeVehicleColor(GetPlayerVehicleID(Player), vColor[0], vColor[1]);
5026
5027 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed "ORAN"%s[%i]'s"GREY" vehicle colors", Name(playerid), playerid, Name(Player), Player);
5028 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" changed your vehicle's colors", Name(playerid), playerid);
5029 FormatMSG(Player, Color:GREY, "You changed "ORAN"%s[%i]"GREY"'s vehicle colors", Name(Player), Player);
5030 }
5031 return 1;
5032}
5033
5034CMD:heal(PARAMS)
5035{
5036 LoginCheck(playerid);
5037
5038 new Player;
5039 if(sscanf(params, "u", Player))
5040 {
5041 if(P_DATA[playerid][Level] == 2)
5042 {
5043 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" healed himself!", Name(playerid), playerid);
5044 SendClientMessage(playerid, Color:GREY, "You healed yourself!");
5045 }
5046 else if(P_DATA[playerid][Level] > 2)
5047 {
5048 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" healed himself!", Name(playerid), playerid);
5049 SendClientMessage(playerid, Color:GREY, "You healed yourself!");
5050 return SendUsage(playerid, "/heal"GREY" <id>", "Will heal a specified player!");
5051 }
5052 }
5053 else
5054 {
5055 if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
5056 SetPlayerHealth(Player, 100.0);
5057
5058 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" healed "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
5059 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" healed you!", Name(playerid), playerid);
5060 FormatMSG(playerid, Color:GREY, "You healed player "ORAN"%s[%i]", Name(Player), Player);
5061 }
5062 return 1;
5063}
5064
5065CMD:healall(PARAMS)
5066{
5067 LoginCheck(playerid);
5068 LevelCheck(playerid, 3);
5069
5070 foreach(Player, i)
5071 {
5072 if(P_DATA[i][Level] != 5)
5073 {
5074 SetPlayerHealth(i, 100.0);
5075 }
5076 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" healed everyone", Name(playerid), playerid);
5077 }
5078 return 1;
5079}
5080CMD:setallskin(PARAMS)
5081{
5082 LoginCheck(playerid);
5083 LevelCheck(playerid, 4);
5084
5085 new Skin;
5086 if(sscanf(params, "i", Skin)) return SendUsage(playerid, "/setallskin "GREY"<skin>", "Will set everyone's skin to the specified ID");
5087 else
5088 {
5089 if(!IsValidSkin(Skin)) return SendError(playerid, "Invalid skin ID!");
5090
5091 foreach(Player, i)
5092 {
5093 if(P_DATA[i][Level] != 5)
5094 {
5095 SetPlayerSkin(i, Skin);
5096 }
5097 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's skin to "ORAN"%d", Name(playerid), playerid, Skin);
5098 }
5099 }
5100 return 1;
5101}
5102
5103CMD:setalltime(PARAMS)
5104{
5105 LoginCheck(playerid);
5106 LevelCheck(playerid, 3);
5107
5108 new Time;
5109 if(sscanf(params, "i", Time)) return SendUsage(playerid, "/setalltime "GREY"<hour>", "Will change everyone's in-game time");
5110 else
5111 {
5112 foreach(Player, i)
5113 {
5114 if(P_DATA[i][Level] != 5)
5115 {
5116 SetPlayerTime(i, Time, 0);
5117 }
5118 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's time to "ORAN"%d:00", Name(playerid), playerid, Time);
5119 }
5120 }
5121 return 1;
5122}
5123CMD:setallweather(PARAMS)
5124{
5125 LoginCheck(playerid);
5126 LevelCheck(playerid, 3);
5127
5128 new Weather;
5129 if(sscanf(params, "i", Weather)) return SendUsage(playerid, "/setallweather "GREY"<weather id>", "Will change everyone's weather");
5130 else
5131 {
5132 foreach(Player, i)
5133 {
5134 if(P_DATA[i][Level] != 5)
5135 {
5136 SetPlayerWeather(i, Weather);
5137 }
5138 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's weather to "ORAN"%d", Name(playerid), playerid, Weather);
5139 }
5140 }
5141 return 1;
5142}
5143
5144CMD:setdrunk(PARAMS)
5145{
5146 LoginCheck(playerid);
5147 LevelCheck(playerid, 3);
5148
5149 new Player, Drunk;
5150 if(sscanf(params, "ui", Player, Drunk)) return SendUsage(playerid, "/setdrunk "GREY"<id> <level>", "Will set a player drunk of the specified level");
5151 else
5152 {
5153 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5154 CheckImune(playerid, Player);
5155
5156 SetPlayerDrunkLevel(Player, Drunk);
5157
5158 if(Player != playerid)
5159 {
5160 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);
5161 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s drunk level to "ORAN"%d", Name(Player), Player, Drunk);
5162 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your drunk level to "ORAN"%d", Name(playerid), playerid, Drunk);
5163 }
5164 else
5165 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set drunk level to "ORAN"%d", Name(playerid), playerid, Drunk);
5166 }
5167 return 1;
5168}
5169CMD:setwanted(PARAMS)
5170{
5171 LoginCheck(playerid);
5172 LevelCheck(playerid, 3);
5173
5174 new Player, Wanted;
5175 if(sscanf(params, "ui", Player, Wanted)) return SendUsage(playerid, "/setwanted "GREY"<id> <level>", "Will set the specified player wanted of the specified level");
5176 else
5177 {
5178 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5179 CheckImune(playerid, Player);
5180
5181 SetPlayerWantedLevel(Player, Wanted);
5182
5183 if(Player != playerid)
5184 {
5185 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);
5186 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s wanted level to "ORAN"%d", Name(Player), Player, Wanted);
5187 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your wanted level to "ORAN"%d", Name(playerid), playerid, Wanted);
5188 }
5189 else
5190 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his wanted level to "ORAN"%d", Name(playerid), playerid, Wanted);
5191 }
5192 return 1;
5193}
5194CMD:setinterior(PARAMS)
5195{
5196 LoginCheck(playerid);
5197 LevelCheck(playerid, 3);
5198
5199 new Player, Interior;
5200 if(sscanf(params, "ui", Player, Interior)) return SendUsage(playerid, "/setinterior "GREY"<id> <interior>", "Will set player's interior");
5201 else
5202 {
5203 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5204 CheckImune(playerid, Player);
5205
5206 SetPlayerInterior(Player, Interior);
5207
5208 if(Player != playerid)
5209 {
5210 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);
5211 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s interior to "ORAN"%d", Name(Player), Player, Interior);
5212 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your interior to "ORAN"%d", Name(playerid), playerid, Interior);
5213 }
5214 else
5215 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his interior to "ORAN"%d", Name(playerid), playerid, Interior);
5216 }
5217 return 1;
5218}
5219CMD:setworld(PARAMS)
5220{
5221 LoginCheck(playerid);
5222 LevelCheck(playerid, 3);
5223
5224 new Player, World;
5225 if(sscanf(params, "ui", Player, World)) return SendUsage(playerid, "/setworld "GREY"<id> <world>", "Will change player's virtual world");
5226 else
5227 {
5228 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5229 CheckImune(playerid, Player);
5230
5231 SetPlayerVirtualWorld(Player, World);
5232
5233 if(Player != playerid)
5234 {
5235 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);
5236 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s virtual world to "ORAN"%d", Name(Player), Player, World);
5237 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your virtual world to "ORAN"%d", Name(playerid), playerid, World);
5238 }
5239 else
5240 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his virtual world to "ORAN"%d", Name(playerid), playerid, World);
5241 }
5242 return 1;
5243}
5244CMD:setcash(PARAMS)
5245{
5246 LoginCheck(playerid);
5247 LevelCheck(playerid, 3);
5248
5249 new Player, Cash;
5250 if(sscanf(params, "ui", Player, Cash)) return SendUsage(playerid, "/setcash "GREY"<id> <cash>", "Will set player's cash to the amount inserted");
5251 else
5252 {
5253 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5254 CheckImune(playerid, Player);
5255
5256 ResetPlayerMoney(Player);
5257 GivePlayerMoney(Player, Cash);
5258
5259 if(Player != playerid)
5260 {
5261 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s cash to "GREE"$%d", Name(playerid), playerid, Name(Player), Player, Cash);
5262 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s cash to "GREE"$%d", Name(Player), Player, Cash);
5263 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your cash to "GREE"$%d", Name(playerid), playerid, Cash);
5264 }
5265 else
5266 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his cash to "GREE"$%d", Name(playerid), playerid, Cash);
5267 }
5268 return 1;
5269}
5270CMD:setscore(PARAMS)
5271{
5272 LoginCheck(playerid);
5273 LevelCheck(playerid, 3);
5274
5275 new Player, aScore;
5276 if(sscanf(params, "ui", Player, aScore)) return SendUsage(playerid, "/setscore "GREY"<id> <score>", "Will set player's score to the specified score");
5277 else
5278 {
5279 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5280 CheckImune(playerid, Player);
5281
5282 SetPlayerScore(Player, aScore);
5283
5284 if(Player != playerid)
5285 {
5286 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s score to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, aScore);
5287 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s score to "ORAN"%d", Name(Player), Player, aScore);
5288 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your score to "ORAN"%d", Name(playerid), playerid, aScore);
5289 }
5290 else
5291 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his score to "ORAN"%d", Name(playerid), playerid, aScore);
5292 }
5293 return 1;
5294}
5295CMD:setdeaths(PARAMS)
5296{
5297 LoginCheck(playerid);
5298 LevelCheck(playerid, 4);
5299
5300 new Player, zDeaths;
5301 if(sscanf(params, "ui", Player, zDeaths) || zDeaths < 0) return SendUsage(playerid, "/setdeaths "GREY"<id> <deaths>", "Will change player's deaths");
5302 else
5303 {
5304 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5305 CheckImune(playerid, Player);
5306
5307 SetPVarInt(Player, "0_Deaths", zDeaths);
5308 P_DATA[Player][Deaths] = zDeaths;
5309 if(Player != playerid)
5310 {
5311 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s deaths to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, zDeaths);
5312 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s deaths to "ORAN"%d", Name(Player), Player, zDeaths);
5313 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your deaths to "ORAN"%d", Name(playerid), playerid, zDeaths);
5314 }
5315 else
5316 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his deaths to "ORAN"%d", Name(playerid), playerid, zDeaths);
5317
5318 #if UPDATE_TOP_ALWAYS
5319
5320 new
5321 Query[256],
5322 DBResult: R1;
5323
5324 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
5325 R1 = DB::Query(_DB, Query);
5326
5327 if(R1)
5328 {
5329 if(DB::Valid(R1))
5330 {
5331 DB::Free(R1);
5332 format(Query, sizeof(Query), "UPDATE `Top` SET `Deaths` = '%d' WHERE `Name` = '%s'", zDeaths, Name(Player));
5333 DB::Query(_DB, Query);
5334 }
5335 else
5336 {
5337 DB::Free(R1);
5338 format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Deaths`) VALUES('%s','%d')", Name(Player), zDeaths);
5339 DB::Query(_DB, Query);
5340 }
5341 }
5342 #endif
5343 }
5344 return 1;
5345}
5346CMD:setkills(PARAMS)
5347{
5348 LoginCheck(playerid);
5349 LevelCheck(playerid, 4);
5350
5351 new Player, zKills;
5352 if(sscanf(params, "ui", Player, zKills) || zKills < 0) return SendUsage(playerid, "/setkills "GREY"<id> <kills>", "Will change player's kills");
5353 else
5354 {
5355 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5356 CheckImune(playerid, Player);
5357
5358 SetPVarInt(Player, "0_Kills", zKills);
5359 P_DATA[Player][Kills] = zKills;
5360
5361 if(Player != playerid)
5362 {
5363 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s kills to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, zKills);
5364 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s kills to "ORAN"%d", Name(Player), Player, zKills);
5365 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your kills to "ORAN"%d", Name(playerid), playerid, zKills);
5366 }
5367 else
5368 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his kills to "ORAN"%d", Name(playerid), playerid, zKills);
5369
5370 #if UPDATE_TOP_ALWAYS == true
5371
5372 new
5373 Query[256],
5374 DBResult: R1;
5375
5376 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
5377 R1 = DB::Query(_DB, Query);
5378
5379 if(R1)
5380 {
5381 if(DB::Valid(R1))
5382 {
5383 DB::Free(R1);
5384 format(Query, sizeof(Query), "UPDATE `Top` SET `Kills` = '%d' WHERE `Name` = '%s'", zKills, Name(Player));
5385 DB::Query(_DB, Query);
5386 }
5387 else
5388 {
5389 DB::Free(R1);
5390 format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Kills`) VALUES('%s','%d')", Name(Player), zKills);
5391 DB::Query(_DB, Query);
5392 }
5393 }
5394
5395 #endif
5396 }
5397 return 1;
5398}
5399CMD:setweather(PARAMS)
5400{
5401 LoginCheck(playerid);
5402 LevelCheck(playerid, 3);
5403
5404 new Player, Weather;
5405 if(sscanf(params, "ui", Player, Weather)) return SendUsage(playerid, "/setweather "GREY"<id> <weather id>", "Will change player's weather to the specified weather ID");
5406 else
5407 {
5408 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5409 CheckImune(playerid, Player);
5410
5411 SetPlayerWeather(Player, Weather);
5412
5413 if(Player != playerid)
5414 {
5415 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed "ORAN"\"%s[%i]"GREY"'s weather to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, Weather);
5416 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s weather to "ORAN"%d", Name(Player), Player, Weather);
5417 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your weather to "ORAN"%d", Name(playerid), playerid, Weather);
5418 }
5419 else
5420 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his weather to "ORAN"%d", Name(playerid), playerid, Weather);
5421 }
5422 return 1;
5423}
5424CMD:settime(PARAMS)
5425{
5426 LoginCheck(playerid);
5427 LevelCheck(playerid, 1);
5428
5429 new Player, Time;
5430 if(sscanf(params, "ui", Player, Time)) return SendUsage(playerid, "/settime "GREY"<id> <hour>", "Will change player's time");
5431 else
5432 {
5433 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5434 CheckImune(playerid, Player);
5435 if(Time < 0 || Time > 24) return SendError(playerid, "Invalid hour! (0 - 24)");
5436 SetPlayerTime(Player, Time, 0);
5437
5438 if(Player != playerid)
5439 {
5440 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);
5441 FormatMSG(Player, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s time to "ORAN"%d:00", Name(Player), Player, Time);
5442 }
5443 else
5444 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his time to "ORAN"%d:00", Name(playerid), playerid, Time);
5445 }
5446 return 1;
5447}
5448CMD:setskin(PARAMS)
5449{
5450 LoginCheck(playerid);
5451 LevelCheck(playerid, 2);
5452
5453 new Player, Skin;
5454 if(sscanf(params, "ui", Player, Skin)) return SendUsage(playerid, "/setskin "GREY"<id> <skin>", "Will change player's skin to the specified skin ID");
5455 else
5456 {
5457 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5458 CheckImune(playerid, Player);
5459 if(!IsValidSkin(Skin)) return SendError(playerid, "Invalid skin!");
5460 SetPlayerSkin(Player, Skin);
5461
5462 if(Player != playerid)
5463 {
5464 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed "ORAN"\"%s[%i]"GREY"'s skin to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, Skin);
5465 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s skin to "ORAN"%d", Name(Player), Player, Skin);
5466 }
5467 else
5468 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his skin to "ORAN"%d", Name(playerid), playerid, Skin);
5469 }
5470 return 1;
5471}
5472CMD:setarmour(PARAMS)
5473{
5474 LoginCheck(playerid);
5475 LevelCheck(playerid, 3);
5476
5477 new Player, Float: Armour;
5478 if(sscanf(params, "uf", Player, Armour)) return SendUsage(playerid, "/setarmour "GREY"<id> <armour>", "Will set player's armour to the specified armour");
5479 else
5480 {
5481 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5482 CheckImune(playerid, Player);
5483
5484 SetPlayerArmour(Player, Float: Armour);
5485
5486 if(Player != playerid)
5487 {
5488 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s armour to "ORAN"%.1f", Name(playerid), playerid, Name(Player), Player, Armour);
5489 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s armour to "ORAN"%.1f", Name(Player), Player, Armour);
5490 }
5491 else
5492 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his armour to "ORAN"%.1f", Name(playerid), playerid, Armour);
5493 }
5494 return 1;
5495}
5496CMD:sethealth(PARAMS)
5497{
5498 LoginCheck(playerid);
5499 LevelCheck(playerid, 3);
5500
5501 new Player, Float: Health;
5502 if(sscanf(params, "uf", Player, Health)) return SendUsage(playerid, "/sethealth "GREY"<id> <health>", "Will set player's health to the specified health");
5503 else
5504 {
5505 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5506 CheckImune(playerid, Player);
5507
5508 SetPlayerHealth(Player, Float: Health);
5509
5510 if(Player != playerid)
5511 {
5512 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s health to "ORAN"%.1f", Name(playerid), playerid, Name(Player), Player, Health);
5513 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s health to "ORAN"%.1f", Name(Player), Player, Health);
5514 }
5515 else
5516 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his health to "ORAN"%.1f", Name(playerid), playerid, Health);
5517 }
5518 return 1;
5519}
5520CMD:pm(PARAMS)
5521{
5522 LoginCheck(playerid);
5523
5524 if((P_DATA[playerid][Muted] || P_DATA[playerid][Muted]) && P_DATA[playerid][Level] != 5 && !IsPlayerAdmin(playerid))
5525 return SendError(playerid, "You are not allowed to send personal message while muted!");
5526
5527 new Player, Message[129];
5528 if(sscanf(params, "us[129]", Player, Message)) return SendUsage(playerid, "/pm "GREY"<id> [message]", "Sends a personal message to the specified id");
5529 else
5530 {
5531 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5532 if(Player == playerid ) return SendError(playerid, "You cannot PM yourself!");
5533
5534 FormatMSG(Player, Color:ORAN, "PM Received: {FFD48A}%s[%i] says: "W"%s", Name(playerid), playerid, Message);
5535 FormatMSG(playerid, Color:ORAN, "PM Sent: {FFD48A}to %s[%i]: %s", Name(Player), Player, Message);
5536
5537 if(S_DATA[ReadPM])
5538 {
5539 SendAdminCMD(playerid, "PM Detected: {FFD48A}%s[%i] "GREY"to %s[%i]", Name(playerid), playerid, Name(Player), Player);
5540 SendAdminCMD(playerid, "Message: {FFD48A}%s", Message);
5541 }
5542 #if SAVE_IN_LOGS == true
5543 SaveInLog(PMS_LOG, "---------------------------\r\n\
5544 Sender %s\r\n\
5545 Receiver %s\r\n\
5546 Message: %s\r\n\
5547 Date: %s\r\n\
5548 ---------------------------\r\n\\r\n", Name(playerid), Name(Player), Message, zDate());
5549 #endif
5550 }
5551 return 1;
5552}
5553CMD:register(PARAMS)
5554{
5555 if(P_DATA[playerid][Logged])
5556 return SendClientMessage(playerid, -1, ""ORAN"ACCOUNT: "W"You are already registered and logged in! ");
5557
5558 new zStr[150];
5559 if(P_DATA[playerid][Registered])
5560 {
5561 format(zStr, sizeof (zStr), ""GREY"Hello "GREE"%s"GREY", you already have an account!\n\nPlease login into your account:", Name(playerid));
5562 SPD(playerid, Dialog:Login3, INPUT, ""W"Welcome back", zStr, "Login", "Exit");
5563 }
5564 else
5565 {
5566 format(zStr, sizeof (zStr), ""GREY"Hello "ORAN"%s"GREY"\n\nPlease write your desired password:", Name(playerid));
5567 ShowPlayerDialog(playerid, Dialog:Register1, DIALOG_STYLE_INPUT, ""W"Register an account", zStr, "Register", "Exit");
5568 }
5569
5570 return 1;
5571}
5572CMD:login(PARAMS)
5573{
5574 if(P_DATA[playerid][Logged])
5575 return SendClientMessage(playerid, -1, ""ORAN"ACCOUNT: "W"You are already registered and logged in! ");
5576
5577 new zStr[150];
5578 if(P_DATA[playerid][Registered])
5579 {
5580 format(zStr, sizeof (zStr), ""GREY"Hello "GREE"%s"GREY"!\n\nPlease login into your account:", Name(playerid));
5581 SPD(playerid, Dialog:Login3, INPUT, ""W"Welcome back", zStr, "Login", "Exit");
5582 }
5583 else
5584 {
5585 format(zStr, sizeof (zStr), ""GREY"Hello "ORAN"%s"GREY", you don't have an account!\n\nPlease write your desired password:", Name(playerid));
5586 ShowPlayerDialog(playerid, Dialog:Register1, DIALOG_STYLE_INPUT, ""W"Register an account", zStr, "Register", "Exit");
5587 }
5588 return 1;
5589}
5590CMD:t(p){FormatMSG(p, -1, "%d", P_DATA[p][Logged]);return 1;}
5591CMD:acp(PARAMS)
5592{
5593 LoginCheck(playerid);
5594 LevelCheck(playerid, 5);
5595
5596 SPD(playerid, Dialog:cPanel, LIST, ""ORAN"Server Control Panel", cPanel(), "Enable", "Disable");
5597 return 1;
5598}
5599CMD:clearchat(PARAMS)
5600{
5601 LoginCheck(playerid);
5602 LevelCheck(playerid, 3);
5603
5604 new Yes[3];
5605 if(sscanf(params, "s[3]", Yes)) return SendUsage(playerid, "/clearchat "GREY"[yes]", "Will clear the chat");
5606 else
5607 {
5608 if(!strcmp(Yes, "yes"))
5609 {
5610 for(new m = 0; m < 10; m ++) { SendClientMessage(m, -1, " "); }
5611 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" cleared the chat", Name(playerid), playerid);
5612 SendClientMessage(playerid, Color:GREY, "You cleared the chat.");
5613 }
5614 else SendUsage(playerid, "/clearchat "GREY"[yes]", "Will clear the chat");
5615 }
5616 return 1;
5617}
5618CMD:chat(PARAMS)
5619{
5620 LoginCheck(playerid);
5621 LevelCheck(playerid, 4);
5622
5623 if(!strlen(params))
5624 return SendUsage(playerid, "/chat "GREY"[block/unblock/spam/clear]");
5625
5626 if(!strcmp(params, "unblock"))
5627 {
5628 if(!S_DATA[Chat]) return SendError(playerid, "Chat already unblocked!");
5629
5630 S_DATA[Chat] = 0;
5631 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unblocked the chat", Name(playerid), playerid);
5632 SendClientMessage(playerid, Color:GREY, "You unblocked the chat.");
5633 }
5634 else if(!strcmp(params, "block"))
5635 {
5636 BlockChat(playerid);
5637 }
5638 else if(!strcmp(params, "clear"))
5639 {
5640 for(new m = 0; m < 20; m ++) { SendClientMessageToAll(-1, "-"); }
5641 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" cleared the chat", Name(playerid), playerid);
5642 SendClientMessage(playerid, Color:GREY, "You cleared the chat.");
5643 }
5644 else if(!strcmp(params, "spam"))
5645 {
5646 new Str[65],
5647 Preload[65] = "zxcvbnmlkjhgfdsaqwertyuioplmkjnhbgfvcdfrtghyasetgrhnhgrftghnhjki";
5648
5649
5650 for(new x = 0; x < 45; x++)
5651 {
5652 new rCo = random(sizeof(SpamColors)),
5653 rMe = random(65);
5654
5655 format(Str, sizeof (Str), "%s%s", Str[rMe], Preload[rMe]);
5656 foreach(Player, i)
5657 {
5658
5659 SendClientMessage(i, SpamColors[rCo], Str[x]);
5660 }
5661 }
5662
5663 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" spammed the chat", Name(playerid), playerid);
5664 SendClientMessage(playerid, Color:GREY, "You spammed the chat.");
5665 }
5666 else return SendUsage(playerid, "/chat "GREY"[block/unblock/spam/clear]");
5667
5668 return 1;
5669}
5670
5671CMD:respawncars(PARAMS)
5672{
5673 LoginCheck(playerid);
5674 LevelCheck(playerid, 5);
5675
5676 new Yes[3];
5677 if(sscanf(params, "s[3]", Yes)) return SendUsage(playerid, "/respawncars "GREY"[yes]", "Will respawn all server's unoccupied vehicles");
5678 else
5679 {
5680 if(!strcmp(Yes, "yes"))
5681 {
5682 for (new v = 0; v < MAX_VEHICLES; v++)
5683 {
5684 if(!VehicleOccupied(v))
5685 {
5686 SetVehicleToRespawn(v);
5687 }
5688 }
5689 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" respawned all server unoccupied vehicles!", Name(playerid), playerid);
5690 SendClientMessage(playerid, Color:GREY, "You respawned all server unoccupied vehicles!");
5691 }else SendUsage(playerid, "/respawncars "GREY"[yes]", "Will rspawn all server's unoccupied vehicles");
5692 }
5693
5694 return 1;
5695}
5696CMD:explode(PARAMS)
5697{
5698 LoginCheck(playerid);
5699 LevelCheck(playerid, 3);
5700
5701 if(sscanf(params, "u", params[0])) return SendUsage(playerid, "/explode "GREY"<id>", "Will create an explosion near specified player's location");
5702 else
5703 {
5704 CheckImune(playerid, params[0]);
5705 if(params[0] == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
5706 if(params[0] == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot unfreeze yourself!");
5707
5708 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" exploded player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
5709 FormatMSG(playerid, Color:GREY, "You exploded "ORAN"%s[%i]", Name(params[0]), params[0]);
5710 SendClientMessage(params[0], Color:GREY, "You have been exploded!");
5711
5712 new Float: _P[3];
5713 GetPlayerPos(params[0],_P[0], _P[1], _P[2]);CreateExplosion(_P[0], _P[1], _P[2], 7, 10.0);
5714 }
5715 return 1;
5716}
5717
5718CMD:slap(PARAMS)
5719{
5720 LoginCheck(playerid);
5721 LevelCheck(playerid, 3);
5722
5723 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");
5724 else
5725 {
5726 CheckImune(playerid, params[0]);
5727 if(params[0] == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
5728 if(params[0] == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot slap yourself!");
5729
5730 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" slapped player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
5731 FormatMSG(playerid, Color:GREY, "You slapped "ORAN"%s[%i]", Name(params[0]), params[0]);
5732 SendClientMessage(params[0], Color:GREY, "You have been slapped!");
5733
5734 new Float:Pos[3], Float: Health;
5735 GetPlayerPos(params[0], Pos[0], Pos[1], Pos[2]);
5736 SetPlayerPos(params[0], Pos[0], Pos[1], Pos[2] + 3.5);
5737 GetPlayerHealth(params[0], Health);
5738 SetPlayerHealth(params[0], Health - 30);
5739 }
5740 return 1;
5741}
5742CMD:unfreeze(PARAMS)
5743{
5744 LoginCheck(playerid);
5745 LevelCheck(playerid, 2);
5746
5747 if(sscanf(params, "u", params[0], params[1])) return SendUsage(playerid, "/unfreeze "GREY"<id>", "Will un-freeze the player that has been frozen");
5748 else
5749 {
5750 CheckImune(playerid, params[0]);
5751 if(params[0] == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
5752 if(params[0] == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot unfreeze yourself!");
5753 if(!P_DATA[params[0]][Frozen]) return SendClientMessage(playerid, -1, ""GREY"Player is not frozen!");
5754
5755 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unfreezed player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
5756 FormatMSG(playerid, Color:GREY, "You unfreezed "ORAN"%s[%i]", Name(params[0]), params[0]);
5757 SendClientMessage(params[0], Color:GREY, "You have been unfreezed!");
5758
5759 P_DATA[params[0]][Frozen] = 0;
5760 UnFreeze(params[0]);
5761
5762 #if SAVE_FREEZE == true
5763
5764 new
5765 Query[256];
5766 format(Query, 256, "DELETE FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
5767 DB::Query(_DB, Query);
5768
5769 #endif
5770 }
5771 return 1;
5772}
5773CMD:freeze(PARAMS)
5774{
5775 LoginCheck(playerid);
5776 LevelCheck(playerid, 2);
5777
5778 if(sscanf(params, "u", params[0])) return SendUsage(playerid, "/freeze "GREY"<id>", "Will freeze a specified player, he will cannot freeze-evade!");
5779 else
5780 {
5781 CheckImune(playerid, params[0]);
5782 if(params[0] == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
5783 if(params[0] == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot freeze yourself!");
5784 if(P_DATA[params[0]][Frozen]) return SendClientMessage(playerid, -1, ""GREY"Player is already frozen!");
5785
5786 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" freezed player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
5787 FormatMSG(playerid, Color:GREY, "You freezed "ORAN"%s[%i]", Name(params[0]), params[0]);
5788 SendClientMessage(params[0], Color:GREY, "You have been freezed!");
5789
5790 P_DATA[params[0]][Frozen] = 1;
5791 Freeze(params[0]);
5792
5793 #if SAVE_FREEZE == true
5794
5795 new
5796 Query[256],
5797 DBResult:R1;
5798 format(Query, sizeof(Query), "SELECT `Key` FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(params [0]));
5799 R1 = DB::Query(_DB, Query);
5800
5801 if(R1)
5802 {
5803 if(DB::Valid(R1))
5804 {
5805 DB::Free(R1);
5806 format(Query, sizeof(Query), "INSERT INTO `Frozen` VALUES(NULL, '%s',1, '%s')",Name(params [0]), GetPlayerIPEx(params [0]));
5807 DB::Query(_DB, Query);
5808 }
5809 else
5810 {
5811 DB::Free(R1);
5812 format(Query, sizeof(Query), "UPDATE `Frozen` SET `Frozen` = '1', `RealName` = '%s' WHERE `IP` = '%s'", Name(params [0]), GetPlayerIPEx(params [0]));
5813 DB::Query(_DB, Query);
5814 }
5815 }
5816
5817 #endif
5818 }
5819 return 1;
5820}
5821CMD:unjail(PARAMS)
5822{
5823 LoginCheck(playerid);
5824 LevelCheck(playerid, 3);
5825
5826 new Player;
5827 if(sscanf(params, "u", Player)) return SendUsage(playerid, "/unjail "GREY"<id>", "Will unjail the specified player");
5828 else
5829 {
5830 CheckImune(playerid, Player);
5831 if(Player == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
5832 if(Player == playerid && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, ""GREY"You cannot unjail yourself!");
5833 if(!P_DATA[Player][Jailed]) return SendClientMessage(playerid, -1, ""GREY"Player is not jailed!");
5834
5835 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unjailed player "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
5836 FormatMSG(playerid, Color:GREY, "You unjailed "ORAN"%s[%i]", Name(Player), Player);
5837 SendClientMessage(Player, Color:GREY, "You have been unjailed!");
5838
5839 P_DATA[Player][Jailed] = 0;
5840 P_DATA[Player][JailTime] = 0;
5841
5842 SetPlayerInterior(playerid, 0);
5843 SetPlayerPos(playerid, 0.0, 0.0, 0.0);
5844 SpawnPlayer(playerid);
5845 PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
5846
5847 #if SAVE_JAIL == true
5848
5849 new Query[256], DBResult:Result;
5850 format(Query, 256, "SELECT `Key` FROM `Jailed` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
5851 Result = DB::Query(_DB, Query);
5852
5853 if(Result)
5854 {
5855 if(DB::Valid(Result))
5856 {
5857 DB::Free(Result);
5858 format(Query, 256, "DELETE FROM `Jailed` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
5859 DB::Query(_DB, Query);
5860 }
5861 else
5862 {
5863 DB::Free(Result);
5864 }
5865 }
5866
5867 #endif
5868 }
5869 return 1;
5870}
5871CMD:jail(PARAMS)
5872{
5873 LoginCheck(playerid);
5874 LevelCheck(playerid, 3);
5875
5876 new Player, Time, Reason[40];
5877 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");
5878 else
5879 {
5880 CheckImune(playerid, Player);
5881 if(Player == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
5882 if(Player == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot jail yourself!");
5883 if(P_DATA[Player][Jailed]) return SendClientMessage(playerid, -1, ""GREY"Player is already jailed!");
5884
5885 if(Time == 0)
5886 {
5887 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" jailed player "ORAN"%s[%i] "GREY"[Reason: "W"%s"GREY"]", Name(playerid), playerid, Name(Player), Player, Reason);
5888 FormatMSG(playerid, Color:GREY, "You jailed "ORAN"%s[%i] "GREY"[Reason: "W"%s"GREY"][Time: "W"Forever]", Name(Player), Player, Reason, Time);
5889 SendClientMessage(Player, Color:GREY, "You have been jailed "W"["GREY"Time:"W" Forever[");
5890 }
5891 if(Time > 0)
5892 {
5893 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);
5894 FormatMSG(playerid, Color:GREY, "You jailed "ORAN"%s[%i] "GREY"[Reason: "W"%s"GREY"][Time: "W"%d"GREY" Minutes]", Name(Player), Player, Reason, Time);
5895 FormatMSG(Player, Color:GREY, "You have been jailed "W"["GREY"Time:"W" %d "GREY"Minutes "W"]", Time);
5896 }
5897 P_DATA[Player][Jailed] = 1;
5898 P_DATA[Player][JailTime] = Time;
5899
5900 SetTimerEx("JailPlayer", 1500, false, "i", Player);
5901
5902 #if SAVE_JAIL == true
5903
5904 new Query[256],DBResult:R1;
5905 format(Query, sizeof(Query), "SELECT `Key` FROM `Jailed` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
5906 R1 = DB::Query(_DB, Query);
5907
5908 if(R1)
5909 {
5910 if(DB::Valid(R1))
5911 {
5912 DB::Free(R1);
5913 format(Query, sizeof(Query), "INSERT INTO `Jailed` (`IP`,`Jailed`,`Time`,`RealName`) VALUES('%s','1','%d','%s')",Name(Player), Time, GetPlayerIPEx(Player));
5914 DB::Query(_DB, Query);
5915 }
5916 else
5917 {
5918 DB::Free(R1);
5919 format(Query, sizeof(Query), "UPDATE `Jailed` SET `Jailed` = '1', `Time` = '%d', `RealName` = '%s' WHERE `IP` = '%s'", Time, GetPlayerIPEx(Player), Name(Player));
5920 DB::Query(_DB, Query);
5921 }
5922 }
5923
5924 #endif
5925 }
5926 return 1;
5927}
5928CMD:settemplevel(PARAMS)
5929{
5930 LoginCheck(playerid);
5931 LevelCheck(playerid, 5);
5932
5933 new Player, TempLevel;
5934 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");
5935 else
5936 {
5937 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
5938 if(Player == playerid ) return SendError(playerid, "Player entered is you!");
5939 if(Player < 0 || TempLevel > 5) return SendError(playerid, "Invalid level! Maximum level is "ORAN"5");
5940
5941 P_DATA[Player][tLevel] = 1;
5942 P_DATA[Player][Level] = TempLevel;
5943
5944 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);
5945 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s temporary level to "ORAN"%d", Name(Player), Player, TempLevel);
5946 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your temporary level to "ORAN"%d", Name(playerid), playerid, TempLevel);
5947 SendClientMessage(playerid, Color:ORAN, "Level will expire on exit!");
5948 }
5949 return 1;
5950}
5951CMD:setvip(PARAMS)
5952{
5953 LoginCheck(playerid);
5954 LevelCheck(playerid, 5);
5955
5956 if(sscanf(params, "ui", params[0], params[1])) return SendUsage(playerid, "/setvip "GREY"<id> <level>", "Will set a player to the specified VIP level");
5957 else
5958 {
5959 if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
5960 if(!P_DATA[params[0]][Logged]) return SendError(playerid, "Player must be logged in to change his level!");
5961 if(P_DATA[params[0]][Vip] == params[1]) return SendError(playerid, "Player is already that level!");
5962 if(params[1] < 0 || params[1] > 3) return SendError(playerid, "Invalid level! Maximum VIP level is "ORAN"3");
5963
5964 if(params[0] == playerid)
5965 {
5966 #if SAVE_IN_LOGS == true
5967 SaveInLog(SETVIP_LOG, "Admin %s set his VIP level %d on %s", Name(playerid), params[1], zDate());
5968 #endif
5969 SendAdminCMD(-1, "Admin "ORAN"%s[%i]"GREY" set himself a VIP member level "ORAN"%d", Name(playerid), playerid, params[1]);
5970 FormatMSG(playerid, Color:GREY, "You set yourself a VIP member level "ORAN"%d", params[1]);
5971 }
5972 else
5973 {
5974 #if SAVE_IN_LOGS == true
5975 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());
5976 #endif
5977 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]);
5978 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s VIP level to "ORAN"%d", Name(params[0]), params[0], params[1]);
5979 FormatMSG(params[0], Color:GREY,"Admin "ORAN"%s[%i]"GREY" set your VIP level to "ORAN"%d", Name(playerid), playerid, params[1]);
5980 }
5981 SetPVarInt(params[0], "0_Vip", params[1]) ;
5982 P_DATA[params[0]][Vip] = params[1];
5983
5984 new Query[120], DBResult:Result;
5985 format(Query, 120, "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s'",Name(params[0]));
5986 Result = DB::Query(_DB, Query);
5987
5988 if(Result)
5989 {
5990 if(DB::Valid(Result))
5991 {
5992 DB::Free(Result);
5993 format(Query, 120, "UPDATE `Accounts` SET `VIP` = '%d' WHERE `Name` = '%s'", params[1], Name(params[0]));
5994 DB::Query(_DB, Query);
5995 }
5996 else DB::Free(Result);
5997 }
5998 }
5999 return 1;
6000}
6001CMD:ranks(PARAMS)
6002{
6003 #if USE_RANKS == false
6004
6005 return SendError(playerid, "Using ranks is disabled from script!");
6006
6007 #else
6008
6009 LoginCheck(playerid);
6010
6011 new
6012 RankString[2_0_0_0];
6013 RankString = ""BLUE"# "GREY"The current server ranks:\n\n";
6014 for (new r = 0; r < sizeof(_Ranks); r++)
6015 {
6016 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]);
6017 }
6018 ShowPlayerDialog(playerid, Dialog:Empty, BOX, ""BLUE"Server Ranks", RankString, "Close", "");
6019 return 1;
6020
6021 #endif
6022}
6023CMD:setrank(PARAMS)
6024{
6025 #if USE_RANKS == false
6026
6027 return SendError(playerid, "Using ranks is disabled from script!");
6028
6029 #else
6030
6031 LoginCheck(playerid);
6032 LevelCheck(playerid, 4);
6033
6034 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")");
6035 else
6036 {
6037 if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
6038 if(!P_DATA[params[0]][Logged]) return SendError(playerid, "Player must be logged in to change his rank!");
6039 if(P_DATA[params[0]][Rank] == params[1]) return SendError(playerid, "Player is already that rank!");
6040 if(params[1] < 0 || params[1] > sizeof(_Ranks) - 1)
6041 {
6042 FormatMSG(playerid, Color:ORAN, "* "GREY"Invalid level! Maximum rank is "ORAN"%d "W"-"ORAN"%s", sizeof(_Ranks) - 1, _Ranks[sizeof(_Ranks) - 1][irName]);
6043 return 1;
6044 }
6045 if(params[0] == playerid)
6046 {
6047 #if SAVE_IN_LOGS == true
6048 SaveInLog(SETRANK_LOG, "Admin %s promoved set his rank to %d on %s", Name(playerid), params[1], zDate());
6049 #endif
6050 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his rank to "ORAN"%d "GREY"|"ORAN" %s", Name(playerid), playerid, params[1], RankName(params[1]));
6051 FormatMSG(playerid, Color:GREY, "You set your rank to "ORAN"%d "GREY"|"ORAN" %s", params[1], RankName(params[1]));
6052
6053 SetPVarInt(playerid, "0_Rank", params[1]) ;
6054 P_DATA[playerid][Rank] = params[1];
6055 }
6056 else
6057 {
6058 if(P_DATA[params[0]][Rank] < params[1])
6059 {
6060 #if SAVE_IN_LOGS == true
6061 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());
6062 #endif
6063 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]));
6064 GameTextForPlayer(params[0], "~n~~n~~n~~n~~n~~n~~n~~g~Ranked up!!", 6000, 1);
6065 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]));
6066 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]));
6067 }
6068 else
6069 {
6070 #if SAVE_IN_LOGS == true
6071 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());
6072 #endif
6073 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]));
6074 GameTextForPlayer(params[0], "~n~~n~~n~~n~~n~~n~~n~~r~Ranked down!!", 6000, 1);
6075 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]));
6076 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]));
6077 }
6078 P_DATA[params[0]][Rank] = params[1];
6079 SetPVarInt(params[0], "0_Rank", params[1]);
6080 }
6081 new Query[120], DBResult:Result;
6082 format(Query, 120, "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s'",Name(params[0]));
6083 Result = DB::Query(_DB, Query);
6084
6085 if(Result)
6086 {
6087 if(DB::Valid(Result))
6088 {
6089 DB::Free(Result);
6090 format(Query, 120, "UPDATE `Accounts` SET `Rank` = '%d' WHERE `Name` = '%s'", params[1], Name(params[0]));
6091 DB::Query(_DB, Query);
6092 }
6093 else DB::Free(Result);
6094 }
6095
6096 #if UPDATE_TOP_ALWAYS == true
6097 new
6098 DBResult: R1;
6099
6100 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(params[0]));
6101 R1 = DB::Query(_DB, Query);
6102
6103 if(R1)
6104 {
6105 if(DB::Valid(R1))
6106 {
6107 DB::Free(R1);
6108 format(Query, sizeof(Query), "UPDATE `Top` SET `Rank` = '%d' WHERE `Name` = '%s'", params[1], Name(params[0]));
6109 DB::Query(_DB, Query);
6110 }
6111 else
6112 {
6113 DB::Free(R1);
6114 format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Rank`) VALUES('%s','%d')",Name(params[0]), params[1]);
6115 DB::Query(_DB, Query);
6116 }
6117 }
6118 #endif
6119 }
6120 return 1;
6121
6122 #endif
6123}
6124CMD:setlevel(PARAMS)
6125{
6126 LoginCheck(playerid);
6127 LevelCheck(playerid, 5);
6128
6129 if(sscanf(params, "ud", params[0], params[1])) return SendUsage(playerid, "/setlevel "GREY"<id> <level>", "Will change a player's level position!");
6130 else
6131 {
6132 if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
6133 if(!P_DATA[params[0]][Logged]) return SendError(playerid, "Player must be logged in to change his level!");
6134 if(P_DATA[params[0]][Level] == params[1]) return SendError(playerid, "Player is already that level!");
6135 if(params[1] < 0 || params[1] > 5) return SendError(playerid, "Invalid level! Maximum level is "ORAN"5");
6136
6137 if(params[0] == playerid)
6138 {
6139 #if SAVE_IN_LOGS == true
6140 SaveInLog(SETLEVEL_LOG, "Admin %s set his level to %d | %s on %s", Name(playerid), params[1], LevelName(params[1]), zDate());
6141 #endif
6142 SetPVarInt(playerid, "0_Level", params[1]) ;
6143 P_DATA[playerid][Level] = params[1];
6144 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set himself as "ORAN"%s"GREY" of the server!", Name(playerid), playerid, LevelName(params[1]));
6145 FormatMSG(playerid, Color:GREY, "You set yourself as "ORAN"%s"GREY" of the server!", LevelName(params[1]));
6146 }
6147 else
6148 {
6149 if(P_DATA[params[0]][Level] < params[1])
6150 {
6151 #if SAVE_IN_LOGS == true
6152 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());
6153 #endif
6154 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]));
6155 GameTextForPlayer(params[0], "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~Promoved!", 6000, 1);
6156 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]));
6157 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]));
6158 }
6159 else
6160 {
6161 #if SAVE_IN_LOGS == true
6162 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());
6163 #endif
6164 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]));
6165 GameTextForPlayer(params[0], "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~Demoted!", 6000, 1);
6166 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]));
6167 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]));
6168
6169 }
6170 SetPVarInt(params[0], "0_Level", params[1]) ;
6171 P_DATA[params[0]][Level] = params[1];
6172
6173 }
6174
6175 new Query[120], DBResult:Result;
6176 format(Query, 120, "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s'",Name(params[0]));
6177 Result = DB::Query(_DB, Query);
6178
6179 if(Result)
6180 {
6181 if(DB::Valid(Result))
6182 {
6183 DB::Free(Result);
6184 format(Query, 120, "UPDATE `Accounts` SET `Level` = '%d' WHERE `Name` = '%s'", params[1], Name(params[0]));
6185 DB::Query(_DB, Query);
6186 }
6187 else DB::Free(Result);
6188 }
6189 }
6190 return 1;
6191}
6192
6193CMD:unmute(PARAMS)
6194{
6195 LoginCheck(playerid);
6196 LevelCheck(playerid, 2);
6197
6198 if(sscanf(params, "u", params[0])) return SendUsage(playerid, "/unmute "GREY"<id>", "Will unmute the specified player");
6199 else
6200 {
6201 CheckImune(playerid, params[0]);
6202 if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
6203 if(params[0] == playerid ) return SendError(playerid, "You cannot unmute yourself!");
6204 if(!P_DATA[params[0]][Muted]) return SendError(playerid, "Player is not muted!");
6205
6206 P_DATA[params[0]][Muted] = 0;
6207 P_DATA[params[0]][MutedTime] = 0;
6208
6209 KillTimer(MuteTimer[params[0]]);
6210 #if SAVE_MUTE == true
6211
6212 new
6213 Query[256];
6214 format(Query, 256, "DELETE FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
6215 DB::Query(_DB, Query);
6216
6217
6218 #endif
6219
6220 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unmuted player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
6221 FormatMSG(playerid, Color:GREY, "You unmuted "ORAN"%s[%i]", Name(params[0]), params[0]);
6222 SendClientMessage(params[0], Color:GREY, "You have been unmuted!");
6223 }
6224 return 1;
6225}
6226CMD:spawnall(PARAMS)
6227{
6228 LoginCheck(playerid);
6229 LevelCheck(playerid, 4);
6230
6231 foreach(Player, i)
6232 {
6233 if(P_DATA[i][Level] != 5)
6234 {
6235 if(i != playerid)
6236 {
6237 SpawnPlayer(i);
6238 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" spawned you and everyone!", Name(playerid), playerid);
6239 }
6240 }
6241 }
6242 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" spawned everyone!", Name(playerid), playerid);
6243 SendClientMessage(playerid, Color:GREY, "You spawned everyone in the server!");
6244 return 1;
6245}
6246CMD:killall(PARAMS)
6247{
6248 LoginCheck(playerid);
6249 LevelCheck(playerid, 4);
6250
6251 foreach(Player, i)
6252 {
6253 if(P_DATA[i][Level] != 5)
6254 {
6255 if(i != playerid)
6256 {
6257 SetPlayerHealth(i, 0.0);
6258 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" killed you and everyone!", Name(playerid), playerid);
6259 }
6260 }
6261 }
6262 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" killed everyone!", Name(playerid), playerid);
6263 SendClientMessage(playerid, Color:GREY, "You killed everyone in the server!");
6264 return 1;
6265}
6266CMD:unfreezeall(PARAMS)
6267{
6268 LoginCheck(playerid);
6269 LevelCheck(playerid, 4);
6270
6271 foreach(Player, i)
6272 {
6273 if(P_DATA[i][Level] != 5)
6274 {
6275 if(i != playerid)
6276 {
6277 P_DATA[i][Frozen] = 0;
6278 UnFreeze(i);
6279 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" defrosted you and everyone!", Name(playerid), playerid);
6280 }
6281 }
6282 }
6283 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" defrosted everyone!", Name(playerid), playerid);
6284 SendClientMessage(playerid, Color:GREY, "You defrosted everyone in the server!");
6285 return 1;
6286}
6287CMD:freezeall(PARAMS)
6288{
6289 LoginCheck(playerid);
6290 LevelCheck(playerid, 4);
6291
6292 foreach(Player, i)
6293 {
6294 if(P_DATA[i][Level] != 5)
6295 {
6296 if(i != playerid)
6297 {
6298 P_DATA[i][Frozen] = 1;
6299 Freeze(i);
6300 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" froze you and everyone!", Name(playerid), playerid);
6301 }
6302 }
6303 }
6304 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" froze everyone!", Name(playerid), playerid);
6305 SendClientMessage(playerid, Color:GREY, "You froze everyone in the server! However, if the re-connect, they will be able to move again.");
6306 return 1;
6307}
6308CMD:kickall(PARAMS)
6309{
6310 LoginCheck(playerid);
6311 LevelCheck(playerid, 5);
6312
6313
6314 new
6315 File:zFile,
6316 zStr[100];
6317
6318
6319 zFile = fopen(KICK_LOG, io_append);
6320 format(zStr, sizeof (zStr), "\r\n\r\n\r\n][MASSIVE KICK ON %s[]\r\n", zDate ());
6321
6322 fwrite(zFile, zStr);
6323
6324 foreach(Player, i)
6325 {
6326 if(P_DATA[i][Level] < 3 || !P_DATA[i][Vip])
6327 {
6328 if(i != playerid)
6329 {
6330 KickEx(i, Name(i), "Massive kick!", false);
6331 }
6332 }
6333 }
6334 fwrite(zFile, "][!! END OF MASSIVE KICK !![]");
6335 fclose(zFile);
6336 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" kicked everyone from the server except VIP members and level 3 admins!", Name(playerid), playerid);
6337 SendClientMessage(playerid, Color:GREY, "You kicked everyone from the server!");
6338 return 1;
6339}
6340CMD:slapall(PARAMS)
6341{
6342 LoginCheck(playerid);
6343 LevelCheck(playerid, 4);
6344
6345 new
6346 Float:Pos[3],
6347 Float:Health
6348 ;
6349
6350 foreach(Player, i)
6351 {
6352 if(P_DATA[i][Level] != 5)
6353 {
6354 if(i != playerid)
6355 {
6356
6357 GetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
6358 SetPlayerPos(i, Pos[0], Pos[1], Pos[2] + 3.5);
6359 GetPlayerHealth(i, Health);
6360 SetPlayerHealth(i, Health - 30);
6361 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" unmuted you and everyone!", Name(playerid), playerid);
6362 }
6363 }
6364 }
6365 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" slapped everyone!", Name(playerid), playerid);
6366 SendClientMessage(playerid, Color:GREY, "You slapped everyone in the server!");
6367 return 1;
6368}
6369
6370CMD:unmuteall(PARAMS)
6371{
6372 LoginCheck(playerid);
6373 LevelCheck(playerid, 4);
6374
6375 foreach(Player, i)
6376 {
6377 if(P_DATA[i][Level] != 5)
6378 {
6379 if(i != playerid)
6380 {
6381 P_DATA[i][MutedAll] = 0;
6382 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" unmuted you and everyone!", Name(playerid), playerid);
6383 }
6384 }
6385 }
6386 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unmuted everyone!", Name(playerid), playerid);
6387 SendClientMessage(playerid, Color:GREY, "You unmuted everyone in the server!");
6388 return 1;
6389}
6390CMD:muteall(PARAMS)
6391{
6392 LoginCheck(playerid);
6393 LevelCheck(playerid, 3);
6394
6395 foreach(Player, i)
6396 {
6397 if(P_DATA[i][Level] != 5)
6398 {
6399 if(i != playerid)
6400 {
6401 P_DATA[i][MutedAll] = 1;
6402 FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" muted you and everyone!", Name(playerid), playerid);
6403 }
6404 }
6405 }
6406 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" muted everyone!", Name(playerid), playerid);
6407 SendClientMessage(playerid, Color:GREY, "You muted everyone in the server! However, if the re-connect, they will be able to speak.");
6408 return 1;
6409}
6410CMD:mute(PARAMS)
6411{
6412 LoginCheck(playerid);
6413 LevelCheck(playerid, 2);
6414
6415 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");
6416 else
6417 {
6418 CheckImune(playerid, params[0]);
6419 if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
6420 if(params[0] == playerid) return SendError(playerid, "You cannot mute yourself!");
6421 if(P_DATA[params[0]][Muted]) return SendError(playerid, "Player is already muted!");
6422
6423 if(!params[1])
6424 {
6425
6426 P_DATA[params[0]][Muted] = 1;
6427 P_DATA[params[0]][MutedTime] = 0;
6428
6429
6430 #if SAVE_MUTE == true
6431 new
6432 pQue[256];
6433
6434 format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
6435 new DBResult:R1 = DB::Query(_DB, pQue);
6436
6437 if(R1)
6438 {
6439 if(!DB::Valid(R1))
6440 {
6441 DB::Free(R1);
6442 format(pQue, sizeof (pQue), "INSERT INTO `Muted` VALUES (NULL, '%s', '1', '0', '%s')", GetPlayerIPEx(params[0]), Name(params[0]));
6443 DB::Query(_DB, pQue);
6444 }
6445 else
6446 {
6447 DB::Free(R1);
6448 format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '0', `RealName` = '%s' WHERE `IP` = '%s'", Name(params[0]), GetPlayerIPEx(params[0]));
6449 DB::Query(_DB, pQue);
6450 }
6451 }
6452
6453 #endif
6454
6455 SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" muted player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0], params[1]);
6456 FormatMSG(playerid, Color:GREY, "You muted "ORAN"%s[%i]", Name(params[0]), params[0]);
6457 SendClientMessage(params[0], Color:GREY, "You have been muted!");
6458 }
6459 else
6460 {
6461 P_DATA[params[0]][Muted] = 1;
6462
6463 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]);
6464 FormatMSG(playerid, Color:GREY, "You muted "ORAN"%s[%i] "GREY"["ORAN"Time: "W"%d"GREY" minutes[", Name(params[0]), params[0], params[1]);
6465 FormatMSG(params[0], Color:GREY, "You have been muted! "W"["GREE"Time: "W"%d"GREY" minutes"W"[", params[1]);
6466
6467 #if SAVE_MUTE == true
6468
6469 new
6470 pQue[256];
6471
6472 format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
6473 new DBResult:R1 = DB::Query(_DB, pQue);
6474
6475 if(R1)
6476 {
6477 if(!DB::Valid(R1))
6478 {
6479 DB::Free(R1);
6480 format(pQue, sizeof (pQue), "INSERT INTO `Muted` VALUES (NULL, '%s', '1', '%d', '%s')", GetPlayerIPEx(params[0]), params[1], Name(params[0]));
6481 DB::Query(_DB, pQue);
6482 }
6483 else
6484 {
6485 DB::Free(R1);
6486 format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '%d', `RealName` = '%s' WHERE `IP` = '%s'", params[1], Name(params[0]), GetPlayerIPEx(params[0]));
6487 DB::Query(_DB, pQue);
6488 }
6489 }
6490
6491 #endif
6492
6493 KillTimer(MuteTimer[params[0]]);
6494 MuteTimer[params[0]] = SetTimerEx("UnMutePlayer", 60_000, true, "i", params[0]);
6495 P_DATA[params[0]][MutedTime] = params[1];
6496 }
6497 }
6498 return 1;
6499}
6500
6501CMD:kick(PARAMS)
6502{
6503 LoginCheck(playerid);
6504 LevelCheck(playerid, 4);
6505
6506 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");
6507 else
6508 {
6509 if(playerid == params[0]) return SendError(playerid, "You can't kick yourself!");
6510 if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
6511
6512 CheckImune(playerid, params[0]);
6513
6514 KickEx(params[0], Name(playerid), params[1], true);
6515 }
6516 return 1;
6517}
6518CMD:unban(PARAMS)
6519{
6520 LoginCheck(playerid);
6521 LevelCheck(playerid, 5);
6522
6523 new Account[50];
6524 if(sscanf(params, "s[50]", Account)) return SendUsage(playerid, "/unban [name]","Will unban a banned account");
6525 else
6526 {
6527 new DBResult:Result, Query[129];
6528 format(Query, 129, "SELECT `IP` FROM `Banlist` WHERE `Name` = '%s'", Account);
6529 Result = DB::Query(_DB, Query);
6530
6531 if(Result)
6532 {
6533 if(DB::Valid(Result))
6534 {
6535 new fIP[30];
6536 DB::GetField(Result, "IP", fIP, 30);
6537
6538 if(strlen(fIP) > 0)
6539 {
6540 new Str[50];
6541 format(Str, sizeof (Str), "unbanip %s", fIP);
6542 SendRconCommand(Str), SendRconCommand("reloadbans");
6543 }
6544 DB::Free(Result);
6545 format(Query, 129, "DELETE FROM `Banlist` WHERE `Name` = '%s'", Account);
6546 DB::Query(_DB, Query);
6547
6548 FormatMSG(playerid, Color:GREY, "Account "ORAN"%s"GREY" has been removed from the Banlist!", Account);
6549 }
6550 else
6551 {
6552 DB::Free(Result);
6553 SendError(playerid, "Account not found in the Banlist!");
6554 return 1;
6555 }
6556 }
6557
6558 }
6559 return 1;
6560}
6561
6562CMD:ban(PARAMS)
6563{
6564 LoginCheck(playerid);
6565 LevelCheck(playerid, 5);
6566
6567 new Player, IpBan, Reason[40];
6568 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");
6569 else
6570 {
6571 if(playerid == Player) return SendError(playerid, "You can't ban yourself!");
6572 if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
6573 CheckImune(playerid, Player);
6574
6575 if(IpBan)
6576 {
6577 #if SAVE_IN_LOGS == true
6578 new
6579 zStr[256],
6580 File:zFile;
6581
6582 format(zStr, sizeof (zStr), "Player: %s[%i] has been IP banned by \"%s\" with reason \"%s\" on %s\r\n",
6583 Name(playerid),
6584 playerid,
6585 Name(playerid),
6586 Reason,
6587 zDate());
6588
6589
6590 zFile = fopen(BAN_LOG, io_append);
6591 if(zFile)
6592 {
6593 fwrite(zFile, zStr);
6594 fclose(zFile);
6595 }
6596 #endif
6597
6598 FormatMSG(playerid, Color:ORAN, "SERVER:"W" You have been banned from this server! "W"["GREY" %s"W"]", Reason);
6599 BanEx(Player, Reason);
6600 }
6601 else
6602 {
6603 BanEx2(Player, Name(playerid), Reason);
6604 FormatMSG(playerid, Color:ORAN, "SERVER:"W" You have been banned from this server! "W"["GREY" %s"W"]", Reason);
6605 }
6606 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);
6607
6608 }
6609 return 1;
6610}
6611stock AntiIP(const string[])
6612{
6613 static
6614 RegEx:IP;
6615 if(!IP)IP = regex_build("[A-Z][a-z]+_[A-Z][a-z]{1,3}[A-Z]?[a-z]*");
6616
6617 return regex_match_exid(string, IP);
6618}
6619stock AntiSite(const string[])
6620{
6621 static
6622 RegEx:Site;
6623 if(!Site)Site = regex_build("([\\w-]*://)?([\\w-]+\\.)+([\\w-]+)(/[^\\s]*)*");
6624
6625 return regex_match_exid(string, Site);
6626}
6627public OnPlayerText(playerid, text[])
6628{
6629 if(!P_DATA[playerid][Muted] || !P_DATA[playerid][MutedAll])
6630 {P_DATA[playerid][Msgs]++;}
6631
6632 //If player is NOT the RCON admin and NEITHER the OWNER
6633 if(!IsPlayerAdmin(playerid) && P_DATA[playerid][Level] != 5)
6634 {
6635
6636 //Then, take action!
6637 if((P_DATA[playerid][Muted] || P_DATA[playerid][MutedAll]))
6638 {
6639 if(!P_DATA[playerid][MutedTime])
6640 SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You are not allowed to chat! You have been muted!");
6641 else
6642 FormatMSG(playerid, Color:ORAN, "SERVER:"W" You are still muted! "ORAN"["GREY"Aprox: "W"%d minutes"ORAN"]",P_DATA[playerid][MutedTime]);
6643
6644 return 0;
6645 }
6646
6647
6648 if(S_DATA[AntiRepeat])
6649 {
6650 if(!isnull(P_DATA[playerid][RepMSG]))
6651 {
6652 if(!strcmp(text, P_DATA[playerid][RepMSG], false))
6653 {
6654 SendClientMessage(playerid, Color:ORAN, "SERVER:"W" Please don't repeat yourself!");
6655 SendAdminCMD(playerid, "Player %s[%i] repeated himself!", Name(playerid), playerid);
6656 return 0;
6657 }
6658 }
6659 format(P_DATA[playerid][RepMSG], 129, text);
6660 }
6661 if(S_DATA[Chat])
6662 {
6663 return GameTextForPlayer(playerid, "~n~~n~~n~~n~~r~Chat has been disabled!~w~You cannot send any messages!", 5000, 3);
6664 }
6665
6666 P_DATA[playerid][SpamMSG] ++;
6667 if(!P_DATA[playerid][Muted] && S_DATA[AntiSpam])
6668 {
6669 if(P_DATA[playerid][SpamMSG] > MAXIMUM_SPAM && !IsPlayerAdmin(playerid))
6670 return BanEx2(playerid, .zReason = "Extreme Spam!"),false;
6671
6672 else if(P_DATA[playerid][SpamMSG] > MEDIUM_SPAM)
6673 return KickEx(playerid, .zReason = "Massive Spam"),false;
6674
6675 else if(P_DATA[playerid][SpamMSG] > MINIMUM_SPAM)
6676 {
6677 P_DATA[playerid][Muted] = 1;
6678 P_DATA[playerid][MutedTime] = 1;
6679 SendClientMessage(playerid, Color:ORAN, "SERVER: "W"You have been muted "ORAN"1"W" minutes for spamming the chat!");
6680
6681 MuteTimer[playerid] = SetTimerEx("UnMutePlayer", 60_000, true, "i", playerid);
6682
6683 #if SAVE_MUTE == true
6684
6685 new pQue[256];
6686
6687 format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(playerid));
6688 new DBResult:R1 = DB::Query(_DB, pQue);
6689
6690 if(R1)
6691 {
6692 if(!DB::Valid(R1))
6693 {
6694 DB::Free(R1);
6695 format(pQue, sizeof (pQue), "INSERT INTO `Muted` (`IP`, `Muted`, `Time`, `RealName`) VALUES ('%s', '1', '1', '%s')", GetPlayerIPEx(playerid), Name(playerid));
6696 DB::Query(_DB, pQue);
6697 }
6698 else
6699 {
6700 DB::Free(R1);
6701 format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '2', `RealName` = '%s' WHERE `IP` = '%s'", Name(playerid), GetPlayerIPEx(playerid));
6702 DB::Query(_DB, pQue);
6703 }
6704 }
6705 #endif
6706 return 0;
6707 }
6708 }
6709 }
6710 if(S_DATA[AntiAD])
6711 {
6712 if(!P_DATA[playerid][Muted] || !P_DATA[playerid][MutedAll])
6713 {
6714 if(P_DATA[playerid][Vip] > 0)
6715 {
6716 if(text[0] == VIP_CHAT_SYMBOL || text[0] == VIP_CHAT_SYMBOL2)
6717 {
6718 if(!S_DATA[VipChat] && P_DATA[playerid][Level] < 4)
6719 return SendError(playerid, "Only the Owner and the Administrator of the server can use the VIP Chat.");
6720
6721 #if SAVE_IN_LOGS == true
6722 new
6723 Date[6];
6724 getdate(Date[0], Date[1], Date[2]);
6725 gettime(Date[3], Date[4], Date[5]);
6726 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]);
6727 #endif
6728
6729
6730 new
6731 iStr[160];
6732 format(iStr, sizeof (iStr), "#### "GREY"%s:"W" %s", Name(playerid), text[1]);
6733
6734 foreach(Player, i){
6735 if(P_DATA[i][Vip] > 0){
6736 SendClientMessage(i, Color:BLUE, iStr);
6737 }
6738 }
6739 return 0;
6740 }
6741 }
6742 if(P_DATA[playerid][Level] > 0)
6743 {
6744 if(text[0] == ADMIN_CHAT_SYMBOL || text[0] == ADMIN_CHAT_SYMBOL2)
6745 {
6746 if(!S_DATA[AdminChat] && P_DATA[playerid][Level] < 4)
6747 return SendError(playerid, "Only the Owner and the Administrator of the server can use the Admin Chat.");
6748
6749 #if SAVE_IN_LOGS == true
6750 new
6751 Date[6];
6752 getdate(Date[0], Date[1], Date[2]);
6753 gettime(Date[3], Date[4], Date[5]);
6754 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]);
6755 #endif
6756
6757
6758 new
6759 iStr[160];
6760 format(iStr, sizeof (iStr), "#### "GREY"%s:"W" %s", Name(playerid), text[1]);
6761
6762 foreach(Player, i){
6763 if(P_DATA[i][Level] > 0){
6764 SendClientMessage(i, 0xFF0000FF, iStr);
6765 }
6766 }
6767 return 0;
6768 }
6769 }
6770 if(text[0] != ADMIN_CHAT_SYMBOL || text[0] != ADMIN_CHAT_SYMBOL2)
6771 {
6772 if(AntiIP(text) || AntiSite(text))
6773 {
6774 P_DATA[playerid][Warns]++;
6775
6776 FormatMSG(playerid, Color:ORAN, "*** "GREY"You have been warned for advertising! ("ORAN"%d"GREY"/"ORAN""#MAX_P_WARNS""GREY")", P_DATA[playerid][Warns]);
6777
6778 if(P_DATA[playerid][Warns] >= MAX_P_WARNS)
6779 {
6780 SendClientMessage(playerid, Color:ORAN, "*** "GREY"You have been kicked from the server for advertising!");
6781
6782 foreach(Player, x){
6783 if(x != playerid){
6784 FormatMSG(x, Color:ORAN, "*** "GREY"%s has kicked from the server for advertising.", Name(playerid));
6785 }
6786 }
6787 P_DATA[playerid][Warns] = 0;
6788 KickEx(playerid, .zReason = "Advertising in the chat");
6789 }
6790 return 0;
6791 }
6792 SendPlayerMessageToAll(playerid, text);
6793 }
6794 }
6795
6796 }else SendPlayerMessageToAll(playerid, text);
6797
6798 return 0;
6799}
6800
6801public OnVehicleDeath(vehicleid)
6802{
6803 foreach(Player, InV)
6804 {
6805 if(vehicleid == P_DATA[InV][aCar])
6806 {
6807 SendError(InV, "Your admin car has been dstroyed!");
6808 P_DATA[InV][aCar] = -1;
6809 UpdatePlayer3DTextLabelText(InV, ZaAdminCar[InV], 0xFF0000FF, "Destroyed!\n{000000}--------------\n"W"You can spawn another one!");
6810 SetTimerEx("dLabel", 4000, false, "i", InV);
6811 }
6812 }
6813 return 1;
6814}
6815public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
6816{
6817 if(strlen(GPVSEx(playerid, "Type")))
6818 {
6819 if(PRESSED(KEY_FIRE) && !strcmp(GPVSEx(playerid, "Type"), "Unlimited", false))
6820 {
6821 if(!IsPlayerInVehicle(playerid, P_DATA[playerid][aCar])) return 0;
6822
6823 AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
6824 P_DATA[playerid][NosTimer] = SetTimerEx("UnlimitedNos",17 * 1000, true, "i", playerid);
6825
6826 }
6827 else if(RELEASED(KEY_FIRE) && !strcmp(GPVSEx(playerid, "Type"), "Unlimited", false))
6828 {
6829 KillTimer(P_DATA[playerid][NosTimer]),
6830 RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1010);
6831 }
6832
6833 if(PRESSED(KEY_FIRE) && strcmp(GPVSEx(playerid, "Type"), "Unlimited", false))
6834 {
6835 if(!IsPlayerInVehicle(playerid, P_DATA[playerid][aCar])) return 0;
6836
6837 AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
6838 GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~10~g~~h~x~b~~h~ nitro added!", 1500, 3);
6839 }
6840 }
6841 if(P_DATA[playerid][Vip] > 0)
6842 {
6843 if(newkeys & KEY_ACTION && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
6844 {
6845 new Float:V[3];
6846 GetVehicleVelocity(GetPlayerVehicleID(playerid), V[0], V[1], V[2]);
6847 if(floatabs(V[0]) < 3 && floatabs(V[1]) < 3 && floatabs(V[2]) < 3)
6848 {
6849 SetVehicleVelocity(GetPlayerVehicleID (playerid), V[0] * P_DATA[playerid][bSpeed], V[1] * P_DATA[playerid][bSpeed], V[2] * P_DATA[playerid][bSpeed] );
6850 }
6851 }
6852
6853 if(PRESSED(KEY_LOOK_BEHIND) && P_DATA[playerid][Spin] == 1 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
6854 {
6855 new Float:P[3];
6856 GetVehiclePos(GetPlayerVehicleID(playerid), P[0], P[1], P[2] );
6857 SetVehiclePos(GetPlayerVehicleID(playerid), P[0], P[1], P[2] +1 );
6858 SetVehicleAngularVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, 3.0);
6859 GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~WOOSH!", 600, 3);
6860 }
6861 }
6862 return 1;
6863}
6864CMD:bspeed(PARAMS)
6865{
6866 if(P_DATA[playerid][Vip] > 0)
6867 {
6868 if(!P_DATA[playerid][Boost])
6869 return SendError(playerid, "Speed Boost must be activated first! Activate it from "BLUE"/PCP");
6870
6871 new Speed;
6872 if(sscanf(params, "d", Speed))
6873 {
6874 SendUsage(playerid, "/bspeed "GREY"<speed> "W"(Speed is betwen 0-30)", "Wil change speed boost!");
6875 return 1;
6876 }
6877 else
6878 {
6879 switch(P_DATA[playerid][Vip])
6880 {
6881 case (1):
6882 {
6883 if(Speed < 0 || Speed > 10)
6884 return SendError(playerid, "Level 1 VIP Members are allowed only up to "BLUE"10"W".");
6885 }
6886 case (2):
6887 {
6888 if(Speed < 0 || Speed > 20)
6889 return SendError(playerid, "Level 2 VIP Members are allowed only up to "BLUE"20"W".");
6890 }
6891 case (3):
6892 {
6893 if(Speed < 0 || Speed > 30)
6894 return SendError(playerid, "Level 3 VIP Members are allowed only up to "BLUE"30"W".");
6895 }
6896 }
6897 new Float:Speed2 = Speed;
6898 P_DATA[playerid][bSpeed] = (Speed) ? (Speed2 / 2.367) : (0.0) ;
6899 P_DATA[playerid][Boost] = 1;
6900
6901 if(Speed)FormatMSG(playerid, ~1, "Speed Boost set to "BLUE"%d"W" ("BLUE"%.3f"W")", Speed, P_DATA[playerid][bSpeed]);
6902 else
6903 {
6904 P_DATA[playerid][Boost] = 0;
6905 P_DATA[playerid][bSpeed] = 0;
6906 SendClientMessage(playerid, Color:ORAN, "Speed Boost disabled!");
6907 }
6908 }
6909 }
6910 else
6911 {
6912 SendError(playerid, "Only VIP members allowed!");
6913 }
6914 return 1;
6915}
6916
6917FormatList(playerid)
6918{
6919 new Str[1024];
6920 strcat(Str, ""GREY"Name\n\
6921 "GREY"Money\n\
6922 "GREY"Score\n\
6923 "GREY"Cookies\n\
6924 "GREY"Respect\n\
6925 "GREY"Kills\n\
6926 "GREY"Deaths\n\
6927 "GREY"Messages\n\
6928 "GREY"Commands\n\
6929 "GREY"Fail Commands\n\
6930 "GREY"Online Time\n\
6931 "GREY"Admin Level\n\
6932 "GREY"VIP Level\n\
6933 "GREY"Change Password", 1024);
6934
6935 if(playerid != GetPVarInt(playerid, "StatsOf"))
6936 {
6937 strcat(Str, "\n"ORAN"Ban Account\n\
6938 "ORAN"Delete Account", 1024);
6939 }
6940
6941 return Str;
6942}
6943
6944FormatInside(playerid, Player, what[] = "z", extra[] = " ", zelse[] =" ")
6945{
6946 new Str[256];
6947 if(strcmp(what, "z", true))
6948 {
6949 if(Player == playerid){
6950 format(Str, sizeof (Str), ""GREY"Changing "ORAN"your"GREY" %s\n\n"ORAN"%s", what, extra);}
6951 else{
6952 format(Str, sizeof (Str), ""GREY"Changing "ORAN"%s"GREY"'s %s\n\n"ORAN"%s", Name(Player), what, extra);}
6953 }
6954 else
6955 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);
6956
6957 return Str;
6958}
6959NameExist(name[])
6960{
6961 foreach(Player, i)
6962 {
6963 if(!strcmp(name, Name(i), false)) return 1;
6964 }
6965 return 0;
6966}
6967public OnPlayerClickPlayer(playerid, clickedplayerid, source)
6968{
6969 if(playerid != clickedplayerid)
6970 {
6971 ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(clickedplayerid), ""BLUE"Send Personal Message\n\
6972 "BLUE"Give Respect\n\
6973 "BLUE"Give Money\n\
6974 "BLUE"See Stats\n\
6975 "ORAN"Report", "Select", "Exit");
6976 SetPVarInt(playerid, "ClickedTO", clickedplayerid);
6977 }else SendError(playerid, "Please select someone else other than you!");
6978}
6979public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
6980{
6981 new Query[500];
6982
6983 if(response)
6984 {
6985 iDialog<PCP>
6986 {
6987 switch(listitem)
6988 {
6989 case 1:
6990 {
6991 if(S_DATA[AutoLogin])
6992 {
6993 P_DATA[playerid][pAuto] = 1;
6994 SPD(playerid, Dialog:PCPBack, BOX, ""W"Auto-Login", ""BLUE"Auto-Login\n\n"W"This feature has been enabled!", "Back", "");
6995 }
6996 else
6997 {
6998 P_DATA[playerid][pAuto] = 0;
6999 SPD(playerid, Dialog:PCPBack, BOX, ""W"Auto-Login", ""BLUE"Auto-Login\n\n"W"This feature is not available!!", "Back", "");
7000 }
7001 }
7002 case 2:
7003 {
7004 P_DATA[playerid][BAPMs] = 1;
7005 SPD(playerid, Dialog:PCPBack, BOX, ""W"Block PM", ""BLUE"Block Personal Messages\n\n"W"This feature has been enabled!", "Back", "");
7006 }
7007 case 3:
7008 {
7009 cmd_stats(playerid,"");
7010 }
7011 case 4: cmd_pcp(playerid, "");
7012 case 5:
7013 {
7014 P_DATA[playerid][God] = 1;
7015 SPD(playerid, Dialog:PCPBack, BOX, ""W"Godlike", ""BLUE"Godlike\n\n"W"This feature has been enabled!\nYou won't loose health anymore.", "Back", "");
7016 }
7017 case 6:
7018 {
7019 P_DATA[playerid][CarGod] = 1;
7020 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", "");
7021 }
7022 case 7:
7023 {
7024 P_DATA[playerid][Boost] = 1;
7025 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", "");
7026 }
7027 case 8:
7028 {
7029 P_DATA[playerid][VIPTag] = 1;
7030 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", "");
7031
7032 Delete3DTextLabel(P_DATA[playerid][Tag3D]);
7033 P_DATA[playerid][Tag3D] = Create3DTextLabel("VIP Member", Color:BLUE, 0.0, 0.0, 0.0, 90.0, 0, 1);
7034 Attach3DTextLabelToPlayer(P_DATA[playerid][Tag3D], playerid, 0.0, 0.0, 1.2);
7035 }
7036 case 9: cmd_pcp(playerid, "");
7037 case 10:
7038 {
7039 P_DATA[playerid][Spin] = 1;
7040 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", "");
7041 }
7042 case 11:
7043 {
7044 for(new i = 0; i < 5; i++)
7045 if(IsPlayerAttachedObjectSlotUsed(playerid, i))
7046 RemovePlayerAttachedObject(playerid, i);
7047
7048 P_DATA[playerid][Incred] = 1;
7049 SetPlayerAttachedObject(playerid, 0, 18693, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
7050 SetPlayerAttachedObject(playerid, 1, 18693, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
7051 SetPlayerAttachedObject(playerid, 2, 18703, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
7052 SetPlayerAttachedObject(playerid, 3, 18703, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
7053 SetPlayerAttachedObject(playerid, 4, 18965, 2, 0.111052, 0.021643, -0.000846, 92.280899, 92.752510, 358.071044, 1.200000, 1.283168, 1.200000 );
7054
7055 SPD(playerid, Dialog:PCPBack, BOX, ""W"Incredible", ""BLUE"Incredible\n\n"W"This feature has been enabled!\nCheck your character!", "Back", "");
7056 }
7057 case 12: cmd_pcp(playerid, "");
7058 case 13:
7059 {
7060 SPD(playerid, Dialog:PCPShout, INPUT, ""W"Shout to the server!", ""W"Insert the text you want to shout:", "Insert", "Back");
7061 }
7062 }
7063 }
7064 }
7065 else
7066 {
7067 iDialog<PCP>
7068 {
7069 switch(listitem)
7070 {
7071 case 1:
7072 {
7073 if(S_DATA[AutoLogin])
7074 {
7075 P_DATA[playerid][pAuto] = 0;
7076 SPD(playerid, Dialog:PCPBack, BOX, ""W"Auto-Login", ""BLUE"Auto-Login\n\n"W"This feature has been disabled!", "Back", "");
7077 }
7078 else
7079 {
7080 P_DATA[playerid][pAuto] = 0;
7081 SPD(playerid, Dialog:PCPBack, BOX, ""W"Auto-Login", ""BLUE"Auto-Login\n\n"W"This feature is not available!!", "Back", "");
7082 }
7083 }
7084 case 2:
7085 {
7086 P_DATA[playerid][BAPMs] = 0;
7087 SPD(playerid, Dialog:PCPBack, BOX, ""W"Block PM", ""BLUE"Block Personal Messages\n\n"W"This feature has been disabled!", "Back", "");
7088 }
7089 case 3:
7090 {
7091 cmd_stats(playerid,"");
7092 }
7093 case 4: cmd_pcp(playerid, "");
7094 case 5:
7095 {
7096 P_DATA[playerid][God] = 0;
7097 SPD(playerid, Dialog:PCPBack, BOX, ""W"Godlike", ""BLUE"Godlike\n\n"W"This feature has been disabled!\nYou will loose health.", "Back", "");
7098 }
7099 case 6:
7100 {
7101 P_DATA[playerid][CarGod] = 0;
7102 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", "");
7103 }
7104 case 7:
7105 {
7106 P_DATA[playerid][Boost] = 0;
7107 SPD(playerid, Dialog:PCPBack, BOX, ""W"Vehicle Boost", ""BLUE"Vehicle Boost\n\n"W"This feature has been disabled!", "Back", "");
7108 }
7109 case 8:
7110 {
7111 P_DATA[playerid][VIPTag] = 0;
7112 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", "");
7113
7114 Delete3DTextLabel(P_DATA[playerid][Tag3D]);
7115 }
7116 case 9: cmd_pcp(playerid, "");
7117 case 10:
7118 {
7119 P_DATA[playerid][Spin] = 0;
7120 SPD(playerid, Dialog:PCPBack, BOX, ""W"Vehicle Spin", ""BLUE"Vehicle Spin\n\n"W"This feature has been disabled!", "Back", "");
7121 }
7122 case 11:
7123 {
7124 for(new i = 0; i < 5; i++)
7125 if(IsPlayerAttachedObjectSlotUsed(playerid, i))
7126 RemovePlayerAttachedObject(playerid, i);
7127
7128 P_DATA[playerid][Incred] = 0;
7129
7130 SPD(playerid, Dialog:PCPBack, BOX, ""W"Incredible", ""BLUE"Incredible\n\n"W"This feature has been enabled!\nCheck your character!", "Back", "");
7131 }
7132 case 12: cmd_pcp(playerid, "");
7133 case 13:
7134 {
7135 SPD(playerid, Dialog:PCPShout, INPUT, ""W"Shout to the server!", ""W"Insert the text you want to shout:", "Insert", "Back");
7136 }
7137 }
7138 }
7139 }
7140
7141 iDialog<PCPBack>
7142 {
7143 cmd_pcp(playerid, "");
7144 }
7145 iDialog<PCPShout>
7146 {
7147 if(response)
7148 {
7149 if(strlen(inputtext))
7150 {
7151 SendClientMessageToAll(Color:BLUE, inputtext);
7152 }
7153 else SPD(playerid, Dialog:PCPShout, INPUT, ""W"Shout to the server!", ""W"Insert the text you want to shout:", "Insert", "Back");
7154 }
7155 else cmd_pcp(playerid, "");
7156 }
7157 iDialog<CLICK_REPORT>
7158 {
7159 if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
7160 {
7161 SendError(playerid, "Player is no longer connected to the server!");
7162 DeletePVar(playerid, "ClickedTO");
7163 return 1;
7164 }
7165 if(!response)
7166 return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
7167 "BLUE"Give Respect\n\
7168 "BLUE"Give Money\n\
7169 "BLUE"See Stats\n\
7170 "ORAN"Report", "Select", "Exit");
7171 new
7172 Report[256];
7173
7174 if(sscanf(inputtext, "s[256]", Report) || !strlen(Report))
7175 return SendError(playerid, "Please insert a reason!"),
7176 OnDialogResponse(playerid, Dialog:CLICK, 1, 4, "");
7177 else
7178 {
7179 if(strlen(Report) < 10)
7180 return SendError(playerid, "The reason must be at least "BLUE"10"GREY" characters long!"),
7181 OnDialogResponse(playerid, Dialog:CLICK, 1, 4, "");
7182 new
7183 Player = GetPVarInt(playerid, "ClickedTO"),
7184 Str[256];
7185
7186 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);
7187 SPD(playerid, Dialog:Empty, BOX, ""W"Player reported!", Str, "Close", "");
7188
7189 foreach(Player, i)
7190 {
7191 if(P_DATA[i][Level] > 2)
7192 {
7193 if(i != playerid)
7194 {
7195 FormatMSG(i, Color:BLUE, "REPORT: "GREY"Player "ORAN"%s[%i]"GREY" reported "ORAN"%s[%i]"GREY"", Name(playerid), playerid, Name(Player), Player);
7196 FormatMSG(i, Color:GREE, "MESSAGE:"GREY" %s", Report);
7197 }
7198 }
7199 }
7200
7201 format(Str, sizeof(Str), "\r\n---------------------------------------------------------\r\n\
7202 Reporter: %s\r\n\
7203 Reported: %s\r\n\
7204 Message: %s\r\n\
7205 Date: %s\r\n\
7206 ---------------------------------------------------------\r\n",
7207 Name(playerid),
7208 Name(Player),
7209 Report,
7210 zDate());
7211 new
7212 File: ReportLog = fopen(REPORT_LOG, io_append);
7213
7214 if(ReportLog)
7215 {
7216 fwrite(ReportLog, Str);
7217 fclose(ReportLog);
7218 }
7219 }
7220 }
7221
7222 iDialog<CLICK_MONEY>
7223 {
7224 if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
7225 {
7226 SendError(playerid, "Player is no longer connected to the server!");
7227 DeletePVar(playerid, "ClickedTO");
7228 return 1;
7229 }
7230 if(!response)
7231 return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
7232 "BLUE"Give Respect\n\
7233 "BLUE"Give Money\n\
7234 "BLUE"See Stats\n\
7235 "ORAN"Report", "Select", "Exit");
7236 new
7237 pMoney;
7238 if(sscanf(inputtext, "i", pMoney) || !pMoney)
7239 return SendError(playerid, "Please insert a correct value!"),
7240 OnDialogResponse(playerid, Dialog:CLICK, 1, 2, "");
7241 else
7242 {
7243 new
7244 Player = GetPVarInt(playerid, "ClickedTO"),
7245 Str[256];
7246
7247 if(GetPlayerMoney(playerid) < pMoney)
7248 return SendError(playerid, "Not enough money to send!"),
7249 OnDialogResponse(playerid, Dialog:CLICK, 1, 2, "");
7250
7251 GivePlayerMoney(Player, pMoney);
7252 GivePlayerMoney(playerid, -pMoney);
7253
7254 format(Str, sizeof(Str), ""W"You gave a "GREE"$%d"W" to:\n"BLUE"%s"W" ID: "BLUE"%d", pMoney, Name(Player), Player);
7255 SPD(playerid, Dialog:Empty, BOX, ""W"Money sent!", Str, "Close", "");
7256 FormatMSG(Player, Color:BLUE, "***"GREY" You received "GREE"$%d"GREY" from player "BLUE"%s[%i]", pMoney, Name(playerid), playerid);
7257 }
7258 }
7259 iDialog<CLICK_RP>
7260 {
7261 if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
7262 {
7263 SendError(playerid, "Player is no longer connected to the server!");
7264 DeletePVar(playerid, "ClickedTO");
7265 return 1;
7266 }
7267 if(!response)
7268 return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
7269 "BLUE"Give Respect\n\
7270 "BLUE"Give Money\n\
7271 "BLUE"See Stats\n\
7272 "ORAN"Report", "Select", "Exit");
7273 new
7274 Player = GetPVarInt(playerid, "ClickedTO"),
7275 Str[256],
7276 Time[5];
7277 switch(listitem)
7278 {
7279 case (0):
7280 {
7281 if(P_DATA[playerid][Vip] != 3)
7282 {
7283 format(Query, 256, "SELECT `Key` FROM `Positive` WHERE `Name` = '%s'", Name(playerid));
7284
7285 new
7286 DBResult:R2 = DB::Query(_DB, Query);
7287
7288 gettime(Time[0], Time[1]);
7289 getdate(.day = Time[2]);
7290
7291 if(R2)
7292 {
7293 if(DB::Valid(R2))
7294 {
7295 new
7296 Field[64],
7297 T2[3];
7298
7299 DB::GetField(R2, "Expiration", Field, sizeof (Field));
7300 DB::Free(R2);
7301 if(!isnull(Field))
7302 {
7303 sscanf(Field, "p<|>iii", Time[2], Time[0], Time[1]);
7304
7305 gettime(T2[0], T2[1]);
7306 getdate(.day = T2[2]);
7307
7308 if(Time[0] == 0) Time[0] = 24;
7309 if(T2[2] == Time[2])
7310 {
7311 if(T2[0] == Time[0])
7312 {
7313 if(T2[1] < Time[1])
7314 {
7315 SendError(playerid, "You are allowed to give only one "GREE"+"GREY" respect per hour!");
7316 FormatMSG(playerid, Color:GREY, "You can repeat the process after "BLUE"%d"GREY":"BLUE"%d "GREY"!", Time[0], Time[1]);
7317 return 1;
7318 }
7319 }
7320 else if(T2[0] < Time[0])
7321 {
7322 SendError(playerid, "You are allowed to give only one "GREE"+"GREY" respect per hour!");
7323 FormatMSG(playerid, Color:GREY, "You can repeat the process after "BLUE"%d"GREY":"BLUE"%d "GREY"!", Time[0], Time[1]);
7324 return 1;
7325 }
7326 }
7327 }
7328
7329 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));
7330 DB::Query(_DB, Query);
7331 }
7332 else
7333 {
7334 DB::Free(R2);
7335 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]);
7336 DB::Query(_DB, Query);
7337 }
7338 }
7339
7340 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);
7341 }else format(Str, sizeof (Str), ""W"You gave a "GREE"Positive Respect"W" to:\n"BLUE"%s"W" ID: "BLUE"%d", Name(Player), Player);
7342
7343 P_DATA[Player][Positive] += 1;
7344 SetPVarInt(Player, "0_Positive", P_DATA[Player][Positive]);
7345 FormatMSG(Player, Color:ORAN, "*** "GREY"You received a "GREE"+1"GREY" respect from "BLUE"%s[%i]", Name(playerid), playerid);
7346
7347 SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Respect given", Str, "Close", "");
7348 }
7349 case (1):
7350 {
7351 if(P_DATA[playerid][Vip] != 3)
7352 {
7353 format(Query, 256, "SELECT `Key` FROM `Negative` WHERE `Name` = '%s'", Name(playerid));
7354
7355 new
7356 DBResult:R2 = DB::Query(_DB, Query);
7357
7358 gettime(Time[0], Time[1]);
7359 getdate(.day = Time[2]);
7360
7361 if(R2)
7362 {
7363 if(DB::Valid(R2))
7364 {
7365 new
7366 Field[64],
7367 T2[3];
7368
7369 DB::GetField(R2, "Expiration", Field, sizeof (Field));
7370 DB::Free(R2);
7371 if(!isnull(Field))
7372 {
7373 sscanf(Field, "p<|>iii", Time[2], Time[0], Time[1]);
7374
7375 gettime(T2[0], T2[1]);
7376 getdate(.day = T2[2]);
7377
7378 if(Time[0] == 0) Time[0] = 24;
7379 if(T2[2] == Time[2])
7380 {
7381 if(T2[0] == Time[0])
7382 {
7383 if(T2[1] < Time[1])
7384 {
7385 SendError(playerid, "You are allowed to give only one "ORAN"-"GREY" respect per hour!");
7386 FormatMSG(playerid, Color:GREY, "You can repeat the process after "BLUE"%d"GREY":"BLUE"%d "GREY"!", Time[0], Time[1]);
7387 return 1;
7388 }
7389 }
7390 else if(T2[0] < Time[0])
7391 {
7392 SendError(playerid, "You are allowed to give only one "ORAN"-"GREY" respect per hour!");
7393 FormatMSG(playerid, Color:GREY, "You can repeat the process after "BLUE"%d"GREY":"BLUE"%d "GREY"!", Time[0], Time[1]);
7394 return 1;
7395 }
7396 }
7397 }
7398
7399 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));
7400 DB::Query(_DB, Query);
7401 }
7402 else
7403 {
7404 DB::Free(R2);
7405 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]);
7406 DB::Query(_DB, Query);
7407 }
7408 }
7409 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);
7410 }else format(Str, sizeof (Str), ""W"You gave a "ORAN"Negative Respect"W" to:\n"BLUE"%s"W" ID: "BLUE"%d", Name(Player), Player);
7411
7412 P_DATA[Player][Negative] += 1;
7413 SetPVarInt(Player, "0_Negative", P_DATA[Player][Negative]);
7414
7415 FormatMSG(Player, Color:ORAN, "*** "GREY"You received a "ORAN"-1"GREY" respect from "BLUE"%s[%i]", Name(playerid), playerid);
7416 SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Respect given", Str, "Close", "");
7417 }
7418 }
7419 }
7420 iDialog<CLICK_PM>
7421 {
7422 if(!response)
7423 return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
7424 "BLUE"Give Respect\n\
7425 "BLUE"Give Money\n\
7426 "BLUE"See Stats\n\
7427 "ORAN"Report", "Select", "Exit");
7428
7429 if(P_DATA[playerid][Muted])
7430 return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
7431 "BLUE"Give Respect\n\
7432 "BLUE"Give Money\n\
7433 "BLUE"See Stats\n\
7434 "ORAN"Report", "Select", "Exit"),
7435 SendError(playerid, "You are still muted! Check with "ORAN"/mutecheck"GREY" to see when it will be lifted!");
7436
7437 if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
7438 {
7439 SendError(playerid, "Player is no longer connected to the server!");
7440 DeletePVar(playerid, "ClickedTO");
7441 return 1;
7442 }
7443 new
7444 Message[140];
7445 if(sscanf(inputtext, "s[140]", Message))
7446 return OnDialogResponse(playerid, Dialog:CLICK, 1, 0, ""),
7447 SendError(playerid, "Please enter a message to send!");
7448 else
7449 {
7450 if(strlen(Message) < 5)
7451 return OnDialogResponse(playerid, Dialog:CLICK, 1, 0, ""),
7452 SendError(playerid, "Message must be at least "BLUE"5"GREY" characters long.");
7453
7454 new
7455 Player = GetPVarInt(playerid, "ClickedTO");
7456
7457 FormatMSG(Player, Color:GREY, "From "BLUE"%s[%i]"W": %s", Name(playerid), playerid, Message);
7458 FormatMSG(playerid, Color:GREY, "PM Sent to "BLUE"%s[%i]"W": %s", Name(Player), Player, Message);
7459
7460 if(S_DATA[ReadPM])
7461 {
7462 SendAdminCMD(playerid, "PM Detected: "BLUE"%s[%i] "GREY"to"BLUE" %s[%i]", Name(playerid), playerid, Name(Player), Player);
7463 SendAdminCMD(playerid, "Message: "BLUE"%s", Message);
7464 }
7465 }
7466 }
7467
7468 iDialog<CLICK>
7469 {
7470 if(!response)
7471 return DeletePVar(playerid, "ClickedTO"),
7472 false;
7473
7474 if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
7475 {
7476 SendError(playerid, "Player is no longer connected to the server!");
7477 DeletePVar(playerid, "ClickedTO");
7478 return 1;
7479 }
7480 switch(listitem)
7481 {
7482 case (0):
7483 {
7484 new
7485 Player = GetPVarInt(playerid, "ClickedTO"),
7486 Str[129];
7487
7488 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);
7489
7490 SPD(playerid, Dialog:CLICK_PM, INPUT, "{FFFFFF}Send a Personal Message", Str, "Send", "Back");
7491 }
7492 case (1): SPD(playerid, Dialog:CLICK_RP, LIST, "{FFFFFF}Select Rspect type", ""GREE"Positive\n"ORAN"Negative", "Select", "Back");
7493 case (2):
7494 {
7495 new
7496 Player = GetPVarInt(playerid, "ClickedTO"),
7497 Str[129];
7498
7499 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);
7500
7501 SPD(playerid, Dialog:CLICK_MONEY, INPUT, "{FFFFFF}Send money", Str, "Send", "Back");
7502 }
7503 case (3):
7504 {
7505 FormatStats(GetPVarInt(playerid, "ClickedTO"));
7506 }
7507 case (4):
7508 {
7509 new
7510 Player = GetPVarInt(playerid, "ClickedTO"),
7511 Str[129];
7512
7513 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);
7514
7515 SPD(playerid, Dialog:CLICK_REPORT, INPUT, "{FFFFFF}Reporting player", Str, "Send", "Back");
7516 }
7517 }
7518 }
7519
7520 iDialog<TOP>
7521 {
7522 return cmd_top(playerid, "");
7523 }
7524 iDialog<TOP_RESPECT>
7525 {
7526
7527 if(!response) cmd_top(playerid, "");
7528 else
7529 {
7530 switch(listitem)
7531 {
7532 case 0: ShowTopStats(playerid, "Positive", "Respected Players");
7533 case 1: ShowTopStats(playerid, "Negative", "Disrespected Players");
7534 }
7535 }
7536 }
7537 iDialog<TOP_SELECT>
7538 {
7539 if(!response) return 1;
7540 else
7541 {
7542 switch(listitem)
7543 {
7544 case 0: ShowTopStats(playerid, "Kills", "Killers");
7545 case 1: ShowTopStats(playerid, "Deaths", "Deaths");
7546 case 2: ShowTopStats(playerid, "Rank", "Ranked");
7547 case 3: SPD(playerid, Dialog:TOP_RESPECT, LIST, "{FFFFFF}Select type", ""W"Positive\n"W"Negative", "Select", "Back");
7548 case 4: ShowTopStats(playerid, "Hours", "Hours");
7549 case 5:
7550 {
7551 new Speed = GetTickCount(),
7552 DialString[3_0_0_0],
7553 String[2][128],
7554 sQuery[2][256],
7555 DBResult:Result1;
7556
7557 format(sQuery[0], 256, "SELECT `Name` FROM `Top` ORDER BY (`Ratio` * 1) DESC limit %d", MAX_TOP_LIMIT);
7558
7559 Result1 = DB::Query(_DB, sQuery[0]);
7560
7561 format(DialString, sizeof (DialString), "{FFFFFF}Server top "ORAN" Kills/Deaths ratio\n\n\n"W"Pos. Player = Ratio");
7562 for (new Qr; Qr < DB::Valid(Result1); Qr++)
7563 {
7564 db_get_field(Result1, 0, String[0], 128);
7565
7566 format(sQuery[1], 256, "SELECT `Ratio` FROM `Top` WHERE `Name` = '%s'", String[0]);
7567
7568 new DBResult:Result2 = DB::Query(_DB, sQuery[1]);
7569 db_get_field(Result2, 0, String[1], 128);
7570
7571 format(DialString, sizeof (DialString), "%s\n"BLUE"%d."GREY" %s "W": %s", DialString, Qr + 1, String[0], String[1]);
7572
7573 db_next_row(Result1);
7574 DB::Free(Result2);
7575 }
7576 DB::Free(Result1);
7577 format(DialString, sizeof (DialString), "%s\n\n"W"Top list generated in "ORAN"%d "W"ms.", DialString, GetTickCount() - Speed);
7578 SPD(playerid, Dialog:TOP, BOX, ""W"TOP PLAYERS", DialString, "Close", "");
7579 }
7580 }
7581 }
7582 }
7583
7584 switch(dialogid)
7585 {
7586 CaseDialog<NAME>
7587 {
7588 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7589
7590 new
7591 NewName[MAX_PLAYER_NAME];
7592 if(sscanf(inputtext, "s["#MAX_PLAYER_NAME"]", NewName))
7593 {
7594 OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, NAME, "");
7595 return 1;
7596 }
7597 else
7598 {
7599 if(strlen(NewName) > MAX_PLAYER_NAME || strlen(NewName) < 5)
7600 return SendError(playerid, "Invalid name length! Max: "ORAN""#MAX_PLAYER_NAME""GREY" Min: "ORAN"5"),
7601 OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, NAME, "");
7602
7603 new
7604 Player = GetPVarInt(playerid, "StatsOf");
7605
7606 if(Player == 0xFFFF)
7607 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
7608
7609 if(NameExist(NewName))
7610 return SendError(playerid, "The name entered is already used by someone else!"),
7611 OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, NAME, "");
7612
7613 if(Player != playerid)
7614 {
7615 FormatMSG(playerid, Color:GREY, "You changed the name of "ORAN"%s"GREY" to "ORAN"%s"GREY"", Name(Player), NewName);
7616 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" changed your name to "ORAN"%s"GREY"", Name(playerid), playerid, NewName);
7617 }
7618 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!");}
7619 SetPlayerName(Player, NewName);
7620
7621 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7622 }
7623 }
7624 CaseDialog<MONEY>
7625 {
7626 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7627
7628 if(sscanf(inputtext, "d", inputtext[0]))
7629 {
7630 OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, MONEY, "");
7631 return 1;
7632 }
7633 else
7634 {
7635 new
7636 Player = GetPVarInt(playerid, "StatsOf");
7637
7638 if(Player == 0xFFFF)
7639 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
7640
7641 ResetPlayerMoney(Player), GivePlayerMoney(Player, inputtext[0]);
7642 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7643
7644 if(Player != playerid)
7645 {
7646 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s money to "ORAN"$%d"GREY"", Name(Player), inputtext[0]);
7647 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your money to "ORAN"$%d"GREY"", Name(playerid), playerid, inputtext[0]);
7648 }
7649 else
7650 FormatMSG(playerid, Color:GREY, "You set your money to "ORAN"$%d"GREY" ", inputtext[0]);
7651
7652 }
7653 }
7654 CaseDialog<SCORE>
7655 {
7656 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7657
7658 if(sscanf(inputtext, "d", inputtext[0]))
7659 {
7660 OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, SCORE, "");
7661 return 1;
7662 }
7663 else
7664 {
7665 new
7666 Player = GetPVarInt(playerid, "StatsOf");
7667
7668 if(Player == 0xFFFF)
7669 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
7670
7671 SetPlayerScore(Player, inputtext[0]);
7672 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7673
7674 if(Player != playerid)
7675 {
7676 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s score to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
7677 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your score to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
7678 }
7679 else
7680 FormatMSG(playerid, Color:GREY, "You set your score to "ORAN"%d"GREY" ", inputtext[0]);
7681
7682 }
7683 }
7684 CaseDialog<COOKIES>
7685 {
7686 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7687
7688 if(sscanf(inputtext, "d", inputtext[0]))
7689 {
7690 OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, COOKIES, "");
7691 return 1;
7692 }
7693 else
7694 {
7695 new
7696 Player = GetPVarInt(playerid, "StatsOf");
7697
7698 if(Player == 0xFFFF)
7699 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
7700
7701 SetPVarInt(Player, "0_Cookies", inputtext[0]);
7702 P_DATA[Player][Cookies] = inputtext[0];
7703
7704 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7705
7706 if(Player != playerid)
7707 {
7708 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s cookies to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
7709 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your cookies to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
7710 }
7711 else
7712 FormatMSG(playerid, Color:GREY, "You set your cookies to "ORAN"%d"GREY" ", inputtext[0]);
7713
7714 }
7715 }
7716 CaseDialog<RESPECT>
7717 {
7718 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7719
7720 new
7721 _2DS[2][129],
7722 _Dialog,
7723 Player = GetPVarInt(playerid, "StatsOf");
7724
7725 if(Player == 0xFFFF)
7726 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
7727
7728 switch(listitem)
7729 {
7730 case 0:{ if(Player != playerid)format(_2DS[0], 129, "Changing "ORAN"%s"GREY"'s Positive Respect\nPlease insert your respect value:", Name(Player));
7731 else _2DS[0] = "Changing "ORAN"your"GREY"'s Positive Respect\nPlease insert your respect value:";
7732 _2DS[1] = "{FFFFFF}Changing Positive"; _Dialog = Dialog:RESPECT_POS;}
7733
7734
7735 case 1:{ if(Player != playerid)format(_2DS[0], 129, "Changing "ORAN"%s"GREY"'s Negative Respect\nPlease insert your respect value:", Name(Player));
7736 else _2DS[0] = "Changing "ORAN"your"GREY"'s Positive Respect\nPlease insert your respect value:";
7737 _2DS[1] = "{FFFFFF}Changing Negative" ; _Dialog = Dialog:RESPECT_NEG;}
7738 }
7739 SPD(playerid, _Dialog, INPUT, _2DS[1], _2DS[0], "Set", "Back");
7740 }
7741 CaseDialog<RESPECT_POS>
7742 {
7743 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7744
7745 if(sscanf(inputtext, "d", inputtext[0]))
7746 {
7747 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, 0, "");
7748 return 1;
7749 }
7750 else
7751 {
7752 new
7753 Player = GetPVarInt(playerid, "StatsOf");
7754
7755 if(Player == 0xFFFF)
7756 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
7757
7758 SetPVarInt(Player, "0_Positive", inputtext[0]);
7759 P_DATA[Player][Positive] = inputtext[0];
7760
7761 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7762
7763 if(Player != playerid)
7764 {
7765 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s Positive Respect to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
7766 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your Positive Respect to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
7767 }
7768 else
7769 FormatMSG(playerid, Color:GREY, "You set your Positive Respect to "ORAN"%d"GREY" ", inputtext[0]);
7770
7771 #if UPDATE_TOP_ALWAYS == true
7772 new DBResult: R1;
7773 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
7774 R1 = DB::Query(_DB, Query);
7775
7776 if(R1)
7777 {
7778 if(DB::Valid(R1))
7779 {
7780 DB::Free(R1);
7781 format(Query, sizeof(Query), "UPDATE `Top` SET `Positive` = '%d' WHERE `Name` = '%s'", inputtext[0], Name(Player));
7782 DB::Query(_DB, Query);
7783 }
7784 else
7785 {
7786 DB::Free(R1);
7787 format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Positive`) VALUES('%s','%d')", Name(Player), inputtext[0]);
7788 DB::Query(_DB, Query);
7789 }
7790 }
7791 #endif
7792 }
7793 }
7794 CaseDialog<RESPECT_NEG>
7795 {
7796 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7797
7798 if(sscanf(inputtext, "d", inputtext[0]))
7799 {
7800 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, 1, "");
7801 return 1;
7802 }
7803 else
7804 {
7805 new
7806 Player = GetPVarInt(playerid, "StatsOf");
7807
7808 if(Player == 0xFFFF)
7809 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
7810
7811 SetPVarInt(Player, "0_Negative", inputtext[0]);
7812 P_DATA[Player][Negative] = inputtext[0];
7813
7814 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7815
7816 if(Player != playerid)
7817 {
7818 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s Negative Respect to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
7819 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your Negative Respect to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
7820 }
7821 else
7822 FormatMSG(playerid, Color:GREY, "You set your Negative Respect to "ORAN"%d"GREY" ", inputtext[0]);
7823
7824 #if UPDATE_TOP_ALWAYS == true
7825 new DBResult: R1;
7826
7827 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
7828 R1 = DB::Query(_DB, Query);
7829
7830 if(R1)
7831 {
7832 if(DB::Valid(R1))
7833 {
7834 DB::Free(R1);
7835 format(Query, sizeof(Query), "UPDATE `Top` SET `Negative` = '%d' WHERE `Name` = '%s'", inputtext[0], Name(Player));
7836 DB::Query(_DB, Query);
7837 }
7838 else
7839 {
7840 DB::Free(R1);
7841 format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Negative`) VALUES('%s','%d')", Name(Player),inputtext[0]);
7842 DB::Query(_DB, Query);
7843 }
7844 }
7845 #endif
7846 }
7847 }
7848 CaseDialog<KILLS>
7849 {
7850 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7851
7852 if(sscanf(inputtext, "d", inputtext[0]))
7853 {
7854 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, KILLS, "");
7855 return 1;
7856 }
7857 else
7858 {
7859 new
7860 Player = GetPVarInt(playerid, "StatsOf");
7861
7862 if(Player == 0xFFFF)
7863 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
7864
7865 SetPVarInt(Player, "0_Kills", inputtext[0]);
7866 P_DATA[Player][Kills] = inputtext[0];
7867
7868 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7869
7870 if(Player != playerid)
7871 {
7872 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s kills to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
7873 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your kills to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
7874 }
7875 else
7876 FormatMSG(playerid, Color:GREY, "You set your kills to "ORAN"%d"GREY" ", inputtext[0]);
7877
7878 #if UPDATE_TOP_ALWAYS == true
7879 new DBResult: R1;
7880
7881 format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
7882 R1 = DB::Query(_DB, Query);
7883
7884 if(R1)
7885 {
7886 if(DB::Valid(R1))
7887 {
7888 DB::Free(R1);
7889 format(Query, sizeof(Query), "UPDATE `Top` SET `Kills` = '%d', `Ratio` = '%.3f' WHERE `Name` = '%s'", inputtext[0], Name(Player));
7890 DB::Query(_DB, Query);
7891 }
7892 else
7893 {
7894 DB::Free(R1);
7895 format(Query, sizeof(Query), "INSERT INTO `Top` (`Name` `Negative`, `Ratio`) VALUES('%s','%d','%.3f')",Name(Player), inputtext[0], (Float:P_DATA[playerid][Kills] / Float:P_DATA[playerid][Deaths]));
7896 DB::Query(_DB, Query);
7897 }
7898 }
7899 #endif
7900 }
7901 }
7902 CaseDialog<DEATHS>
7903 {
7904 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7905
7906 if(sscanf(inputtext, "d", inputtext[0]))
7907 {
7908 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, DEATHS, "");
7909 return 1;
7910 }
7911 else
7912 {
7913 new
7914 Player = GetPVarInt(playerid, "StatsOf");
7915
7916 if(Player == 0xFFFF)
7917 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
7918
7919 SetPVarInt(Player, "0_Deaths", inputtext[0]);
7920 P_DATA[Player][Deaths] = inputtext[0];
7921
7922 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7923
7924 if(Player != playerid)
7925 {
7926 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s deaths to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
7927 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your deaths to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
7928 }
7929 else
7930 FormatMSG(playerid, Color:GREY, "You set your deaths to "ORAN"%d"GREY" ", inputtext[0]);
7931
7932 }
7933 }
7934 CaseDialog<MESSAGES>
7935 {
7936 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7937
7938 if(sscanf(inputtext, "d", inputtext[0]))
7939 {
7940 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, MESSAGES, "");
7941 return 1;
7942 }
7943 else
7944 {
7945 new
7946 Player = GetPVarInt(playerid, "StatsOf");
7947
7948 if(Player == 0xFFFF)
7949 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
7950
7951 SetPVarInt(Player, "0_Messages", inputtext[0]);
7952 P_DATA[Player][Msgs] = inputtext[0];
7953
7954 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7955
7956 if(Player != playerid)
7957 {
7958 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s sent messages to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
7959 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your sent messages to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
7960 }
7961 else
7962 FormatMSG(playerid, Color:GREY, "You set your sent messages to "ORAN"%d"GREY" ", inputtext[0]);
7963
7964 }
7965 }
7966 CaseDialog<COMMANDS>
7967 {
7968 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7969
7970 if(sscanf(inputtext, "d", inputtext[0]))
7971 {
7972 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, COMMANDS, "");
7973 return 1;
7974 }
7975 else
7976 {
7977 new
7978 Player = GetPVarInt(playerid, "StatsOf");
7979
7980 if(Player == 0xFFFF)
7981 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
7982
7983 SetPVarInt(Player, "0_Commands", inputtext[0]);
7984 P_DATA[Player][Cmds] = inputtext[0];
7985
7986 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
7987
7988 if(Player != playerid)
7989 {
7990 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s used commands to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
7991 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your used commands to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
7992 }
7993 else
7994 FormatMSG(playerid, Color:GREY, "You set your used commands to "ORAN"%d"GREY" ", inputtext[0]);
7995
7996 }
7997 }
7998 CaseDialog<FCOMMANDS>
7999 {
8000 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8001
8002 if(sscanf(inputtext, "d", inputtext[0]))
8003 {
8004 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, FCOMMANDS, "");
8005 return 1;
8006 }
8007 else
8008 {
8009 new
8010 Player = GetPVarInt(playerid, "StatsOf");
8011
8012 if(Player == 0xFFFF)
8013 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
8014
8015 SetPVarInt(Player, "0_Fail_Commands", inputtext[0]);
8016 P_DATA[Player][fCmds] = inputtext[0];
8017
8018 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8019
8020 if(Player != playerid)
8021 {
8022 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s fail commands to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
8023 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your fail commands to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
8024 }
8025 else
8026 FormatMSG(playerid, Color:GREY, "You set your fail commands to "ORAN"%d"GREY" ", inputtext[0]);
8027
8028 }
8029 }
8030 CaseDialog<ONLINE>
8031 {
8032 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8033
8034 new
8035 _2DS2[2][129],
8036 _Dialog,
8037 Player = GetPVarInt(playerid, "StatsOf");
8038
8039 if(Player == 0xFFFF)
8040 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
8041
8042 switch(listitem)
8043 {
8044 case 0:{ if(Player != playerid)format(_2DS2[0], 129, ""GREY"Changing "ORAN"%s"GREY"'s Hours\nPlease insert the hour value:", Name(Player));
8045 else _2DS2[0] = ""GREY"Changing "ORAN"your"GREY" Hours\nPlease insert the hour value:";
8046 _2DS2[1] = "{FFFFFF}Changing Hours" ; _Dialog = Dialog:ONLINE_H; }
8047
8048 case 1:{ if(Player != playerid)format(_2DS2[0], 129, ""GREY"Changing "ORAN"%s"GREY"'s Minutes\nPlease insert the hour value:", Name(Player));
8049 else _2DS2[0] = ""GREY"Changing "ORAN"your"GREY" Minutes\nPlease insert the hour value:";
8050 _2DS2[1] = "{FFFFFF}Changing Minutes" ; _Dialog = Dialog:ONLINE_M;}
8051
8052 case 2:{ if(Player != playerid)format(_2DS2[0], 129, ""GREY"Changing "ORAN"%s"GREY"'s Seconds\nPlease insert the hour value:", Name(Player));
8053 else _2DS2[0] = ""GREY"Changing "ORAN"your"GREY" Seconds\nPlease insert the hour value:";
8054 _2DS2[1] = "{FFFFFF}Changing Seconds" ; _Dialog = Dialog:ONLINE_S;}
8055 }
8056 SPD(playerid, _Dialog, INPUT, _2DS2[1], _2DS2[0], "Set", "Back");
8057 }
8058 CaseDialog<ONLINE_H>
8059 {
8060 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
8061
8062 if(sscanf(inputtext, "d", inputtext[0]))
8063 {
8064 OnDialogResponse(playerid, Dialog:ONLINE, true, 0, "");
8065 return 1;
8066 }
8067 else
8068 {
8069 new
8070 Player = GetPVarInt(playerid, "StatsOf");
8071
8072 if(Player == 0xFFFF)
8073 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
8074
8075 P_DATA[Player][Hours] = inputtext[0];
8076 P_DATA[Player][ConnTime] = gettime();
8077
8078 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
8079
8080 if(Player != playerid)
8081 {
8082 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s online hours to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
8083 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your online hours to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
8084 }
8085 else
8086 FormatMSG(playerid, Color:GREY, "You set your online hours to "ORAN"%d"GREY" ", inputtext[0]);
8087
8088 }
8089 }
8090 CaseDialog<ONLINE_M>
8091 {
8092 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
8093
8094 if(sscanf(inputtext, "d", inputtext[0]))
8095 {
8096 OnDialogResponse(playerid, Dialog:ONLINE, true, 1, "");
8097 return 1;
8098 }
8099 else
8100 {
8101 if(inputtext[0] > 60 || inputtext[0] < 0)
8102 return OnDialogResponse(playerid, Dialog:ONLINE, true, 1, ""),
8103 SendError(playerid, "Minutes must be from "ORAN"0"GREY" to "ORAN"60"GREY".");
8104 new
8105 Player = GetPVarInt(playerid, "StatsOf");
8106
8107 if(Player == 0xFFFF)
8108 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
8109
8110 P_DATA[Player][Minutes] = inputtext[0];
8111 P_DATA[Player][ConnTime] = gettime();
8112
8113 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
8114
8115 if(Player != playerid)
8116 {
8117 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s online minutes to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
8118 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your online minutes to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
8119 }
8120 else
8121 FormatMSG(playerid, Color:GREY, "You set your online minutes to "ORAN"%d"GREY" ", inputtext[0]);
8122
8123 }
8124 }
8125 CaseDialog<ONLINE_S>
8126 {
8127 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
8128
8129 if(sscanf(inputtext, "d", inputtext[0]))
8130 {
8131 OnDialogResponse(playerid, Dialog:ONLINE, true, 2, "");
8132 return 1;
8133 }
8134 else
8135 {
8136 if(inputtext[0] > 60 || inputtext[0] < 0)
8137 return OnDialogResponse(playerid, Dialog:ONLINE, true, 2, ""),
8138 SendError(playerid, "Seconds must be from "ORAN"0"GREY" to "ORAN"60"GREY".");
8139 new
8140 Player = GetPVarInt(playerid, "StatsOf");
8141
8142 if(Player == 0xFFFF)
8143 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
8144
8145 P_DATA[Player][Seconds] = inputtext[0];
8146 P_DATA[Player][ConnTime] = gettime();
8147
8148 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
8149
8150 if(Player != playerid)
8151 {
8152 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s online seonds to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
8153 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your online seonds to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
8154 }
8155 else
8156 FormatMSG(playerid, Color:GREY, "You set your online seonds to "ORAN"%d"GREY" ", inputtext[0]);
8157
8158 }
8159 }
8160 CaseDialog<LEVEL>
8161 {
8162 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8163
8164 if(sscanf(inputtext, "d", inputtext[0]))
8165 {
8166 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, LEVEL, "");
8167 return 1;
8168 }
8169 else
8170 {
8171 new
8172 Player = GetPVarInt(playerid, "StatsOf");
8173
8174 if(Player == 0xFFFF)
8175 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
8176
8177 if(inputtext[0] < 0 || inputtext[0] > 5)
8178 return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, LEVEL, ""),
8179 SendError(playerid, "Invalid level! Min. "ORAN"0"GREY" Max. "ORAN"5");
8180
8181 SetPVarInt(Player, "0_Level", inputtext[0]);
8182 P_DATA[Player][Level] = inputtext[0];
8183
8184 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8185
8186 if(Player != playerid)
8187 {
8188 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY" as "ORAN"%s"GREY" of the server!", Name(Player), LevelName(inputtext[0]));
8189 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s"GREY" set you as "ORAN"%s"GREY" of the server!", Name(playerid), playerid, LevelName(inputtext[0]));
8190 }
8191 else
8192 FormatMSG(playerid, Color:GREY, "You set yourself as "ORAN"%s"GREY" of the server!", LevelName(inputtext[0]));
8193
8194 }
8195 }
8196 CaseDialog<VLEVEL>
8197 {
8198 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8199
8200 if(sscanf(inputtext, "d", inputtext[0]))
8201 {
8202 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, VLEVEL, "");
8203 return 1;
8204 }
8205 else
8206 {
8207 new
8208 Player = GetPVarInt(playerid, "StatsOf");
8209
8210 if(Player == 0xFFFF)
8211 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
8212
8213 if(inputtext[0] < 0 || inputtext[0] > 3)
8214 return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, LEVEL, ""),
8215 SendError(playerid, "Invalid level! Min. "ORAN"0"GREY" Max. "ORAN"3");
8216
8217 SetPVarInt(Player, "0_Vip", inputtext[0]);
8218 P_DATA[Player][Vip] = inputtext[0];
8219
8220 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8221
8222 if(Player != playerid)
8223 {
8224 FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s VIP Level to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
8225 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your VIP Level to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
8226 }
8227 else
8228 FormatMSG(playerid, Color:GREY, "You set your VIP Level to "ORAN"%d"GREY" ", inputtext[0]);
8229
8230 }
8231 }
8232 CaseDialog<CPASS>
8233 {
8234 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8235
8236 new NewPass[30];
8237 if(sscanf(inputtext, "s[30]", NewPass))
8238 {
8239 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, CPASS, "");
8240 return 1;
8241 }
8242 else
8243 {
8244 new
8245 Player = GetPVarInt(playerid, "StatsOf");
8246
8247 if(Player == 0xFFFF)
8248 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
8249
8250 if(strlen(NewPass) < MIN_PASS_LEN || strlen(NewPass) > MAX_PASS_LEN)
8251 return SendError(playerid, "An error has occured. Invalid Password length!"),
8252 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, CPASS, "");
8253
8254 new Buf[129];
8255
8256 WP_Hash(Buf, (129), NewPass);
8257 format(Query, 280, "UPDATE `Accounts` SET `Password` = '%s' WHERE `Name` = '%s'", Buf, Name(Player));
8258 DB::Query(_DB, Query);
8259
8260
8261 if(Player != playerid)
8262 FormatMSG(playerid, Color:GREY, "You changed "ORAN"%s"GREY"'s password to "ORAN"%s", Name(Player), NewPass);
8263 else
8264 FormatMSG(playerid, Color:GREY, "You changed your password to "ORAN"%s", NewPass);
8265 }
8266 }
8267 CaseDialog<BACCOUNT>
8268 {
8269 if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8270
8271 new Reason[129];
8272 if(sscanf(inputtext, "s[129]", Reason))
8273 {
8274 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, BACCOUNT, "");
8275 return 1;
8276 }
8277 else
8278 {
8279 if(strlen(Reason) < 5 || strlen(Reason) > 129)
8280 return SendError(playerid, "The reason must be Min. "ORAN"5"GREY" Max. "ORAN"129"GREY" characters long!"),
8281 OnDialogResponse(playerid, Dialog:SetStatsTrue, true, BACCOUNT, "");
8282
8283 new
8284 Player = GetPVarInt(playerid, "StatsOf");
8285
8286 if(Player == 0xFFFF)
8287 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
8288
8289 format(Query, 129, "INSERT INTO `Banlist` VALUES('%s', '%s', '%s', '%s', '%s')", GetPlayerIPEx(Player), Name(Player), Reason, Name(playerid), zDate());
8290 DB::Query(_DB, Query);
8291
8292 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8293
8294 if(Player != playerid)
8295 {
8296 FormatMSG(playerid, Color:GREY, "You banned "ORAN"%s"GREY"'s account with reason "ORAN"%s", Name(Player), Reason);
8297 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s"GREY" banned your account with reason:", Name(playerid));
8298 FormatMSG(Player, Color:GREY, "REASON: "ORAN"%s",Reason);
8299 }
8300 else
8301 return 0;
8302
8303 KickEx(Player, "System", "Account banned with [/setstats]", false);
8304 }
8305 }
8306 CaseDialog<DACCOUNT>
8307 {
8308 if(!response)
8309 return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8310
8311 new
8312 Player = GetPVarInt(playerid, "StatsOf");
8313
8314 if(Player == 0xFFFF)
8315 return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
8316
8317 OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
8318
8319 if(Player != playerid)
8320 {
8321 FormatMSG(playerid, Color:GREY, "You deleted "ORAN"%s"GREY"'s account.", Name(Player));
8322 FormatMSG(Player, Color:GREY, "Admin "ORAN"%s"GREY" deleted your account", Name(playerid));
8323 SendClientMessage(Player, Color:GREY, "You will be kicked in 2 seconds!");
8324 SendClientMessage(Player, Color:GREY, "Later you can come back without an account.");
8325
8326 format(Query, 120, "DELETE FROM `Accounts` WHERE `Name` = '%s'", Name(Player));
8327 DB::Query(_DB, Query);
8328 }
8329 else
8330 return 0;
8331
8332 KickEx(Player, "System", "Account banned with [/setstats]", false);
8333 }
8334 }
8335
8336 iDialog<SetStatsTrue>
8337 {
8338 if(response)
8339 {
8340 new id = GetPVarInt(playerid, "StatsOf");
8341 switch(listitem)
8342 {
8343 case NAME: \
8344 SPD(playerid, Dialog:NAME, INPUT, "{FFFFFF}Changing Name", \
8345 FormatInside(playerid, id, "Name", "Please insert the new name!"), "Insert", "Back");
8346
8347
8348 case MONEY: \
8349 SPD(playerid, Dialog:MONEY, INPUT, "{FFFFFF}Changing Money", \
8350 FormatInside(playerid, id, "Money", "Please insert the new money value!"),"Insert", "Back");
8351
8352
8353 case SCORE: \
8354 SPD(playerid, Dialog:SCORE, INPUT, "{FFFFFF}Changing Score", \
8355 FormatInside(playerid, id, "Score", "Please insert the new score!"),"Insert", "Back");
8356
8357
8358 case COOKIES: \
8359 SPD(playerid, Dialog:COOKIES, INPUT, "{FFFFFF}Changing Cookies", \
8360 FormatInside(playerid, id, "Cookies", "Please insert the new cookies!"), "Insert", "Back");
8361
8362
8363 case RESPECT: \
8364 SPD(playerid, Dialog:RESPECT, LIST, "{FFFFFF}Changing Respect", \
8365 "Positive\nNegative", "Select", "Back");
8366
8367
8368
8369 case KILLS: \
8370 SPD(playerid, Dialog:KILLS, INPUT, "{FFFFFF}Changing Kills", \
8371 FormatInside(playerid, id, "Kills", "Please insert the new kills!"), "Insert", "Back");
8372
8373
8374 case DEATHS: \
8375 SPD(playerid, Dialog:DEATHS, INPUT, "{FFFFFF}Changing Deaths", \
8376 FormatInside(playerid, id, "Deaths", "Please insert the new deaths!"), "Insert", "Back");
8377
8378
8379 case MESSAGES: \
8380 SPD(playerid, Dialog:MESSAGES, INPUT, "{FFFFFF}Changing Messages Sent", \
8381 FormatInside(playerid, id, "Messages", "Please insert the new messages!"), "Insert", "Back");
8382
8383
8384 case COMMANDS: \
8385 SPD(playerid, Dialog:COMMANDS, INPUT, "{FFFFFF}Changing Commands Used", \
8386 FormatInside(playerid, id, "Used Commands", "Please insert the new used commands value!"), "Insert", "Back");
8387
8388
8389 case FCOMMANDS: \
8390 SPD(playerid, Dialog:FCOMMANDS,INPUT, "{FFFFFF}Changing Fail Commands", \
8391 FormatInside(playerid, id, "Fail Commands", "Please insert the new failed commands value !"), "Insert", "Back");
8392
8393
8394 case ONLINE: \
8395 SPD(playerid, Dialog:ONLINE, LIST, "{FFFFFF}Changing Online Time", \
8396 "Hours\nMinutes\nSeconds", "Select", "Back");
8397
8398
8399 case LEVEL: \
8400 SPD(playerid, Dialog:LEVEL, INPUT, "{FFFFFF}Changing Admin Level", \
8401 FormatInside(playerid, id, "Admin Level", "Please insert the new admin level!"), "Insert", "Back");
8402
8403
8404 case VLEVEL: \
8405 SPD(playerid, Dialog:VLEVEL, INPUT, "{FFFFFF}Changing VIP Level", \
8406 FormatInside(playerid, id, "VIP Level", "Please insert the new VIP level!"), "Insert", "Back");
8407
8408
8409 case CPASS: \
8410 SPD(playerid, Dialog:CPASS, INPUT, "{FFFFFF}Changing Password", \
8411 FormatInside(playerid, id, "Password", "Please insert the new password!"), "Insert", "Back");
8412
8413
8414 case BACCOUNT: \
8415 SPD(playerid, Dialog:BACCOUNT, INPUT, "{FFFFFF}Banning Account", \
8416 FormatInside(playerid, id, .zelse = "Banning", .extra = "Account"), "Yes" , "Back");
8417
8418
8419 case DACCOUNT: \
8420 SPD(playerid, Dialog:DACCOUNT, BOX, "{FFFFFF}Deleting Account", \
8421 FormatInside(playerid, id, .zelse = "Deleting", .extra = "Account"), "Yes" , "Back");
8422 }
8423 }else DeletePVar(playerid, "StatsOf");
8424 }
8425 iDialog<SetStatsSure>
8426 {
8427 if(response)
8428 {
8429 new zStr[30];
8430 format(zStr, 30, "%s", Name(GetPVarInt(playerid, "StatsOf")));
8431 ShowPlayerDialog(playerid, Dialog:SetStatsTrue, LIST, zStr, FormatList(playerid), "Change", "Exit");
8432
8433 }else DeletePVar(playerid, "StatsOf");
8434 }
8435 iDialog<cPanel_Back> cmd_acp(playerid, "");
8436
8437 iDialog<ACCP_LOAD>
8438 {
8439 if(!response)
8440 return cmd_accp(playerid, "");
8441
8442 new Accp_String[16], Accp_Vars[6], DBResult:Result;
8443 format(Query, sizeof(Query), "SELECT `ACCP` FROM `Accounts` WHERE `Name` = '%s'", Name(playerid));
8444 Result = DB::Query(_DB, Query);
8445
8446 if(Result)
8447 {
8448 if(DB::Valid(Result))
8449 {
8450 new Field[50];
8451 DB::GetField(Result, "ACCP", Field, sizeof(Field));
8452 SetPVarString(playerid, "ACCP_DATA", Field);
8453
8454 DB::Free(Result);
8455
8456 if(!sscanf(GPVSEx(playerid, "ACCP_DATA"), "p<:>s[16]iiiiii",Accp_String,
8457 Accp_Vars[0],
8458 Accp_Vars[1],
8459 Accp_Vars[2],
8460 Accp_Vars[3],
8461 Accp_Vars[4],
8462 Accp_Vars[5]))
8463 {
8464 SetPVarString(playerid, "Type", Accp_String);
8465 P_DATA[playerid][A_Component1] = Accp_Vars[0];
8466 P_DATA[playerid][A_Component2] = Accp_Vars[1];
8467 P_DATA[playerid][A_Component3] = Accp_Vars[2];
8468 P_DATA[playerid][A_Component4] = Accp_Vars[3];
8469 P_DATA[playerid][A_Wheels] = Accp_Vars[4];
8470 P_DATA[playerid][A_Color ] = Accp_Vars[5];
8471
8472 }
8473
8474 if(P_DATA[playerid][A_Component1] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component1]);
8475 if(P_DATA[playerid][A_Component2] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component2]);
8476 if(P_DATA[playerid][A_Component3] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component3]);
8477 if(P_DATA[playerid][A_Component4] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component4]);
8478 if(P_DATA[playerid][A_Wheels] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Wheels]);
8479 if(P_DATA[playerid][A_Color] != 0)ChangeVehicleColor(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Color], P_DATA[playerid][A_Color]);
8480
8481 SendClientMessage(playerid, Color:GREY, "The components of your Admin Vehicle have been loaded!");
8482 }
8483 else
8484 {
8485 SendClientMessage(playerid, Color:GREY, "Failed to load the components from the database!");
8486 }
8487 }
8488 }
8489 iDialog<ACCP_DISCARD>
8490 {
8491 if(!response)
8492 return cmd_accp(playerid, "");
8493
8494 if(P_DATA[playerid][A_Component1] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component1]);
8495 if(P_DATA[playerid][A_Component2] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component2]);
8496 if(P_DATA[playerid][A_Component3] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component3]);
8497 if(P_DATA[playerid][A_Component4] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component4]);
8498 if(P_DATA[playerid][A_Wheels] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Wheels]);
8499 if(P_DATA[playerid][A_Color] != 0)ChangeVehicleColor(GetPlayerVehicleID(playerid), 0, 0);
8500
8501 P_DATA[playerid][A_Component1] = 0;
8502 P_DATA[playerid][A_Component2] = 0;
8503 P_DATA[playerid][A_Component3] = 0;
8504 P_DATA[playerid][A_Component4] = 0;
8505 P_DATA[playerid][A_Wheels] = 0;
8506 P_DATA[playerid][A_Color] = 0;
8507
8508 SendClientMessage(playerid, Color:GREY, "The components of your Admin Vehicle have been discarted! You can "BLUE"Save Changes"GREY" from Admin Car cPanel again!");
8509
8510 }
8511 iDialog<ACCP_SAVE>
8512 {
8513 if(!response) return cmd_accp(playerid, "");
8514
8515 CheckComponents(playerid,"No changes have been made to your Admin Car!");
8516
8517 new zQuery[300];
8518 format(zQuery, 300, "UPDATE `Accounts` SET ACCP = '%s:%d:%d:%d:%d:%d:%d', ACCPSav = '1' WHERE `Name` = '%s'",
8519 (strlen(GPVSEx(playerid, "Type")) ? (GPVSEx(playerid, "Type")) : ("None")),
8520 (P_DATA[playerid][A_Component1]) ? (P_DATA[playerid][A_Component1]) : (0),
8521 (P_DATA[playerid][A_Component2]) ? (P_DATA[playerid][A_Component2]) : (0),
8522 (P_DATA[playerid][A_Component3]) ? (P_DATA[playerid][A_Component3]) : (0),
8523 (P_DATA[playerid][A_Component4]) ? (P_DATA[playerid][A_Component4]) : (0),
8524 (P_DATA[playerid][A_Wheels]) ? (P_DATA[playerid][A_Wheels]) : (0) ,
8525 (P_DATA[playerid][A_Color]) ? (P_DATA[playerid][A_Color]) : (0),
8526 Name(playerid));
8527 DB::Query(_DB, zQuery);
8528
8529
8530 P_DATA[playerid][Accp_Saved] = 1;
8531
8532 SendClientMessage(playerid, Color:GREY, "The components of Admin Vehicle have been saved! Later select "BLUE"Load Changes"GREY" from Admin Car cPanel!");
8533
8534 }
8535 iDialog<ACCP_COMPS>
8536 {
8537 if(!response) return OnDialogResponse(playerid, Dialog:ACCP, 1, 2, "");
8538
8539 AddVehicleComponent(GetPlayerVehicleID(playerid), ACCP_Components[listitem][iComponent]);
8540 FormatMSG(playerid, Color:GREY, "You added "ORAN"%s"GREY" on your Admin Car!", ACCP_Components[listitem][icName]);
8541
8542 switch(listitem)
8543 {
8544 case 0,1: P_DATA[playerid][A_Component1] = ACCP_Components[listitem][iComponent];
8545 case 2,3,4: P_DATA[playerid][A_Component2] = ACCP_Components[listitem][iComponent];
8546 case 5: P_DATA[playerid][A_Component3] = ACCP_Components[listitem][iComponent];
8547 case 6: P_DATA[playerid][A_Component4] = ACCP_Components[listitem][iComponent];
8548 }
8549
8550 return cmd_accp(playerid,"");
8551 }
8552
8553 iDialog<ACCP_WHEELS>
8554 {
8555 if(!response) return OnDialogResponse(playerid, Dialog:ACCP, 1, 2, "");
8556
8557 AddVehicleComponent(GetPlayerVehicleID(playerid), Wheels[listitem][iWheel]);
8558 FormatMSG(playerid, Color:GREY, "You added wheels "ORAN"%s"GREY" on your Admin Car!",Wheels[listitem][iwName]);
8559
8560 P_DATA[playerid][A_Wheels] = Wheels[listitem][iWheel];
8561
8562 return cmd_accp(playerid,"");
8563 }
8564
8565 iDialog<ACCP_COLORS>
8566 {
8567 if(!response) return cmd_accp(playerid,"");
8568
8569 ChangeVehicleColor(GetPlayerVehicleID(playerid),ACCP_Colors[listitem][ivColor], ACCP_Colors[listitem][ivColor]);
8570 FormatMSG(playerid, Color:GREY, "You changed your vehicle's color to color to %s%s!", ACCP_Colors[listitem][ivcRGB], ACCP_Colors[listitem][ivcName]);
8571
8572 P_DATA[playerid][A_Color] = ACCP_Colors[listitem][ivColor];
8573
8574 return cmd_accp(playerid,"");
8575 }
8576
8577 iDialog<ACCP_C_C>
8578 {
8579 if(!response) return cmd_accp(playerid,"");
8580
8581 switch(listitem)
8582 {
8583 case (0):
8584 {
8585 new Str[1024];
8586 for (new c = 0; c < sizeof(Wheels); c++)
8587 {format(Str, sizeof (Str), "%s"GREY"ID: "ORAN"%d "GREY" NAME: "ORAN"%s\n",Str, Wheels[c][iWheel], Wheels[c][iwName]);}
8588
8589 SPD(playerid, Dialog:ACCP_WHEELS, LIST, "Change: "ORAN"Wheels", Str, "Change", "Back");
8590 }
8591 case (1):
8592 {
8593 new Str[1024];
8594 for (new c = 0; c < sizeof(ACCP_Components); c++)
8595 {format(Str, sizeof (Str), "%s"GREY"%s\n",Str, ACCP_Components[c][icName]);}
8596
8597 SPD(playerid, Dialog:ACCP_COMPS, LIST, "Add: "ORAN"Components", Str, "Change", "Back");
8598 }
8599 }
8600 }
8601
8602 iDialog<ACCP>
8603 {
8604 if(response)
8605 {
8606 switch(listitem)
8607 {
8608 case (0): SPD(playerid, Dialog:ACCP_NOS, LIST, "Add: "ORAN"Nos", ""GREY"2x\n\
8609 "GREY"5x\n\
8610 "GREY"10x\n\
8611 "GREY"Unlimited\n\
8612 "ORAN"Remove Nos", "Add", "Back");
8613
8614 case (1):
8615 {
8616 new Str[512];
8617 for (new c = 0; c < sizeof(ACCP_Colors); c++)
8618 { format(Str, sizeof (Str), "%s%s%s\n", Str, ACCP_Colors[c][ivcRGB], ACCP_Colors[c][ivcName]); }
8619
8620 SPD(playerid, Dialog:ACCP_COLORS, LIST, "Change: "ORAN"Colors", Str, "Change", "Back");
8621 }
8622 case (2): SPD(playerid, Dialog:ACCP_C_C, LIST, "Add: "ORAN"Components", ""GREY"Wheels\n\
8623 "GREY"Components", "Add", "Back");
8624
8625 case (3):
8626 {
8627
8628 CheckComponents(playerid, "There are no changes to save!");
8629
8630 SPD(playerid, Dialog:ACCP_SAVE, BOX, "Save: "ORAN"Changes!", ""GREY"Saving changes made to your vehicle can be used everytime, anywhere!\n\
8631 Changes will be saved into your account.\n\
8632 Later select the "BLUE"Load Changes"GREY" item on your Admin Car cPanel.\n\
8633 It's totally free and usable anytime!\n\n\
8634 Want to "ORAN"save"GREY" or go "ORAN"back"GREY" ?", "Save", "Back");
8635 }
8636 case (4):
8637 {
8638 if(!P_DATA[playerid][Accp_Saved])
8639 return SendError(playerid, "You didn't save any changes to your vehicle!"), cmd_accp(playerid, "");
8640
8641 SPD(playerid, Dialog:ACCP_LOAD, BOX, "Load: "ORAN"Changes!", ""GREY"With this you will load the changes you saved last time\n\
8642 If you want to remove the changes select the "ORAN"Discard Changes"GREY" from Admin Car cPanel!\n\n\
8643 Want to "ORAN"load"GREY" or go "ORAN"back"GREY" ?", "Load", "Back");
8644 }
8645 case (5):
8646 {
8647 CheckComponents(playerid, "There are no changes to discard due to the fact that there aren't any!");
8648
8649 SPD(playerid, Dialog:ACCP_DISCARD, BOX, "Discard: "ORAN"Changes!", ""GREY"You are about to discard the changes made to your vehicle!\n\
8650 Ani component, nos type, wheels, colors selected for your Admin Car WILL BE DELETED!!\n\n\
8651 Want to "ORAN"discard"GREY" or go "ORAN"back"GREY" ?", "Discard", "Back");
8652 }
8653 }
8654 }
8655 }
8656 iDialog<ACCP_NOS>
8657 {
8658 if(!response) return cmd_accp(playerid,"");
8659 switch(listitem)
8660 {
8661 case (0): AddVehicleComponent(GetPlayerVehicleID(playerid), 1009),SetPVarString(playerid, "Type", "2x");
8662 case (1): AddVehicleComponent(GetPlayerVehicleID(playerid), 1008),SetPVarString(playerid, "Type", "5x");
8663 case (2): AddVehicleComponent(GetPlayerVehicleID(playerid), 1010),SetPVarString(playerid, "Type", "10x");
8664 case (3): AddVehicleComponent(GetPlayerVehicleID(playerid), 1010),SetPVarString(playerid, "Type", "Unlimited");
8665 case (4):
8666 {
8667 if(!strcmp(GPVSEx(playerid, "Type"), "None", false))
8668 return SendError(playerid, "You don't have NOS installed!"),
8669 OnDialogResponse(playerid, Dialog:ACCP, 1, 0, "");
8670
8671 SendClientMessage(playerid, Color:ORAN, "ACCP: "GREY"You removed your Nitro from vehicle!");
8672
8673 RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1010),
8674 RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1009),
8675 RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1008),
8676 SetPVarString(playerid, "Type", "None");
8677 }
8678 }
8679 if(listitem != 4)
8680 {
8681 FormatMSG(playerid, Color:ORAN, "ACCP: "GREY" You have added "ORAN"%s"GREY" nitro to your vehicle!", GPVSEx(playerid, "Type"));
8682
8683 if(!strcmp(GPVSEx(playerid, "Type"), "Unlimited", false))
8684 SendClientMessage(playerid, Color:ORAN, "NOTE:"GREY" Hold your left mouse button for unlimited nos!");
8685
8686 else
8687 SendClientMessage(playerid, Color:ORAN, "NOTE:"GREY" Press "ORAN"2"GREY" or "ORAN"Left Mouse Button"GREY" to recharge when exhausted!");
8688
8689 return cmd_accp(playerid,"");
8690 }
8691 }
8692 iDialog<cPanel_Ping>
8693 {
8694 if(!response)
8695 {
8696 S_DATA[Ping] = 0;
8697
8698 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Ping Kicker",
8699 ""W"Feature "ORAN"\"Ping Kicker\""W" has been disabled!\n\
8700 Players won't be kicked from the server for high ping.", "Back", "");
8701 }
8702 else
8703 {
8704 new sPing[10];
8705 if(sscanf(inputtext, "s[10]", sPing)) return OnDialogResponse(playerid, Dialog:cPanel, 1, 2, "");
8706 else
8707 {
8708 if(!IsNumeric(sPing))
8709 {
8710 if(!strcmp(sPing, "off", true))
8711 {
8712 S_DATA[Ping] = 0;
8713 new INI:
8714 ServerData = INI_Open(SERVER_FILE);
8715 INI_WriteInt(ServerData, INI_Server_Info[2][isName], 0);
8716 INI_Close(ServerData);
8717 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Ping Kicker", \
8718 ""W"Feature "ORAN"\"Ping Kicker\""W" has been disabled!\n\
8719 Players won't be kicked if they have a high ping", "Back", "");
8720 return 0;
8721 }
8722 else
8723 {
8724 SPD(playerid, Dialog:cPanel_Ping, INPUT, ""W"cPanel: "ORAN"Ping Kicker","\n\n\
8725 "GREY"Please write down the ping needed for the player to get kicked.\n\
8726 If you write "ORAN"OFF"GREY" the "ORAN"Ping Kicker"GREY" will be disabled.", "Enter", "Disable");
8727 }
8728 }
8729 else
8730 {
8731 if(strval(sPing) < MIN_PING_LIMIT || strval(sPing) > MAX_PING_LIMIT)
8732 return SPD(playerid, Dialog:cPanel_Ping, INPUT, ""W"cPanel: "ORAN"Ping Kicker",
8733 ""ORAN"ERROR:"W" Min. Ping: "ORAN""#MIN_PING_LIMIT" "W"| Max. Ping: "ORAN""#MAX_PING_LIMIT"\n\n\
8734 "GREY"Please write down the ping needed for the player to get kicked.\n\
8735 If you write "ORAN"OFF"GREY" the "ORAN"Ping Kicker"GREY" will be disabled.", "Enter", "Disable");
8736
8737 S_DATA[Ping] = strval(sPing);
8738
8739 new INI: ServerData = INI_Open(SERVER_FILE);
8740 INI_WriteInt(ServerData, INI_Server_Info[2][isName], strval(sPing));
8741 INI_Close(ServerData);
8742
8743 new zStr[256];
8744 format(zStr, sizeof (zStr), ""W"Feature "ORAN"\"Ping Kicker\""W" has been enabled!\n\
8745 Players will be kicked if they exceed the "ORAN"%d"W" ping limit!", strval(sPing));
8746 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Ping Kicker", zStr, "Back", "");
8747
8748 }
8749 }
8750 }
8751 }
8752 iDialog<cPanel>
8753 {
8754 if(response)
8755 {
8756 new INI:
8757 ServerData = INI_Open(SERVER_FILE);
8758 switch(listitem)
8759 {
8760 case 0:
8761 {
8762 INI_WriteInt(ServerData, INI_Server_Info[0][isName], 1);
8763 S_DATA[AntiSpam] = 1;
8764 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti-Spam",\
8765 ""W"Feature "ORAN"\"Anti-Spam\""W" has been enabled!\n\
8766 Players won't be able to spam the chat and will be kicked for abuse.", "Back", "");
8767 }
8768 case 1:
8769 {
8770 INI_WriteInt(ServerData, INI_Server_Info[1][isName], 1);
8771 S_DATA[AntiCSpam] = 1;
8772 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Command Spam",\
8773 ""W"Feature "ORAN"\"Anti Command Spam\""W" has been enabled!\n\
8774 Players won't be able to spam the chat with commands.", "Back", "");
8775 }
8776 case 2:
8777 {
8778 SPD(playerid, Dialog:cPanel_Ping, INPUT, ""W"cPanel: "ORAN"Ping Kicker","\n\n\
8779 "GREY"Please write down the ping needed for the player to get kicked.\n\
8780 If you write "ORAN"OFF"GREY" the "ORAN"Ping Kicker"GREY" will be disabled.", "Enter", "Disable");
8781 }
8782 case 3:
8783 {
8784 INI_WriteInt(ServerData, INI_Server_Info[3][isName], 1);
8785 S_DATA[RCONProt] = 1;
8786 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"RCON Protection",\
8787 ""W"Feature "ORAN"\"Rcon Protection\""W" has been enabled!\n\
8788 After "ORAN""#MAX_RCON_ATTEMPTS" attempts players will be banned\n\
8789 from the server for repeated login attempts", "Back", "");
8790 }
8791 case 4:
8792 {
8793 INI_WriteInt(ServerData, INI_Server_Info[4][isName], 1);
8794 S_DATA[TellPlayer] = 1;
8795 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Tell Player",\
8796 ""W"Feature "ORAN"\"Tell Player\""W" has been enabled!\n\
8797 Players will receive a message when typing an admin command\n\
8798 telling them that their admin level is not high enough!", "Back", "");
8799 }
8800 case 5:
8801 {
8802 INI_WriteInt(ServerData, INI_Server_Info[5][isName], 0);
8803 S_DATA[Chat] = 0;
8804 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Block Chat",\
8805 ""W"The "ORAN"Chat"W" has been unblocked!\n\
8806 Players are able to speak in the chat!", "Back", "");
8807 }
8808
8809 case 6:
8810 {
8811 INI_WriteInt(ServerData, INI_Server_Info[6][isName], 1);
8812 S_DATA[ReadPM] = 1;
8813 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Read Personal Messages",\
8814 ""W"Feature "ORAN"\"Read PMs\""W" has been enabled!\n\
8815 Administrators will be able to see the messages\n\
8816 sent by members to others!", "Back", "");
8817 }
8818 case 7:
8819 {
8820 INI_WriteInt(ServerData, INI_Server_Info[7][isName], 1);
8821 S_DATA[ReadCMD] = 1;
8822 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Read Commands",\
8823 ""W"Feature "ORAN"\"Read Commands\""W" has been enabled!\n\
8824 Administrators will be able to see the commands a player used!", "Back", "");
8825 }
8826 case 8:
8827 {
8828 INI_WriteInt(ServerData, INI_Server_Info[8][isName], 1);
8829 S_DATA[AKA] = 1;
8830 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"AKA",\
8831 ""W"Feature "ORAN"\"AKA\""W" has been enabled!\n\
8832 Admins will see the AKA names of a player!", "Back", "");
8833 }
8834
8835 case 9:
8836 {
8837 SPD(playerid, Dialog:cPanel2, LIST, ""ORAN"Server Control Panel"W" Page: 2", cPanel2(), "Enable", "Disable");
8838 }
8839 }
8840 INI_Close(ServerData);
8841 }
8842 else
8843 {
8844 new INI:
8845 ServerData = INI_Open(SERVER_FILE);
8846 switch(listitem)
8847 {
8848 case 0:
8849 {
8850 INI_WriteInt(ServerData, INI_Server_Info[0][isName], 0);
8851 S_DATA[AntiSpam] = 0;
8852 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti-Spam",\
8853 ""W"Feature "ORAN"\"Anti-Spam\""W" has been disabled!\n\
8854 Players will be able to spam the chat.", "Back", "");
8855 }
8856 case 1:
8857 {
8858 INI_WriteInt(ServerData, INI_Server_Info[1][isName], 0);
8859 S_DATA[AntiCSpam] = 0;
8860 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Command Spam",\
8861 ""W"Feature "ORAN"\"Anti Command Spam\""W" has been disabled!\n\
8862 Players will be able to spam the chat with commands.", "Back", "");
8863 }
8864 case 2:
8865 {
8866 INI_WriteInt(ServerData, INI_Server_Info[2][isName], 0);
8867 S_DATA[Ping] = 0;
8868 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Ping Kicker",\
8869 ""W"Feature "ORAN"\"Ping Kicker\""W" has been disabled!\n\
8870 Players won't be kicked for a high ping.", "Back", "");
8871 }
8872 case 3:
8873 {
8874 INI_WriteInt(ServerData, INI_Server_Info[3][isName], 0);
8875 S_DATA[RCONProt] = 0;
8876 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"RCON Protection",\
8877 ""W"Feature "ORAN"\"Rcon Protection\""W" has been disabled!\n\
8878 Players won't be banned from the server for RCON login attempts.", "Back", "");
8879 }
8880 case 4:
8881 {
8882 INI_WriteInt(ServerData, INI_Server_Info[4][isName], 0);
8883 S_DATA[TellPlayer] = 0;
8884 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Tell Player",\
8885 ""W"Feature "ORAN"\"Tell Player\""W" has been disabled!\n\
8886 Players won't be informed that their level is not high enough\n\
8887 to execute the admin command, actually, no message will be sent.", "Back", "");
8888 }
8889 case 5:
8890 {
8891 INI_WriteInt(ServerData, INI_Server_Info[5][isName], 1);
8892 S_DATA[Chat] = 1;
8893 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Block Chat",\
8894 ""W"The "ORAN"Chat"W" has been blocked!\n\
8895 Players won't be able to speak in the chat", "Back", "");
8896 }
8897 case 6:
8898 {
8899 INI_WriteInt(ServerData, INI_Server_Info[6][isName], 0);
8900 S_DATA[ReadPM] = 0;
8901 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Read Personal Messages",\
8902 ""W"Feature "ORAN"\"Read PMs\""W" has been disabled!\n\
8903 Personal Messages are now PERSONAL!", "Back", "");
8904 }
8905 case 7:
8906 {
8907 INI_WriteInt(ServerData, INI_Server_Info[7][isName], 0);
8908 S_DATA[ReadCMD] = 0;
8909 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Read Commands",\
8910 ""W"Feature "ORAN"\"Read Commands\""W" has been disabled!\n\
8911 Reading Commands is now disabled, Admins won't see.!", "Back", "");
8912 }
8913 case 8:
8914 {
8915 INI_WriteInt(ServerData, INI_Server_Info[8][isName], 0);
8916 S_DATA[AKA] = 0;
8917 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"AKA",\
8918 ""W"Feature "ORAN"\"AKA\""W" has been disabled!\n\
8919 Admins won't see the AKA the players logged with!", "Back", "");
8920 }
8921 }
8922 INI_Close(ServerData);
8923 }
8924 }
8925 iDialog<cPanel2>
8926 {
8927 if(response)
8928 {
8929 new INI:
8930 ServerData = INI_Open(SERVER_FILE);
8931 switch(listitem)
8932 {
8933 case 0:
8934 {
8935 INI_WriteInt(ServerData, INI_Server_Info[9][isName], 1);
8936 S_DATA[ShowFunction] = 1;
8937 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Show Function",\
8938 ""W"Feature "ORAN"\"Show Function\""W" has been enabled!\n\
8939 When admins type an admin command, they will see the \""ORAN"Function: "W"blabla\"", "Back", "");
8940 }
8941 case 1:
8942 {
8943 INI_WriteInt(ServerData, INI_Server_Info[10][isName], 1);
8944 S_DATA[AntiRepeat] = 1;
8945 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Message Repeat",\
8946 ""W"Feature "ORAN"\"Anti Message Repeat\""W" has been enabled!\n\
8947 Players will be warned if they continue to send same message in the chat!", "Back", "");
8948 }
8949 case 2:
8950 {
8951 INI_WriteInt(ServerData, INI_Server_Info[11][isName], 1);
8952 S_DATA[AutoLogin] = 1;
8953 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Auto Login",\
8954 ""W"Feature "ORAN"\"Auto Login\""W" has been enabled!\n\
8955 When players connect and the IP with which they left matches\n\
8956 the one they connected with and the name is same they will\n\
8957 auto login into their account without password request\n\n\
8958 "ORAN"# Could be unsafe! Use carfully!", "Back", "");
8959 }
8960 case 3:
8961 {
8962 #if USE_RANKS == true
8963
8964 INI_WriteInt(ServerData, INI_Server_Info[12][isName], 1);
8965 S_DATA[AnnRank] = 1;
8966 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Announce Rank",\
8967 ""W"Feature "ORAN"\"Announce Rank\""W" has been enabled!\n\
8968 When a player will rank up, will tell to the whole server\n\
8969 This feature can get frustrating when the server is crowded!", "Back", "");
8970
8971 #else
8972
8973 cmd_acp(playerid, "");
8974 SendError(playerid, "Using Ranks is disabled from script!");
8975
8976 #endif
8977 }
8978 case 4:
8979 {
8980 INI_WriteInt(ServerData, INI_Server_Info[13][isName], 1);
8981 S_DATA[AntiAD] = 1;
8982 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
8983 ""W"Feature "ORAN"\"Anti Advertising\""W" has been enabled!\n\
8984 Players that will advertise will be warned then kicked!", "Back", "");
8985 }
8986 case 5:
8987 {
8988 INI_WriteInt(ServerData, INI_Server_Info[14][isName], 0);
8989 S_DATA[AdminChat] = 1;
8990 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
8991 ""W"Feature "ORAN"\"Bloch Admin Chat\""W" has been enabled!\n\
8992 All admins will be able to chat trough Admin Chat", "Back", "");
8993 }
8994 case 6:
8995 {
8996 INI_WriteInt(ServerData, INI_Server_Info[15][isName], 0);
8997 S_DATA[VipChat] = 1;
8998 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
8999 ""W"Feature "ORAN"\"Block VIP Chat\""W" has been enabled!\n\
9000 VIP members can now chat freely trough VIP Chat.", "Back", "");
9001 }
9002 case 7:
9003 {
9004 cmd_acp(playerid, "");
9005 }
9006 }
9007 INI_Close(ServerData);
9008 }
9009 else
9010 {
9011 new INI:
9012 ServerData = INI_Open(SERVER_FILE);
9013
9014 switch(listitem)
9015 {
9016 case 0:
9017 {
9018 INI_WriteInt(ServerData, INI_Server_Info[9][isName], 0);
9019 S_DATA[ShowFunction] = 0;
9020 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Show Function",\
9021 ""W"Feature "ORAN"\"Show Function\""W" has been disabled!\n\
9022 When admins type an admin command, they won't see the \"Function: blabla\"", "Back", "");
9023 }
9024 case 1:
9025 {
9026 INI_WriteInt(ServerData, INI_Server_Info[10][isName], 0);
9027 S_DATA[AntiRepeat] = 0;
9028 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Message Repeat",\
9029 ""W"Feature "ORAN"\"Anti Message Repeat\""W" has been disabled!\n\
9030 Players are now allowed to repeate themselves in the chat!", "Back", "");
9031 }
9032 case 2:
9033 {
9034 INI_WriteInt(ServerData, INI_Server_Info[11][isName], 0);
9035 S_DATA[AutoLogin] = 0;
9036 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Auto Login",\
9037 ""W"Feature "ORAN"\"Auto Login\""W" has been disabled!\n\
9038 On connection player will need to enter their passwords\n\
9039 to enter their accounts!\n\n\
9040 "GREE"# Safest Way!", "Back", "");
9041 }
9042 case 3:
9043 {
9044 #if USE_RANKS == true
9045
9046 INI_WriteInt(ServerData, INI_Server_Info[12][isName], 0);
9047 S_DATA[AnnRank] = 0;
9048 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Announce Rank",\
9049 ""W"Feature "ORAN"\"Announce Rank\""W" has been disabled!\n\
9050 Only the ranked up player will see the message!", "Back", "");
9051
9052 #else
9053
9054 cmd_acp(playerid, "");
9055 SendError(playerid, "Using Ranks is disabled from script!");
9056
9057 #endif
9058 }
9059 case 4:
9060 {
9061 INI_WriteInt(ServerData, INI_Server_Info[13][isName], 0);
9062 S_DATA[AntiAD] = 0;
9063 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
9064 ""W"Feature "ORAN"\"Anti Advertising\""W" has been disabled!\n\
9065 Players will now be able to send IP in chat!!!", "Back", "");
9066 }
9067 case 5:
9068 {
9069 INI_WriteInt(ServerData, INI_Server_Info[14][isName], 0);
9070 S_DATA[AdminChat] = 0;
9071 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
9072 ""W"Feature "ORAN"\"Bloch Admin Chat\""W" has been disabled!\n\
9073 Only Administrators and Owners will be able to Admin Chat", "Back", "");
9074 }
9075 case 6:
9076 {
9077 INI_WriteInt(ServerData, INI_Server_Info[15][isName], 0);
9078 S_DATA[VipChat] = 0;
9079 SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
9080 ""W"Feature "ORAN"\"Block VIP Chat\""W" has been disabled!\n\
9081 VIP members won't be able to chat trough VIP Chat.", "Back", "");
9082 }
9083 case 7:
9084 {
9085 cmd_acp(playerid, "");
9086 }
9087 }
9088 INI_Close(ServerData);
9089 }
9090 }
9091
9092 switch(dialogid)
9093 {
9094 CaseDialog<Register1> if(response)RegisterPlayer(playerid, Dialog:Register1, inputtext);
9095 CaseDialog<Login> SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""W"Please write your password!", "Login", "Forg. Pass");
9096 CaseDialog<Register>
9097 {
9098 if(! response) return KickEx(playerid, .zReason = "Not registering", .tell = true);
9099
9100 if(strlen(inputtext))
9101 {
9102 if(strlen(inputtext) < MIN_PASS_LEN || strlen(inputtext) > MAX_PASS_LEN)
9103 return ShowPlayerDialog
9104 (
9105 playerid,
9106 Dialog:Register,
9107 DIALOG_STYLE_INPUT,
9108 ""W"Register an account",
9109 ""ORAN"ERROR:"W" An error has occured while trying to register the account, please try again!!\n\n\
9110 Please write your desired password.", "Register", "Kick");
9111
9112 SetPVarString(playerid, "TempPass", inputtext);
9113 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", "");
9114 }
9115 else
9116 {
9117 new zStr[256];
9118 format(zStr, sizeof (zStr), "{FF0000}Please write a password!\n\n"W"Please write your desired password", Name(playerid), GetServerHostName());
9119 ShowPlayerDialog(playerid, Dialog:Register, DIALOG_STYLE_INPUT, ""W"Register an account", zStr, "Register", "Kick");
9120 }
9121 }
9122 CaseDialog<SQuestion>
9123 {
9124 if(response || !response)
9125 {
9126 if(strlen(inputtext))
9127 {
9128 if(strlen(inputtext) > 10 && strlen(inputtext) < 90)
9129 {
9130 if(strfind(inputtext, "?", true) != -1)
9131 {
9132 SetPVarString(playerid, "Question", inputtext);
9133 new Str[190];
9134 format(Str, 190, ""W"Your secret question is:\n "BLUE"%s\n\n"W"Please insert the answer:", inputtext);
9135 SPD(playerid, Dialog:SAnswer, INPUT, ""W"Secret Answer",Str, "Insert", "Back");
9136 }
9137 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", "");
9138 }
9139 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", "");
9140 }
9141 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", "");
9142 }
9143 }
9144 CaseDialog<SAnswer2>
9145 {
9146 RegisterPlayer(playerid, Dialog:Register1, GPVSEx(playerid, "TempPass"));
9147 }
9148 CaseDialog<SAnswer>
9149 {
9150 if(response)
9151 {
9152 new Str[190];
9153 if(strlen(inputtext))
9154 {
9155 if(strlen(inputtext) > 4 && strlen(inputtext) < 90)
9156 {
9157 SetPVarString(playerid, "Answer", inputtext);
9158
9159 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);
9160 SPD(playerid, Dialog:SAnswer2, BOX, ""W"Account login",Str, "Continue", "");
9161
9162 format(Query, 200, "UPDATE `Accounts` SET `Question` = '%s', `Answer` = '%s' WHERE `Name` = '%s'", GPVSEx(playerid, "Question"), inputtext, Name(playerid));
9163 DB::Query(_DB, Query);
9164 }
9165 else
9166 {
9167 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"));
9168 SPD(playerid, Dialog:SAnswer, INPUT, ""W"Secret Answer",Str, "Insert", "Back");
9169 }
9170 }
9171 else
9172 {
9173 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"));
9174 SPD(playerid, Dialog:SAnswer, INPUT, ""W"Secret Answer",Str, "Insert", "Back");
9175 }
9176 }
9177 else
9178 {
9179 DeletePVar(playerid, "Question");
9180 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", "");
9181 }
9182 }
9183 CaseDialog<Login2>
9184 {
9185 if(response)
9186 {
9187 if(!strlen(inputtext))
9188 return SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""ORAN"ERROR:"W" No password entered!\n\n"W"Please write your password!", "Login", "Forg. Pass");
9189
9190
9191 LoginPlayer(playerid, inputtext);
9192 }
9193 else SPD(playerid, Dialog:ForgPass, INPUT, ""W"Forgot Password", ""W"Please insert the answer to your secret question for password retrival", "Insert", "Back");
9194
9195 }
9196 CaseDialog<ForgPass>
9197 {
9198 if(response)
9199 {
9200 if(strlen(inputtext))
9201 {
9202 new DBResult:Result;
9203 format(Query, 200, "SELECT `Question`, `Answer`, `RPassword` FROM `Accounts` WHERE `Name` = '%s';", Name(playerid));
9204 Result = DB::Query(_DB, Query);
9205
9206 if(Result)
9207 {
9208 if(DB::Valid(Result))
9209 {
9210 new Field[129];
9211
9212 DB::GetField(Result, "Answer", Field, sizeof(Field));
9213 SetPVarString(playerid, "TempAnswer", Field);
9214
9215 DB::GetField(Result, "Question", Field, sizeof(Field));
9216 SetPVarString(playerid, "Question", Field);
9217
9218 if(!strcmp(GPVSEx(playerid, "TempAnswer"), inputtext, false))
9219 {
9220 DB::GetField(Result, "RPassword", Field, sizeof(Field));
9221
9222 new Str[100];
9223 format(Str, 100, ""W"The answer is correct!\n\nYour password is:"BLUE" %s", Field);
9224 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", "");
9225
9226 DB::Free(Result);
9227
9228 DeletePVar(playerid, "TempAnswer");
9229 }
9230 else
9231 {
9232 DB::Free(Result);
9233 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");
9234 }
9235 }
9236 }
9237 }else SPD(playerid, Dialog:ForgPass, INPUT, ""W"Forgot Password", ""W"Please insert the answer to your secret question for password retrival", "Insert", "Back");
9238 }
9239 else SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""W"Please write your password!", "Login", "Forg. Pass");
9240
9241 }
9242
9243 CaseDialog<Login3>
9244 {
9245 if(response)
9246 {
9247 if(!strlen(inputtext))
9248 return SPD(playerid, Dialog:Login3, INPUT, ""W"Account login", ""ORAN"ERROR:"W" No password entered!\n\n"W"Please write your password!", "Login", "Forg. Pass");
9249
9250 LoginPlayer(playerid, inputtext);
9251 }
9252 }
9253 }
9254 return 0;
9255}
9256
9257Public:dLabel(InV) return DeletePlayer3DTextLabel(InV, ZaAdminCar[InV]);
9258Public:UnlimitedNos(playerid)AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
9259
9260Public:LoadPlayerIP(playerid, name[], value[])
9261{
9262 if(!strcmp(name, "IP")) SetPVarString(playerid, "AutoLogIP", value);
9263}
9264Public:LoadAKA(playerid, name[], value[])
9265{
9266 new pIP[30];
9267 GetPlayerIp(playerid, pIP, 30);
9268 if(!strcmp(name, pIP)) SetPVarString(playerid, "pAKA", value);
9269}
9270Public:PingKick()
9271{
9272 foreach(Player, i)
9273 {
9274 if(S_DATA[Ping] != 0)
9275 {
9276 if(GetPlayerPing(i) > S_DATA[Ping] && P_DATA[i][Level] < IPGKICK)
9277 {
9278 new Str[30];
9279 format(Str, sizeof (Str), "Exceeding Ping Limit of %d", S_DATA[Ping]);
9280 KickEx(i, .zAdmin = "System", .zReason = Str, .tell = true);
9281 }
9282 }
9283 }
9284}
9285Public:BlockChat(playerid)
9286{
9287 if(S_DATA[Chat]) return SendError(playerid, "Chat already blocked!");
9288 S_DATA[Chat] = 1;
9289 SendAdminCMD(-1, "Admin "ORAN"%s[%i]"GREY" blocked the chat.", Name(playerid), playerid);
9290 SendClientMessage(playerid, Color:GREY, "You blocked the chat.");
9291
9292 foreach(Player, i)
9293 {
9294 if(P_DATA[i][Level] <= 0)
9295 {
9296 SendClientMessage(i, -1, "- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *");
9297 FormatMSG(i, -1, "Chat has been disabled by the Owner: %s", Name(playerid));
9298 SendClientMessage(i, -1, "- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *");
9299 }
9300 }
9301 return 1;
9302}
9303
9304Public:JailPlayer(playerid)
9305{
9306 KillTimer(JailTimer[playerid]);
9307
9308 UnFreeze(playerid);
9309
9310 SetPlayerPos(playerid, 197.6661, 173.8179, 1003.0234);
9311 SetPlayerInterior(playerid,3);
9312 SetCameraBehindPlayer(playerid);
9313
9314 if(P_DATA[playerid][Frozen])
9315 {
9316 Freeze(playerid);
9317 }
9318 JailTimer[playerid] = SetTimerEx("UnjailPlayer", 60_000, true, "d", playerid);
9319 P_DATA[playerid][Jailed] = 1;
9320}
9321Public:UnjailPlayer(playerid)
9322{
9323
9324 --P_DATA[playerid][JailTime];
9325
9326
9327 if(!P_DATA[playerid][JailTime])
9328 {
9329 KillTimer(JailTimer[playerid]);
9330 UnjailPlayer(playerid);
9331
9332 P_DATA[playerid][Jailed] = 0;
9333 P_DATA[playerid][JailTime] = 0;
9334
9335 SetPlayerInterior(playerid, 0);
9336 SetPlayerPos(playerid, 0.0, 0.0, 0.0);
9337 PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
9338
9339 SpawnPlayer(playerid);
9340 SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You have been un-jailed by the system!");
9341
9342 #if SAVE_JAIL == true
9343 new
9344 Query[256];
9345 format(Query, 256, "DELETE FROM `Jailed` WHERE `IP` = '%s'", GetPlayerIPEx(playerid));
9346 DB::Query(_DB, Query);
9347 #endif
9348 }
9349 else if(P_DATA[playerid][JailTime] == 1){
9350 GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~b~~h~JAIL INFO~n~~b~~h~One~w~ minute left", 10000, 3);}
9351
9352 else if(P_DATA[playerid][JailTime] > 1)
9353 {
9354 new Str[129];
9355 format(Str, 129, "~n~~n~~n~~n~~n~~n~~b~~h~JAIL INFO~n~~b~~h~%d~w~ minutes left", P_DATA[playerid][JailTime]);
9356 GameTextForPlayer(playerid, Str, 10000, 3);
9357 }
9358
9359 return 1;
9360}
9361Public:UnbanIP(playerid, name[], value[])
9362{
9363 if(!strcmp(name, "IP")) SetPVarString(playerid, "UnbanPlayerIP", value);
9364}
9365
9366PcPanel(playerid)
9367{
9368
9369 new Str[2_0_0_0];
9370
9371 format(Str, sizeof (Str), ""ORAN"Exit cPanel\n\
9372 "W"Auto-Login\t\t%s\n\
9373 "W"Block PMs\t\t%s\n\
9374 "W"My stats",
9375 (S_DATA[AutoLogin] && P_DATA[playerid][pAuto]) ? (""GREE"Enabled") : (""ORAN"Disabled"),
9376 P_DATA[playerid][BAPMs] ? (""GREE"Enabled") : (""ORAN"Disabled"));
9377
9378 switch(P_DATA[playerid][Vip])
9379 {
9380 case 1:
9381 {
9382 format(Str, sizeof (Str), "%s\n"BLUE"VIP LEVEL 1\n\
9383 "W"Godlike\t\t%s\n\
9384 "W"Vehicle God\t\t%s\n\
9385 "W"Vehicle Boost\t\t%s\n\
9386 "W"Wear VIP Tag\t\t%s",
9387 Str,
9388 P_DATA[playerid][God] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9389 P_DATA[playerid][CarGod] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9390 P_DATA[playerid][Boost] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9391 P_DATA[playerid][VIPTag] ? (""GREE"Enabled") : (""ORAN"Disabled"));
9392 }
9393 case 2:
9394 {
9395 format(Str, sizeof (Str), "%s\n"BLUE"VIP LEVEL 1\n\
9396 "W"Godlike\t\t\t%s\n\
9397 "W"Vehicle God\t\t%s\n\
9398 "W"Vehicle Boost\t\t%s\n\
9399 "W"Wear VIP Tag\t\t%s\n\
9400 "BLUE"VIP LEVEL 2\n\
9401 "W"Carmageddon\t\t%s\n\
9402 "W"Incredible\t\t%s",
9403 Str,
9404 P_DATA[playerid][God] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9405 P_DATA[playerid][CarGod] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9406 P_DATA[playerid][Boost] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9407 P_DATA[playerid][VIPTag] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9408 P_DATA[playerid][Spin] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9409 P_DATA[playerid][Incred] ? (""GREE"Enabled") : (""ORAN"Disabled"));
9410 }
9411 case 3:
9412 {
9413 format(Str, sizeof (Str), "%s\n"BLUE"VIP LEVEL 1\n\
9414 "W"Godlike\t\t\t%s\n\
9415 "W"Vehicle God\t\t%s\n\
9416 "W"Vehicle Boost\t\t%s\n\
9417 "W"Wear VIP Tag\t\t%s\n\
9418 "BLUE"VIP LEVEL 2\n\
9419 "W"Vehicle Spin\t\t%s\n\
9420 "W"Incredible\t\t%s\n\
9421 "BLUE"VIP LEVEL 3\n\
9422 "W"Shout\n\
9423 "W"Start event",
9424 Str,
9425 P_DATA[playerid][God] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9426 P_DATA[playerid][CarGod] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9427 P_DATA[playerid][Boost] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9428 P_DATA[playerid][VIPTag] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9429 P_DATA[playerid][Spin] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9430 P_DATA[playerid][Incred] ? (""GREE"Enabled") : (""ORAN"Disabled"));
9431 }
9432 }
9433 return Str;
9434}
9435cPanel()
9436{
9437 new PingString[50], Str[1024];
9438 if(S_DATA[Ping] != 0) format(PingString, sizeof (PingString), ""GREE"Enabled"W"\tPing Limit: "ORAN"%d", S_DATA[Ping]); else PingString = ""ORAN"Disabled";
9439 format(Str, sizeof (Str), ""W"Anti Spam\t\t%s\n\
9440 "W"Anti Command Spam\t%s\n\
9441 "W"Ping Kicker\t\t%s\n\
9442 "W"RCON Protection\t%s\n\
9443 "W"Tell Player\t\t%s\n\
9444 "W"Chat\t\t\t%s\n\
9445 "W"Read Commands\t%s\n\
9446 "W"Read PMs\t\t%s\n\
9447 "W"AKA\t\t\t%s\n\
9448 "GREY"..: Page 2\n\
9449 "ORAN"..: Exit",
9450 S_DATA[AntiSpam] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9451 S_DATA[AntiCSpam] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9452 PingString,
9453 S_DATA[RCONProt] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9454 S_DATA[TellPlayer] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9455 S_DATA[Chat] ? (""ORAN"Blocked") : (""GREE"Free to chat"),
9456 S_DATA[ReadPM] ? (""GREE"Reading") : (""ORAN"Not Reading"),
9457 S_DATA[ReadCMD] ? (""GREE"Reading") : (""ORAN"Not Reading"),
9458 S_DATA[AKA] ? (""GREE"Enabled") : (""ORAN"Disabled"));
9459
9460
9461
9462 return Str;
9463}
9464cPanel2()
9465{
9466 new Str[512];
9467 format(Str, sizeof (Str), ""W"Show Function\t\t%s\n\
9468 "W"Anti Message Repeat\t%s\n\
9469 "W"Autologin\t\t%s\n\
9470 "W"Announce Rank-Up\t%s\n\
9471 "W"Anti Advertising\t%s\n\
9472 "W"Admin Chat\t\t%s\n\
9473 "W"VIP Chat\t\t%s\n\
9474 "GREY"..: Back\n\
9475 "ORAN"..: Exit",
9476 S_DATA[ShowFunction] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9477 S_DATA[AntiRepeat] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9478 S_DATA[AutoLogin] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9479 S_DATA[AnnRank] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9480 S_DATA[AntiAD] ? (""GREE"Enabled") : (""ORAN"Disabled"),
9481 S_DATA[AdminChat] ? (""GREE"Allowed") : (""ORAN"Not Allowed"),
9482 S_DATA[VipChat] ? (""GREE"Allowed") : (""ORAN"Not Allowed"));
9483
9484
9485
9486 return Str;
9487}
9488OnlineCheck(type[], C)
9489{
9490 new cS[126];
9491 if(!strcmp(type, "Admins"))
9492 {
9493 if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" Administrators online!\n\n", C);
9494 else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" Administrator online!\n\n");
9495 }
9496 else if(!strcmp(type, "Vips"))
9497 {
9498 if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" VIP Members online!\n\n", C);
9499 else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" VIP Member online!\n\n");
9500 }
9501 else if(!strcmp(type, "Jailed"))
9502 {
9503 if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" Jailed players online!\n\n", C);
9504 else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" Jailed player online!\n\n");
9505 }
9506 else if(!strcmp(type, "Muted"))
9507 {
9508 if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" Muted players online!\n\n", C);
9509 else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" Muted player online!\n\n");
9510 }
9511 else if(!strcmp(type, "Frozen"))
9512 {
9513 if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" Frozen players online!\n\n", C);
9514 else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" Frozen player online!\n\n");
9515 }
9516 return cS;
9517}
9518Public: LowerSpam()
9519{
9520 foreach(Player, playerid)
9521 {
9522 if(P_DATA[playerid][SpamMSG] > 0) P_DATA[playerid][SpamMSG]--;
9523 if(P_DATA[playerid][cSpam] > 0) P_DATA[playerid][cSpam]--;
9524 }
9525}
9526
9527fNMB(nmb)
9528{
9529 new Str[4];
9530 format(Str, sizeof (Str), "%d", nmb);
9531 return Str;
9532}
9533
9534
9535FormatStats(z)
9536{
9537 #if USE_RANKS == true
9538 format(StatsString, sizeof (StatsString), "\n"W"Viewing %s\n\n\
9539 "W"Level: "ORAN"%s\n\
9540 "W"Vip: "ORAN"%s\n\
9541 "W"Kills: "ORAN"%d\n\
9542 "W"Deaths: "ORAN"%d\n\
9543 "W"Ratio: "ORAN"%.3f\n\
9544 "W"Rank: "ORAN"%s\n\
9545 "W"Cookies: "ORAN"%d\n\
9546 "W"Respect: "GREE"+%d"W"/"ORAN"-%d\n",
9547 WhosStats,
9548 LevelName(P_DATA[z][Level]),
9549 (P_DATA[z][Vip]) ? (fNMB(P_DATA[z][Vip])) : ("NO!"),
9550 P_DATA[z][Kills],
9551 P_DATA[z][Deaths],
9552 (Float:P_DATA[z][Kills] / Float:P_DATA[z][Deaths]),
9553 RankName(P_DATA[z][Rank]),
9554 P_DATA[z][Cookies],
9555 P_DATA[z][Positive],
9556 P_DATA[z][Negative]);
9557 #else
9558 format(StatsString, sizeof (StatsString), "\n"W"Viewing %s\n\n\
9559 "W"Level: "ORAN"%s\n\
9560 "W"Vip: "ORAN"%s\n\
9561 "W"Kills: "ORAN"%d\n\
9562 "W"Deaths: "ORAN"%d\n\
9563 "W"Ratio: "ORAN"%.3f\n\
9564 "W"Cookies: "ORAN"%d\n\
9565 "W"Respect: "GREE"+%d"W"/"ORAN"-%d\n",
9566 WhosStats,
9567 LevelName(P_DATA[z][Level]),
9568 (P_DATA[z][Vip]) ? (fNMB(P_DATA[z][Vip])) : ("NO!"),
9569 P_DATA[z][Kills],
9570 P_DATA[z][Deaths],
9571 P_DATA[z][Cookies],
9572 (Float:P_DATA[z][Kills[/ Float:P_DATA[z][Deaths]),
9573 P_DATA[z][Positive],
9574 P_DATA[z][Negative]);
9575 #endif
9576 format(StatsString, sizeof (StatsString), "%s\
9577 "W"Money: "ORAN"%d\n\
9578 "W"Score: "ORAN"%d\n\
9579 "W"Online: "ORAN"%s\n\
9580 "W"Commands: "ORAN"%d\n\
9581 "W"Fail Cmds: "ORAN"%d\n\
9582 "W"Messages: "ORAN"%d\n\
9583 "W"Kicks: "ORAN"%d\n\
9584 "W"Account date: "ORAN"%s\n\
9585 "W"Account ID: "ORAN"%d\n\n",
9586 StatsString,
9587 GetPlayerMoney(z),
9588 GetPlayerScore(z),
9589 FormatOnline(z),
9590 P_DATA[z][Cmds],
9591 P_DATA[z][fCmds],
9592 P_DATA[z][Msgs],
9593 P_DATA[z][Kicks],
9594 GPVSEx(z, "AccountDate"),
9595 P_DATA[z][AccID]);
9596 return 1;
9597}
9598#if USE_RANKS == true
9599 RankName(rank) return _RankNames[rank];
9600
9601#endif
9602LevelName(iLevel)
9603{
9604 new zLevel[35];
9605 if (iLevel == 0) format(zLevel, 35, "%s", _Levels[0]);
9606 else if(iLevel == 1) format(zLevel, 35, "%s", _Levels[1]);
9607 else if(iLevel == 2) format(zLevel, 35, "%s", _Levels[2]);
9608 else if(iLevel == 3) format(zLevel, 35, "%s", _Levels[3]);
9609 else if(iLevel == 4) format(zLevel, 35, "%s", _Levels[4]);
9610 else if(iLevel >= 5) format(zLevel, 35, "%s", _Levels[5]);
9611 else zLevel = "<< Error >>";
9612 return zLevel;
9613}
9614
9615LoginPlayer(playerid, const pPass[], pAutoLogin = false)
9616{
9617
9618 new Buf[129], Query[280], DBResult:Result;
9619 WP_Hash(Buf, (129), pPass);
9620
9621 format(Query, 280, "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s' AND `Password` = '%s'", Name(playerid), Buf);
9622 Result = DB::Query(_DB, Query);
9623
9624 if(Result)
9625 {
9626 if(DB::Valid(Result))
9627 {
9628 DB::Free(Result);
9629 new Accp_String[16], Accp_Vars[6], Str[256];
9630
9631 LoadPlayerData(playerid);
9632 P_DATA[playerid][Logged] = 1;
9633
9634
9635 sscanf(GPVSEx(playerid, "Online"), "p<:>iii", P_DATA[playerid][Hours],P_DATA[playerid][Minutes],P_DATA[playerid][Seconds]);
9636
9637 if(!sscanf(GPVSEx(playerid, "ACCP_DATA"), "p<:>s[16]iiiiii",Accp_String,
9638 Accp_Vars[0],
9639 Accp_Vars[1],
9640 Accp_Vars[2],
9641 Accp_Vars[3],
9642 Accp_Vars[4],
9643 Accp_Vars[5]))
9644 {
9645 SetPVarString(playerid, "Type", Accp_String);
9646 P_DATA[playerid][A_Component1] = Accp_Vars[0];
9647 P_DATA[playerid][A_Component2] = Accp_Vars[1];
9648 P_DATA[playerid][A_Component3] = Accp_Vars[2];
9649 P_DATA[playerid][A_Component4] = Accp_Vars[2];
9650 P_DATA[playerid][A_Wheels] = Accp_Vars[3];
9651 P_DATA[playerid][A_Color] = Accp_Vars[4];
9652 }
9653 else
9654 {
9655 SetPVarString(playerid, "Type", "None");
9656 P_DATA[playerid][A_Component1] = 0;
9657 P_DATA[playerid][A_Component2] = 0;
9658 P_DATA[playerid][A_Component3] = 0;
9659 P_DATA[playerid][A_Component4] = 0;
9660 P_DATA[playerid][A_Wheels] = 0;
9661 P_DATA[playerid][A_Color] = 0;
9662 }
9663 SetPVarInt(playerid, "0_Level", P_DATA[playerid][Level]);
9664 SetPVarInt(playerid, "0_Vip", P_DATA[playerid][Vip]);
9665 SetPVarInt(playerid, "0_Kills", P_DATA[playerid][Kills]);
9666 SetPVarInt(playerid, "0_Deaths", P_DATA[playerid][Deaths]);
9667 SetPVarInt(playerid, "0_Messages", P_DATA[playerid][Msgs]);
9668 SetPVarInt(playerid, "0_Commands", P_DATA[playerid][Cmds]);
9669 SetPVarInt(playerid, "0_Fail_Commands", P_DATA[playerid][fCmds]);
9670 SetPVarInt(playerid, "0_Cookies", P_DATA[playerid][Cookies]);
9671 SetPVarInt(playerid, "0_God", P_DATA[playerid][God]);
9672 SetPVarInt(playerid, "0_CarGod", P_DATA[playerid][CarGod]);
9673 SetPVarInt(playerid, "0_Positive", P_DATA[playerid][Positive]);
9674 SetPVarInt(playerid, "0_Negative", P_DATA[playerid][Negative]);
9675 SetPVarInt(playerid, "0_Rank", P_DATA[playerid][Rank]);
9676
9677
9678 if(!pAutoLogin)
9679 {
9680
9681 if(P_DATA[playerid][Level] > 0 && P_DATA[playerid][Vip] > 0)
9682 {
9683 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]);
9684 if(P_DATA[playerid][VIPTag])
9685 {
9686 Delete3DTextLabel(P_DATA[playerid][Tag3D]);
9687 P_DATA[playerid][Tag3D] = Create3DTextLabel("VIP Member", Color:BLUE, 0.0, 0.0, 0.0, 90.0, 0, 1);
9688
9689 }
9690 }
9691 else if(P_DATA[playerid][Level] > 0 && P_DATA[playerid][Vip] <= 0)
9692 format(Str, sizeof (Str), ""W"Welcome "ORAN"%s.\n\n"W"-------------------\nAdmin: "ORAN"%s",Name(playerid), LevelName(P_DATA[playerid][Level]));
9693
9694 else if(P_DATA[playerid][Level] <= 0 && P_DATA[playerid][Vip] > 0)
9695 {
9696 format(Str, sizeof (Str), ""W"Welcome "ORAN"%s.\n\n"W"-------------------\nVIP: "ORAN"%d",Name(playerid), P_DATA[playerid][Vip]);
9697
9698 if(P_DATA[playerid][VIPTag])
9699 {
9700 Delete3DTextLabel(P_DATA[playerid][Tag3D]);
9701 P_DATA[playerid][Tag3D] = Create3DTextLabel("VIP Member", Color:BLUE, 0.0, 0.0, 0.0, 90.0, 0, 1);
9702
9703 }
9704 }
9705 else if(P_DATA[playerid][Level] == 0 && P_DATA[playerid][Vip] == 0)
9706 format(Str, sizeof (Str), ""W"Welcome "ORAN"%s.\n\n"W"-------------------",Name(playerid));
9707
9708 format(Str, sizeof (Str), "%s\n"W"Online: "ORAN"%s\n"W"Kills: "ORAN"%d\n"W"Deaths: "ORAN"%d"W"\n-------------------\n",
9709 Str,
9710 FormatOnline(playerid),
9711 P_DATA[playerid][Kills],
9712 P_DATA[playerid][Deaths]);
9713
9714 SPD(playerid, 9000, BOX, ""W"Succesfully logged in!", Str, "Close", "");
9715 }
9716 else
9717 {
9718 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")");
9719 SPD(playerid, 9000, BOX, ""W"Succesfully logged in!", Str, "Close", "");
9720 }
9721 }
9722 else
9723 {
9724 --P_DATA[playerid][LogFail];
9725
9726 new zStr[256];
9727
9728 if(P_DATA[playerid][LogFail] != 0)
9729 {
9730 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]);
9731 SPD(playerid, Dialog:Login2, INPUT, ""W"Account login error", zStr, "Login", "Forg. Pass");
9732 }
9733 else if(P_DATA[playerid][LogFail] <= 0)
9734 {
9735 GameTextForPlayer(playerid, "~r~Kicked from the server~n~~w~REASON: ~g~Exceeding login fails.", 60000, 3);
9736 KickEx(playerid, .zReason = "Exceeding login tries", .tell = true);
9737 }
9738 }
9739 }
9740}
9741
9742CMD:mutecheck(PARAMS)
9743{
9744 if(!P_DATA[playerid][Muted]) return SendClientMessage(playerid, Color:ORAN, "SERVER: "W"You are not muted!");
9745
9746 if(P_DATA[playerid][MutedTime] > 0)
9747 {
9748 FormatMSG(playerid, Color:ORAN, "SERVER:"W" You will be unmuted after "ORAN"%d"W" seconds!", P_DATA[playerid][MutedTime]);
9749 }
9750 else if(P_DATA[playerid][MutedTime] == 0)
9751 {
9752 SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You will never be unmuted automatically! (Even after connect!)");
9753 }
9754 return 1;
9755}
9756
9757Public:GodLike()
9758{
9759 foreach(Player, i)
9760 {
9761 if(GetPVarInt(i, "0_God") == 1 || P_DATA[i][God])
9762 {
9763 new Float: H;
9764 GetPlayerHealth(i, H);
9765 if(H < 300) SetPlayerHealth(i, 9999);
9766 }
9767 if(GetPVarInt(i, "0_CarGod") == 1 || P_DATA[i][CarGod])
9768 {
9769 if(IsPlayerInAnyVehicle(i))
9770 {
9771 SetVehicleHealth(GetPlayerVehicleID(i), 1000);
9772 RepairVehicle(GetPlayerVehicleID(i));
9773 }
9774 }
9775 }
9776}
9777GetPlayerIPEx(playerid)
9778{
9779 new pIP[30];
9780 GetPlayerIp(playerid, pIP, sizeof(pIP));
9781 return pIP;
9782}
9783
9784SavePlayerData(playerid)
9785{
9786
9787 new Query[500], DBResult:Result;
9788 format(Query, sizeof(Query), "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s'", Name(playerid));
9789 Result = DB::Query(_DB, Query);
9790
9791 if(Result)
9792 {
9793 if(DB::Valid(Result))
9794 {
9795 DB::Free(Result);
9796 format(Query, sizeof(Query), "UPDATE `Accounts` SET \
9797 `Online` = '%s', \
9798 `Level` = '%d', \
9799 `VIP` = '%d', \
9800 `Rank` = '%d', \
9801 `Autologin` = '%d', \
9802 `Money` = '%d', \
9803 `Score` = '%d', \
9804 `Kills` = '%d', \
9805 `Deaths` = '%d', \
9806 `Cookies` = '%d', \
9807 `Positive` = '%d', \
9808 `Negative` = '%d' WHERE `Name` = '%s'",
9809 FormatOnline(playerid),
9810 P_DATA[playerid][Level],
9811 P_DATA[playerid][Vip],
9812 P_DATA[playerid][Rank],
9813 P_DATA[playerid][pAuto],
9814 GetPlayerMoney(playerid),
9815 GetPlayerScore(playerid),
9816 P_DATA[playerid][Kills],
9817 P_DATA[playerid][Deaths],
9818 P_DATA[playerid][Cookies],
9819 P_DATA[playerid][Positive],
9820 P_DATA[playerid][Negative],
9821 Name(playerid));
9822 DB::Query(_DB, Query);
9823 format(Query, sizeof(Query), "UPDATE `Accounts` SET \
9824 `Messages` = '%d', \
9825 `Commands` = '%d', \
9826 `fCommands` = '%d', \
9827 `Warns` = '%d', \
9828 `Kicks` = '%d', \
9829 `God` = '%d', \
9830 `Cargod` = '%d', \
9831 `ACCPSav` = '%d', \
9832 `BlockPM` = '%d', \
9833 `Boost` = '%d', \
9834 `bSpeed` = '%f', \
9835 `WearTag` = '%d', \
9836 `Incred` = '%d', \
9837 `Spin` = '%d' WHERE `Name` = '%s'",
9838 P_DATA[playerid][Msgs],
9839 P_DATA[playerid][Cmds],
9840 P_DATA[playerid][fCmds],
9841 P_DATA[playerid][Warns],
9842 P_DATA[playerid][Kicks],
9843 P_DATA[playerid][God],
9844 P_DATA[playerid][CarGod],
9845 P_DATA[playerid][Accp_Saved],
9846 P_DATA[playerid][BAPMs],
9847 P_DATA[playerid][Boost],
9848 Float:P_DATA[playerid][bSpeed],
9849 P_DATA[playerid][VIPTag],
9850 P_DATA[playerid][Incred],
9851 P_DATA[playerid][Spin],
9852 Name(playerid));
9853 DB::Query(_DB, Query);
9854
9855
9856 }
9857 else
9858 {
9859 printf("Account: %s doesn't exist! Server tried to save data on it!", Name(playerid), Name(playerid));
9860 }
9861 }
9862
9863 format(Query, sizeof (Query),"SELECT `Key` FROM `Top` WHERE `Name` = '%s' LIMIT 1", Name(playerid));
9864
9865 new DBResult:Q_RESULT;
9866 Q_RESULT = DB::Query(_DB, Query);
9867 if(DB::Valid(Q_RESULT))
9868 {
9869 DB::Free(Q_RESULT);
9870 format(Query, sizeof (Query),"UPDATE `Top` SET `Kills` = '%d',`Deaths` = '%d',`Hours` = '%d',`Rank` = '%d',`Ratio` = '%.3f',`Negative` = '%d',`Positive` = '%d' WHERE `Name` = '%s'",
9871 P_DATA[playerid][Kills],
9872 P_DATA[playerid][Deaths],
9873 P_DATA[playerid][Hours],
9874 P_DATA[playerid][Rank],
9875 (Float:P_DATA[playerid][Kills] / Float:P_DATA[playerid][Deaths]),
9876 P_DATA[playerid][Negative],
9877 P_DATA[playerid][Positive],
9878 Name(playerid));
9879 DB::Free(Q_RESULT);
9880 DB::Query(_DB, Query);
9881
9882 }
9883 else
9884 {
9885 format(Query, sizeof (Query), "INSERT INTO `Top` (`Name`,`Kills`,`Deaths`,`Hours`,`Rank`,`Ratio`,`Negative`,`Positive`) VALUES('%s','%d','%d','%d','%d','%.3f','%d','%d')",
9886 Name(playerid),
9887 P_DATA[playerid][Kills],
9888 P_DATA[playerid][Deaths],
9889 P_DATA[playerid][Hours],
9890 P_DATA[playerid][Rank],
9891 (Float:P_DATA[playerid][Kills] / Float:P_DATA[playerid][Deaths]),
9892 P_DATA[playerid][Negative],
9893 P_DATA[playerid][Positive]);
9894
9895 DB::Query(_DB, Query);
9896
9897 }
9898 #if TRACK_ACCOUNTS == true
9899
9900 new
9901 Str[24],fStr[2_0_0_0], Player = playerid;
9902
9903 format(Str, sizeof(Str) + strlen(STATS_LOC), ""#STATS_LOC"%s.ini", Name(Player));
9904
9905 new
9906 Online[3];
9907 TotalGameTime(Player, Online[0], Online[1], Online[2]);
9908 format(fStr, 2_0_0_0, "Date: %s (saved on disconnect)\r\n------------------------------------------\r\n\
9909 Registration Date: %s\r\n\
9910 IP: %s\r\n\
9911 Account ID: %d\r\n\
9912 Level: %d\r\n\
9913 VIP: %d\r\n\
9914 Rank: %d\r\n\
9915 Commands Used: %d\r\n\
9916 Failed Commands: %d\r\n\
9917 Messages Sent: %d\r\n\
9918 Cookies: %d\r\n",
9919 zDate (),
9920 GPVSEx(Player, "AccountDate"),
9921 PlayerIP[Player],
9922 P_DATA[Player][AccID],
9923 P_DATA[Player][Level],
9924 P_DATA[Player][Vip],
9925 P_DATA[Player][Rank],
9926 P_DATA[Player][Cmds],
9927 P_DATA[Player][fCmds],
9928 P_DATA[Player][Msgs],
9929 P_DATA[Player][Cookies]);
9930 format(fStr, 2_0_0_0, "%s\
9931 Online: %d:%d:%d\r\n\
9932 Respect: %d/-%d\r\n\
9933 Money: %d\r\n\
9934 Score: %d\r\n\
9935 Deaths: %d\r\n\
9936 Kills: %d\r\n\
9937 Ratio: %.3f\r\n\
9938 Kicks Received: %d\r\n",
9939 fStr,
9940 Online[0], Online[1], Online[2],
9941 P_DATA[Player][Positive],
9942 P_DATA[Player][Negative],
9943 GetPlayerMoney(Player),
9944 GetPlayerScore(Player),
9945 P_DATA[Player][Deaths],
9946 P_DATA[Player][Kills],
9947 (Float:P_DATA[Player][Deaths] / Float:P_DATA[Player][Kills]),
9948 P_DATA[Player][Kicks]);
9949
9950 new
9951 File:Stats = fopen(Str, io_append);
9952
9953 if(Stats)
9954 {
9955 if(fexist(Str)) fwrite(Stats, "\r\n\r\n\r\n");
9956 fwrite(Stats, fStr);
9957 fclose(Stats);
9958 }
9959
9960 #endif
9961 return 1;
9962}
9963
9964RegisterPlayer(playerid, returndialog, inputtext[])
9965{
9966 if(!strlen(inputtext) || strlen(inputtext) < MIN_PASS_LEN || strlen(inputtext) > MAX_PASS_LEN)
9967 return ShowPlayerDialog
9968 (
9969 playerid,
9970 returndialog,
9971 DIALOG_STYLE_INPUT,
9972 ""W"Register an account",
9973 ""ORAN"ERROR:"W" An error has occured while trying to register the account, please try again!!\n\n\
9974 Please write your desired password.", "Register", "Kick");
9975
9976 new Buf[129], Query[500], zStr[450];
9977
9978 WP_Hash(Buf, (129), inputtext);
9979 format(Query, sizeof(Query), "INSERT INTO `Accounts` \
9980 VALUES(NULL, '%s', '%s', '%s', '00:00:00', '%s', '0', '0', \
9981 '0', '0', '2000', '0', '0', '0', '0', '0', '0', \
9982 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', \
9983 '0', '0', '%s', '%s', '%s', '1', '0', '0', '0')", GetPlayerIPEx(playerid), Name(playerid), Buf, zDate(), inputtext, GPVSEx(playerid, "Question"), GPVSEx(playerid, "Answer"));
9984 DB::Query(_DB, Query);
9985 format(Query, sizeof(Query), "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s'", Name(playerid));
9986 new DBResult:Result = DB::Query(_DB, Query);
9987 if(Result)
9988 {
9989 if(DB::Valid(Result))
9990 {
9991 new Field[15];
9992 DB::GetField(Result, "Key", Field, sizeof(Field));
9993 S_DATA[sAccounts] = strval(Field);
9994 P_DATA[playerid][AccID] = strval(Field);
9995
9996 DB::Free(Result);
9997 }
9998 }
9999
10000 format(zStr, sizeof (zStr), ""W"Account succesfully created!\n\n\
10001 "ORAN"["W" Account Information "ORAN"]\n\
10002 "W"Account: "BLUE"%s\n\
10003 "W"Password: "BLUE"%s\n\
10004 "W"Account ID: "BLUE"%d\n\
10005 "W"Created On: "BLUE"%s\n", Name(playerid), inputtext, S_DATA[sAccounts], zDate());
10006
10007 format(zStr, sizeof (zStr), "%s\
10008 "W"Secret Question: "BLUE"%s\n\
10009 "W"Secret Answer: "BLUE"%s\n\n\n\
10010 Thanks for registering an account.\n\
10011 Please procceed with login.", zStr, GPVSEx(playerid, "Question"), GPVSEx(playerid, "Answer"));
10012
10013 SPD(playerid, Dialog:Login, BOX, ""W"Account Information", zStr, "Continue", "");
10014
10015 new INI:
10016 Accounts = INI_Open(USER_ID);
10017 INI_WriteInt(Accounts, "Accounts_Created", S_DATA[sAccounts]);
10018 INI_WriteString(Accounts, "Last_Account", Name(playerid));
10019 INI_WriteString(Accounts, "Last_Account_Date", zDate());
10020 INI_Close(Accounts);
10021 return 1;
10022}
10023FormatOnline(playerid)
10024{
10025 new zStr[15], T[3];
10026 TotalGameTime(playerid, T[0], T[1], T[2]);
10027 format(zStr, sizeof (zStr), "%d:%d:%d", T[0], T[1], T[2]);
10028 return zStr;
10029}
10030ClearVars(playerid)
10031{
10032 DestroyVehicle(P_DATA[playerid][GiveCar]);
10033 Delete3DTextLabel(P_DATA[playerid][Tag3D]);
10034
10035 P_DATA[playerid][Kills] = 0;
10036 P_DATA[playerid][Deaths] = 0;
10037 P_DATA[playerid][Hours] = 0;
10038 P_DATA[playerid][Rank] = 0;
10039 P_DATA[playerid][Msgs] = 0;
10040 P_DATA[playerid][Cmds] = 0;
10041 P_DATA[playerid][fCmds] = 0;
10042 P_DATA[playerid][Cookies] = 0;
10043 P_DATA[playerid][Negative] = 0;
10044 P_DATA[playerid][Positive] = 0;
10045 P_DATA[playerid][Money] = 0;
10046 P_DATA[playerid][Score] = 0;
10047 P_DATA[playerid][Banned] = 0;
10048 P_DATA[playerid][Kicks] = 0;
10049 P_DATA[playerid][Logged] = 0;
10050 P_DATA[playerid][Muted] = 0;
10051 P_DATA[playerid][Frozen] = 0;
10052 P_DATA[playerid][Jailed] = 0;
10053 P_DATA[playerid][MutedTime] = 0;
10054 P_DATA[playerid][JailTime] = 0;
10055 P_DATA[playerid][tLevel] = 0;
10056 P_DATA[playerid][PMSent] = 0;
10057 P_DATA[playerid][RepMSG] = EOS;
10058 P_DATA[playerid][Warns] = 0;
10059 P_DATA[playerid][aCar] = -1;
10060 P_DATA[playerid][pAuto] = 0;
10061 P_DATA[playerid][MutedAll] = 0;
10062 P_DATA[playerid][Accp_Saved] = 0;
10063 P_DATA[playerid][A_Color] = 0;
10064 P_DATA[playerid][A_Component1] = 0;
10065 P_DATA[playerid][A_Component2] = 0;
10066 P_DATA[playerid][A_Component3] = 0;
10067 P_DATA[playerid][A_Component4] = 0;
10068 P_DATA[playerid][A_Wheels] = 0;
10069 P_DATA[playerid][Registered] = 0;
10070 P_DATA[playerid][Spin] = 0;
10071 P_DATA[playerid][VIPTag] = 0;
10072
10073 P_DATA[playerid][Spec_ID] = 0xFFFF;
10074 P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_NONE;
10075}
10076
10077Public:ParseUserID(name[], value[])if(!strcmp(name, "Accounts_Created")) S_DATA[sAccounts] = strval(value);
10078
10079Public:LoadServerData(name[], value[])
10080{
10081 if(!strcmp(name, INI_Server_Info[0][isName])) S_DATA[AntiSpam] = strval(value);
10082 if(!strcmp(name, INI_Server_Info[1][isName])) S_DATA[AntiCSpam] = strval(value);
10083 if(!strcmp(name, INI_Server_Info[2][isName])) S_DATA[Ping] = strval(value);
10084 if(!strcmp(name, INI_Server_Info[3][isName])) S_DATA[RCONProt] = strval(value);
10085 if(!strcmp(name, INI_Server_Info[4][isName])) S_DATA[TellPlayer] = strval(value);
10086 if(!strcmp(name, INI_Server_Info[5][isName])) S_DATA[Chat] = strval(value);
10087 if(!strcmp(name, INI_Server_Info[6][isName])) S_DATA[ReadPM] = strval(value);
10088 if(!strcmp(name, INI_Server_Info[7][isName])) S_DATA[ReadCMD] = strval(value);
10089 if(!strcmp(name, INI_Server_Info[8][isName])) S_DATA[AKA] = strval(value);
10090 if(!strcmp(name, INI_Server_Info[9][isName])) S_DATA[ShowFunction] = strval(value);
10091 if(!strcmp(name, INI_Server_Info[10][isName])) S_DATA[AntiRepeat] = strval(value);
10092 if(!strcmp(name, INI_Server_Info[11][isName])) S_DATA[AutoLogin] = strval(value);
10093 if(!strcmp(name, INI_Server_Info[12][isName])) S_DATA[AnnRank] = strval(value);
10094 if(!strcmp(name, INI_Server_Info[13][isName])) S_DATA[AntiAD] = strval(value);
10095 if(!strcmp(name, INI_Server_Info[14][isName])) S_DATA[AdminChat] = strval(value);
10096 if(!strcmp(name, INI_Server_Info[15][isName])) S_DATA[VipChat] = strval(value);
10097}
10098
10099
10100Public:LoadPlayerData(playerid)
10101{
10102 new Query[750], DBResult:Result;
10103
10104 format(Query, 750, "SELECT `IP`, `Level`, `VIP`, \
10105 `Rank`, `Money`, `Score`, \
10106 `Kills`, `Deaths`, `Cookies`, \
10107 `Positive`, `Negative`, `Messages`, \
10108 `Commands`, `fCommands`, `Warns`, \
10109 `Kicks`, `God`, `Cargod`, \
10110 `ACCP`, `ACCPSav`, `BlockPM`, \
10111 `Key`, `Boost`, `bSpeed` `JoinDate`, `Online`, \
10112 `Spin`, `WearTAG`, `Incred` FROM `Accounts` WHERE `Name` = '%s';", Name(playerid));
10113 Result = DB::Query(_DB, Query);
10114
10115 if(Result)
10116 {
10117 if(DB::Valid(Result))
10118 {
10119 new Field[30];
10120
10121 _GetField<"Key">Store<AccID>
10122 _GetField<"Level">Store<Level>
10123 _GetField<"VIP">Store<Vip>
10124 _GetField<"Rank">Store<Rank>
10125 _GetField<"Kills">Store<Kills>
10126 _GetField<"Deaths">Store<Deaths>
10127 _GetField<"Cookies">Store<Cookies>
10128 _GetField<"Positive">Store<Positive>
10129 _GetField<"Negative">Store<Negative>
10130 _GetField<"Messages">Store<Msgs>
10131 _GetField<"Commands">Store<Cmds>
10132 _GetField<"fCommands">Store<fCmds>
10133 _GetField<"Warns">Store<Warns>
10134 _GetField<"Kicks">Store<Kicks>
10135 _GetField<"God">Store<God>
10136 _GetField<"Cargod">Store<CarGod>
10137 _GetField<"ACCPSav">Store<Accp_Saved>
10138 _GetField<"BlockPM">Store<BAPMs>
10139 _GetField<"Boost">Store<Boost>
10140 _GetField<"Spin">Store<Spin>
10141 _GetField<"WearTAG">Store<VIPTag>
10142 _GetField<"Incred">Store<Incred>
10143
10144 DB::GetField(Result, "bSpeed", Field, sizeof(Field));
10145 P_DATA[playerid][bSpeed] = floatstr(Field);
10146
10147 DB::GetField(Result, "IP", Field, sizeof(Field));
10148 PlayerIP[playerid] = Field;
10149
10150 DB::GetField(Result, "Money", Field, sizeof(Field));
10151 GivePlayerMoney(playerid, strval(Field));
10152
10153 DB::GetField(Result, "Score", Field, sizeof(Field));
10154 SetPlayerScore(playerid, GetPlayerScore(playerid) + strval(Field));
10155
10156 DB::GetField(Result, "ACCP", Field, sizeof(Field));
10157 SetPVarString(playerid, "ACCP_DATA", Field);
10158
10159 DB::GetField(Result, "Online", Field, sizeof(Field));
10160 SetPVarString(playerid, "Online", Field);
10161
10162 DB::GetField(Result, "JoinDate", Field, sizeof(Field));
10163 SetPVarString(playerid, "AccountDate", Field);
10164
10165 DB::Free(Result);
10166 }
10167 }
10168}
10169
10170Public:UnMutePlayer(playerid)
10171{
10172 --P_DATA[playerid][MutedTime];
10173
10174 if(!P_DATA[playerid][MutedTime])
10175 {
10176 KillTimer(MuteTimer[playerid]);
10177 UnMutePlayer(playerid);
10178 P_DATA[playerid][MutedTime] = 0;
10179 P_DATA[playerid][Muted] = 0;
10180
10181 SendClientMessage(playerid, -1, ""ORAN"SERVER:"W" You have been unmuted by the system!");
10182 #if SAVE_MUTE == true
10183
10184 new
10185 Query[256];
10186 format(Query, 256, "DELETE FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(playerid));
10187 DB::Query(_DB, Query);
10188
10189 #endif
10190 }
10191 else if(P_DATA[playerid][MutedTime] == 1){
10192 GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~r~~h~MUTE INFO~n~~r~~h~One~w~ minute left", 10000, 3);}
10193
10194 else if(P_DATA[playerid][MutedTime] > 1)
10195 {
10196 new Str[129];
10197 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]);
10198 GameTextForPlayer(playerid, Str, 10000, 3);
10199 }
10200 return 1;
10201}
10202GPVSEx(playerid, zPVSTR[] )
10203{
10204 new zStr[129];
10205 GetPVarString(playerid, zPVSTR, zStr, 129);
10206 return zStr;
10207}
10208
10209BanEx2(playerid, zAdmin[] = "System", zReason[] = "No Reason")
10210{
10211 new
10212 zStr[256];
10213 #if SAVE_IN_LOGS == true
10214 new
10215 File:zFile;
10216
10217 format(zStr, sizeof (zStr), "Player: %s[%i] has been banned by \"%s\" with reason \"%s\" on %s\r\n",
10218 Name(playerid),
10219 playerid,
10220 zAdmin,
10221 zReason,
10222 zDate());
10223
10224
10225 zFile = fopen(BAN_LOG, io_append);
10226 if(zFile)
10227 {
10228 fwrite(zFile, zStr);
10229 fclose(zFile);
10230 }
10231 #else
10232 #pragma unused zAdmin
10233 #endif
10234
10235
10236 new Query[129];
10237 format(Query, 129, "INSERT INTO `Banlist` VALUES('%s', '%s', '%s', '%s', '%s')", GetPlayerIPEx(playerid), Name(playerid), zReason, zAdmin, zDate());
10238 FormatMSG(playerid, Color:ORAN, "SERVER:"W" You have been banned from this server! "W"["GREY" %s"W"]", zReason);
10239 KickAfter(playerid);
10240
10241
10242
10243 return 1;
10244}
10245
10246
10247
10248Public:KickAfterTimer(playerid) return Kick(playerid);
10249KickAfter(playerid, time = 1200 ){ SetTimerEx("KickAfterTimer", time, false, "i", playerid);}
10250
10251BadRcon(zIP[], zPassword[], zAdmin[] = "System", zReason[] = "RCON Login Attempt")
10252{
10253 new
10254 zStr[256];
10255 #if SAVE_IN_LOGS == true
10256 new
10257 File:zFile;
10258
10259 format(zStr, sizeof (zStr), "IP \"%s\" has been banned by \"%s\" with reason \"%s\" and password \"%s\" on %s\r\n",
10260 zIP,
10261 zAdmin,
10262 zReason,
10263 zPassword,
10264 zDate());
10265
10266
10267 zFile = fopen(RCON_LOG, io_append);
10268 if(zFile)
10269 {
10270 fwrite(zFile, zStr);
10271 fclose(zFile);
10272 }
10273 #else
10274 #pragma unused zPassword
10275 #endif
10276 format(zStr, sizeof (zStr), ""ORAN"Ban Info: "W"IP "ORAN"\"%s\""W" has been IP banned by "ORAN"\"%s\" "W"with reason"ORAN" \"%s\"",
10277 zIP,
10278 zAdmin,
10279 zReason);
10280
10281 SendMessageToAdmins(.zMessage = zStr);
10282
10283
10284 format(zStr, sizeof (zStr), "banip %s", zIP);
10285 SendRconCommand(zStr);
10286 return 1;
10287}
10288KickEx(playerid, zAdmin[] = "System", zReason[] = "No Reason", tell = true)
10289{
10290 new zStr[256];
10291 #if SAVE_IN_LOGS == true
10292 new
10293 File:zFile;
10294
10295 format(zStr, sizeof (zStr), "Player: %s[%i] has been kicked by \"%s\" with reason \"%s\" on %s\r\n",
10296 Name(playerid),
10297 playerid,
10298 zAdmin,
10299 zReason,
10300 zDate());
10301
10302
10303 zFile = fopen(KICK_LOG, io_append);
10304 if(zFile)
10305 {
10306 fwrite(zFile, zStr);
10307 fclose(zFile);
10308 }
10309 #endif
10310 if(tell)
10311 {
10312
10313 format(zStr, sizeof (zStr), ""ORAN"Kick Info: "W"Player "ORAN"%s[%i]"W" has been kicked by "ORAN"\"%s\" "W"with reason"ORAN" \"%s\"",
10314 Name(playerid),
10315 playerid,
10316 zAdmin,
10317 zReason);
10318
10319 SendMessageToAdmins(.zMessage = zStr);
10320
10321 }
10322
10323 P_DATA[playerid][Kicks] += 1;
10324
10325 new Query[120], DBResult:Result;
10326 format(Query, 120, "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s'",Name(playerid));
10327 Result = DB::Query(_DB, Query);
10328
10329 if(Result)
10330 {
10331 if(DB::Valid(Result))
10332 {
10333 DB::Free(Result);
10334 format(Query, 120, "UPDATE `Accounts` SET `Kicks` = '%d' WHERE `Name` = '%s'", P_DATA[playerid][Kicks], Name(playerid));
10335 DB::Query(_DB, Query);
10336 }
10337 else DB::Free(Result);
10338 }
10339 KickAfter(playerid);
10340 return 1;
10341}
10342
10343SendMessageToAdmins(zColor = -1, zMessage[], level = 1)
10344{
10345 foreach(Player, A)
10346 {
10347 if(P_DATA[A][Level] >= level)
10348 {
10349 SendClientMessage(A, zColor, zMessage);
10350 }
10351 }
10352 return 1;
10353}
10354
10355zDate(ms = false)
10356{
10357 new zStr[30];
10358 if(ms)
10359 {
10360 new Date[6];
10361 getdate(Date[0], Date[1], Date[2]);
10362 gettime(Date[3], Date[4], Date[5]);
10363 format(zStr, sizeof (zStr), "%d/%d/%d %d:%d:%d", Date[2], Date[1], Date[0], Date[3], Date[4], Date[5]);
10364 }
10365 else
10366 {
10367 new Date[5];
10368 getdate(Date[0], Date[1], Date[2]);
10369 gettime(Date[3], Date[4]);
10370 format(zStr, sizeof (zStr), "%d/%d/%d %d:%d", Date[2], Date[1], Date[0], Date[3], Date[4]);
10371 }
10372 return zStr;
10373}
10374
10375
10376Name(playerid)
10377{
10378 new zName[MAX_PLAYER_NAME];
10379 GetPlayerName(playerid, zName, MAX_PLAYER_NAME);
10380 return zName;
10381}
10382
10383TotalGameTime(playerid, &h=0, &m=0, &s=0)
10384{
10385 P_DATA[playerid][TotalTime] = ((gettime() - P_DATA[playerid][ConnTime]) + (P_DATA[playerid][Hours]*60*60) + (P_DATA[playerid][Minutes]*60) + (P_DATA[playerid][Seconds]));
10386
10387 h = floatround(P_DATA[playerid][TotalTime] / 3600, floatround_floor);
10388 m = floatround(P_DATA[playerid][TotalTime] / 60, floatround_floor) % 60;
10389 s = floatround(P_DATA[playerid][TotalTime] % 60, floatround_floor);
10390
10391 return P_DATA[playerid][TotalTime];
10392}
10393
10394
10395Public:VehicleOccupied(v)
10396{
10397 foreach(Player, i)
10398 {
10399 if(IsPlayerInVehicle(i, v)) return 1;
10400 }
10401 return 0;
10402}
10403SendError(playerid, error[])
10404{
10405 new Str[256];
10406 format(Str, sizeof (Str), "* "GREY"%s", error);
10407 SendClientMessage(playerid, Color:ORAN, Str);
10408 return 1;
10409}
10410SendUsage(playerid, usage[], function[] = "don't send function" )
10411{
10412 new Str[256];
10413 format(Str, sizeof (Str), "Usage: {FFFFFF} %s", usage);
10414 SendClientMessage(playerid, Color:GREE, Str);
10415 if(strcmp(function, "don't send function") && S_DATA[ShowFunction])
10416 {
10417 format(Str, sizeof (Str), "Function: {FFFFFF} %s", function);
10418 SendClientMessage(playerid, Color:FUNC, Str);
10419 }
10420
10421 return 1;
10422}
10423MiniFormat(number, extra[] = ";")
10424{
10425 new fStr[256];
10426 if(strcmp(extra, ";"))format(fStr, sizeof (fStr), "%d %s", number, extra);
10427 else format(fStr, sizeof (fStr), "%d", number);
10428 return fStr;
10429}
10430
10431EX(ex)
10432{
10433 new ex2[10];
10434 format(ex2, sizeof (ex2), "Yes | %d", ex);
10435 return ex2;
10436}
10437stock IsValidSkin(SkinID)
10438{
10439 switch(SkinID)
10440 {
10441 case 0..41: return 1; case 43..64: return 1; case 66..73: return 1;
10442 case 75..85: return 1; case 87..118: return 1; case 120..148: return 1;
10443 case 150..207: return 1; case 209..264: return 1; case 274..288: return 1;
10444 case 290..299: return 1;
10445 default: return 0;
10446 }
10447 return 0;
10448}
10449IsValidWeapon(weaponid)
10450{
10451 switch(weaponid)
10452 {
10453 case 1..18: return 1;
10454 case 22..46: return 1;
10455 }
10456 return 0;
10457}
10458GetVModelFromName(vName[])
10459{
10460 for (new i = 400; i <= 611; i++)
10461 if(strfind(vNames[i - 400], vName, true) != -1)
10462 return i;
10463
10464 return -1;
10465}
10466GetWeaponIDFromName(WeaponName[])
10467{
10468 if(strfind("molotov", WeaponName, true) !=-1) return 18;
10469 for (new i = 0; i <= 46; i++)
10470 {
10471 switch(i)
10472 {
10473 case 0, 19, 20, 21, 44, 45: continue;
10474 default:
10475 {
10476 new name[32]; GetWeaponName(i, name, 32);
10477 if(strfind(name, WeaponName, true) != -1)
10478 return i;
10479 }
10480 }
10481 }
10482 return -1;
10483}
10484stock GetServerHostName()
10485{
10486 new gString[128];
10487 GetServerVarAsString("hostname", gString, sizeof(gString));
10488 return gString;
10489}
10490stock IsNumeric(string[])
10491{
10492 for (new i = 0, j = strlen(string);i < j; i++)
10493 {
10494 if(string[i] > '9' || string[i] < '0')
10495 return 0;
10496 }
10497 return 1;
10498}
10499stock
10500 FormatNumber(
10501 { _, Float, Text3D, Menu, Text, DB, DBResult, bool, File, hex, bit, bit_byte, Bit }:xVariable, iDecimals = -1, iThousandSeparator = ',', iDecimalPoint = '.', iTag = tagof(xVariable))
10502{
10503 static
10504 s_szReturn[32],
10505 s_szThousandSeparator[2] = { ' ', EOS },
10506 s_iDecimalPos,
10507 s_iChar,
10508 s_iSepPos
10509 ;
10510
10511 if(iTag == tagof(bool:))
10512 {
10513 if(xVariable)
10514 memcpy(s_szReturn, "true", 0, 5 * (cellbits / 8));
10515 else
10516 memcpy(s_szReturn, "false", 0, 6 * (cellbits / 8));
10517
10518 return s_szReturn;
10519 }
10520 else if(iTag == tagof(Float:))
10521 {
10522 if(iDecimals == -1)
10523 iDecimals = 8;
10524
10525 format(s_szReturn, sizeof(s_szReturn), "%.*f", iDecimals, xVariable);
10526 }
10527 else if(iTag == tagof(hex:) || iTag == tagof(Hex:))
10528 {
10529 format(s_szReturn, sizeof(s_szReturn), "0x" "%04h%04h", (xVariable & (0xFFFF0000)) >>> 16, xVariable & (0x0000FFFF));
10530
10531 return s_szReturn;
10532 }
10533 else if(iTag == tagof(bit:) || iTag == tagof(Bit:))
10534 {
10535 format(s_szReturn, sizeof(s_szReturn), "0b" "%08b%08b%08b%08b", (xVariable & 0xFF000000) >>> 24, (xVariable & 0x00FF0000) >>> 16, (xVariable & 0x0000FF00) >>> 8, (xVariable & 0x000000FF));
10536
10537 return s_szReturn;
10538 }
10539 else if(iTag == tagof(bit_byte:))
10540 {
10541 format(s_szReturn, sizeof(s_szReturn), "0b" "%08b", (xVariable & 0x000000FF));
10542
10543 return s_szReturn;
10544 }
10545 else
10546 {
10547 format(s_szReturn, sizeof(s_szReturn), "%d", xVariable);
10548
10549 if(iDecimals > 0)
10550 {
10551 strcat(s_szReturn, ".");
10552
10553 while (iDecimals--)
10554 strcat(s_szReturn, "0");
10555 }
10556 }
10557
10558 s_iDecimalPos = strfind(s_szReturn, ".");
10559
10560 if(s_iDecimalPos == -1)
10561 s_iDecimalPos = strlen(s_szReturn);
10562 else
10563 s_szReturn[s_iDecimalPos] = iDecimalPoint;
10564
10565 if(s_iDecimalPos >= 4 && iThousandSeparator)
10566 {
10567 s_szThousandSeparator[0] = iThousandSeparator;
10568
10569 s_iChar = s_iDecimalPos;
10570 s_iSepPos = 0;
10571
10572 while (--s_iChar > 0)
10573 {
10574 if(++s_iSepPos == 3)
10575 {
10576 strins(s_szReturn, s_szThousandSeparator, s_iChar);
10577
10578 s_iSepPos = 0;
10579 }
10580 }
10581 }
10582 return s_szReturn;
10583}
10584
10585/*stock db_EntryExists(name, const table[])
10586{
10587 new Buffer[240], Entry, DBResult:Result;
10588
10589 format(Buffer, sizeof(Buffer), "SELECT `Key` FROM `%s` WHERE `Name` = '%s'", table, name);
10590 Result = DB::Query(_DB, Buffer);
10591
10592 if(Result)
10593 {
10594 if(DB::Valid(Result))
10595 {
10596 Entry = 1;
10597 DB::Free(Result);
10598 }
10599 else Entry = 0;
10600 }
10601 return Entry;
10602}*/
10603Public:Display()
10604{
10605 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");
10606 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");
10607 print("\124\124\t \48\65\100\109\105\110 \118"#Version"\t\t\124\124");
10608 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");
10609 print("\124\124\t\t\t\t\124\124");
10610 print("\124\124\t\77\97\100\101 \98\121 \90\104\51\114\48\t\t\124\124");
10611 print("\124\124\t\t\t\t\124\124");
10612 print("\124\124\t\76\111\97\100\101\100 \83\117\99\99\101\115\102\117\108\108\121\t\124\124");
10613 print("\124\124\t\t\t\t\124\124");
10614 printf("\124\124\t%s\t\t\124\124", zDate());
10615 print("\124\124\t\t\t\t\124\124");
10616 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");
10617 print("\124\124\t\t\t\t\124\124");
10618 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");
10619 print("\124\124 \75\101\101\112 \116\104\101 \99\114\101\100\105\116\115\33 \124\t\124\124");
10620 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");
10621 print("\124\124\t\t\t\t\124\124");
10622 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");
10623}