Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if defined _0_A_d_m_i_n_
- =======================================================================
- /* 0Admin - Administration filterscript.
- Created over a period of 2 months.
- With the most unique features ever. */
- - 0Admin was planned to be the most unique admin script ever, beating the
- existing one on performance and realiability.
- The goal was achieved, I've used the best ways to build this script.
- It uses SQLite, and Y_Ini in the same time for performance.
- The command processor is ZCMD and I've used SSCANF to gain the best
- performance you could get at the moment.
- Using Regular Expresions(RegEx) for a better search. Examples are the:
- Anti-Advertising functions.
- **************
- ** You may not sell this script under any circumstances.
- For personal use only.
- ** You may edit this script on your like. But don't claim it as yours.
- ** Do whatever YOU LIKE! But don't sell or change credits.
- ** Respect these rules!
- **************
- ..::Changelog::..
- [V1.0]
- - Initial Release.
- [V1.1]
- - Repaired Anti-IP Advertising.
- - Added a define for the security question.
- - Removed "Start Event" from /PCP.
- - Added new commands:
- "/ann /ann2 /cpass /time /aka"
- - Added stats stabilizer. Player won't get wrong information whe his stats
- will be changed from the include, trough the gamemode.
- - Repaired 0Admin_F.inc include, found errors and mistakes.
- - 0Admin_F.inc now saves the stats directly into the database.
- - Added commands "/report" and "/respect" because it was requested.
- - Fixed crashing while setting player kills trough "/setstats"
- - Fixed a mistype in "/vips".
- Upcoming:
- [V1.2]
- - Temporary Ban(tempban)
- - Anti-Swear system.
- - Security upgrade to SQLite database.
- - Forbidden weapons list.
- =======================================================================
- ------------------------------(Level 0 [Member])--------------------------------/*
- - The member, is just a player playing on the server without any
- superior abilities. */
- [V1.0]
- /register - Register an account in the database.
- /login - Login into account.
- /stats - View your stats.
- /pm - Send a personal message.
- /admins - View online Administrators.
- /vips - View online VIP Members.
- /top - View the top. Best kills, deaths, most hours online etc.
- /cookies - Show your current cookies amount.
- /buycookies - Buy some cookies!
- /eatcookie - Eat cookie, gain health.
- /buycookiesjar - Buy a jar of 20 cookies.
- /giftcookie - Gift a cookie to a player!
- /cookieshelp - More information about the cookies system.
- [V1.1]
- /time - View current time,
- /cpass - Change password
- ----------------------------(Level 1 [Helper])----------------------------------/*
- - The Helper has the role to maintain PLEASURE on server.
- - To ensure players got what they need, as time, weather. */
- [V1.0]
- /goto - Go to someone's position.
- /gotopos - Go to the position set, x, y, z.
- /getip - Get someone's IP Adress.
- /settime - Set someone's time.
- /spawn - Spawn a player.
- /acar - Spawn your personal Admin car.
- /accp - Tune your admin car. Components, colors, nitro.
- Save coponents, load components, discard components.
- /jailed - View jailed players and the jail time.
- /frozen - View frozem players.
- /muted - View muted players and the mute time.
- [V1.1]
- - Nothing.
- ------------------------(Level 2 [Mini Moderator])------------------------------/*
- - The mini moderator serves as help when the superiors are offline.
- - His job is to keep the server quiet if there's a fight.
- - To keep away hackers by disarming them or removing money. */
- [V1.0]
- /disarm - Remove someone's weapons.
- /bankrupt - Remove someone's money.
- /tplayer - Teleport a player to another player.
- /eject - Eject a player from the vehicle.
- /heal - Heal yourself.
- /spec - Spectate a player.
- /specoff - Stop spectating a player.
- /show - Send a game text to the specified player.
- /setskin - Set someone's skin.
- /[un]freeze - Freeze or unfreeze the specified player.
- /[un]mute - Mute or unmute a player with specified time.
- /aweapons - Give yourself the best weapons.
- /healcar - Heal someone's car.
- /setvhealth - Set someone's vehicle health.
- /carcolor - Change someone's vehicle colors.
- [V1.1]
- /aka - View the aka list of a player.
- /ann - Send an announcement to the server.
- /ann2 - Send an announcement with style and custom time.
- ----------------------------(Level 3 [Moderator])-------------------------------/*
- - The Moderator has the role to keep the server clean. Clean from idiots and
- spammers, make sure the chat is CLEAR when someone fights.
- - The moderator can warn a player for bad behaviour.
- - He can jail or Unjail a specified player.
- - He can manipulate players data, cookies, score, money, skin etc.. */
- [V1.0]
- /giveweapon - Give someone a weapon with specified ammo.
- /warn - Warn a player, at 3 warns player will be kicked!
- /healall - Heall all players on the server.
- /heal - Heal a specified player.
- /aweapons - Give yourself some weapons.
- /givecar - Give someone a car.
- /write - Write something in the chat, without name in front.
- /destroyv - Destroy a vehicle ID.
- /[un]jail - Jail or Unjail a specified player.
- /slap - Slap a player make him loose -25 health.
- /clearchat - Clear the chat.
- /akill - Kill a player.
- /explode - Explode a player.
- /setalltime - Set everyone's time.
- /setallweather - Set everyone's weather.
- - The below commands are self explanatory.
- /set(cookies|health|armour|score|cash|skin|time|weather|world|interior|drunk|respect|wanted)
- [V1.1]
- - Nothing
- --------------------------(Level 4 [Administrator])-----------------------------/*
- - Doesn't have a specified role, he can pretty much do whatever he likes.
- - His actions may not be judged.
- - Can manipulate everyone's data. */
- [V1.0]
- - Set everyone's x .
- /setall(health|armour|score|cash|skin|world|interior|drunk|cookies|respect|wanted)
- - Give everyone x.
- /giveall(health|armour|score|cash|cookies|wanted|weapon)
- /kick - Kick a player from the server.
- /wcheck - Check a player's weapons.
- /setdeaths - Set someone's deaths.
- /setkills - Set someone's kills.
- /2012 - Fuck up someone's game, 0 money, 0 score, 0 everything.
- /resetallrespect- Change everyone's respect. Negatie and Positive.
- /killall - Kill everyone on the server.
- /[un]muteall - Mute/Unmute everyone, this mute won't save!
- /[un]freezeall - Freeze/Unfreeze all, this freeze won't save!
- /spawnall - Spawn all players.
- /2012all - Fuck up everyone's game!
- /chat - You can manipulate the chat. Spam it, clear it, [un]block it.
- /slapall - Slap everyone!
- /disarmall - Disarm everyone in the server.
- /explodeall - Explode everone.
- [V1.1]
- - Nothing
- -------------------------------(Level 5 [Owner])--------------------------------/*
- - He is the boss, the boss of everyone, he can do whatever he likes!!!
- - He can ban you, LIKE A BOSS!
- - He can change you, LIKE A BOSS!
- - He can delete you, LIKE A BOSS! */
- [V1.0]
- /setlevel - Change someone's level.
- /settemplevel - Set someone's temporary level, on disconnect, level will be reseted.
- /ban - Ban a player.
- /unban - Unban a player, remove his name from the banlist in the database.
- /acp - Open a dialog where you can manipulate server features. Such as, antispam, anti-ad etc.
- /respawncars - Respawn all unoccupied vehicles in the server.
- /removeacc - Delete a player's account from the database.
- /setonline - Change someone's online time.
- /setstat - Open a dialog where you can manipulate a specified ID.
- /fake - Show the fake list commands.
- /fakechat - Send a fake chat of a certain user.
- /fakecmd - Send a fake command, or make him execute a command.
- /fakecon - Send a face connection to the server.
- /fakedisc - Send a fake disconnection from the server.
- /fakedeath - Send a fake death.
- /kickall - Kick everyone from the server.
- /banall - Ban everyone from the server!
- [V1.1]
- - Nothing
- #endif
- //Main Include
- #include <a_samp>
- /*-----------------------------------------------
- Don't change this otherwise whirlpool won't work!*/
- #define MAX_INI_ENTRY_TEXT 130
- #undef MAX_PLAYER_NAME
- #define MAX_PLAYER_NAME 24
- /*-----------------------------------------------*/
- //Includes
- #include < YSI/Y_ini >
- #include < sscanf2 >
- #include < zcmd >
- #include < foreach >
- #include < regex >
- //#include YSI/y_scripting
- //Version of the script.
- #define Version "1.1"
- #pragma dynamic 46500
- //Colors:
- #define ORAN "{FF5500}"
- #define GREE "{94ED40}"
- #define BLUE "{4097ED}"
- #define W "{FFFFFF}"
- #define GREY "{C3C3C3}"
- //Tags:
- #define Dialog: _:DIALOG_
- #define Color: _:COL_
- //Shortcuts
- #define D: = 906 //If you have Dialog Problems, please change here, the higher, the better!
- #define PARAMS playerid, params[]
- #define SPD ShowPlayerDialog
- #define LIST DIALOG_STYLE_LIST
- #define INPUT DIALOG_STYLE_INPUT
- #define BOX DIALOG_STYLE_MSGBOX
- #define CaseDialog<%0> case(Dialog:%0):
- #define iDialog<%0> if(dialogid == Dialog:%0)
- #define GetVehicleName(%0) vNames[(%0) - 400]
- #define Freeze(%0) TogglePlayerControllable((%0), false)
- #define UnFreeze(%0) TogglePlayerControllable((%0), true)
- #define Col(%0,%1) ChangeVehicleColor(GetPlayerVehicleID(playerid), (%0), ((%0) & (zC = %1)))
- #define db_GetField DB::get_field_assoc
- #define db_Query DB::query
- #define db_Free DB::free_result
- #define db_Valid DB::num_rows
- #define DB:: db_
- /*
- =======================================
- ==| Bellow choose your own settings |==
- =======================================
- */
- //----------------------------------------
- #define SECURITY_QUESTION false /*true - Will enable the security question so user can retrieve their password.
- false - Won't.*/
- //----------------------------------------
- #define STATS_STABILIZER false /*true - Stats will be stabilized, uses OnPlayerUpdate, unchek in case of lag...
- false - Won't.*/
- //----------------------------------------
- #define SAVE_IN_LOGS true /*true - It will save on file when player gets kicked/banned/muted etc..
- false - It won't save.*/
- //----------------------------------------
- #define SAVE_MUTE true /*true - Mute with mute time will be saved and on connect it will be re-applied!
- false - Mute won't be saved and it will be disabled on connect/disconnect*/
- //----------------------------------------
- #define SAVE_FREEZE true /*true - Player will be frozen after re-connect
- false - Player will be able to move after reconnection.*/
- //----------------------------------------
- #define SAVE_JAIL true /*true - Player after reconection will be jailed for the amount of time set
- false - Player after reconnection won't go to jail!*/
- //----------------------------------------
- #define USE_RANKS true /*true - Tell player when reaching x kills his new rank!
- false - Don't use ransk at all!*/
- //----------------------------------------
- #define PRINT_RANKS false /* true - Will print the created rank names in the console.
- false - Will do the opposite! Won't show them in console!*/
- //----------------------------------------
- #define UPDATE_TOP_ALWAYS true /*true - The top x players file will be update once a kill/death or whatever stat is, has occured.
- false - It will update only on disconnect.*/
- //----------------------------------------
- #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
- false - Not gonna happen! Only when admin uses !stats <id> in console or /rcon !stats id in game.*/
- //ATTENTION: KEEP THE SYMBOM INSIDE ' '.
- #define ADMIN_CHAT_SYMBOL '@' //Choose symbol1 to let vip members talk among them. Use same symbol on both for 1 usage.
- #define ADMIN_CHAT_SYMBOL2 '#' //Choose symbol2 to let vip members talk among them. Use same symbol on both for 1 usage.
- #define VIP_CHAT_SYMBOL '*' //Choose symbol1 to let Admins talk among them. Use same symbol on both for 1 usage.
- #define VIP_CHAT_SYMBOL2 '$' //Choose symbol2 to let Admins talk among them. Use same symbol on both for 1 usage.
- //Start defining here the way you like!
- #define MIN_PASS_LEN (4) //Minimum characters a password must have. (On register)
- #define MAX_PASS_LEN (20) //Maximum characters a password must have. (On register)
- #define MAX_PASS_FAIL (4) //Define how many tries a player has to login.
- #define MAX_RCON_ATTEMPTS 3 //Define how many tries a player must have to enter the right RCON Password.
- #define MIN_PING_LIMIT 100 //Minimum ping an admin must enter on the cPanel, category, "Ping Kicker"
- #define MAX_PING_LIMIT 3000 //Maximum ping an admin must enter on the cPanel, category, "Ping Kicker"
- #define IPGKICK 1 //Minimun level for admin to not be kicked by the Ping Kicker.
- #define LOW_SPAM_RATE (1300) //Each how many seconds the spam rate drops
- #define GOD_TICK_RATE (500) //Once every x ms/seconds the god will update. (If causes lag increase number)
- #define MINIMUM_SPAM (3) //Minimum spam message for the anti-spam to be triggered!
- #define MEDIUM_SPAM (10) //Medium spam messages for the player to be kicked for spamming.
- #define MAXIMUM_SPAM (16) //Maximum spam messages for the player to be BANNED for spamming.
- #define MIN_CMD_SPAM (7) //Minimun commands spam for the player to be kicked for commands spamming.
- #define MAX_CMD_SPAM (16) //Maximum commands spam for the player to be BANNED for commands spamming
- #define MAX_COOKIE_COST 95 //How much a cookie costs!
- #define MAX_P_WARNS 3 //Max warns for the player to achieve to get kicked!
- #define MAX_TOP_LIMIT 15 //Max how many players will be shown in the top x players!
- #define MAX_SHOW_PER_ROW 6 //Define here how many players should be shoed on /vips /admins /muted etc per row!
- #define MAX_RANK_LEN (50) //Define here the max rank name lenght!
- #define EXTRA_MINUTES 15 /*Define how many +minutes of mute or jail the player will receive
- after evading with a different IP but same name, or same IP but different name*/
- //Files
- #define LOGS_LOC "0Admin/Logs/" //The location where the server will print a log of a ban/kick
- #define KICK_LOG "0Admin/Logs/KickLog.ini" //Naming the Kick Log
- #define BAN_LOG "0Admin/Logs/BanLog.ini" //Naming the Ban Log
- #define RCON_LOG "0Admin/Logs/RCONFails.ini" //Printing in the log what IP tried to break the RCON and with what password!
- #define REPORT_LOG "0Admin/Logs/Reports.ini" //Where the report logs will be saved
- #define SETRANK_LOG "0Admin/Logs/SetRank.ini" //A log where it will store the player that has changed rank etc..
- #define SETLEVEL_LOG "0Admin/Logs/SetLevel.ini" //A log where it will store the player that has changed level etc..
- #define SETVIP_LOG "0Admin/Logs/SetVip.ini" //A log where it will store the player that has changed vip etc..
- #define PMS_LOG "0Admin/Logs/PMs.ini" //Where all Personal Messages will be stored!
- #define WARNS_LOG "0Admin/Logs/Warns.ini" //Where the warns will be stored!
- #define VIPCHAT_LOG "0Admin/Logs/VIP Chat.ini" //Here saves everything admins chat trough the Admin Chat.
- #define ADMINCHAT_LOG "0Admin/Logs/Admin Chat.ini" //Here stores all the messages sent by VIP members
- #define USER_ID "0Admin/Account_ID.ini" //Saving how many accounts have been created and which was the last one
- #define AKA_FILE "0Admin/AKA.ini" //Sacing the AKA(Also Known As) of a player!
- #define SERVER_FILE "0Admin/SVSettings.ini" //The server data, where Autologin Antispam anti whatever will asve!
- #define DATABASE_LOC "0Admin/Database.db" //Define here where the database with the top x players and muted/jaled/frozen
- #define STATS_LOC "0Admin/Stats/" //Where the file of the player creates when admins uses !stats <id> in console.
- //For the /SETSTAT command
- #define NAME 0
- #define MONEY 1
- #define SCORE 2
- #define COOKIES 3
- #define RESPECT 4
- #define KILLS 5
- #define DEATHS 6
- #define MESSAGES 7
- #define COMMANDS 8
- #define FCOMMANDS 9
- #define ONLINE 10
- #define LEVEL 11
- #define VLEVEL 12
- #define CPASS 13
- #define BACCOUNT 14
- #define DACCOUNT 15
- #define ADMIN_SPEC_TYPE_NONE 0
- #define ADMIN_SPEC_TYPE_PLAYER 1
- #define ADMIN_SPEC_TYPE_VEHICLE 2
- //Shortcuts
- #define CreateTable(%0,%1,%2)\
- DB::Query((%0), "CREATE TABLE IF NOT EXISTS " "`"%1"`" %2)
- //----------------------------------------
- #define Public:%0(%1) forward %0(%1);\
- public %0(%1)
- //----------------------------------------
- #define FormatMSG(%0,%1,%2,%3)\
- do{\
- format(_S_T_R_, sizeof (_S_T_R_), (%2), %3);\
- SendClientMessage((%0),(%1), _S_T_R_);\
- }\
- while (False)
- //----------------------------------------
- #define SendAdminCMD(%0,%1,%2)\
- do{\
- foreach(Player, zI){\
- if(P_DATA[zI][Level]> 1){\
- if(zI != (%0)){\
- format(_S_T_R_, sizeof (_S_T_R_), (%1), %2);\
- SendClientMessage(zI,Color:GREY, _S_T_R_);\
- }\
- }\
- }\
- }\
- while (False)
- //----------------------------------------
- #define LevelCheck(%0,%1)\
- do{\
- if(P_DATA[(%0)][Level] < (%1) && !IsPlayerAdmin((%0))){\
- if(S_DATA[TellPlayer]){\
- new Str[256];\
- format(Str, 256, "SERVER:"W" You must be an admin level "ORAN"%d"W" to use this command!", (%1));\
- return SendClientMessage((%0), Color:ORAN, Str);\
- }else return 0;\
- }\
- }\
- while(False)
- //----------------------------------------
- #define LoginCheck(%0) \
- do{\
- if(!P_DATA[(%0)][Logged])\
- {\
- if(S_DATA[TellPlayer])\
- {\
- return SendClientMessage((%0), Color:ORAN, "SERVER:"W" You must be logged in to use this command!");\
- }else return 0;\
- }\
- }\
- while(False)
- //----------------------------------------
- #define SaveInLog(%0,%1,%2) \
- do\
- {\
- new File:_File = fopen((%0), io_append);\
- format(_S_T_R_, sizeof (_S_T_R_), %1 "\r\n", %2);\
- if((_File))\
- {\
- fwrite((_File), _S_T_R_);\
- fclose((_File));\
- }\
- }\
- while(False)
- //----------------------------------------
- #define FileExist(%0);\
- if(!fexist(%0))\
- {\
- printf("MISSING FILE: \"%s\" doesn't exist, created by the system", %0);\
- new File:uFile = fopen(%0, io_write); fclose(uFile);\
- Fail = true;\
- }
- //----------------------------------------
- #define CheckImune(%0,%1); \
- if(P_DATA[(%0)][Level] < P_DATA[(%1)][Level]) \
- return SendError(%0, "You are not allowed to use this command on this admin!");
- //----------------------------------------
- #define VipCheck(%0, %1); \
- if(P_DATA[(%0)][Vip] < %1 && !IsPlayerAdmin(%0)) \
- return format(_S_T_R_, 256, "SERVER:"W" You must be a VIP level "ORAN"%d"W" to use this command!", %0),\
- SendClientMessage((%0), Color:ORAN, _S_T_R_);
- //----------------------------------------
- #define CheckComponents(%0,%1)\
- if(!strcmp(GPVSEx((%0), "Type"), "None") && !P_DATA[(%0)][A_Component1] &&\
- !P_DATA[(%0)][A_Component2] && !P_DATA[(%0)][A_Component3] &&\
- !P_DATA[(%0)][A_Component4] && !P_DATA[(%0)][A_Wheels] &&\
- !P_DATA[(%0)][A_Color])\
- return SendError((%0), %1),cmd_accp((%0), "")
- //----------------------------------------
- #define PRESSED(%0) \
- (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
- //----------------------------------------
- #define RELEASED(%0) \
- (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
- //----------------------------------------
- #define OpenWriteClose(%0,%1,%2,%3);\
- {\
- new INI:%1 = INI_Open((%0));\
- INI_WriteInt((%1), %2, (%3));\
- INI_Close((%1));\
- }
- //----------------------------------------
- #define _0CMD(%0) \
- if(!strcmp(cmd, "!0" %0, true))
- //----------------------------------------
- #define Triadic(%0)\
- (%0) ? ("Enabled") : ("Disabled")
- //----------------------------------------
- #define CONSOLE(%0) \
- if(!strcmp(cmd, (%0), true, .length = strlen((%0))))
- //----------------------------------------
- #define PrintError(%0) \
- print("\n----------------\n" %0 "\n----------------\n")
- //----------------------------------------
- #define PrintErrorEx(%0,%1) \
- printf("\n----------------\n" %0 "\n----------------\n", %1)
- //----------------------------------------
- #define loop(%0,%1) \
- for(new _%0; (_%0) != (%1); (_%0)++)
- //----------------------------------------
- #define _GetField<%0>Store<%1>\
- DB::GetField(Result, %0, (Field), sizeof((Field)));\
- P_DATA[playerid][%1] = strval(Field);
- //----------------------------------------
- #define Show(%0) \
- ShowPlayerDialog(playerid, Dialog:Empty, BOX, ""W"Your Commands:", (%0), "Close", "")
- //----------------------------------------
- #define Detour<%0,%1> \
- CMD:%0(PARAMS) return cmd_%1(playerid, "");
- native WP_Hash(buffer[], len, const str[]);
- stock
- bool:False = false,
- _S_T_R_[256];
- enum
- Colors
- {
- COL_ORAN = 0xFF5500FF,
- COL_GREY = 0xC3C3C3FF,
- COL_GREE = 0xADEB50FF,
- COL_FUNC = 0xFFA640FF,
- COL_BLUE = 0x4097EDFF,
- COL_WHITE = -1
- };
- enum
- Dialogs
- {
- Dialog:Register D:+1, Dialog:Register1 D:+2,
- Dialog:Login D:+3, Dialog:Login2 D:+4,
- Dialog:Login3 D:+5, Dialog:Stats D:+6,
- Dialog:cPanel D:+7, Dialog:cPanel_Back D:+8,
- Dialog:cPanel_Ping D:+9, Dialog:cPanel2 D:+10,
- Dialog:Empty D:+11, Dialog:ACCP D:+12,
- Dialog:ACCP_NOS D:+13, Dialog:ACCP_COLORS D:+14,
- Dialog:ACCP_C_C D:+15, Dialog:ACCP_WHEELS D:+16,
- Dialog:ACCP_COMPS D:+17, Dialog:ACCP_SAVE D:+18,
- Dialog:ACCP_LOAD D:+19, Dialog:ACCP_DISCARD D:+20,
- Dialog:SetStatsSure D:+21, Dialog:SetStatsTrue D:+22,
- Dialog:TOP D:+23, Dialog:TOP_SELECT D:+24,
- Dialog:TOP_RESPECT D:+25, Dialog:CLICK D:+26,
- Dialog:CLICK_PM D:+27, Dialog:CLICK_RP D:+28,
- Dialog:CLICK_MONEY D:+29, Dialog:CLICK_REPORT D:+30,
- Dialog:PCP D:+31, Dialog:NAME D:+32,
- Dialog:MONEY D:+33, Dialog:SCORE D:+34,
- Dialog:COOKIES D:+35, Dialog:RESPECT D:+36,
- Dialog:KILLS D:+37, Dialog:DEATHS D:+38,
- Dialog:MESSAGES D:+39, Dialog:COMMANDS D:+40,
- Dialog:FCOMMANDS D:+41, Dialog:ONLINE D:+42,
- Dialog:LEVEL D:+43, Dialog:VLEVEL D:+44,
- Dialog:CPASS D:+45, Dialog:BACCOUNT D:+46,
- Dialog:DACCOUNT D:+47, Dialog:RESPECT_NEG D:+48,
- Dialog:RESPECT_POS D:+49, Dialog:ONLINE_H D:+50,
- Dialog:ONLINE_M D:+51, Dialog:ONLINE_S D:+52,
- Dialog:SAnswer D:+53, Dialog:SAnswer2 D:+54,
- Dialog:SQuestion D:+55, Dialog:ForgPass D:+56,
- Dialog:PCPBack D:+57, Dialog:PCPShout D:+58
- };
- enum
- P_ENUM_DATA
- {
- Money, Score, MutedAll, Level,
- Vip, Rank, Msgs, Cmds,
- fCmds, Kills, Deaths, Negative,
- Positive, God, CarGod, Boost,
- Banned, Kicks, LogFail, Logged,
- Muted, Frozen, Jailed, cmgddon,
- Hours, Minutes, Seconds, TotalTime,
- ConnTime, AccID, MutedTime, JailTime,
- SpamMSG, cSpam, tLevel, PMSent,
- RepMSG[128], Warns, Cookies, aCar,
- pAuto, GiveCar, Spec_ID, Spec_Type,
- NosTimer, Accp_Saved, A_Color, Spin,
- A_Component1, A_Component2, A_Component3, A_Component4,
- A_Wheels, Incred, BAPMs, VIPTag,
- Text3D:Tag3D, Float:bSpeed
- };
- enum
- S_ENUM_DATA
- {
- AntiSpam, AntiCSpam, Ping, sAccounts,
- RconFails, RCONProt, TellPlayer, Chat,
- ReadPM, ReadCMD, AKA, ShowFunction,
- AntiRepeat, AutoLogin, AnnRank, AntiAD,
- sCMDS, sMSGS, sCrashes, sDisc,
- sConn, sKB, sPlayers, sRecord,
- sD, sM, sY, RecordBy[MAX_PLAYER_NAME],
- sH, sMi, sS, VipChat,
- AdminChat
- };
- enum INI_Enum_NV { iName[15], iValue };
- enum INI_Server_Enum_NV { isName[15], isValue };
- enum WHEELS_E { iWheel, iwName[15] };
- enum vCOLORS_E { ivColor, ivcRGB[9], ivcName[15] };
- enum vCOMPONENTS_E { iComponent, icName[20] };
- enum RANKS_E { iRank, irName[MAX_RANK_LEN] };
- new
- bool:Fail = false;
- new
- DB:_DB,
- PlayerIP[MAX_PLAYERS][50],
- P_DATA[MAX_PLAYERS][P_ENUM_DATA],
- S_DATA[S_ENUM_DATA],
- MuteTimer[MAX_PLAYERS],
- JailTimer[MAX_PLAYERS],
- PlayerText3D:ZaAdminCar[MAX_PLAYERS],
- StatsString[800],
- WhosStats[129],
- _Levels[][] =
- {
- { "Member" },
- { "Helper" },
- { "Mini Moderator" },
- { "Moderator" },
- { "Administrator" },
- { "Owner" }
- },
- #if USE_RANKS == true
- //When you add/remove a rank, count each rank and insert here the number:
- #define TOTAL_RANKS (12)
- _Ranks[TOTAL_RANKS][RANKS_E] =
- {
- /* Kills Rank Name */
- { 0, "Looser" },
- { 25, "Easy Killa'" },
- { 50, "Baby Killer" },
- { 75, "e-Gangsta" },
- { 100, "Boss" },
- { 150, "Lil' Psycho" },
- { 200, "Psycho" },
- { 300, "Unstopable" },
- { 400, "Elite Killer" },
- { 600, "Godlike killer!" },
- { 800, "INSANE KILLER" },
- { 1000, "The God of Deathmatch" }//Last row must NOT have the ','
- },
- #endif
- ACCP_Components[7][vCOMPONENTS_E] =
- {
- /* Model Component Name */
- { 1019, "Twin Exhaust" },
- { 1018, "Upswept Exhaust" },
- { 1001, "Win Spoiler" },
- { 1023, "Fury Spoiler" },
- { 1003, "Alpha Spoiler" },
- { 1087, "Hydraulics" },
- { 1017, "Skirt" }
- },
- ACCP_Colors[16][vCOLORS_E] =
- {
- /* CarCol RRGGBB Color Name */
- { 1, "{FFFFFF}", "White" },
- { 0, "{000000}", "Black" },
- { 2, "{2a77a1}", "Light Blue" },
- { 3, "{840510}", "Dark Red" },
- { 25, "{253739}", "Dark Grey" },
- { 85, "{87446f}", "Soft Magenta" },
- { 6, "{d68f11}", "Orange" },
- { 109, "{bdbdc5}", "Grey" },
- { 49, "{d6dbd5}", "White Grey" },
- { 86, "{34603f}", "Green" },
- { 113, "{5f272a}", "Brown" },
- { 126, "{ed6aae}", "Pinky" },
- { 51, "{305045}", "Dark Green" },
- { 12, "{5e7e8d}", "Soft Blue" },
- { 102, "{ab9d83}", "Easy Color" },
- { 65, "{8f8c47}", "Ugly Green" }
- },
- Wheels[17][WHEELS_E] =
- {
- /* Model Wheel Name */
- { 1_025, "Offroad" },
- { 1_073, "Shadow" },
- { 1_074, "Mega" },
- { 1_075, "Rimshine" },
- { 1_076, "Wires" },
- { 1_077, "Classic" },
- { 1_078, "Twist" },
- { 1_079, "Cutter" },
- { 1_080, "Switch" },
- { 1_081, "Grove" },
- { 1_082, "Import" },
- { 1_083, "Dollar" },
- { 1_084, "Trance" },
- { 1_085, "Atomic" },
- { 1_096, "Ahab" },
- { 1_097, "Virtual" },
- { 1_098, "Access" }
- },
- SpamColors[35] =
- {
- 0xFBBA00FF, 0xB4B5B7AA, 0xAFAFAFAA, 0x0000BBAA, 0x800080AA,
- 0x000000AA, 0x33AA33AA, 0xA52A2AAA, 0xFFA00AFF, 0xFF560AFF,
- 0xFFD8B0FF, 0xFFD876FF, 0xFFBF3BFF, 0xFFC628FF, 0xFF4D28FF,
- 0xFFFF28FF, 0xC0C0C0AA, 0xFFDD80FF, 0x00DD37FF, 0x2C2727AA,
- 0xC968FCFF, 0xC9C0FCFF, 0xA790FCFF, 0x0097FFFF, 0xFF6463FF,
- 0x00DDFFFF, 0x00DDFF15, 0xC500FFFF, 0x33AA33AA, 0x00DD37FF
- },
- INI_Server_Info[16][INI_Server_Enum_NV] =
- {
- /* Feature Value */
- { "AntiSpam", 1 },
- { "AntiCMDSpam", 1 },
- { "MaxPing", 750 },
- { "RconProtect", 1 },
- { "TellPlayer", 1 },
- { "BlockChat", 0 },
- { "ReadPMs", 0 },
- { "ReadCommands", 0 },
- { "AKA", 1 },
- { "ShowFunction", 1 },
- { "AntiRepeat", 1 },
- { "AutoLogin", 0 },
- { "AnnRank", 1 },
- { "AntiAdv", 1 },
- { "AdminChat", 1 },
- { "VipChat", 1 }
- },
- vNames[212][] =
- {
- {"Landstalker"}, {"Bravura"}, {"Buffalo"}, {"Linerunner"}, {"Perrenial"}, {"Sentinel"}, {"Dumper"},
- {"Firetruck"}, {"Trashmaster"}, {"Stretch"}, {"Manana"}, {"Infernus"}, {"Voodoo"}, {"Pony"}, {"Mule"},
- {"Cheetah"}, {"Ambulance"}, {"Leviathan"}, {"Moonbeam"}, {"Esperanto"}, {"Taxi"}, {"Washington"},
- {"Bobcat"}, {"Mr Whoopee"}, {"BF Injection"}, {"Hunter"}, {"Premier"}, {"Enforcer"}, {"Securicar"},
- {"Banshee"}, {"Predator"}, {"Bus"},{"Rhino"}, {"Barracks"}, {"Hotknife"}, {"Trailer 1"}, {"Previon"},
- {"Coach"}, {"Cabbie"}, {"Stallion"}, {"Rumpo"}, {"RC Bandit"}, {"Romero"}, {"Packer"}, {"Monster"},
- {"Admiral"}, {"Squalo"}, {"Seasparrow"}, {"Pizzaboy"}, {"Tram"}, {"Trailer 2"}, {"Turismo"},
- {"Speeder"}, {"Reefer"}, {"Tropic"}, {"Flatbed"}, {"Yankee"}, {"Caddy"}, {"Solair"}, {"Berkley's RC Van"},
- {"Skimmer"}, {"PCJ-6_0_0"}, {"Faggio"}, {"Freeway"}, {"RC Baron"}, {"RC Raider"}, {"Glendale"}, {"Oceanic"},
- {"Sanchez"}, {"Sparrow"}, {"Patriot"}, {"Quad"}, {"Coastguard"}, {"Dinghy"}, {"Hermes"}, {"Sabre"},
- {"Rustler"}, {"ZR-3_5_0"}, {"Walton"}, {"Regina"}, {"Comet"},{"BMX"}, {"Burrito"}, {"Camper"}, {"Marquis"},
- {"Baggage"}, {"Dozer"}, {"Maverick"}, {"News Chopper"}, {"Rancher"}, {"FBI Rancher"}, {"Virgo"}, {"Greenwood"},
- {"Jetmax"}, {"Hotring"}, {"Sandking"}, {"Blista Compact"}, {"Police Maverick"},{"Boxville"}, {"Benson"},
- {"Mesa"}, {"RC Goblin"}, {"Hotring Racer A"}, {"Hotring Racer B"},{"Bloodring Banger"},{"Rancher"},
- {"Super GT"}, {"Elegant"}, {"Journey"}, {"Bike"}, {"Mountain Bike"}, {"Beagle"}, {"Cropdust"}, {"Stunt"},
- {"Tanker"}, {"Roadtrain"}, {"Nebula"}, {"Majestic"}, {"Buccaneer"}, {"Shamal"}, {"Hydra"}, {"FCR-900"},
- {"NRG-500"}, {"HPV1000"}, {"Cement Truck"}, {"Tow Truck"}, {"Fortune"}, {"Cadrona"}, {"FBI Truck"},
- {"Willard"}, {"Forklift"}, {"Tractor"}, {"Combine"}, {"Feltzer"}, {"Remington"}, {"Slamvan"},
- {"Blade"}, {"Freight"}, {"Streak"}, {"Vortex"}, {"Vincent"}, {"Bullet"}, {"Clover"}, {"Sadler"},
- {"Firetruck LA"}, {"Hustler"}, {"Intruder"}, {"Primo"}, {"Cargobob"}, {"Tampa"}, {"Sunrise"}, {"Merit"},
- {"Utility"}, {"Nevada"}, {"Yosemite"}, {"Windsor"}, {"Monster A"}, {"Monster B"}, {"Uranus"}, {"Jester"},
- {"Sultan"}, {"Stratum"}, {"Elegy"}, {"Raindance"}, {"RC Tiger"}, {"Flash"}, {"Tahoma"}, {"Savanna"},
- {"Bandito"}, {"Freight Flat"}, {"Streak Carriage"}, {"Kart"}, {"Mower"}, {"Duneride"}, {"Sweeper"},
- {"Broadway"}, {"Tornado"}, {"AT-400"}, {"DFT-30"}, {"Huntley"}, {"Stafford"}, {"BF-400"}, {"Newsvan"},
- {"Tug"}, {"Trailer 3"}, {"Emperor"}, {"Wayfarer"}, {"Euros"}, {"Hotdog"}, {"Club"}, {"Freight Carriage"},
- {"Trailer 3"}, {"Andromada"}, {"Dodo"}, {"RC Cam"}, {"Launch"}, {"Police Car LSPD"},{"Police Car SFPD"},
- {"Police _LVPD"}, {"Police Ranger"}, {"Picador"}, {"SWAT. Van"}, {"Alpha"}, {"Phoenix"}, {"Glendale"},
- {"Sadler"}, {"Luggage Trailer A"}, {"Luggage Trailer B"}, {"Stair Trailer"},{"Boxville"}, {"Farm Plow"},
- {"Utility Trailer"}
- };
- #if USE_RANKS == true
- new _RankNames[sizeof(_Ranks)][MAX_RANK_LEN];
- #endif
- public OnPlayerUpdate(playerid)
- {
- #if STATS_STABILIZER == true
- if(P_DATA[playerid][Kills] != GetPVarInt((playerid), "0_Kills"))
- P_DATA[(playerid)][Kills] = GetPVarInt((playerid), "0_Kills");
- if(P_DATA[playerid][Deaths] != GetPVarInt((playerid), "0_Deaths"))
- P_DATA[(playerid)][Deaths] = GetPVarInt((playerid), "0_Deaths");
- if(P_DATA[playerid][Level] != GetPVarInt((playerid), "0_Level"))
- P_DATA[(playerid)][Level] = GetPVarInt((playerid), "0_Level");
- if(P_DATA[playerid][Vip] != GetPVarInt((playerid), "0_Vip"))
- P_DATA[(playerid)][Vip] = GetPVarInt((playerid), "0_Vip");
- if(P_DATA[playerid][Cookies] != GetPVarInt((playerid), "0_Cookies"))
- P_DATA[(playerid)][Cookies] = GetPVarInt((playerid), "0_Cookies");
- if(P_DATA[playerid][God] != GetPVarInt((playerid), "0_God"))
- P_DATA[(playerid)][God] = GetPVarInt((playerid), "0_God");
- if(P_DATA[playerid][CarGod] != GetPVarInt((playerid), "0_CarGod"))
- P_DATA[(playerid)][CarGod] = GetPVarInt((playerid), "0_CarGod");
- if(P_DATA[playerid][Positive] != GetPVarInt((playerid), "0_Positive"))
- P_DATA[(playerid)][Positive] = GetPVarInt((playerid), "0_Positive");
- if(P_DATA[playerid][Negative] != GetPVarInt((playerid), "0_Negative"))
- P_DATA[(playerid)][Negative] = GetPVarInt((playerid), "0_Negative");
- if(P_DATA[playerid][Boost] != GetPVarInt((playerid), "0_Boost"))
- P_DATA[(playerid)][Boost] = GetPVarInt((playerid), "0_Boost");
- if(P_DATA[playerid][Rank] != GetPVarInt((playerid), "0_Rank"))
- P_DATA[(playerid)][Rank] = GetPVarInt((playerid), "0_Rank");
- #endif
- return 1;
- }
- public OnFilterScriptInit()
- {
- if(fexist("0Admin/"))
- {
- #if SAVE_IN_LOGS == true
- if(fexist(LOGS_LOC))
- {
- FileExist(VIPCHAT_LOG);
- FileExist(ADMINCHAT_LOG);
- FileExist(WARNS_LOG);
- FileExist(PMS_LOG);
- FileExist(SETRANK_LOG);
- FileExist(SETLEVEL_LOG);
- FileExist(SETVIP_LOG);
- FileExist(KICK_LOG);
- FileExist(BAN_LOG);
- FileExist(RCON_LOG);
- FileExist(REPORT_LOG);
- }
- else print("MISSING FOLDER: Folder \""#LOGS_LOC"\" doesn't exist! Please create it!"),
- Fail = true;
- #endif
- FileExist(AKA_FILE);
- if(!fexist(USER_ID))
- {
- printf("MISSING FILE: \""#USER_ID"\" doesn't exist, created by the system");
- new File:uFile = fopen(USER_ID, io_append);
- if(uFile)
- {
- fwrite(uFile, "Accounts_Created = 0\r\nLast_Account = None\r\nLast_Account_Date = Never");
- fclose(uFile);
- }
- Fail = true;
- }
- if(!fexist(STATS_LOC))
- {
- print("MISSING FOLDER: Folder \""#STATS_LOC"\" doesn't exist! Please create it!");
- Fail = true;
- }
- }else print("MISSING FOLDER: The main folder \"/0Admin/\" is missing from the \"scriptfiles\""),
- Fail = true;
- _DB = db_open(DATABASE_LOC);
- new String[750];
- strcat(String, "CREATE TABLE IF NOT EXISTS `Accounts` ", 750);
- strcat(String, "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, \
- `IP` TEXT, \
- `Name` TEXT, \
- `Password` TEXT, \
- `Online` TEXT, \
- `JoinDate` TEXT, \
- `Level` NUMERIC, \
- `VIP` NUMERIC, \
- `Rank` NUMERIC, \
- `Autologin` NUMERIC, \
- `Money` NUMERIC, \
- `Score` NUMERIC, \
- `Kills` NUMERIC, \
- `Deaths` NUMERIC, \
- `Cookies` NUMERIC, \
- `Positive` NUMERIC, \
- `Negative` NUMERIC, \
- `Messages` NUMERIC, \
- `Commands` NUMERIC, \
- `fCommands` NUMERIC, \
- `Warns` NUMERIC, \
- `Kicks` NUMERIC, \
- `God` NUMERIC, \
- `Cargod` NUMERIC,", 750);
- strcat(String, " `ACCP` NUMERIC, \
- `ACCPSav` TEXT, \
- `BlockPM` NUMERIC, \
- `Boost` NUMERIC, \
- `bSpeed` NUMERIC, \
- `RPassword` TEXT, \
- `Question` TEXT, \
- `Answer` TEXT, \
- `WearTAG` NUMERIC, \
- `Spin` NUMERIC, \
- `Incred` NUMERIC)", 750);
- DB::Query(_DB, String);
- CreateTable(_DB, "Top", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `Name` TEXT,`Kills` NUMERIC,`Deaths` NUMERIC,`Hours` NUMERIC,`Rank` NUMERIC,`Ratio` TEXT,`Negative` NUMERIC,`Positive` NUMERIC)");
- #if SAVE_MUTE == true
- CreateTable(_DB, "Muted", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `IP` TEXT,`Muted` NUMERIC,`Time` NUMERIC,`RealName` TEXT)");
- #endif
- #if SAVE_JAIL == true
- CreateTable(_DB, "Jailed", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `IP` TEXT,`Jailed` NUMERIC,`Time` NUMERIC,`RealName` TEXT)");
- #endif
- #if SAVE_FREEZE == true
- CreateTable(_DB, "Frozen", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `IP` TEXT,`Frozen` NUMERIC,`RealName` TEXT)");
- #endif
- CreateTable(_DB, "Banlist", "(`IP` TEXT,`Name` TEXT, `Reason` TEXT, `Admin` TEXT, `BanDate` TEXT)");
- CreateTable(_DB, "Positive", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `Name` TEXT,`Expiration` TEXT)");
- CreateTable(_DB, "Negative", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `Name` TEXT,`Expiration` TEXT)");
- CreateTable(_DB, "ServerStats", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `Commands`,`Messages`,`Crashes`,`Quits`,`Kicks/Bans`,`Connections`,`Uptime`)");
- CreateTable(_DB, "Record", "(`Players`,`Date`,`Time`,`By`,`DateOLD`,`TimeOLD`,`ByOLD`)");
- new
- DBResult: R1;
- R1 = DB::Query(_DB, "SELECT `Players`, `Date`, `Time`, `By` FROM `Record`");
- if(R1)
- {
- if(DB::Valid(R1))
- {
- new Field[64];
- DB::GetField(R1, "Players", Field, 64);
- S_DATA[sRecord] = strval(Field);
- DB::GetField(R1, "Date", Field, 64);
- sscanf(Field, "p</>iii", S_DATA[sD], S_DATA[sM], S_DATA[sY]);
- DB::GetField(R1, "Time", Field, 64);
- sscanf(Field, "p<:>iii", S_DATA[sH], S_DATA[sMi], S_DATA[sS]);
- DB::GetField(R1, "By", Field, 64);
- format(S_DATA[RecordBy], MAX_PLAYER_NAME, "%s", Field);
- DB::Free(R1);
- }
- else
- {
- DB::Free(R1);
- DB::Query(_DB, "INSERT INTO `Record` VALUES('0','0/0/0','0:0:0','Nobody','0/0/0','0:0:0','Nobody')");
- }
- }
- SetTimer("PingKick", 2000, true);
- SetTimer("LowerSpam", LOW_SPAM_RATE, true);
- SetTimer("GodLike", GOD_TICK_RATE, true);
- INI_ParseFile(USER_ID, "ParseUserID" );
- INI_ParseFile(SERVER_FILE, "LoadServerData");
- if(S_DATA[Ping] < 100 && S_DATA[Ping] != 0)
- {
- new RandomPing = 600 + random(300);
- printf("WARNING: Ping Kicker was under 100, randomly set to: %d", RandomPing);
- S_DATA[Ping] = (RandomPing);
- }
- #if USE_RANKS == true
- #if PRINT_RANKS == true
- print("Ranks created succesfully!\n----------------------------");
- #endif
- for (new r = 0; r < sizeof(_Ranks); r++)
- {
- format(_RankNames[r], MAX_RANK_LEN, "%s", _Ranks[r][irName]);
- #if PRINT_RANKS == true
- printf("Rank: %s | Kills requiered: %d", _RankNames[r], _Ranks[r][iRank]);
- #endif
- }
- #endif
- if(Fail == true)
- {
- print(#\n\n\nWARNING:);
- print(#----------------\n- When a file is missing","# the system will create it.);
- print(#- However","# if you get a folder error","# you must create the folder on your own!);
- print(#- If a folder or a file is deleted while the server runs","# problems may occur!\n\n);
- }
- if(fexist("/0Admin/"))
- {
- if(!fexist(SERVER_FILE))
- {
- printf("MISSING FILE: \""#SERVER_FILE"\" doesn't exist, created by the system");
- print("Thew following atributions have been added to the following features:");
- new INI:ServerFile = INI_Open(SERVER_FILE),
- pStr[512];
- print("\n==========================================");
- print("||\tFeature\t\tState\tValue\t||");
- print("||--------------------------------------||");
- for(new i = 0; i < sizeof(INI_Server_Info); ++i)
- {
- INI_WriteInt(ServerFile, INI_Server_Info[i][isName], INI_Server_Info[i][isValue]);
- format(pStr, sizeof (pStr), "||\t%s%s| %s%s",
- INI_Server_Info[i][isName],
- (i == 2 || i == 6 || i == 8 || i == 12 || i == 13 || i == 15) ? ("\t\t") : ("\t"),
- (INI_Server_Info[i][isValue]) ? ((i == 2) ? (EX(INI_Server_Info[i][isValue])) : ("Yes")) : ("No"),
- (INI_Server_Info[i][isValue]) ? ((i == 2) ? ("\t||") : ("\t\t||")) : ("\t\t||"));
- print(pStr);
- }
- print("==================\t\t\t||");
- print("\t\t|| Copyright Zh3r0 2011 ||");
- print("\t\t==========================\n\n\n");
- INI_Close(ServerFile);
- INI_ParseFile(SERVER_FILE, "LoadServerData");
- }
- }
- if(!Fail) SetTimer("Display", 800, 0);
- /*new
- cmdBuffer[32],
- commandCount;
- for(new it = 0; it < Scripting_GetPublicsCount(); it++) {
- Scripting_GetPublic(it, cmdBuffer);
- if(!strcmp(cmdBuffer, "cmd_", false, 4)) {
- strdel(cmdBuffer, 0, 4);
- strins(cmdBuffer, "/", 0);
- strins(cmdBuffer, "\r\n", strlen(cmdBuffer));
- printf(#%d. %s, it - 47, cmdBuffer);
- new File:F = fopen("Cmds.txt", io_append);
- if(F)
- {
- fwrite(F, cmdBuffer);
- fclose(F);
- }
- commandCount++;
- }
- }
- printf(#A total of %d commands, commandCount);*/
- return 1;
- }
- stock CountZCMDCmds() {
- new
- cmdBuffer[32],
- commandCount;
- for(new it = 0; it < Scripting_GetPublicsCount(); it++) {
- Scripting_GetPublic(it, cmdBuffer);
- if(!strcmp(cmdBuffer, "cmd_", false, 4)) {
- commandCount++;
- }
- }
- return commandCount;
- }
- public OnFilterScriptExit()
- {
- db_close(_DB);
- if(fexist(SERVER_FILE))
- {
- new INI:ServerFile = INI_Open(SERVER_FILE);
- INI_WriteInt(ServerFile, INI_Server_Info[0][isName], S_DATA[AntiSpam]);
- INI_WriteInt(ServerFile, INI_Server_Info[1][isName], S_DATA[AntiCSpam]);
- INI_WriteInt(ServerFile, INI_Server_Info[2][isName], S_DATA[Ping]);
- INI_WriteInt(ServerFile, INI_Server_Info[3][isName], S_DATA[RCONProt]);
- INI_WriteInt(ServerFile, INI_Server_Info[4][isName], S_DATA[TellPlayer]);
- INI_WriteInt(ServerFile, INI_Server_Info[5][isName], S_DATA[Chat]);
- INI_WriteInt(ServerFile, INI_Server_Info[6][isName], S_DATA[ReadPM]);
- INI_WriteInt(ServerFile, INI_Server_Info[7][isName], S_DATA[ReadCMD]);
- INI_WriteInt(ServerFile, INI_Server_Info[8][isName], S_DATA[AKA]);
- INI_WriteInt(ServerFile, INI_Server_Info[9][isName], S_DATA[ShowFunction]);
- INI_WriteInt(ServerFile, INI_Server_Info[10][isName], S_DATA[AntiRepeat]);
- INI_WriteInt(ServerFile, INI_Server_Info[11][isName], S_DATA[AutoLogin]);
- INI_WriteInt(ServerFile, INI_Server_Info[12][isName], S_DATA[AnnRank]);
- INI_WriteInt(ServerFile, INI_Server_Info[13][isName], S_DATA[AntiAD]);
- INI_WriteInt(ServerFile, INI_Server_Info[14][isName], S_DATA[AdminChat]);
- INI_WriteInt(ServerFile, INI_Server_Info[15][isName], S_DATA[VipChat]);
- INI_Close(ServerFile);
- }
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- new
- Player, P2, Reason[129];
- if(!strcmp(cmd, ">", true, .length = 1))
- {
- if(!sscanf(cmd[1], "s[129]", Reason))
- {
- FormatMSG(0, Color:BLUE, "Zh3r0: "W"%s", Reason);
- }
- }
- CONSOLE("!stats")
- {
- if(!sscanf(cmd[6], "uD(0)", Player, P2))
- {
- if(Player != (0xFFFF))
- {
- new
- Str[24],fStr[500];
- format(Str, sizeof(Str) + strlen(STATS_LOC), ""#STATS_LOC"%s.ini", Name(Player));
- format(fStr, sizeof (fStr), "Date: %s\r\n------------------------------------------\r\n\
- Registration Date: %s\r\n\
- IP: %s\r\n\
- Account ID: %d\r\n\
- Level: %d\r\n\
- VIP: %d\r\n\
- Rank: %d\r\n\
- Commands Used: %d\r\n\
- Failed Commands: %d\r\n\
- Messages Sent: %d\r\n\
- Cookies: %d\r\n\
- Online: %s\r\n\
- Respect: %d/-%d\r\n\
- Money: %d\r\n\
- Score: %d\r\n\
- Deaths: %d\r\n\
- Kills: %d\r\n\
- Ratio: %.3f\r\n\
- Kicks Received: %d\r\n",
- zDate (),
- GPVSEx(Player, "AccountDate"),
- PlayerIP[Player],
- P_DATA[Player][AccID],
- P_DATA[Player][Level],
- P_DATA[Player][Vip],
- P_DATA[Player][Rank],
- P_DATA[Player][Cmds],
- P_DATA[Player][fCmds],
- P_DATA[Player][Msgs],
- P_DATA[Player][Cookies],
- FormatOnline(Player),
- P_DATA[Player][Positive],
- P_DATA[Player][Negative],
- GetPlayerMoney(Player),
- GetPlayerScore(Player),
- P_DATA[Player][Deaths],
- P_DATA[Player][Kills],
- (Float:P_DATA[Player][Deaths] / Float:P_DATA[Player][Kills]),
- P_DATA[Player][Kicks]);
- if(P2 > 0) print(fStr);
- printf("\n---------------------------------------------------------------------\n\
- # %s's stats saved inside\n\n# "STATS_LOC"%s.ini\n\n# Open for his account details.\n\
- ---------------------------------------------------------------------\n\
- Type !stats <id> 1 to see them in the console.", Name(Player), Name(Player));
- new
- File:Stats = fopen(Str, io_append);
- if(Stats)
- {
- if(fexist(Str)) fwrite(Stats, "\r\n\r\n\r\n");
- fwrite(Stats, fStr);
- fclose(Stats);
- }
- }
- else PrintError("Player not connected!");
- }
- else PrintError("Invalid Syntax");
- }
- CONSOLE("!warn")
- {
- if(!sscanf(cmd[5], "u", Player))
- {
- if(Player != (0xFFFF))
- {
- ++P_DATA[Player][Warns];
- if(P_DATA[Player][Warns] != MAX_P_WARNS){
- printf(" >>> You warned %s. (Warn Level: %d/"#MAX_P_WARNS")", Name(Player), P_DATA[Player][Warns]);}
- else if(P_DATA[Player][Warns] >= MAX_P_WARNS){
- P_DATA[Player][Warns] = 0,
- 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]);}
- 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]);
- SendAdminCMD(Player, "Owner of the server warned player %s. ("ORAN"%d"GREY"/"ORAN""#MAX_P_WARNS")", Name(Player), P_DATA[Player][Warns]);
- }
- else PrintError("Player not connected!");
- }
- else PrintError("Invalid Syntax");
- }
- CONSOLE("!2012")
- {
- if(!sscanf(cmd[5], "u", Player))
- {
- if(Player != (0xFFFF))
- {
- for (new w = 0; w < 11; w++)
- {SetPlayerSkillLevel(Player, w, 0);}
- SetPlayerHealth(Player, 0.1); SetPlayerArmour(Player, 0.0);
- SetPlayerTime(Player, 0, 0); SetPlayerWeather(Player, -66);
- SetPlayerWantedLevel(Player, 6); SetPlayerSkin(Player, 159);
- ResetPlayerWeapons(Player); GivePlayerWeapon(Player, 10, 1);
- ResetPlayerMoney(Player); SetPlayerScore(Player, 0);
- SetPlayerDrunkLevel(Player, 99999);
- printf(" >>> You fucked up %s's game!.", Name(Player));
- SendClientMessage(Player, Color:GREY, "You have been fucked up by the owner of the server!");
- SendAdminCMD(Player, "Owner of the server fucked up player %s", Name(Player));
- new
- String[MAX_PLAYER_NAME];
- format(String, MAX_PLAYER_NAME, "[NUB]%s", Name(Player));
- if(strfind(Name(Player), "[NUB]", false, 0)) SetPlayerName(Player, String);
- }
- else PrintError("Player not connected!");
- }
- else PrintError("Invalid Syntax");
- }
- CONSOLE("!kill")
- {
- if(!sscanf(cmd[5], "u", Player))
- {
- if(Player != (0xFFFF))
- {
- SetPlayerHealth(Player, 0.0);
- printf(" >>> You killed %s.", Name(Player));
- SendClientMessage(Player, Color:GREY, "You have been killed by the owner of the server!");
- SendAdminCMD(Player, "Owner of the server killed player %s", Name(Player));
- }
- else PrintError("Player not connected!");
- }
- else PrintError("Invalid Syntax");
- }
- CONSOLE("!setonline")
- {
- new
- T[3];
- if(!sscanf(cmd[10], "udD(0)D(0)", Player, T[0], T[1], T[2]))
- {
- if(Player != (0xFFFF))
- {
- if(T[1] > 60 || T[1] < 0) return PrintError("Invalid minutes!");
- if(T[2] > 60 || T[2] < 0) return PrintError("Invalid seconds!");
- P_DATA[Player][Hours] = T[0];
- P_DATA[Player][Minutes] = T[1];
- P_DATA[Player][Seconds] = T[2];
- P_DATA[Player][ConnTime] = gettime();
- printf(" >>> You set %s's online time to %d:%d:%d.",Name(Player), T[0], T[1], T[2]);
- 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]);
- 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]);
- }
- else PrintError("Player not connected!");
- }
- else PrintError("Invalid Syntax");
- }
- CONSOLE("!spawn")
- {
- if(!sscanf(cmd[6], "u", Player))
- {
- if(Player != (0xFFFF))
- {
- SpawnPlayer(Player);
- printf(" >>> You spawned %s.", Name(Player));
- SendClientMessage(Player, Color:GREY, "You have been spawned by the owner of the server!");
- SendAdminCMD(Player, "Owner of the server spawned player %s", Name(Player));
- }
- else PrintError("Player not connected!");
- }
- else PrintError("Invalid Syntax");
- }
- CONSOLE("!unfreeze")
- {
- if(!sscanf(cmd[9], "u", Player))
- {
- if(Player != (0xFFFF))
- {
- if(P_DATA[Player][Frozen])
- {
- P_DATA[Player][Frozen] = 0;
- UnFreeze(Player);
- #if SAVE_FREEZE == true
- new Query[256], DBResult:Result;
- format(Query, 256, "SELECT `Key` FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
- Result = DB::Query(_DB, Query);
- if(Result)
- {
- if(DB::Valid(Result))
- {
- DB::Free(Result);
- format(Query, 256, "DELETE FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
- DB::Query(_DB, Query);
- }
- else DB::Free(Result);
- }
- #endif
- printf(" >>> You unfroze %s.", Name(Player));
- SendClientMessage(Player, Color:GREY, "You have been unfrozen by the owner of the server!");
- SendAdminCMD(Player, "Owner of the server unfrozen player %s", Name(Player));
- }
- else PrintError("Player is is not frozen!");
- }
- else PrintError("Player not connected!");
- }
- else PrintError("Invalid Syntax");
- }
- CONSOLE("!freeze")
- {
- if(!sscanf(cmd[7], "u", Player))
- {
- if(Player != (0xFFFF))
- {
- if(!P_DATA[Player][Frozen])
- {
- P_DATA[Player][Frozen] = 1;
- Freeze(Player);
- #if SAVE_FREEZE == true
- new
- Query[256],
- DBResult:R1;
- format(Query, sizeof(Query), "SELECT `Key` FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
- R1 = DB::Query(_DB, Query);
- if(R1)
- {
- if(!DB::Valid(R1))
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "INSERT INTO `Frozen` VALUES(NULL, '%s', '1', '%s')",GetPlayerIPEx(Player), Name(Player));
- DB::Query(_DB, Query);
- }
- else
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "UPDATE `Frozen` SET `Frozen` = '1', `RealName` = '%s' WHERE `IP` = '%s'", Name(Player), GetPlayerIPEx(Player));
- DB::Query(_DB, Query);
- }
- }
- #endif
- printf(" >>> You froze %s.", Name(Player));
- SendClientMessage(Player, Color:GREY, "You have been frozen by the owner of the server!");
- SendAdminCMD(Player, "Owner of the server froze player %s", Name(Player));
- }
- else PrintError("Player is already frozen!");
- }
- else PrintError("Player not connected!");
- }
- else PrintError("Invalid Syntax");
- }
- CONSOLE("!unmute")
- {
- if(!sscanf(cmd[7], "u", Player))
- {
- if(Player != (0xFFFF))
- {
- if(P_DATA[Player][Muted])
- {
- P_DATA[Player][Muted] = 0;
- P_DATA[Player][MutedTime] = 0;
- KillTimer(MuteTimer[Player]);
- #if SAVE_MUTE == true
- new
- Query[256];
- format(Query, 256, "DELETE FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
- DB::Query(_DB, Query);
- #endif
- printf(" >>> You unmuted %s.", Name(Player));
- SendClientMessage(Player, Color:GREY, "You have been unmuted by the owner of the server!");
- SendAdminCMD(Player, "Owner of the server unmuted player %s", Name(Player));
- }
- else PrintError("Player is not muted!");
- }
- else PrintError("Player not connected!");
- }
- else PrintError("Invalid Syntax");
- }
- CONSOLE("!mute")
- {
- if(!sscanf(cmd[5], "uD(0)", Player, P2))
- {
- if(Player != (0xFFFF))
- {
- if(!P_DATA[Player][Muted])
- {
- if(!P2)
- {
- P_DATA[Player][Muted] = 1;
- P_DATA[Player][MutedTime] = 0;
- #if SAVE_MUTE == true
- new
- pQue[256];
- format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
- new DBResult:R1 = DB::Query(_DB, pQue);
- if(R1)
- {
- if(!DB::Valid(R1))
- {
- DB::Free(R1);
- format(pQue, sizeof (pQue), "INSERT INTO `Muted` VALUES(NULL, '%s', '1', '0', '%s')", GetPlayerIPEx(Player), Name(Player));
- DB::Query(_DB, pQue);
- }
- else
- {
- DB::Free(R1);
- format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '0', `RealName` = '%s' WHERE `IP` = '%s'", Name(Player), GetPlayerIPEx(Player));
- DB::Query(_DB, pQue);
- }
- }
- #endif
- printf(" >>> You muted %s forever", Name(Player));
- SendAdminCMD(INVALID_PLAYER_ID, "The owner of the server muted player "ORAN"%s[%i]"GREY" forever.", Name(Player), Player);
- SendClientMessage(Player, Color:GREY, "You have been muted forever by the owner of the server!");
- }
- else
- {
- P_DATA[Player][Muted] = 1;
- 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);
- FormatMSG(Player, Color:GREY, "You have been muted by the owner of the server! "W"["GREE"Time: "W"%d"GREY" seconds"W"]", P2);
- #if SAVE_MUTE == true
- new
- pQue[256];
- format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
- new DBResult:R1 = DB::Query(_DB, pQue);
- if(R1)
- {
- if(!DB::Valid(R1))
- {
- DB::Free(R1);
- format(pQue, sizeof (pQue), "INSERT INTO `Muted` VALUES(NULL, '%s', '1', '%d', '%s')", GetPlayerIPEx(Player), P2, Name(Player));
- DB::Query(_DB, pQue);
- }
- else
- {
- DB::Free(R1);
- format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '%d', `RealName` = '%s' WHERE `IP` = '%s'", P2, Name(Player), GetPlayerIPEx(Player));
- DB::Query(_DB, pQue);
- }
- }
- #endif
- printf(" >>> You muted %s for %d seconds!", Name(Player), P2);
- KillTimer(MuteTimer[Player]);
- MuteTimer[Player] = SetTimerEx("UnMutePlayer", P2, true, "i", Player);
- P_DATA[Player][MutedTime] = P2;
- }
- }else PrintError("Player is already muted!");
- }
- else PrintError("Player not connected!");
- }
- else PrintError("Invalid Syntax");
- }
- CONSOLE("!ban")
- {
- if(!sscanf(cmd[4], "uS(No Reason)[129]", Player, Reason))
- {
- if(Player != (0xFFFF))
- {
- printf(" >>> You banned %s from the server", Name(Player));
- printf(" >>> REASON: %s", Reason);
- SendClientMessage(Player, Color:GREY, " * You have been banned from the server by the owner. ");
- FormatMSG(Player, Color:BLUE, "REASON: "W"%s", Reason);
- SendAdminCMD(INVALID_PLAYER_ID, ""BLUE"%s"GREY" has been banned from the server by the server owner!", Name(Player));
- BanEx2(Player, "CONSOLE OWNER", Reason);
- }
- else PrintError("Player not connected!");
- }
- else PrintError("Invalid Syntax");
- return 1;
- }
- CONSOLE("!kick")
- {
- if(!sscanf(cmd[5], "uS(No Reason)[129]", Player, Reason))
- {
- if(Player != (0xFFFF))
- {
- printf(" >>> You kicked %s from the server", Name(Player));
- printf(" >>> REASON: %s", Reason);
- SendClientMessage(Player, Color:GREY, " * You have been kicked from the server by the owner. ");
- FormatMSG(Player, Color:BLUE, "REASON: "W"%s", Reason);
- KickEx(Player, "CONSOLE OWNER", Reason, false);
- SendAdminCMD(INVALID_PLAYER_ID, ""BLUE"%s"GREY" has been kicked from the server by the server owner!", Name(Player));
- }
- else PrintError("Player not connected!");
- }
- else PrintError("Invalid Syntax");
- return 1;
- }
- CONSOLE("!setrank")
- {
- if(!sscanf(cmd[8], "ud", Player, P2))
- {
- if(Player != (0xFFFF))
- {
- if(P2 > 0 || P2 < sizeof(_Ranks) - 1)
- {
- #if SAVE_IN_LOGS == true
- 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());
- #endif
- 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));
- printf(" >>> You %s %s to rank to %d | %s.", (P_DATA[Player][Rank] < P2) ? ("promoved") : ("demoted"), Name(Player), P2, RankName(P2));
- P_DATA[Player][Rank] = P2;
- }
- else PrintErrorEx("Maximu rank level is: %d", sizeof(_Ranks) - 1);
- }
- else PrintError("Player not connected!");
- }
- else PrintError("Invalid Syntax");
- return 1;
- }
- CONSOLE("!setvip")
- {
- if(!sscanf(cmd[7], "ud", Player, P2))
- {
- if(Player != (0xFFFF))
- {
- if(P2 < 5 || P2 > 0)
- {
- #if SAVE_IN_LOGS == true
- 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());
- #endif
- P_DATA[Player][Vip] = P2;
- printf(" >>> You %s %s's VIP level to %d.",(P_DATA[Player][Vip] < P2) ? ("promoved") : ("demoted"), Name(Player), P2);
- 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);
- }
- else PrintError("Min. VIP: 0 | Max. VIP: 3");
- }
- else PrintError("Player not connected!");
- }
- else PrintError("Invalid Syntax");
- return 1;
- }
- CONSOLE("!setlevel")
- {
- if(!sscanf(cmd[9], "ud", Player, P2))
- {
- if(Player != (0xFFFF))
- {
- if(P2 < 5 || P2 > 0)
- {
- #if SAVE_IN_LOGS == true
- 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());
- #endif
- printf(" >>> You %s %s as %s of the server! (Level: %d)", (P_DATA[Player][Level] < P2) ? ("promoved") : ("demoted"), Name(Player), LevelName(P2), P2);
- P_DATA[Player][Level] = P2;
- 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);
- }
- else PrintError("Min. level: 0 | Max. level: 5");
- }
- else PrintError("Player not connected!");
- }
- else PrintError("Invalid Syntax");
- return 1;
- }
- _0CMD("cmds")
- {
- print("Commands trough console of 0Admin System V"#Version"");
- print("------------------------------------------------------\n");
- print(" !setlevel <id> <level>\t!setvip <id> <vip>" );
- print(" !setrank <id> <rank>\t\t!ranks <no params>");
- print(" !kick <id> <reason>\t\t!ban <id> <reason>");
- print(" ![un]mute <id> <time>\t\t![un]freeze <id>");
- print(" ![un]jail <id> <time>\t\t!spawn <id>" );
- print(" !setonline <id> <h> <m> <s>\t!kill <id>" );
- print(" !2012 <id>\t\t\t!stats <id>" );
- }
- _0CMD("features")
- {
- new
- pStr[1_5];
- if(!S_DATA[Ping]) pStr = "\tN/A"; else format(pStr, 1_5, "\t\t%d", S_DATA[Ping]);
- print ("-------------------------------------------------");
- print ("| Feature\t\tState\t\tValue\t|" );
- print ("-------------------------------------------------");
- printf("| Anti Spam\t\t%s%sN/A\t|\n\
- | Anti CMD Spam\t%s%sN/A\t|\n\
- | Ping Kicker\t\t%s%s\t|\n\
- | RCON Protection\t%s%sN/A\t|\n\
- | Tell Player\t\t%s%sN/A\t|\n\
- | Block Chat\t\t%s%sN/A\t|\n\
- | Read PM\t\t%s%sN/A\t|\n\
- | Read Commands\t%s\tN/A\t|",
- Triadic(S_DATA[AntiSpam] ),
- S_DATA[AntiSpam] ? ("\t\t") :("\t"),
- Triadic(S_DATA[AntiCSpam]),
- S_DATA[AntiCSpam] ? ("\t\t") :("\t"),
- Triadic(S_DATA[Ping] ),pStr,
- Triadic(S_DATA[RCONProt] ),
- S_DATA[RCONProt] ? ("\t\t") :("\t"),
- Triadic(S_DATA[TellPlayer]),
- S_DATA[TellPlayer] ? ("\t\t") :("\t"),
- Triadic(S_DATA[Chat] ),
- S_DATA[Chat] ? ("\t\t") :("\t"),
- Triadic(S_DATA[ReadPM] ),
- S_DATA[ReadPM] ? ("\t\t") :("\t"),
- Triadic(S_DATA[ReadCMD] ));
- printf("| AKA\t\t\t%s%sN/A\t|\n\
- | Show Function\t%s%sN/A\t|\n\
- | Anti Repeat\t\t%s%sN/A\t|\n\
- | Auto Login\t\t%s%sN/A\t|\n\
- | Announce Rank\t%s%sN/A\t|\n\
- | Anti Advertising\t%s%sN/A\t|",
- Triadic(S_DATA[AKA] ),
- S_DATA[AKA] ? ("\t\t") :("\t"),
- Triadic(S_DATA[ShowFunction]),
- S_DATA[ShowFunction] ? ("\t\t") :("\t"),
- Triadic(S_DATA[AntiRepeat] ),
- S_DATA[AntiRepeat] ? ("\t\t") :("\t"),
- Triadic(S_DATA[AutoLogin] ),
- S_DATA[AutoLogin] ? ("\t\t") :("\t"),
- Triadic(S_DATA[AnnRank] ),
- S_DATA[AnnRank] ? ("\t\t") :("\t"),
- Triadic(S_DATA[AntiAD] ),
- S_DATA[AntiAD] ? ("\t\t") :("\t"));
- print ("-------------------------------------------------");
- }
- _0CMD("info")
- {
- print("\n\n\n");
- print("Informations about 0Admin System V"#Version"");
- print("------------------------------------------------------\n");
- print(" - The idea of creating a new and optimised Admin System came\n\
- to me when i was seeing all these new and old fashioned admin\n\
- scripts with the oldest functions and less optimisation.\n\
- So i decided to start working on a new and unique admin script\n\
- that everyone will enjoy no mather what server you own,\n\
- Stunt, RP, Freeroam, Trucking, etc.\n");
- print(" - The system is provided with the fastest functions like sscanf\n\
- ZCMD - the almost fastest command processor and of course\n\
- using Regular Expresions to detect an advertising in chat.\n\n \
- - The system is mostly based on dialogs, for example Control Panel\n\
- which is available for Admins and VIP or regular members to control\n\
- and use them whenever they need with a vast ease.\n");
- print(" - The basic idea was to let all kind of people that don't know\n\
- the basics or it's new into this kind of game. That's the main\n\
- reason for using so many dialogs, because many don't really know\n\
- or forgot commands name, so I decidede to pack everything up\n\
- and insert it into a dialog.\n");
- print(" - The story ends here, main reason was told. ");
- print("------------------------------------------------------\n");
- }
- _0CMD("credits")
- {
- print("\n\n\n");
- print("Credits to those that helped building 0Admin System V"#Version"");
- print("-------------------------------------------------------------------\n");
- print(" > Helpers: " );
- print("\t sOnGoKu - Helped with the major tests and always reliable" );
- print("\t ScEpTyK - Testing." );
- print("\t Rock - Testing the Anti-Mute/Jail/Freeze." );
- print("\t XpLoD - Gave me some ideas for the script." );
- print("\t FarSe - Opened to me the way of SQLite and its magic.\n" );
- print(" > Scipts:" );
- print("\t Y_Less - For Y_Ini, sscanf2 and foreach also optimisation tips.");
- print("\t ZeeX - For ZCMD, the almost fastest command processor");
- print("\t Fro1sha - Regular expressions\n" );
- print("-------------------------------------------------------------------");
- print(" > And the creator is Zh3r0." );
- print("------" );
- }
- if(!strcmp(cmd, "!help", true))
- {
- print("\n\n\n");
- print("Help for 0Admin System V"#Version"");
- print("--------------------------------------------------------");
- print(" # Type !0cmds to use a command inside a server." );
- print(" # Type !0credits to see the credits." );
- print(" # Type !0info to see informations about this system." );
- print(" # Type !0FAQ for answers to your problems." );
- print(" # Type !0svstats to see the stats of the server." );
- print(" # Type !0features to see enabled/disabled features." );
- print("--------------------------------------------------------");
- print(" > Check often the forums for new updates!");
- print("------");
- }
- if(!strcmp(cmd, "reload0", true))
- {
- SendRconCommand("reloadfs 0Admin");
- print("Reloading 0Admin!");
- }
- return 1;
- }
- #if USE_RANKS == true
- CheckRank(killer, rank)
- {
- if(P_DATA[killer][Kills] == _Ranks[rank][iRank])
- return 1;
- return 0;
- }
- AnnounceRank(killer, rank)
- {
- new Str[256];
- format(Str, sizeof (Str), "RANK UP: "GREY" You are now a member with Rank "ORAN"%d"GREY" |"ORAN" %s", rank, RankName(rank));
- SendClientMessage(killer, Color:ORAN, Str);
- SetPVarInt(killer, "0_Rank", rank);
- P_DATA[killer][Rank] = rank;
- if(S_DATA[AnnRank])
- {
- 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));
- foreach(Player, k){
- if(k != killer){
- SendClientMessage(k, Color:GREY, Str);
- }
- }
- }
- #if UPDATE_TOP_ALWAYS == true
- new
- Query[256],
- DBResult: R1;
- format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(killer));
- R1 = DB::Query(_DB, Query);
- if(R1)
- {
- if(DB::Valid(R1))
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "UPDATE `Top` SET `Rank` = '%d' WHERE `Name` = '%s'", rank, Name(killer));
- DB::Query(_DB, Query);
- }
- else
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `Rank`) VALUES('%s','%d')", Name(killer), rank);
- DB::Query(_DB, Query);
- }
- }
- #endif
- }
- #endif
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(killerid != INVALID_PLAYER_ID)
- {
- P_DATA[killerid][Kills]++;
- SetPVarInt(killerid, "0_Kills", GetPVarInt(killerid, "0_Kills") + 1);
- }
- P_DATA[playerid][Deaths]++;
- SetPVarInt(playerid, "0_Deaths",GetPVarInt(playerid, "0_Deaths") + 1);
- #if UPDATE_TOP_ALWAYS == true
- new
- Query[256],
- DBResult:R1;
- format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(playerid));
- R1 = DB::Query(_DB, Query);
- if(R1)
- {
- if(DB::Valid(R1))
- {
- DB::Free(R1);
- 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));
- DB::Query(_DB, Query);
- }
- else
- {
- DB::Free(R1);
- 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]));
- DB::Query(_DB, Query);
- }
- }
- if(killerid != (0xFFFF))
- {
- format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(killerid));
- R1 = DB::Query(_DB, Query);
- if(R1)
- {
- 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));
- 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]));
- DB::Free(R1);
- DB::Query(_DB, Query);
- }
- }
- #endif
- #if USE_RANKS == true
- if (CheckRank(killerid, 1))AnnounceRank(killerid, 1);
- else if(CheckRank(killerid, 2))AnnounceRank(killerid, 2);
- else if(CheckRank(killerid, 3))AnnounceRank(killerid, 3);
- else if(CheckRank(killerid, 4))AnnounceRank(killerid, 4);
- else if(CheckRank(killerid, 5))AnnounceRank(killerid, 5);
- else if(CheckRank(killerid, 6))AnnounceRank(killerid, 6);
- else if(CheckRank(killerid, 7))AnnounceRank(killerid, 7);
- else if(CheckRank(killerid, 8))AnnounceRank(killerid, 8);
- #endif
- return 1;
- }
- CMD:gmx(PARAMS)
- {
- SendRconCommand("gmx");
- return 1;
- }
- Detour<acmds,0cmds>
- Detour<ahelp,0cmds>
- Detour<admincmds,0cmds>
- Detour<ac,0cmds>
- CMD:arules(PARAMS)
- {
- LoginCheck(playerid);
- new String[2_000];
- switch(P_DATA[playerid][Level])
- {
- case 0:
- {
- strcat(String, ""W"["BLUE"0"W"] "BLUE"Member"W"\n\
- - Don't do anything stupid.\n\
- - You are just a player under rules!", 2_000);
- }
- case 1:
- {
- strcat(String, ""W"["BLUE"1"W"] "BLUE"Helper"W"\n\
- - Make sure players have what they need, like time, weather.\n\
- - Make sure when a player asks for help to give them the appropriate response.\n\
- - You are just a helper! Don't act cocky! Act like a helper!\n\
- - Dealing with players that surpass your abillities? Ask for help to the superiors!\n\n", 2_000);
- }
- case 2:
- {
- strcat(String, "["BLUE"2"W"] "BLUE"Mini Moderator"W"\n\
- - You have somewhat control over the players. You can mute/freeze them.\n\
- - If you notice a hacker or someone with illegal weapons, use "BLUE"/disarm"W".\n\
- - When a players asks for something, do it, like change skin, heal car etc..\n\
- - Use "BLUE"/bankrupt"W" to remove player's money if you they hack.\n\n", 2_000);
- }
- case 3:
- {
- strcat(String, "["BLUE"3"W"] "BLUE"Moderator"W"\n\
- - You are a full moderator, your job is to take care of the server while superiors are offline\n\
- - Make sure nobody spams the chat, use "BLUE"/clearchat"W" to clear the chat just in case.\n\
- - You can manipulate player's account, like set his time,skin,cookies,money,score,kills etc..\n\
- - Your abilities are high enough! Use with caution!\n\n", 2_000);
- }
- case 4:
- {
- strcat(String, "["BLUE"4"W"] "BLUE"Administrator"W"\n\
- - No proper rules for you.\n\
- - Do whatever you think it's right.\n\
- - Lower level member may not judge your actions.\n\n", 2_000);
- }
- case 5:
- {
- strcat(String, "["BLUE"5"W"] "BLUE"Owner"W"\n\
- - Lower level member may not judge your actions.\n\
- - Do whatever you want.", 2_000);
- }
- }
- Show(String);
- return 1;
- }
- CMD:0cmds(PARAMS)
- {
- LoginCheck(playerid);
- switch(P_DATA[playerid][Level])
- {
- case 0:
- {
- Show(""BLUE"Normal Member"W"\n\
- /register /login /stats /pm /admins /vips /top /time changepass(/cpass)\n\
- /cookies /buycookies /eatcookie /buycookiesjar /giftcookie /cookieshelp\n\n\
- "BLUE"Remember to read the rules of your level!!");
- }
- case 1:
- {
- Show(""BLUE"Helper"W"\n\
- /goto /gotopos /getip /settime /spawn /acar /jailed /frozen\n\
- /muted /car /acar /accp /unblock /cargod /god\n\n\
- "BLUE"Remember to read the rules at "BLUE"/arules!");
- }
- case 2:
- {
- Show(""BLUE"Mini Moderator"W"\n\
- /disarm /bankrupt /tplayer /eject /heal /spec /show /setskin\n\
- /[un]freeze /[un]mute /aweapons /healcar /setvhealth /carcolor\n\
- /ann /ann2 /aka\n\
- "BLUE"Remember to read the rules at "BLUE"/arules!");
- }
- case 3:
- {
- Show(""BLUE"Moderator"W"\n\
- /giveweapon /warn /healall /heal /aweapons /givecar /write /destroyv\n\
- /[un]jail /slap /clearchat /akill /explode /setalltime /setallweather\n\
- /set(cookies|health|armour|score|cash|skin|time|weather|world|interior|drunk|respect|wanted)\n\n\
- "BLUE"Remember to read the rules at "BLUE"/arules!");
- }
- case 4:
- {
- new Str[600];
- strcat(Str, \
- ""BLUE"Administrator"W"\n\
- /setall(health|armour|score|cash|skin|world|interior|drunk|cookies|respect|wanted)\n\
- /giveall(h(ealth)|armour|score|cash|cookies|wanted|weapon)\n\
- /kick /wcheck /setdeaths /setkills /2012 /resetallrespect /killall\n", 600);
- strcat(Str, \
- "/[un]muteall /[un]freezeall /spawnall /2012all /chat /slapall\n\
- /disarmall /explodeall\n\n\
- "BLUE"Remember to read the rules at "BLUE"/arules!", 600);
- Show(Str);
- }
- case 5:
- {
- Show(""BLUE"Owner"W"\n\
- /setlevel /settemplevel /ban /unban /acp /respawncars /removeacc\n\
- /setonline /setstat /fake /fakechat /fakecmd /fakecon /fakedisc /fakedeath\n\
- /kickall /banall\n\n\
- "BLUE"Remember to read the rules at "BLUE"/arules!");
- }
- }
- return 1;
- }
- CMD:announce2(PARAMS)
- {
- SendClientMessage(playerid, Color:GREY, "Use "BLUE"/ann2"GREY" instead!");
- return 1;
- }
- CMD:announce(PARAMS)
- {
- SendClientMessage(playerid, Color:GREY, "Use "BLUE"/ann"GREY" instead!");
- return 1;
- }
- CMD:changepass(PARAMS)
- {
- SendClientMessage(playerid, Color:GREY, "Use "BLUE"/cpass"GREY" instead!");
- return 1;
- }
- CMD:cpass(PARAMS)
- {
- LoginCheck(playerid);
- new OldPass[MAX_PASS_LEN], NewPass[MAX_PASS_LEN];
- if(sscanf(params, "s[20]s[20]", OldPass, NewPass)) return SendUsage(playerid, "/cpass "GREY"<old pass> <new pass>", "Will change your password.");
- else
- {
- if(strlen(NewPass) < MIN_PASS_LEN || strlen(NewPass) > MAX_PASS_LEN)
- return SendError(playerid, "The new password has an invalid length!");
- new Query[300], DBResult:Result, Buf[129];
- WP_Hash(Buf, 129, OldPass);
- format(Query, 300, "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s' AND `Password` = '%s'", Name(playerid), Buf);
- Result = DB::Query(_DB, Query);
- if(Result)
- {
- if(DB::Valid(Result))
- {
- DB::Free(Result);
- WP_Hash(Buf, 129, NewPass);
- format(Query, 300, "UPDATE `Accounts` SET `Password` = '%s', `RPassword` = '%s' WHERE `Name` = '%s'", Buf, OldPass, Name(playerid));
- DB::Query(_DB, Query);
- FormatMSG(playerid, Color:GREY, "Password changed! New password is: "BLUE"%s", NewPass);
- SendAdminCMD(playerid, "PLayer "ORAN"%s[%i]"GREY" changed his password!", Name(playerid), playerid);
- }
- else
- {
- DB::Free(Result);
- return SendError(playerid, "Old Password doesn't match the current password!");
- }
- }
- }
- return 1;
- }
- CMD:ann2(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new Announce[129], Time, Style;
- if(sscanf(params, "s[129]dd", Announce, Time, Style)) return SendUsage(playerid, "/ann2 "GREY"<text> <time> <style>", "Send a text to the server with style and time. (Time is in ms)");
- else
- {
- if(Style > 6 || Style < 0) return SendError(playerid, "Style: 0-6");
- GameTextForAll(Announce, Time, Style );
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" used command "ORAN"/ann2", Name(playerid), playerid);
- SendClientMessage(playerid, Color:GREY, "Announce sent!");
- }
- return 1;
- }
- CMD:ann(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new Announce[129];
- if(sscanf(params, "s[129]", Announce)) return SendUsage(playerid, "/ann "GREY"<text>", "Will show a text in the middle of the screen!");
- else
- {
- GameTextForAll(Announce, 7000, 3 );
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" used command "ORAN"/ann", Name(playerid), playerid);
- SendClientMessage(playerid, Color:GREY, "Announce sent!");
- }
- return 1;
- }
- CMD:aka(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new Player;
- if(sscanf(params, "u", Player)) return SendUsage(playerid, "/aka "GREY"<id>", "Will show the aka list of a player");
- else
- {
- if(Player == 0xFFFF)
- return SendError(playerid, "Player not connected!");
- INI_ParseFile(AKA_FILE, "LoadAKA", .bExtra = true, .extra = Player);
- if(strlen(GPVSEx(Player, "pAKA")) > 3)
- {
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" is viewing the aka list of "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
- FormatMSG(playerid, Color:GREY, "Player "ORAN"%s"GREY" has used the following names: "ORAN"%s"GREY".", Name(Player), GPVSEx(Player, "pAKA"));
- }
- else
- {
- SendError(playerid, "An error has occured");
- }
- }
- return 1;
- }
- CMD:unblock(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- new Player;
- if(sscanf(params, "u", Player)) return SendUsage(playerid, "/unblock "GREY"<id>", "Will unstuck a player");
- else
- {
- TogglePlayerControllable(Player, true);
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unblocked player "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
- FormatMSG(playerid, Color:GREY, "You unstucked player "ORAN"%s[%i]", Name(Player), Player);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" unblocked you", Name(playerid), playerid);
- }
- return 1;
- }
- CMD:time(PARAMS)
- {
- LoginCheck(playerid);
- new T[2], Str[10];
- gettime(T[0], T[1]);
- format(Str, 10, "~r~%d~w~:~r~%d", T[0], T[1]);
- GameTextForPlayer(playerid, Str, 3000, 1);
- return 1;
- }
- CMD:cargod(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- switch(P_DATA[playerid][CarGod])
- {
- case false:
- {
- P_DATA[playerid][CarGod] = 1;
- SetPVarInt(playerid, "0_CarGod", 1);
- SendClientMessage(playerid, Color:GREY, "Vehicle God has been activated!");
- }
- case true:
- {
- P_DATA[playerid][CarGod] = 0;
- SetPVarInt(playerid, "0_CarGod", 0);
- SendClientMessage(playerid, Color:GREY, "Vehicle God has been deactivated!");
- }
- }
- return 1;
- }
- CMD:god(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- switch(P_DATA[playerid][God])
- {
- case false:
- {
- P_DATA[playerid][God] = 1;
- SetPVarInt(playerid, "0_God", 1);
- SendClientMessage(playerid, Color:GREY, "Godlike has been activated!");
- }
- case true:
- {
- P_DATA[playerid][God] = 0;
- SetPVarInt(playerid, "0_God", 0);
- SendClientMessage(playerid, Color:GREY, "Godlike has been deactivated!");
- }
- }
- return 1;
- }
- CMD:pcp(PARAMS)
- {
- LoginCheck(playerid);
- SPD(playerid, Dialog:PCP, LIST, "Player control panel", PcPanel(playerid), "ON/Select", "OFF/Exit");
- return 1;
- }
- CMD:record(playerid)
- {
- LoginCheck(playerid);
- new
- Str[1024];
- format(Str, sizeof (Str), ""W"Record details:\n\n\
- "GREE"NEW RECORD:\n\
- "GREY"Broken by: "BLUE"%s\n\
- "GREY"Date: "BLUE"%d/%d/%d\n\
- "GREY"Time: "BLUE"%d:%d:%d\n\
- "GREY"Record: "BLUE"%d "GREY"players",
- S_DATA[RecordBy],
- S_DATA[sD], S_DATA[sM], S_DATA[sY],
- S_DATA[sH], S_DATA[sMi], S_DATA[sS],
- S_DATA[sRecord]);
- new
- Field[4][64],
- DBResult: R1;
- R1 = DB::Query(_DB, "SELECT `ByOLD`, `DateOLD`, `TimeOLD` FROM `Record`;");
- if(DB::Valid(R1))
- {
- DB::GetField(R1, "ByOLD", Field[0], 64);
- DB::GetField(R1, "DateOLD", Field[1], 64);
- DB::GetField(R1, "TimeOLD", Field[2], 64);
- DB::Free(R1);
- }
- else
- {
- DB::Free(R1);
- Field[0] = "Nobody"; Field[1] = "Never"; Field[2] = "Never";
- }
- format(Str, sizeof (Str), "%s\n\n{FF0000}OLD RECORD:\n\
- "GREY"Broken by: "ORAN"%s\n\
- "GREY"Date: "ORAN"%s\n\
- "GREY"Time: "ORAN"%s\n\
- "GREY"Record: "ORAN"%d "GREY"players",
- Str,
- Field[0], Field[1], Field[2], S_DATA[sRecord] - 1);
- SPD(playerid, Dialog:Empty, BOX, ""W"Players record!", Str, "Close", "");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- if(IsPlayerNPC(playerid)) return 1;
- new DBResult:bResult, bQuery[129];
- format(bQuery, 129, "SELECT `IP`, `Reason`, `Admin`, `BanDate` FROM `Banlist` WHERE `Name` = '%s';", Name(playerid));
- bResult = DB::Query(_DB, bQuery);
- new bField[4][129], Field[50];
- if(bResult)
- {
- if(DB::Valid(bResult))
- {
- DB::GetField(bResult, "Reason", bField[0], 129);
- DB::GetField(bResult, "Admin", bField[1], 129);
- DB::GetField(bResult, "BanDate", bField[2], 129);
- DB::Free(bResult);
- for (new i = 0; i < 10; i++)SendClientMessage(playerid, -1, " ");
- SendClientMessage(playerid, Color:ORAN, "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *");
- SendClientMessage(playerid, Color:ORAN, "BANNED:"W" Sorry to inform you, but this account is "ORAN"banned"W" from this server!");
- FormatMSG(playerid, ~1, "You were banned by Administrator "ORAN"%s"W" on "ORAN"%s"W" with the following reason:", bField[1], bField[2]);
- SendClientMessage(playerid, Color:ORAN, bField[0]);
- KickEx(playerid, "System", "Banned Account", true);
- return 0;
- }
- else
- {
- DB::Free(bResult);
- new DBResult:bResult2;
- format(bQuery, 129, "SELECT `IP`, `Name`, `Reason`, `Admin`, `BanDate` FROM `Banlist` WHERE `IP` = '%s';", GetPlayerIPEx(playerid));
- bResult2 = DB::Query(_DB, bQuery);
- if(bResult2)
- {
- if(DB::Valid(bResult2))
- {
- loop(i, 4){ bField[_i][0] = '\0'; }
- DB::GetField(bResult2, "IP", bField[3], 129);
- if(!strcmp(GetPlayerIPEx(playerid), bField[3]))
- {
- DB::GetField(bResult2, "Reason", bField[0], 129);
- DB::GetField(bResult2, "Admin", bField[1], 129);
- DB::GetField(bResult2, "BanDate", bField[2], 129);
- DB::Free(bResult2);
- loop(o, 10){ SendClientMessage(playerid, -1, " "); }
- SendClientMessage(playerid, Color:ORAN, "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *");
- SendClientMessage(playerid, Color:ORAN, "BANNED:"W" Sorry to inform you, but this account is "ORAN"banned"W" from this server!");
- FormatMSG(playerid, -1, "You were banned by Administrator "ORAN"%s"W" on "ORAN"%s"W" with the following reason:", bField[1], bField[2]);
- SendClientMessage(playerid, Color:ORAN, bField[0]);
- KickEx(playerid, "System", "Banned Account", true);
- return 0;
- }
- }else DB::Free(bResult2);
- }
- }
- }
- S_DATA[sPlayers] ++;
- if(S_DATA[sRecord] < S_DATA[sPlayers])
- {
- new
- Date[6],
- Query[256];
- getdate(Date[2], Date[1], Date[0]);
- gettime(Date[3], Date[4], Date[5]);
- if(!strlen(S_DATA[RecordBy])) format(S_DATA[RecordBy], MAX_PLAYER_NAME, "Nobody");
- 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'",\
- 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]);
- DB::Query(_DB, Query);
- getdate(S_DATA[sY], S_DATA[sM], S_DATA[sD]);
- gettime(S_DATA[sH], S_DATA[sMi], S_DATA[sS]);
- SendClientMessage(playerid, -1, " ");
- SendClientMessage(playerid, -1, " ");
- SendClientMessage(playerid, -1, " ");
- SendClientMessage(playerid, Color:BLUE, "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ");
- 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]);
- SendClientMessage(playerid, Color:GREY, "Use "BLUE"/record"GREY" to check more details!");
- SendClientMessage(playerid, Color:BLUE, "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ");
- SendClientMessage(playerid, -1, " ");
- SendClientMessage(playerid, -1, " ");
- foreach(Player, i)
- {
- if(i != playerid)
- {
- 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]);
- SendClientMessage(i, Color:GREY, "Use "BLUE"/record"GREY" to check more details!");
- }
- }
- format(S_DATA[RecordBy], MAX_PLAYER_NAME, "%s", Name(playerid));
- S_DATA[sRecord] = S_DATA[sPlayers];
- }
- format(PlayerIP[playerid], 50, "%s", GetPlayerIPEx(playerid));
- SetPVarInt(playerid, "FirstConnection", 1);
- new String[256];
- if(!S_DATA[AKA])
- {
- format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined the server!", Name(playerid), playerid);
- SendClientMessageToAll(Color:ORAN, String);
- }
- else
- {
- INI_ParseFile(AKA_FILE, "LoadAKA", .bExtra = true, .extra = playerid);
- if(strlen(GPVSEx(playerid, "pAKA")) < 3)
- {
- format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined the server!", Name(playerid), playerid);
- }
- else if(!strcmp(GPVSEx(playerid, "pAKA"), Name(playerid), true))
- {
- format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined the server!", Name(playerid), playerid);
- }
- else format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined the server!"GREY"[AKA:"W" %s"GREY"]",Name(playerid), playerid, GPVSEx(playerid, "pAKA"));
- foreach(Player, i)
- {
- if(P_DATA[i][Level] > 2)
- {
- if(i != playerid)SendClientMessage(i, Color:ORAN, String);
- }
- else
- {
- format(String, sizeof (String),"%s["W"%i"ORAN"]"W" Has joined the server!", Name(playerid), playerid);
- SendClientMessage(i, Color:ORAN, String);
- }
- }
- new pIP[30];
- GetPlayerIp(playerid, pIP, 30);
- //INI_ParseFile(AKA_FILE, "LoadAKA", .bExtra = true, .extra = playerid);
- if(!strlen(GPVSEx(playerid, "pAKA")))
- {
- new INI: pAka = INI_Open(AKA_FILE);
- INI_WriteString(pAka, pIP, Name(playerid));
- INI_Close(pAka);
- }
- else
- {
- if(strfind(GPVSEx(playerid, "pAKA"), Name(playerid), true) == -1)
- {
- new Str[256];
- format (Str, 256, "%s,%s", GPVSEx(playerid, "pAKA"), Name(playerid));
- new INI: pAka = INI_Open(AKA_FILE);
- INI_WriteString(pAka, pIP, Str);
- INI_Close(pAka);
- }
- }
- }
- P_DATA[playerid][ConnTime] = gettime();
- P_DATA[playerid][LogFail] = MAX_PASS_FAIL;
- P_DATA[playerid][Spec_ID] = 0xFFFF;
- P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_NONE;
- ClearVars(playerid);
- #if SAVE_FREEZE == true
- new Query[256];
- format(Query, sizeof (Query), "SELECT `Key`, `Frozen`, `RealName` FROM `Frozen` WHERE `IP` = '%s';", GetPlayerIPEx(playerid));
- new DBResult:Result1 = DB::Query(_DB, Query);
- if(Result1)
- {
- if(DB::Valid(Result1))
- {
- new xField[64];
- DB::GetField(Result1, "RealName", xField, 64);
- SetPVarString(playerid, "FreezeName", xField);
- DB::GetField(Result1, "Frozen", xField, 64);
- P_DATA[playerid][Frozen] = strval(xField);
- DB::Free(Result1);
- }
- else
- {
- DB::Free(Result1);
- format(Query, 256, "SELECT `IP`, `Frozen`, `RealName` FROM `Frozen` WHERE `RealName` = '%s';", Name(playerid));
- new DBResult:Result2 = DB::Query(_DB, Query);
- if(Result2)
- {
- if(DB::Valid(Result2))
- {
- DB::GetField(Result2, "IP", Field, sizeof (Field));
- SetPVarString(playerid, "FalseIP", Field);
- if(strcmp(GetPlayerIPEx(playerid), Field))
- {
- DB::GetField(Result2, "Frozen", Field, sizeof (Field));
- P_DATA[playerid][Frozen] = strval(Field);
- DB::GetField(Result2, "RealName", Field, sizeof (Field));
- SetPVarString(playerid, "FreezeName", Field);
- DB::GetField(Result2, "IP", Field, sizeof (Field));
- SetPVarString(playerid, "FalseIP", Field);
- }
- DB::Free(Result2);
- }
- else
- {
- DB::Free(Result2);
- SetPVarString(playerid, "FreezeName", "5;6:2:6:*:$:^");
- }
- }
- }
- }
- if(P_DATA[playerid][Frozen])
- {
- if(strcmp(GPVSEx(playerid, "FreezeName"), Name(playerid), false))
- {
- SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- 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"));
- SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- P_DATA[playerid][Warns] += 2;
- SetPlayerName(playerid, GPVSEx(playerid, "FreezeName"));
- }
- else if(strcmp(GPVSEx(playerid, "FalseIP"), GetPlayerIPEx(playerid)))
- {
- SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- 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"));
- SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- P_DATA[playerid][Warns] += 2;
- SetPlayerName(playerid, GPVSEx(playerid, "FreezeName"));
- }
- format(Query, 256, "UPDATE `Frozen` SET `IP` = '%s', `Frozen` = '1', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "FreezeName"));
- DB::Query(_DB, Query);
- if(P_DATA[playerid][Warns] >= MAX_P_WARNS)
- {
- SendClientMessage(playerid, Color:GREY, "You have been kicked from the server for exceeding warnings!");
- KickEx(playerid, "System", "Exceeding Warnings");
- return 0;
- }
- }
- #endif
- #if SAVE_MUTE == true
- new Query2[256],
- DBResult:Result3;
- format(Query2, sizeof (Query2), "SELECT `Muted`, `Time`, `RealName` FROM `Muted` WHERE `IP` = '%s';", GetPlayerIPEx(playerid));
- Result3 = DB::Query(_DB, Query2);
- if(Result3)
- {
- if(DB::Valid(Result3))
- {
- DB::GetField(Result3, "Muted", Field, sizeof (Field));
- P_DATA[playerid][Muted] = strval(Field);
- DB::GetField(Result3, "Time", Field, sizeof (Field));
- P_DATA[playerid][MutedTime] = strval(Field);
- DB::GetField(Result3, "RealName", Field, sizeof (Field));
- SetPVarString(playerid, "MuteName", Field);
- DB::Free(Result3);
- GameTextForPlayer(playerid, "~r~You have been cought freeze evading the system!~n~You have been punished!", 7600, 3);
- }
- else
- {
- DB::Free(Result3);
- format(Query2, sizeof(Query2), "SELECT `IP`, `Muted`, `RealName`, `Time` FROM `Muted` WHERE `RealName` = '%s';", Name(playerid));
- new DBResult:Result4 = DB::Query(_DB, Query2);
- if(Result4)
- {
- if(DB::Valid(Result4))
- {
- DB::GetField(Result4, "IP", Field, sizeof (Field));
- if(strcmp(GetPlayerIPEx(playerid), Field))
- {
- DB::GetField(Result4, "Muted", Field, sizeof (Field));
- P_DATA[playerid][Muted] = strval(Field);
- DB::GetField(Result4, "Time", Field, sizeof (Field));
- P_DATA[playerid][MutedTime] = strval(Field);
- DB::GetField(Result4, "RealName", Field, sizeof (Field));
- SetPVarString(playerid, "MuteName", Field);
- DB::GetField(Result4, "IP", Field, sizeof (Field));
- SetPVarString(playerid, "FalseIP", Field);
- GameTextForPlayer(playerid, "~r~You have been cought mute evading the system!~n~You have been punished!", 7600, 3);
- }
- DB::Free(Result4);
- }
- else
- {
- DB::Free(Result4);
- SetPVarString(playerid, "MuteName", "5;6:2:6:*:$:^");
- SetPVarString(playerid, "FalseIP", "5;6:2:6:*:$:^");
- }
- }
- }
- }
- if(P_DATA[playerid][MutedTime] > 0)
- {
- if(strcmp(GPVSEx(playerid, "MuteName"), Name(playerid), false))
- {
- SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- 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"));
- SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- SetPlayerName(playerid, GPVSEx(playerid, "MuteName"));
- P_DATA[playerid][MutedTime] += (EXTRA_MINUTES);
- }
- else if(strcmp(GPVSEx(playerid, "FalseIP"), GetPlayerIPEx(playerid)))
- {
- SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- 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"));
- SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- SetPlayerName(playerid, GPVSEx(playerid, "MuteName"));
- P_DATA[playerid][MutedTime] += (EXTRA_MINUTES);
- }
- P_DATA[playerid][Muted] = 1;
- FormatMSG(playerid, Color:ORAN, "SERVER:"W" You are still muted! "ORAN"["GREY"Aprox. "W"%d minutes"ORAN"]", P_DATA[playerid][MutedTime]);
- MuteTimer[playerid] = SetTimerEx("UnMutePlayer", 60_000, true, "i", playerid);
- new pQ[129];
- format(pQ, sizeof (pQ), "UPDATE `Muted` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "MuteName"));
- DB::Query(_DB, pQ);
- }
- else if(P_DATA[playerid][Muted] && !P_DATA[playerid][MutedTime])
- {
- if(strcmp(GPVSEx(playerid, "MuteName"), Name(playerid), false))
- {
- SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- 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"));
- SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- SetPlayerName(playerid, GPVSEx(playerid, "MuteName"));
- P_DATA[playerid][Warns] += 2;
- new pQ[129];
- format(pQ, sizeof (pQ), "UPDATE `Muted` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "MuteName"));
- DB::Query(_DB, pQ);
- }
- else if(strcmp(GPVSEx(playerid, "FalseIP"), GetPlayerIPEx(playerid)))
- {
- SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- 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"));
- SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- SetPlayerName(playerid, GPVSEx(playerid, "MuteName"));
- P_DATA[playerid][Warns] += 2;
- format(Query2, sizeof (Query2), "UPDATE `Muted` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "MuteName"));
- DB::Query(_DB, Query2);
- }
- SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You are still muted! "ORAN"["GREY"Mute time: "W"Forever"ORAN"]");
- }
- if(P_DATA[playerid][Warns] == MAX_P_WARNS)
- {
- SendClientMessage(playerid, Color:GREY, "You have been kicked from the server for exceeding warnings!");
- KickEx(playerid, "System", "Exceeding Warnings");
- return 0;
- }
- #endif
- new pQuery[512], DBResult:pResult;
- format(pQuery, 512, "SELECT `Autologin` FROM `Accounts` WHERE `Name` = '%s';", Name(playerid));
- pResult = DB::Query(_DB, pQuery);
- new pField[60];
- if(pResult)
- {
- if(DB::Valid(pResult))
- {
- DB::GetField(pResult, "Autologin", pField, sizeof(pField));
- P_DATA[playerid][pAuto] = strval(pField);
- DB::Free(pResult);
- if(P_DATA[playerid][pAuto])
- {
- new DBResult:pResult2;
- format(pQuery, 512, "SELECT `IP`, `RPassword` FROM `Accounts` WHERE `Name` = '%s';", Name(playerid));
- pResult2 = DB::Query(_DB, pQuery);
- if(pResult2)
- {
- if(DB::Valid(pResult2))
- {
- DB::GetField(pResult2, "IP", pField, sizeof(pField));
- if(!strcmp(pField, GetPlayerIPEx(playerid), false))
- {
- DB::GetField(pResult2, "RPassword", pField, sizeof(pField));
- LoginPlayer(playerid, pField, .pAutoLogin = true);
- }
- else SendLogin(playerid);
- }
- else SendLogin(playerid);
- }
- } else SendLogin(playerid);
- }
- else
- {
- new zStr[256];
- format(zStr, sizeof (zStr), ""W"Welcome "GREE"%s "W"on "GREE"%s."W"\n\nEste server requiere que te registres\nPorfavor, escribe la contraseña que desees", Name(playerid), GetServerHostName());
- ShowPlayerDialog(playerid, Dialog:Register, DIALOG_STYLE_INPUT, ""W"Registra una cuenta", zStr, "Registrar", "Salir");
- }
- }
- return 1;
- }
- SendLogin(playerid)
- {
- new zStr[150];
- format(zStr, sizeof (zStr), ""W"Bienvenido "GREE"%s"W"\n\nPor favor inicia tu sesión:", Name(playerid));
- #if SECURITY_QUESTION == true
- SPD(playerid, Dialog:Login2, INPUT, ""W"Bienvenido", zStr, "Login", "Olvidé la contraseña");
- #else
- SPD(playerid, Dialog:Login2, INPUT, ""W"Bienvenido", zStr, "Login", "Salir");
- #endif
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- S_DATA[sPlayers] --;
- DeletePlayer3DTextLabel(playerid, ZaAdminCar[playerid]);
- if(P_DATA[playerid][tLevel])
- {
- P_DATA[playerid][Level] = 0;
- }
- DestroyVehicle(P_DATA[playerid][aCar]);
- new zStr[256];
- switch(reason)
- {
- case 0: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" ha salido del servidor "ORAN"[CRASH]", Name(playerid), playerid);
- case 1: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" ha salido del servidor "ORAN"[DESCONECTAD]", Name(playerid), playerid);
- case 2: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" ha salido del servidor "ORAN"[KICK"W"/"ORAN"BAN]", Name(playerid), playerid);
- }
- SendClientMessageToAll(Color:ORAN, zStr);
- if(P_DATA[playerid][Logged]) { SavePlayerData(playerid); }
- new Query[129];
- #if !SAVE_JAIL && !SAVE_MUTE
- #pragma unused Query
- #endif
- #if SAVE_JAIL == true
- if(P_DATA[playerid][JailTime] > 0 )
- {
- 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]);
- DB::Query(_DB, Query);
- }
- else if(!P_DATA[playerid][JailTime] && P_DATA[playerid][Jailed])
- {
- format(Query, 129, "SELECT `Key` FROM `Jailed` WHERE `IP` = '%s';", PlayerIP[playerid]);
- new DBResult:Result = DB::Query(_DB, Query);
- if(Result)
- {
- if(!DB::Valid(Result))
- {
- DB::Free(Result);
- format(Query, 129, "DELETE FROM `Jailed` WHERE `IP` = '%s'", PlayerIP[playerid]);
- DB::Query(_DB, Query);
- }
- }
- }
- #endif
- #if SAVE_MUTE == true
- if(P_DATA[playerid][MutedTime] > 0)
- {
- 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]);
- DB::Query(_DB, Query);
- }
- else if(!P_DATA[playerid][MutedTime] && P_DATA[playerid][Muted])
- {
- format(Query, 129, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", PlayerIP[playerid]);
- new DBResult:Result = DB::Query(_DB, Query);
- if(Result)
- {
- if(!DB::Valid(Result))
- {
- DB::Free(Result);
- format(Query, 129, "DELETE FROM `Muted` WHERE `IP` = '%s'", PlayerIP[playerid]);
- DB::Query(_DB, Query);
- }
- }
- }
- #endif
- for(new i = 0; i < 5; i++)
- {
- if(IsPlayerAttachedObjectSlotUsed(playerid, i))
- {
- RemovePlayerAttachedObject(playerid, i);
- }
- }
- KillTimer(MuteTimer[playerid] );
- KillTimer(JailTimer[playerid] );
- KillTimer(P_DATA[playerid][NosTimer] );
- P_DATA[playerid][LogFail] = 0;
- ClearVars(playerid);
- return 1;
- }
- public OnPlayerCommandPerformed(playerid, cmdtext[], success)
- {
- if(success)
- {
- P_DATA[playerid][Cmds]++;
- SetPVarInt(playerid, "0_Commands", P_DATA[playerid][Cmds]);
- if(S_DATA[ReadCMD])
- {
- SendAdminCMD(playerid, ""GREY"[CMD] %s[%i] "W"used command{FF0000} %s", Name(playerid), playerid, cmdtext);
- printf(#[%s] %s - %s, zDate(), Name(playerid), cmdtext);
- }
- }
- else
- {
- P_DATA[playerid][fCmds]++;
- SetPVarInt(playerid, "0_Fail_Commands", P_DATA[playerid][fCmds]) ;
- return 0;
- }
- return 1;
- }
- public OnPlayerCommandReceived(playerid, cmdtext[])
- {
- P_DATA[playerid][cSpam]++;
- if(S_DATA[AntiCSpam] && (!IsPlayerAdmin(playerid) || P_DATA[playerid][Level] != 5))
- {
- if(P_DATA[playerid][cSpam] > MAX_CMD_SPAM && !IsPlayerAdmin(playerid))
- {
- BanEx2(playerid, .zReason = "Extreme command spam");
- return 0;
- }
- else if(P_DATA[playerid][cSpam] > MIN_CMD_SPAM)
- {
- KickEx(playerid, .zReason = "Command spam");
- return 0;
- }
- }
- if(P_DATA[playerid][Jailed] && !P_DATA[playerid][JailTime] && P_DATA[playerid][Level] != 5 && !IsPlayerAdmin(playerid))
- {
- SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You are not allowed to use any commands while jailed! "GREY"[Jail Time: "ORAN"Forever"GREY"]");
- return 0;
- }
- else if(P_DATA[playerid][Jailed] && P_DATA[playerid][JailTime] > 0 && P_DATA[playerid][Level] != 5 && !IsPlayerAdmin(playerid))
- {
- 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]);
- return 0;
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(IsPlayerNPC(playerid)) return 1;
- #if SAVE_JAIL == true
- if(GetPVarType(playerid, "FirstConnection"))
- {
- if(P_DATA[playerid][Incred])
- {
- for(new i = 0; i < 5; i++)
- if(IsPlayerAttachedObjectSlotUsed(playerid, i))
- RemovePlayerAttachedObject(playerid, i);
- SetPlayerAttachedObject(playerid, 0, 18693, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
- SetPlayerAttachedObject(playerid, 1, 18693, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
- SetPlayerAttachedObject(playerid, 2, 18703, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
- SetPlayerAttachedObject(playerid, 3, 18703, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
- SetPlayerAttachedObject(playerid, 4, 18965, 2, 0.111052, 0.021643, -0.000846, 92.280899, 92.752510, 358.071044, 1.200000, 1.283168, 1.200000 );
- }
- if(P_DATA[playerid][VIPTag])
- {
- if(P_DATA[playerid][Tag3D])
- {
- Attach3DTextLabelToPlayer(P_DATA[playerid][Tag3D], playerid, 0.0, 0.0, 1.2);
- }
- }
- DeletePVar(playerid, "FirstConnection");
- new Query[256],
- DBResult:Result1;
- format(Query, sizeof (Query), "SELECT `Key`, `Jailed`, `Time`, `RealName` FROM `Jailed` WHERE `IP` = '%s';", GetPlayerIPEx(playerid));
- Result1 = DB::Query(_DB, Query);
- if(Result1)
- {
- if(DB::Valid(Result1))
- {
- new Field[30];
- DB::GetField(Result1, "Jailed", Field, sizeof (Field));
- P_DATA[playerid][Jailed] = strval(Field);
- DB::GetField(Result1, "Time", Field, sizeof (Field));
- P_DATA[playerid][JailTime] = strval(Field);
- DB::GetField(Result1, "RealName", Field, sizeof (Field));
- SetPVarString(playerid, "JailName", Field);
- DB::Free(Result1);
- }
- else
- {
- DB::Free(Result1);
- format(Query, 256, "SELECT `IP` FROM `Jailed` WHERE `RealName` = '%s'", Name(playerid));
- new DBResult:Result2 = DB::Query(_DB, Query);
- if(Result2)
- {
- if(DB::Valid(Result2))
- {
- new Field[64];
- DB::GetField(Result2, "IP", Field, sizeof (Field));
- if(strcmp(GetPlayerIPEx(playerid), Field))
- {
- format(Query, sizeof (Query), "SELECT `Key`, `Jailed`, `Time`, `RealName`, `IP` FROM `Jailed` WHERE `RealName` = '%s';", Name(playerid));
- Result1 = DB::Query(_DB, Query);
- DB::GetField(Result2, "Jailed", Field, sizeof (Field));
- P_DATA[playerid][Jailed] = strval(Field);
- DB::GetField(Result2, "Time", Field, sizeof (Field));
- P_DATA[playerid][JailTime] = strval(Field);
- DB::GetField(Result2, "RealName", Field, sizeof (Field));
- SetPVarString(playerid, "JailName", Field);
- DB::GetField(Result2, "IP", Field, sizeof (Field));
- SetPVarString(playerid, "JFalseIP", Field);
- DB::Free(Result2);
- }
- }
- else DB::Free(Result2);
- }
- }
- }
- if(P_DATA[playerid][JailTime] > 0)
- {
- if(strcmp(GPVSEx(playerid, "JailName"), Name(playerid), false))
- {
- SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- 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"));
- SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- SetPlayerName(playerid, GPVSEx(playerid, "JailName"));
- P_DATA[playerid][JailTime] += (EXTRA_MINUTES);
- }
- else if(strcmp(GPVSEx(playerid, "JFalseIP"), GetPlayerIPEx(playerid), false))
- {
- SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- 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"));
- SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- SetPlayerName(playerid, GPVSEx(playerid, "JailName"));
- P_DATA[playerid][JailTime] += (EXTRA_MINUTES);
- }
- P_DATA[playerid][Jailed] = 1;
- FormatMSG(playerid, Color:ORAN, "SERVER:"W" You are still jailed! "ORAN"["GREY"Jail time: "W"%d minutes"ORAN"]", P_DATA[playerid][JailTime]);
- SetTimerEx("JailPlayer", 1500, false, "i", playerid);
- new pQ[129];
- format(pQ, sizeof (pQ), "UPDATE `Jailed` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "JailName"));
- DB::Query(_DB, pQ);
- }
- else if(P_DATA[playerid][Jailed] && P_DATA[playerid][JailTime] == 0)
- {
- if(strcmp(GPVSEx(playerid, "JailName"), Name(playerid), false))
- {
- SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- 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"));
- SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- SetPlayerName(playerid, GPVSEx(playerid, "JailName"));
- P_DATA[playerid][Warns] += 2;
- }
- else if(strcmp(GPVSEx(playerid, "JFalseIP"), GetPlayerIPEx(playerid), false))
- {
- SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- 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"));
- SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- SetPlayerName(playerid, GPVSEx(playerid, "JailName"));
- P_DATA[playerid][Warns] += 2;
- }
- SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You are still jailed! "ORAN"["GREY"Jail time: "W"Forever"ORAN"]");
- SetTimerEx("JailPlayer", 1500, false, "i", playerid);
- new pQ[129];
- format(pQ, sizeof (pQ), "UPDATE `Jailed` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "JailName"));
- DB::Query(_DB, pQ);
- if(P_DATA[playerid][Warns] == MAX_P_WARNS)
- {
- SendClientMessage(playerid, Color:GREY, "You have been kicked from the server for exceeding warnings!");
- KickEx(playerid, "System", "Exceeding Warnings");
- return 0;
- }
- }
- }
- #endif
- if(P_DATA[playerid][Frozen])
- {
- Freeze(playerid);
- 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!)");
- }
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- if(! success)
- {
- new zStr[180];
- if(S_DATA[RCONProt])
- {
- S_DATA[RconFails] += 1;
- if(S_DATA[RconFails] >= MAX_RCON_ATTEMPTS)
- {
- BadRcon(ip, password);
- S_DATA[RconFails] = 0;
- }
- else
- {
- format(zStr, sizeof (zStr), "*** RCON: "W"RCON Protection turned off, someone tried to break the RCON. (IP: %s| RCON: %s)", ip, password);
- SendMessageToAdmins(Color:GREY, zStr, 4);
- SendMessageToAdmins(Color:GREY, "Enable "ORAN"Rcon Protection"GREY" from the Admin Control Panel!", 4);
- }
- }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;
- }
- else
- {
- foreach(Player, i)
- {
- new zIP[16];
- GetPlayerIp(i, zIP, 16);
- if(!strcmp (zIP, ip, true))
- {
- SendClientMessage(i, -1, ""BLUE"RCON:"W" Welcome, RCON Admin.");
- }
- }
- }
- return 1;
- }
- ShowTopStats(playerid, stats[], what[], limit = MAX_TOP_LIMIT)
- {
- new Speed = GetTickCount(),
- DialString[3_0_0_0],
- String[2][128],
- Query[2][256],
- DBResult:Result1;
- format(Query[0], 256, "SELECT `Name` FROM `Top` ORDER BY (`%s` * 1) DESC limit %d", stats, limit);
- Result1 = DB::Query(_DB, Query[0]);
- new cColor[12];
- if(!strcmp(stats, "Negative", false)) cColor = "{FF0000}";
- else if(!strcmp(stats, "Positive", false)) cColor = ""GREE"";
- else cColor = "{FFFFFF}";
- format(DialString, sizeof (DialString), "{FFFFFF}Server top "ORAN"%s\n\n\n"W"Pos. Player = %s", what, stats);
- for (new Qr; Qr < DB::Valid(Result1); Qr++)
- {
- db_get_field(Result1, 0, String[0], 128);
- format(Query[1], 256, "SELECT `%s` FROM `Top` WHERE `Name` = '%s'", stats, String[0]);
- new DBResult:Result2 = DB::Query(_DB, Query[1]);
- db_get_field(Result2, 0, String[1], 128);
- 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])));
- else format(DialString, sizeof (DialString), "%s\n"BLUE"%d."GREY" %s "W": %s%s", DialString, Qr + 1, String[0], cColor, FormatNumber(strval(String[1])));
- db_next_row(Result1);
- DB::Free(Result2);
- }
- DB::Free(Result1);
- format(DialString, sizeof (DialString), "%s\n\n"W"Top list generated in "ORAN"%d "W"ms.", DialString, GetTickCount() - Speed);
- SPD(playerid, Dialog:TOP, BOX, ""W"TOP PLAYERS", DialString, "Close", "");
- }
- CMD:top(playerid,params[])
- {
- LoginCheck(playerid);
- SPD(playerid, Dialog:TOP_SELECT, LIST, ""W"TOP PLAYERS", ""W"Top Killers\n\
- "W"Top Deaths\n\
- "W"Top Ranked\n\
- "W"Top Respected\n\
- "W"Top Online\n\
- "W"Kills/Deaths ratio", "Select", "Close");
- return 1;
- }
- CMD:stats(PARAMS)
- {
- LoginCheck(playerid);
- new Player;
- if(sscanf(params, "u", Player))
- {
- WhosStats = "your current stats";
- FormatStats(playerid);
- SendError(playerid, "You can also use "ORAN"/stats "W"<id>"GREY" to see someone else's stats!");
- }
- else
- { if(Player == playerid)
- {
- WhosStats = "your current stats";
- FormatStats(playerid);
- SendError(playerid, "You can also use "ORAN"/stats "W"<id>"GREY" to see someone else's stats!");
- }
- else
- {
- if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
- format(WhosStats, sizeof (WhosStats), ""ORAN"%s{FFFFFF}'s stats", Name(Player));
- FormatStats(Player);
- FormatMSG(Player, Color:GREY, "Player "ORAN"%s[%i]"GREY" is watching your stats!", Name(playerid), playerid);
- }
- }
- SPD(playerid, Dialog:Stats, BOX, ""W"Statistics:", StatsString, "Close", "");
- return 1;
- }
- CMD:specoff(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- if(P_DATA[playerid][Spec_Type] == ADMIN_SPEC_TYPE_NONE)
- return SendError(playerid, "You are not spectating!");
- TogglePlayerSpectating(playerid, 0);
- P_DATA[playerid][Spec_ID] = 0xFFFF;
- P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_NONE;
- foreach(Player, x)
- {
- if(P_DATA[x][Level] > 2)
- {
- FormatMSG(x, Color:GREY, "Admin "ORAN"%s[%i]"GREY" stopped spectating", Name(playerid), playerid);
- }
- }
- SendClientMessage(playerid, Color:GREY, "You stopped spectating");
- return 1;
- }
- CMD:specv(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new VehicleID;
- if(sscanf(params, "u", VehicleID)) return SendUsage(playerid, "/specv "GREY"<vehicleid>", "Will spectatea certain vehicle!");
- else
- {
- if(VehicleID == (0xFFFF)) return SendError(playerid, "Invalid vehicle id");
- if(VehicleID < MAX_VEHICLES)
- {
- TogglePlayerSpectating(playerid, 1);
- PlayerSpectateVehicle(playerid, VehicleID);
- P_DATA[playerid][Spec_ID] = VehicleID;
- P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_VEHICLE;
- }
- FormatMSG(playerid, Color:GREY, "You are now spectating vehicle id "ORAN"%i"GREY". Use "ORAN"/specoff"GREY" to stop spectating.", VehicleID);
- foreach(Player, x)
- {
- if(P_DATA[x][Level] > 2)
- {
- FormatMSG(x, Color:GREY, "Admin "ORAN"%s[%i]"GREY" is spectating vehicle id "ORAN"%i"GREY".", Name(playerid), playerid, VehicleID);
- }
- }
- }
- return 1;
- }
- CMD:spec(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new Player;
- if(sscanf(params, "u", Player)) return SendUsage(playerid, "/spec "GREY"<id>", "Will spectate a certain player!");
- else
- {
- if(Player == 0xFFFF )
- return SendError(playerid, "Player not connected!");
- if(Player == playerid)
- return SendError(playerid, "You cannot spectate yourself!");
- if(P_DATA[playerid][Level] < P_DATA[Player][Level])
- return SendError(playerid, "You are not allowed to spectate this admin!");
- TogglePlayerSpectating(playerid, 1);
- PlayerSpectatePlayer(playerid, Player);
- SetPlayerInterior(playerid, GetPlayerInterior(Player));
- P_DATA[playerid][Spec_ID] = Player;
- P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_PLAYER;
- FormatMSG(playerid, Color:GREY, "You are now spectating player "ORAN"%s[%i]"GREY". Use "ORAN"/specoff"GREY" to stop spectating.", Name(Player), Player);
- foreach(Player, x)
- {
- if(P_DATA[x][Level] > 2)
- {
- FormatMSG(x, Color:GREY, "Admin "ORAN"%s[%i]"GREY" is spectating "ORAN"%s[%i]"GREY".", Name(playerid), playerid, Name(Player), Player);
- }
- }
- }
- return 1;
- }
- CMD:2012all(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- foreach(Player, Player)
- {
- if(P_DATA[Player][Level] < 1)
- {
- for (new w = 0; w < 11; w++)
- {SetPlayerSkillLevel(Player, w, 0);}
- SetPlayerHealth(Player, 0.1); SetPlayerArmour(Player, 0.0 ); SetPlayerTime(Player, 0, 0);
- SetPlayerWeather(Player, -66); SetPlayerWantedLevel(Player, 6 ); SetPlayerSkin(Player, 159);
- ResetPlayerWeapons(Player ); GivePlayerWeapon(Player, 10, 1); ResetPlayerMoney(Player );
- SetPlayerScore(Player, 0 ); SetPlayerDrunkLevel(Player, 99999);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" fucked up your and everyone's game!", Name(playerid), playerid);
- }
- }
- SendClientMessage(playerid, Color:GREY, "You fucked up everyone's game! (Admins are an exception!)");
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" fucked up everyone's game!", Name(playerid), playerid);
- return 1;
- }
- CMD:2012(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new Player;
- 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");
- else
- {
- if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
- if(Player == playerid) return SendError(playerid, "Player entered is you!");
- for (new w = 0; w < 11; w++)
- {SetPlayerSkillLevel(Player, w, 0);}
- SetPlayerHealth(Player, 0.1); SetPlayerArmour(Player, 0.0 ); SetPlayerTime(Player, 0, 0);
- SetPlayerWeather(Player, -66); SetPlayerWantedLevel(Player, 6 ); SetPlayerSkin(Player, 159);
- ResetPlayerWeapons(Player ); GivePlayerWeapon(Player, 10, 1); ResetPlayerMoney(Player );
- SetPlayerScore(Player, 0 ); SetPlayerDrunkLevel(Player, 99999);
- new String[MAX_PLAYER_NAME];
- format(String, MAX_PLAYER_NAME, "[NUB]%s", Name(Player));
- if(strfind(Name(Player), "[NUB]", false, 0)) SetPlayerName(Player, String);
- FormatMSG(playerid, Color:GREY, "You fucked up "ORAN"%s[%i]"GREY"'s game!", Name(Player), Player);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" fucked up your game!", Name(playerid), playerid);
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" fucked up "ORAN"%s[%i]"GREY"'s game!", Name(playerid), playerid ,Name(Player), Player);
- }
- return 1;
- }
- CMD:eject(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new Player;
- if(sscanf(params, "u", Player)) return SendUsage(playerid, "/eject "GREY"<id>", "Will eject player from vehicle");
- else
- {
- if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
- if(Player == playerid) return SendError(playerid, "Player entered is you!");
- if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
- RemovePlayerFromVehicle(Player);
- FormatMSG(playerid, Color:GREY, "You ejected "ORAN"%s[%i]"GREY" from vehicle!", Name(Player), Player);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" ejected you from vehicle!", Name(playerid), playerid);
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" ejected "ORAN"%s[%i]"GREY" from vehicle!", Name(playerid), playerid ,Name(Player), Player);
- }
- return 1;
- }
- CMD:setonline(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- new Player, Time[3];
- 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");
- else
- {
- if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
- if(Time[1] > 60 || Time[1] < 0) return SendError(playerid, "Invalid minutes inserted!");
- if(Time[2] > 60 || Time[2] < 0) return SendError(playerid, "Invalid seconds inserted!");
- P_DATA[Player][Hours] = Time[0]; P_DATA[Player][Minutes] = Time[1]; P_DATA[Player][Seconds] = Time[2];
- if(Player == playerid)
- {
- 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]);
- 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]);
- }
- else
- {
- 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]);
- 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]);
- 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]);
- }
- P_DATA[Player][ConnTime] = gettime();
- }
- return 1;
- }
- CMD:warn(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new Player, Reason[80];
- 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!");
- else
- {
- if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
- if(Player == playerid) return SendError(playerid, "Player entered is you!");
- CheckImune(playerid, Player);
- P_DATA[Player][Warns] += 1;
- if(P_DATA[Player][Warns] != MAX_P_WARNS)
- {
- #if SAVE_IN_LOGS == true
- 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 ());
- #endif
- 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]);
- 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]);
- GameTextForPlayer(Player, "~r~WARNED!", 3000, 3);
- }
- else if(P_DATA[Player][Warns] >= MAX_P_WARNS)
- {
- #if SAVE_IN_LOGS == true
- 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 ());
- #endif
- P_DATA[Player][Warns] = 0;
- FormatMSG(Player, Color:GREY, "You have been warned by admin "ORAN"%s[%i]"GREY" for "ORAN" %s", Name(playerid), playerid, Reason);
- SendError(Player, "You have reached the maximum warns per player! "ORAN""#MAX_P_WARNS""W"/"#MAX_P_WARNS"");
- SendError(Player, "Kicked from the server!");
- KickEx(Player, Name(playerid), "Exceeding Warnings!", true);
- }
- }
- return 1;
- }
- CMD:show(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new Player, Show[129];
- 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!");
- else
- {
- if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
- if(Player == playerid) return SendError(playerid, "Player entered is you!");
- CheckImune(playerid, Player);
- GameTextForPlayer(Player, Show, 6000, 3);
- FormatMSG(playerid, Color:GREY, "Screen text sent to "ORAN"%s[%i]", Name(Player), Player);
- }
- return 1;
- }
- CMD:cookies(PARAMS)
- {
- LoginCheck(playerid);
- if(!P_DATA[playerid][Cookies] )
- SendClientMessage(playerid, Color:GREY, "You currently have no cookies! Buy some with "ORAN"/buycookies");
- else if(P_DATA[playerid][Cookies] > 1)
- FormatMSG(playerid, Color:GREY, "You have "ORAN"%d"GREY" cookies! Eat them or gift them to somebody!", P_DATA[playerid][Cookies]);
- else if(P_DATA[playerid][Cookies] == 1)
- SendClientMessage(playerid, Color:GREY, "You have "ORAN"1"GREY" cookie! Eat it or gift it to somebody!");
- return 1;
- }
- CMD:cookieshelp(PARAMS)
- {
- LoginCheck(playerid);
- new bStr[512];
- format(bStr, sizeof(bStr), "%s%s",\
- ""ORAN"Cookies Center!\n\n\
- "GREY"Use "ORAN"/cookies"GREY" to check how many cookies you have!\n\
- "GREY"Use "ORAN"/buycookies"GREY" to buy cookies.\n\
- "GREY"Use "ORAN"/buycookiesjar"GREY" to buy a jar of "ORAN"600"GREY" cookies!\n",
- ""GREY"Use "ORAN"/eatcookie"GREY" you will eat one cookie and gain 25 health!\n\
- "GREY"Use "ORAN"/giftcookies"GREY" you will gift cookies to your friends.\n\n\
- {FFFFFF}--------------------\nBe the cookie monster!");
- SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Cookies!", bStr, "Close", "");
- return 1;
- }
- CMD:setcookies(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new Player, Cookiz;
- if(sscanf(params, "ud", Player, Cookiz)) return SendUsage(playerid, "/setcookies <id> <cookies>", "Will set player's cookies!!");
- else
- {
- if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
- P_DATA[Player][Cookies] = Cookiz;
- if(playerid != Player)
- {
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY" cookies to "ORAN"%d",Name(Player), Player, Cookiz);
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"%s[%i]"GREY"'s cookies to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, Cookiz);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your cookies to "ORAN"%d"GREY"!", Name(playerid), playerid, Cookiz);
- }
- else
- {
- FormatMSG(playerid, Color:GREY, "You set your cookies to "ORAN"%d" ,Cookiz);
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his cookies to "ORAN"%d", Name(playerid), playerid, Cookiz);
- }
- }
- return 1;
- }
- CMD:giftcookies(PARAMS)
- {
- LoginCheck(playerid);
- new Player, Cookiz;
- if(sscanf(params, "ud", Player, Cookiz)) return SendUsage(playerid, "/giftcookies <id> <cookies>", "Will gift cookies to specified player!");
- else
- {
- if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
- if(Player == playerid) return SendError(playerid, "Player entered is you!");
- if(P_DATA[playerid][Cookies] < Cookiz) return SendError(playerid, "You don't have enough cookies to gift!");
- P_DATA[playerid][Cookies] -= Cookiz;
- P_DATA[Player][Cookies] += Cookiz;
- FormatMSG(playerid, Color:GREY, "You gifted "ORAN"%d"GREY" cookies to "ORAN"%s[%i]"GREY"",Cookiz, Name(Player), Player);
- FormatMSG(Player, Color:GREY, "Player "ORAN"%s[%i]"GREY" gifted you "ORAN"%d"GREY" cookies!", Name(playerid), playerid, Cookiz);
- new Str[60];
- format(Str, sizeof (Str), "~w~Cookies left:~n~~w~%d", P_DATA[playerid][Cookies]);
- GameTextForPlayer(playerid, Str, 4000, 1);
- format(Str, sizeof (Str), "~w~Cookies:~n~~w~%d", P_DATA[Player][Cookies]);
- GameTextForPlayer(Player, Str, 4000, 1);
- }
- return 1;
- }
- CMD:eatcookie(PARAMS)
- {
- LoginCheck(playerid);
- if(!P_DATA[playerid][Cookies])
- return SendClientMessage(playerid, Color:GREY, "You don't have any cookies! Buy some with "ORAN"/buycookies");
- P_DATA[playerid][Cookies]-= 1;
- GameTextForPlayer(playerid, "~r~+~w~25~r~ Health", 5000, 1);
- new Float:Health;
- GetPlayerHealth(playerid, Health );
- SetPlayerHealth(playerid,(Health + 25));
- FormatMSG(playerid, Color:GREY, "Cookies left: "ORAN"%d", P_DATA[playerid][Cookies]);
- return 1;
- }
- CMD:buycookiesjar(PARAMS)
- {
- LoginCheck(playerid);
- new Yes[4];
- if(sscanf(params, "s[4]", Yes)) return SendUsage(playerid, "/buycookiesjar <yes>", "Will buy a jar of 600 cookies. "ORAN"("GREY"600 * "GREE"$"#MAX_COOKIE_COST""ORAN")");
- else
- {
- if(!strcmp(Yes, "yes"))
- {
- if(GetPlayerMoney(playerid) <= 600 * MAX_COOKIE_COST)
- {
- FormatMSG(playerid, Color:GREY, "Insufficient moneys! ("ORAN" 600 Cookies * "#MAX_COOKIE_COST" = "GREE"$%s"GREY")", FormatNumber(600 * MAX_COOKIE_COST));
- return 0;
- }
- else
- {
- GivePlayerMoney(playerid, - (600 * MAX_COOKIE_COST));
- P_DATA[playerid][Cookies] += 600;
- FormatMSG(playerid, Color:GREY, "You bought a jar of "ORAN"600"GREY" cookies and costed you "GREE"$%s", FormatNumber(600 * MAX_COOKIE_COST));
- }
- }else return SendUsage(playerid, "/buycookiesjar <yes>", "Will buy a jar of 600 cookies. "ORAN"("GREY"600 * "GREE"$"#MAX_COOKIE_COST""ORAN")");
- }
- return 1;
- }
- CMD:buycookies(PARAMS)
- {
- LoginCheck(playerid);
- new Cookiz;
- if(sscanf(params, "i", Cookiz)) return SendUsage(playerid, "/buycookies <cookies>", "Will buy specified amount of cookies. One cookie = "GREE"$"#MAX_COOKIE_COST"");
- else
- {
- if(Cookiz < 1 ) return SendUsage(playerid, "/buycookies <cookies>");
- if(Cookiz > 600) return SendError(playerid, "You can't buy more than "ORAN"600"GREY" cookies at once! YOU COOKIE MONSTER!!!!");
- if(GetPlayerMoney(playerid) <= Cookiz * MAX_COOKIE_COST)
- {
- FormatMSG(playerid, Color:GREY, "Insufficient moneys! ("ORAN" %d Cookies * "#MAX_COOKIE_COST" = "GREE"$%s"GREY")", Cookiz, FormatNumber(Cookiz * MAX_COOKIE_COST));
- return 0;
- }
- else
- {
- GivePlayerMoney(playerid, - (Cookiz * MAX_COOKIE_COST));
- P_DATA[playerid][Cookies] += Cookiz;
- FormatMSG(playerid, Color:GREY, "You bought "ORAN"%d"GREY" cookies and costed you "GREE"$%s", Cookiz, FormatNumber(Cookiz * MAX_COOKIE_COST));
- }
- }
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- new _X = 0;
- while (_X != MAX_PLAYERS)
- {
- if(IsPlayerConnected(_X) &&
- GetPlayerState(_X) == PLAYER_STATE_SPECTATING &&
- P_DATA[_X][Spec_ID] == playerid &&
- P_DATA[_X][Spec_Type] == ADMIN_SPEC_TYPE_PLAYER)
- {
- SetPlayerInterior(_X, newinteriorid);
- }
- _X++;
- }
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid)
- {
- if(vehicleid == P_DATA[playerid][aCar])
- return SendClientMessage(playerid, Color:GREY, " "GREY"Welcome back to your "ORAN"Admin Vehicle"GREY"!");
- return 1;
- }
- CreateVehicleEx(playerid, model, Float:x, Float:z, Float:y, Float:rot, color1, color2, respawn_time, inveh = true)
- {
- DestroyVehicle(P_DATA[playerid][GiveCar]);
- P_DATA[playerid][GiveCar] = CreateVehicle(model, Float:x, Float:z, Float:y, Float:rot, color1, color2, respawn_time);
- if(inveh)PutPlayerInVehicle(playerid, P_DATA[playerid][GiveCar], 0);
- }
- CMD:accp(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- if(P_DATA[playerid][aCar] == -1)
- return SendError(playerid, "You didn't spawn any admin vehicle! Spawn it with "ORAN"/acar");
- if(!IsPlayerInVehicle(playerid, P_DATA[playerid][aCar]))
- return SendError(playerid, "You must be in your "ORAN"Admin Vehicle"GREY" to use this command!");
- SPD(playerid, Dialog:ACCP, LIST, ""W"Tune: "ORAN"Admin Car", ""GREY"Add nos\n\
- "GREY"Change colors\n\
- "GREY"Components\n\
- "BLUE"Save Changes\n\
- "GREE"Load Changes\n\
- "ORAN"Discard Changes", "Select", "Close");
- return 1;
- }
- CMD:acar(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- new Float:Pos[4];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- if(IsPlayerInAnyVehicle(playerid))
- {
- GetVehicleZAngle(GetPlayerVehicleID(playerid), Pos[3]);
- GetPlayerFacingAngle(playerid, Pos[3]);
- SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]+2);
- }else GetPlayerFacingAngle(playerid, Pos[3]);
- if(P_DATA[playerid][aCar] == -1)
- {
- DestroyVehicle(P_DATA[playerid][aCar]);
- P_DATA[playerid][aCar] = CreateVehicle(415, Pos[0], Pos[1], Pos[2], Pos [3], 0, 0, 90000);
- PutPlayerInVehicle(playerid, P_DATA[playerid][aCar], 0);
- SetVehicleHealth(P_DATA[playerid][aCar], 99999.0);
- GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~Admin car created!", 3000, 3);
- ZaAdminCar[playerid] = CreatePlayer3DTextLabel(playerid, "Your Admin Car", Color:ORAN, 0.0, 0.0, 0.0, 120.0, (0xFFFF), P_DATA[playerid][aCar], 1);
- }
- else
- {
- GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~Admin car called!", 3000, 3);
- SetVehiclePos(P_DATA[playerid][aCar], Pos[0], Pos[1], Pos[2]);
- SetVehicleZAngle(P_DATA[playerid][aCar], Pos[3]);
- PutPlayerInVehicle(playerid, P_DATA[playerid][aCar], 0);
- }
- SendClientMessage(playerid, Color:GREY, "Use "ORAN"/accp"GREY" to tune your admin vehicle!!");
- return 1;
- }
- CMD:vips(PARAMS)
- {
- LoginCheck(playerid);
- new C, S[1024], cString[150];
- foreach(Player, i){
- if(P_DATA[i][Vip] > 0){
- C++;
- }
- }
- format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Vips", C)) : ("{FF0000}No VIP members online!")) ;
- if(C == 1){
- foreach(Player, i){
- if(P_DATA[i][Vip] > 0){
- format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"L:%d|ID:%d"W"]",cString, Name(i), P_DATA[i][Vip],i);
- }
- }
- }
- if(C > 1){
- foreach(Player, i){
- if(P_DATA[i][Vip] > 0){
- format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"L:%d|ID:%d"W"], ",S, Name(i), P_DATA[i][Vip],i);
- if(!(i % MAX_SHOW_PER_ROW)){
- if(i != 0){
- strdel(S, strlen(S) - 2, strlen(S));
- strins(S, "\n", strlen(S));
- //S[0] = EOS;
- }
- }
- }
- }
- }
- if(!C) memcpy(S, cString, 0, 1024 );
- if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Online VIP members!", S, "Close", "");
- 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", "");
- return 1;
- }
- CMD:muted(PARAMS)
- {
- LoginCheck(playerid);
- new C, S[1024], cString[150];
- foreach(Player, i){
- if(P_DATA[i][Muted] > 0){
- C++;
- }
- }
- format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Muted", C)) : (""W"--------------\n{FF0000}No Muted players online!\n"W"--------------\n")) ;
- if(C == 1){
- foreach(Player, i){
- if(P_DATA[i][Muted] > 0){
- if(!P_DATA[i][MutedTime]){
- format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:Forever|ID:%d"W"]",cString, Name(i), i);
- }else{
- format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:%d|ID:%d"W"]",cString, Name(i), P_DATA[i][MutedTime],i);}
- }
- }
- }
- if(C > 1){
- foreach(Player, i){
- if(P_DATA[i][Muted] > 0){
- if(!P_DATA[i][MutedTime]){
- format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:Forever|ID:%d"W"]",cString, Name(i), i);
- }else{
- 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);}
- if(!(i % MAX_SHOW_PER_ROW)){
- if(i != 0){
- strdel(S, strlen(S) - 2, strlen(S));
- strins(S, "\n", strlen(S));
- }
- }
- }
- }
- }
- if(!C) format(S, sizeof (S), "%s", cString);
- if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Muted players!", S, "Close", "");
- if(strlen(S) > 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Muted players!", "{FF0000}An error has occured while trying to show the online players!\n{FFFFFF}Please contact the owner and inform him about this problem!", "Close", "");
- return 1;
- }
- CMD:jailed(PARAMS)
- {
- LoginCheck(playerid);
- new C, S[1024], cString[150];
- foreach(Player, i){
- if(P_DATA[i][Jailed] > 0){
- C++;
- }
- }
- format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Jailed", C)) : (""W"--------------\n{FF0000}No Jailed players online!\n"W"--------------\n")) ;
- if(C == 1){
- foreach(Player, i){
- if(P_DATA[i][Jailed] > 0){
- if(!P_DATA[i][JailTime]){
- format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:Forever|ID:%d"W"]",cString, Name(i), i);
- }else{
- format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:%d|ID:%d"W"]",cString, Name(i), P_DATA[i][JailTime],i);}
- }
- }
- }
- if(C > 1){
- foreach(Player, i){
- if(P_DATA[i][Jailed] > 0){
- if(!P_DATA[i][JailTime]){
- format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:Forever|ID:%d"W"]",cString, Name(i), i);
- }else{
- 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);}
- if(!(i % MAX_SHOW_PER_ROW)){
- if(i != 0){
- strdel(S, strlen(S) - 2, strlen(S));
- strins(S, "\n", strlen(S));
- }
- }
- }
- }
- }
- if(!C) format(S, sizeof (S), "%s", cString);
- if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Jailed players!", S, "Close", "");
- if(strlen(S) > 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Jailed players!", "{FF0000}An error has occured while trying to show the online players!\n{FFFFFF}Please contact the owner and inform him about this problem!", "Close", "");
- return 1;
- }
- CMD:frozen(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- new C, S[1024], cString[150];
- foreach(Player, i){
- if(P_DATA[i][Vip] > 0){
- C++;
- }
- }
- format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Frozen", C)) : ("{FF0000}No VIP members online!")) ;
- if(C == 1){
- foreach(Player, i){
- if(P_DATA[i][Vip] > 0){
- format(S, sizeof (S), "%s"BLUE"%s",cString, Name(i));
- }
- }
- }
- if(C > 1){
- foreach(Player, i){
- if(P_DATA[i][Vip] > 0){
- format(S, sizeof (S), "%s"BLUE"%s, ",S, Name(i));
- if(!(i % MAX_SHOW_PER_ROW)){
- if(i != 0){
- strdel(S, strlen(S) - 2, strlen(S));
- strins(S, "\n", strlen(S));
- //S[0] = EOS;
- }
- }
- }
- }
- }
- if(!C) format(S, sizeof (S), "%s", cString);
- if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Frozen Players!", S, "Close", "");
- 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", "");
- return 1;
- }
- CMD:admins(PARAMS)
- {
- LoginCheck(playerid);
- new C, S[1024], cString[150];
- foreach(Player, i){
- if(P_DATA[i][Level] > 0){
- C++;
- }
- }
- format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Admins", C)) : ("{FF0000}No VIP members online!")) ;
- if(C == 1){
- foreach(Player, i){
- if(P_DATA[i][Level] > 0){
- format(S, sizeof (S), "%s"GREE"%s"W"["GREE"L:%d|ID:%d"W"]",cString, Name(i), P_DATA[i][Level],i);
- }
- }
- }
- if(C > 1){
- foreach(Player, i){
- if(P_DATA[i][Level] > 0){
- format(S, sizeof (S), "%s"GREE"%s"W"["GREE"L:%d|ID:%d"W"], ",S, Name(i), P_DATA[i][Level],i);
- if(!(i % MAX_SHOW_PER_ROW)){
- if(i != 0){
- strdel(S, strlen(S) - 2, strlen(S));
- strins(S, "\n", strlen(S));
- //S[0] = EOS;
- }
- }
- }
- }
- }
- if(!C) format(S, sizeof (S), "%s", cString);
- if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Online Administrators!", S, "Close", "");
- 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", "");
- return 1;
- }
- CMD:wcheck(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new Player;
- if(sscanf(params, "u", Player)) return SendUsage(playerid, "/wcheck <id>", "Will check player's weapon and ammo");
- else
- {
- if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
- new Weapon, Ammo, WeaponName[20], String[715];
- if(Player != playerid) format(String, sizeof String, ""ORAN"%s"GREY"'s weapons:\n\n", Name(Player));
- else String = "{FFFFFF}Checking your weapons\n";
- for (new w = 0; w < 9; w++)
- {
- GetPlayerWeaponData(Player, w, Weapon, Ammo);
- if(Ammo < 0) Ammo = 9999;
- if(Weapon != 0)
- {
- GetWeaponName(Weapon, WeaponName[w], 20);
- format(String, sizeof String, "%s"GREY"Weapon: "ORAN"%s"GREY" Ammo: "ORAN"%d\n", String, WeaponName[w], Ammo);
- }
- }
- SPD(playerid, Dialog:Empty, BOX, ""GREY"Checking Weapons!", String, "Close", "");
- }
- return 1;
- }
- CMD:fake(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- SendClientMessage(playerid, Color:GREY, "/fakechat /fakecmd /fakedeath /fakecon /fakedisc");
- return 1;
- }
- CMD:fakedisc(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- new Player, Reason;
- 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")");
- else
- {
- if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
- if(Reason > 3 || Reason < 0) return SendError(playerid, "Invalid reason! ("ORAN" 0 - Crash | 1 - Leaving | 2 - Kick/Ban "GREY")");
- SendClientMessage(playerid, Color:GREY, "Fake command sent!");
- new zStr[129];
- switch(Reason)
- {
- case 0: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[CRASH]", Name(playerid), playerid);
- case 1: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[LEAVING]", Name(playerid), playerid);
- case 2: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[KICK"W"/"ORAN"BAN]", Name(playerid), playerid);
- }
- SendClientMessageToAll(Color:ORAN, zStr);
- }
- return 1;
- }
- CMD:fakecon(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- new Player;
- if(sscanf(params, "u",Player)) return SendUsage(playerid, "/fakecon "GREY"<id>", "Will send a fake connection of the player!");
- else
- {
- if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
- SendClientMessage(playerid, Color:GREY, "Fake command sent!");
- new String[256];
- format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined the server!", Name(Player), Player);
- SendClientMessageToAll(Color:ORAN, String);
- }
- return 1;
- }
- CMD:fakecmd(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- new Player, Command[129];
- if(sscanf(params, "us[129]",Player, Command)) return SendUsage(playerid, "/fakecmd "GREY"<id> <command>", "Will send a fake command! The command must include the /.");
- else
- {
- if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
- SendClientMessage(playerid, Color:GREY, "Fake command sent!");
- CallRemoteFunction("OnPlayerCommandText", "is", Player, Command);
- }
- return 1;
- }
- CMD:fakemsg(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- new Player, xChat[129];
- if(sscanf(params, "us[129]",Player, xChat)) return SendUsage(playerid, "/fakemsg "GREY"<id> [message]", "Will send a fake message of the specified player!");
- else
- {
- if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
- SendClientMessage(playerid, Color:GREY, "Fake chat sent!");
- SendPlayerMessageToAll(Player, xChat);
- }
- return 1;
- }
- CMD:fakechat(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- new Player, xChat[129];
- if(sscanf(params, "us[129]",Player, xChat)) return SendUsage(playerid, "/fakechat "GREY"<id> [message]", "Will send a fake message of the specified player!");
- else
- {
- if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
- SendClientMessage(playerid, Color:GREY, "Fake chat sent!");
- SendPlayerMessageToAll(Player, xChat);
- }
- return 1;
- }
- CMD:fakedeath(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- #define Killer 0
- #define Killed 1
- new Fake[2], Weapon;
- if(sscanf(params, "uuD(-1)", Fake[Killer], Fake[Killed], Weapon))
- 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!)");
- else
- {
- if(Fake[Killer] == 0xFFFF) return SendError(playerid, "Killer is not connected!");
- if(Fake[Killed] == 0xFFFF) return SendError(playerid, "Killed is not connected!");
- if(Fake[Killer] == 0xFFFF && Fake[Killed] == 0xFFFF) return SendError(playerid, "Killer and Killed are both offline!");
- if(Weapon == -1)
- {
- new rWeapon;
- switch (random(2))
- {
- case 0: rWeapon = random(19);
- case 1: rWeapon = 21 + random(26);
- default: rWeapon = 0;
- }
- Weapon = rWeapon;
- return SendDeathMessage(Fake[Killer], Fake[Killed], Weapon),
- SendClientMessage(playerid, Color:GREY, "Fake death sent!");
- }
- if(!IsValidWeapon(Weapon))
- return SendError(playerid, "Invalid Weapon ID!");
- SendDeathMessage(Fake[Killer], Fake[Killed], Weapon);
- SendClientMessage(playerid, Color:GREY, "Fake death sent!");
- }
- return 1;
- }
- CMD:removeacc(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- new Account[MAX_PLAYER_NAME], Reason[100];
- 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");
- else
- {
- if(AccountExist(Account))
- {
- if(!strcmp(Name(playerid), Account, false))
- return SendError(playerid, "You cannot delete your own account!");
- new Query[100];
- format(Query, 200, "DELETE FROM `Accounts` WHERE `Name` = '%s'", Account);
- DB::Query(_DB, Query);
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" has deleted account: "ORAN"%s"GREY"["ORAN"Reason: %s"GREY"]", Name(playerid), playerid, Account, Reason);
- FormatMSG(playerid, Color:GREY, "Account "ORAN"%s"GREY" has been deleted!", Account);
- FormatMSG(playerid, Color:ORAN, "Reason: "GREY"%s", Reason);
- }
- else
- {
- SendError(playerid, "Account does not exist in the database!");
- return 1;
- }
- }
- return 1;
- }
- CMD:aweapons(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- GivePlayerWeapon(playerid, 24, 99999);
- GivePlayerWeapon(playerid, 26, 99999);
- GivePlayerWeapon(playerid, 29, 99999);
- GivePlayerWeapon(playerid, 31, 99999);
- GivePlayerWeapon(playerid, 33, 99999);
- GivePlayerWeapon(playerid, 38, 99999);
- GivePlayerWeapon(playerid, 9, 1);
- SendClientMessage(playerid, Color:GREY, ""ORAN"*"GREY" Admin weapons received!");
- return 1;
- }
- CMD:car(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- new Car[30], Color[2];
- 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)");
- else
- {
- if(IsPlayerInAnyVehicle(playerid)) return SendError(playerid, "You are already in a vehicle!");
- new CarModel;
- if(IsNumeric(Car)) CarModel = strval(Car);
- else CarModel = GetVModelFromName(Car);
- if(CarModel < 400 || CarModel > 611) return SendError(playerid, "Invalid vehicle model/name!");
- if(Color[0] == -1) Color[0] = random(250);
- if(Color[1] == -1) Color[1] = random(250);
- new Float: Pos[4];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- GetPlayerFacingAngle(playerid, Pos[3]);
- CreateVehicleEx(playerid, CarModel, Pos[0], Pos[1], Pos[2], Pos[3], Color[0], Color[1], 900000);
- FormatMSG(playerid, Color:GREY, "You spawned "ORAN"%s"GREY" ("ORAN"Model: %d"GREY").", GetVehicleName(CarModel), CarModel);
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" spawned a "ORAN"%s"GREY" ("ORAN"Model: %d"GREY").", Name(playerid), playerid, GetVehicleName(CarModel), CarModel);
- }
- return 1;
- }
- CMD:givecar(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new Player, Car[30];
- 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!");
- else
- {
- if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
- if(Player == playerid) return SendError(playerid, "Player entered is you! You can use "ORAN"/car"GREY" instead!");
- if(IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is already driving a vehicle!");
- CheckImune(playerid, Player);
- new CarModel;
- if(IsNumeric(Car)) CarModel = strval(Car);
- else CarModel = GetVModelFromName(Car);
- if(CarModel < 400 || CarModel > 611) return SendError(playerid, "Invalid vehicle model/name!");
- new Float: Pos[4];
- GetPlayerPos(Player, Pos[0], Pos[1], Pos[2]);
- GetPlayerFacingAngle(Player, Pos[3]);
- CreateVehicleEx(Player, CarModel, Pos[0], Pos[1], Pos[2], Pos[3], random(250), random(250), 900000);
- FormatMSG(playerid, Color:GREY, "You gave "ORAN"%s[%i] "GREY"an"ORAN" %s"GREY" ("ORAN"Model: %d"GREY").", Name(Player), Player, GetVehicleName(CarModel), CarModel);
- 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);
- }
- return 1;
- }
- CMD:giveallweapon(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new Weapon[10], Ammo;
- 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!");
- else
- {
- if(Ammo <= 0) return SendError(playerid, "Invalid ammo entered!");
- new WeaponID;
- if(IsNumeric(Weapon)) WeaponID = strval(Weapon);
- else WeaponID = GetWeaponIDFromName(Weapon);
- if(!IsValidWeapon(WeaponID))
- return SendError(playerid, "Invalid weapon id/name inserted!");
- new WeaponName[30];
- GetWeaponName(WeaponID, WeaponName, 30);
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)GivePlayerWeapon(i, WeaponID, Ammo);GameTextForPlayer(i, "~w~Weapon received!",3000,1);
- 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);
- }
- FormatMSG(playerid, Color:GREY, "You gave everyone a "ORAN"%s(WID:%d)"GREY" with "ORAN"%d"GREY" ammo", WeaponName, WeaponID, Ammo);
- }
- return 1;
- }
- CMD:giveweapon(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new Player, Weapon[10], Ammo;
- 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!");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- if(Ammo <= 0) return SendError(playerid, "Invalid ammo entered!");
- CheckImune(playerid, Player);
- new WeaponID;
- if(IsNumeric(Weapon)) WeaponID = strval(Weapon);
- else WeaponID = GetWeaponIDFromName(Weapon);
- if(!IsValidWeapon(WeaponID))
- return SendError(playerid, "Invalid weapon id/name inserted!");
- new WeaponName[30];
- GetWeaponName(WeaponID, WeaponName, 30);
- GivePlayerWeapon(Player, WeaponID, Ammo);
- if(Player == playerid)
- {
- 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);
- FormatMSG(playerid, Color:GREY, "You gave yourself a "ORAN"%s(WID:%d)"GREY" with "ORAN"%d"GREY" ammo", WeaponName, WeaponID, Ammo);
- }
- else
- {
- 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);
- 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);
- 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);
- }
- GameTextForPlayer(Player, "~w~Weapon received!",3000,1);
- }
- return 1;
- }
- CMD:gotopos(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- new Float: Pos[3];
- 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!");
- else
- {
- if(IsPlayerInAnyVehicle(playerid))SetVehiclePos(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
- else SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" teleported to coords: "ORAN"%.1f %.1f %.1f", Name(playerid), playerid, Pos[0], Pos[1], Pos[2]);
- FormatMSG(playerid, Color:GREY, "You teleported to coords: "ORAN"%.1f %.1f %.1f", Pos[0], Pos[1], Pos[2]);
- }
- return 1;
- }
- CMD:akill(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new Player;
- if(sscanf(params, "u", Player)) return SendUsage(playerid, "/akill "GREY"<id>", "Will kill the specified player");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- if(Player == playerid ) return SendError(playerid, "Player entered is you!");
- CheckImune(playerid, Player);
- SetPlayerHealth(Player, 0.0);
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" killed "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
- FormatMSG(playerid, Color:GREY, "You killed "ORAN"%s[%i]", Name(Player), Player);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" killed you!", Name(playerid), playerid);
- }
- return 1;
- }
- CMD:spawn(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- new Player;
- if(sscanf(params, "u", Player)) return SendUsage(playerid, "/spawn "GREY"<id>", "It will spawn the player on the server's spawn points!");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- if(Player == playerid ) return SendError(playerid, "Player entered is you!");
- CheckImune(playerid, Player);
- SpawnPlayer(Player);
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" spawned "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
- FormatMSG(playerid, Color:GREY, "You spawned "ORAN"%s[%i]", Name(Player), Player);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" spawned you!", Name(playerid), playerid);
- }
- return 1;
- }
- CMD:explodeall(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new
- Float:_P[3];
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- if(i != playerid)
- {
- GetPlayerPos(i,_P[0], _P[1], _P[2]);CreateExplosion(_P[0], _P[1], _P[2], 7, 10.0);
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" exploded you and everyone else!", Name(playerid), playerid);
- }
- }
- }
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" exploded everyone!", Name(playerid), playerid);
- FormatMSG(playerid, Color:GREY, "You exploded everyone!",0);
- return 1;
- }
- CMD:disarmall(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- if(i != playerid)
- {
- ResetPlayerWeapons(i);
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" disarmed you and everyone else!", Name(playerid), playerid);
- }
- }
- }
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" disarmed everyone!", Name(playerid), playerid);
- FormatMSG(playerid, Color:GREY, "You disarmed everyone!",0);
- return 1;
- }
- CMD:disarm(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new Player;
- if(sscanf(params, "u", Player)) return SendUsage(playerid, "/disarm "GREY"<id>", "Will remove all player's weapons.");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- if(Player == playerid ) return SendError(playerid, "Player entered is you!");
- CheckImune(playerid, Player);
- ResetPlayerWeapons(Player);
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%s[%i]"GREY"'s weapons!", Name(playerid), playerid, Name(Player), Player);
- FormatMSG(playerid, Color:GREY, "You disarmed "ORAN"%s[%i]", Name(Player), Player);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" disarmed you!", Name(playerid), playerid);
- }
- return 1;
- }
- CMD:setstats(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- new Player;
- if(sscanf(params, "u", Player))
- {
- SetPVarInt(playerid, "StatsOf", playerid);
- ShowPlayerDialog(playerid, Dialog:SetStatsSure, BOX, "{FFFFFF}Information:", ""GREY"You are on your way to edit your stats!\n"W"Proceed?", "Yes", "Exit");
- return SendUsage(playerid, "/setstats "GREY"<id>", "Will open a dialog where you can set player's stats to the desired ones!");
- }
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- if(Player == playerid ) SetPVarInt(playerid, "StatsOf", playerid),
- ShowPlayerDialog(playerid, Dialog:SetStatsSure, BOX, "{FFFFFF}Information:", ""GREY"You are on your way to edit your stats!\n"W"Proceed?", "Yes", "Exit");
- else
- {
- new zStr[160];
- format(zStr, 160, ""GREY"You are on your way to edit "ORAN"%s"GREY"'s stats!\n"W"Proceed?", Name(Player));
- ShowPlayerDialog(playerid, Dialog:SetStatsSure, BOX, "{FFFFFF}Information:", zStr, "Yes", "Exit");
- SetPVarInt(playerid, "StatsOf", Player);
- }
- }
- return 1;
- }
- CMD:getip(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- new Player;
- if(sscanf(params, "u", Player)) return SendUsage(playerid, "/getip "GREY"<id>", "Will get the IP of the specified player!");
- else
- {
- CheckImune(playerid, Player);
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- if(Player == playerid )
- {
- FormatMSG(playerid, Color:GREY, "Your IP is: "ORAN"%s"GREY" !", GetPlayerIPEx(playerid));
- return 1;
- }
- else
- {
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" used command "ORAN"\"/getip\""GREY" on "ORAN"%s[%i]"GREY"", Name(playerid), playerid, Name(Player), Player);
- FormatMSG(playerid, Color:GREY, "Player: "ORAN"%s[%i]"GREY" IP: "ORAN"\"%s\"", Name(Player), Player, GetPlayerIPEx(Player));
- }
- }
- return 1;
- }
- CMD:bankrupt(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new Player;
- if(sscanf(params, "u", Player)) return SendUsage(playerid, "/bankrupt "GREY"<id>", "Will remove player's cash!");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- if(Player == playerid ) return SendError(playerid, "Player entered is you!");
- CheckImune(playerid, Player);
- ResetPlayerMoney(Player);
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%s[%i]"GREY"'s cash!", Name(playerid), playerid, Name(Player), Player);
- FormatMSG(playerid, Color:GREY, "You removed"ORAN"%s[%i]"GREY"'s cash!", Name(Player), Player);
- }
- return 1;
- }
- CMD:get(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new Player;
- if(sscanf(params, "u", Player)) return SendUsage(playerid, "/get "GREY"<id>", "Will teleport the specified player to your position");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- if(Player == playerid ) return SendError(playerid, "Player entered is you!");
- CheckImune(playerid, Player);{}
- new Float: Pos[4];
- if(IsPlayerInAnyVehicle(Player))
- {
- LinkVehicleToInterior(GetPlayerVehicleID(Player), GetPlayerInterior(playerid));
- SetVehicleVirtualWorld(GetPlayerVehicleID(Player), GetPlayerVirtualWorld(playerid));
- SetVehiclePos(GetPlayerVehicleID(Player), Pos[0] + 2, Pos[1] + 2, Pos[2] + 1);
- SetVehicleZAngle(GetPlayerVehicleID(Player), Pos[3]);
- }
- else
- {
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- GetPlayerFacingAngle(playerid, Pos[3]);
- SetPlayerPos(Player, Pos[0], Pos[1] + 2, Pos[2] + 0.5);
- SetPlayerFacingAngle(Player, Pos[3]);
- }
- SetPlayerVirtualWorld(Player, GetPlayerVirtualWorld(playerid));
- SetPlayerInterior(Player, GetPlayerInterior(playerid));
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" teleported "ORAN"%s[%i]"GREY" to his location!", Name(playerid), playerid, Name(Player), Player);
- FormatMSG(playerid, Color:GREY, "You teleported to "ORAN"%s[%i]"GREY" to your location!", Name(Player), Player);
- }
- return 1;
- }
- CMD:tplayer(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new Player, Player2;
- if(sscanf(params, "uu", Player)) return SendUsage(playerid, "/tplayer "GREY"<id1> <id2>", "Will teleport a player to another player");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player1 not connected!");
- if(Player2 == (0xFFFF)) return SendError(playerid, "Player2 not connected!");
- if(Player == playerid ) return SendError(playerid, "Player1 entered is you!");
- if(Player2 == playerid ) return SendError(playerid, "Player2 entered is you!");
- if(P_DATA[playerid][Level] < P_DATA[Player][Level])
- return SendError(playerid, "You are not allowed to use this command on this admin!");
- if(P_DATA[playerid][Level] < P_DATA[Player2][Level])
- return SendError(playerid, "You are not allowed to use this command on this admin!");
- new Float: Pos[4];
- GetPlayerPos(Player2, Pos[0], Pos[1], Pos[2]);
- GetPlayerFacingAngle(Player2, Pos[3]);
- if(IsPlayerInAnyVehicle(Player))
- {
- LinkVehicleToInterior(GetPlayerVehicleID(Player), GetPlayerInterior(Player2));
- SetVehicleVirtualWorld(GetPlayerVehicleID(Player), GetPlayerVirtualWorld(Player2));
- SetVehiclePos(GetPlayerVehicleID(Player), Pos[0] + 2, Pos[1] + 2, Pos[2] + 1);
- SetVehicleZAngle(GetPlayerVehicleID(Player), Pos[3]);
- }
- else
- {
- SetPlayerPos(Player, Pos[0], Pos[1] + 2, Pos[2] + 0.5);
- SetPlayerFacingAngle(Player, Pos[3]);
- }
- SetPlayerVirtualWorld(Player, GetPlayerVirtualWorld(Player2));
- SetPlayerInterior(Player, GetPlayerInterior(Player2));
- 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);
- FormatMSG(playerid, Color:GREY, "You teleported "ORAN"%s[%i]"GREY" to "ORAN"%s[%i]", Name(Player), Player ,Name(Player2), Player2);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" teleported you to "ORAN"%s[%i]"GREY"", Name(playerid), playerid ,Name(Player2), Player2);
- FormatMSG(Player2, Color:GREY, "Admin "ORAN"%s[%i]"GREY" teleported "ORAN"%s[%i]"GREY" to your position", Name(playerid), playerid ,Name(Player), Player);
- }
- return 1;
- }
- CMD:goto(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- new Player;
- if(sscanf(params, "u", Player)) return SendUsage(playerid, "/goto "GREY"<id>", "Will teleport you to the specified player");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- if(Player == playerid ) return SendError(playerid, "Player entered is you!");
- CheckImune(playerid, Player);
- new Float: Pos[4];
- GetPlayerPos(Player, Pos[0], Pos[1], Pos[2]);
- GetPlayerFacingAngle(Player, Pos[3]);
- if(IsPlayerInAnyVehicle(playerid))
- {
- LinkVehicleToInterior(GetPlayerVehicleID(playerid), GetPlayerInterior(Player));
- SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(Player));
- SetVehiclePos(GetPlayerVehicleID(playerid), Pos[0] + 2, Pos[1] + 2, Pos[2] + 1);
- SetVehicleZAngle(GetPlayerVehicleID(playerid), Pos[3]);
- }
- else
- {
- SetPlayerPos(playerid, Pos[0], Pos[1] + 2, Pos[2] + 0.5);
- SetPlayerFacingAngle(playerid, Pos[3]);
- }
- SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(Player));
- SetPlayerInterior(playerid, GetPlayerInterior(Player));
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" teleported to "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
- FormatMSG(playerid, Color:GREY, "You teleported to "ORAN"%s[%i]", Name(Player), Player);
- }
- return 1;
- }
- CMD:write(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new Message[129];
- if(sscanf(params, "s[129]", Message)) return SendUsage(playerid, "/write "GREY"[message]", "Will send a message in the chat with grey color");
- else
- {
- SendClientMessageToAll(Color:GREY, Message);
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" sent a message to the server.", Name(playerid), playerid);
- GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~g~~h~Message sent!", 3000, 3);
- }
- return 1;
- }
- CMD:giveallcash(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new Cash;
- 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")");
- else
- {
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)GivePlayerMoney(i, Cash);
- if(Cash > 0)
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"$%d"GREY" cash!", Name(playerid), playerid, Cash);
- else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"$%d"GREY" cash from everyone!", Name(playerid), playerid, Cash);
- }
- }
- return 1;
- }
- CMD:setallcash(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new Cash;
- if(sscanf(params, "i", Cash)) return SendUsage(playerid, "/setallcash "GREY"<cash>", "Will set everyone's cash to the amount set");
- else
- {
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- ResetPlayerMoney(i);
- GivePlayerMoney(i, Cash);
- }
- if(Cash > 0)
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's cash to "ORAN"%d", Name(playerid), playerid, Cash);
- else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed everyone's cash!", Name(playerid), playerid);
- }
- }
- return 1;
- }
- CMD:giveallarmour(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new Armour;
- if(sscanf(params, "i", Armour)) return SendUsage(playerid, "/giveallarmour "GREY"<armour>", "Will give everyone armour("GREY"Negative numbers are not allowed! "W")");
- else
- {
- if(Armour < 1) return SendUsage(playerid, "/giveallarmour "GREY"<armour>", "Will give everyone armour("GREY"Negative numbers are not allowed! "W")");
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- new Float:a;
- GetPlayerArmour(i, a);
- SetPlayerArmour(i, a + Armour);
- }
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" armour!", Name(playerid), playerid, Armour);
- }
- }
- return 1;
- }
- CMD:setallarmour(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new Armour;
- if(sscanf(params, "i", Armour)) return SendUsage(playerid, "/setallarmour "GREY"<armour>", "Will set everyone's armour");
- else
- {
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- SetPlayerArmour(i, Armour);
- }
- if(Armour > 0)
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's Armour to "ORAN"%d", Name(playerid), playerid, Armour);
- else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed everyone's armour!", Name(playerid), playerid);
- }
- }
- return 1;
- }
- CMD:giveallh(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new Health;
- if(sscanf(params, "i", Health)) return SendUsage(playerid, "/giveallh "GREY"<health>", "Will give everyone health("GREY"Negative numbers are not allowed! "W")");
- else
- {
- if(Health < 1) return SendUsage(playerid, "/ah "GREY"<health>", "Will give everyone health("GREY"Negative numbers are not allowed! "W")");
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- new Float:he;
- GetPlayerHealth(i, he),
- SetPlayerHealth(i, he + Health);
- }
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" health!", Name(playerid), playerid, Health);
- }
- }
- return 1;
- }
- CMD:setallhealth(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new Health;
- if(sscanf(params, "i", Health)) return SendUsage(playerid, "/setallhealth "GREY"<health>", "Will set everyone's health");
- else
- {
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- SetPlayerHealth(i, Health);
- }
- if(Health > 0)
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's health to "ORAN"%d", Name(playerid), playerid, Health);
- else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" killed everyone!", Name(playerid), playerid);
- }
- }
- return 1;
- }
- CMD:setalldrunk(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new Drunk;
- if(sscanf(params, "i", Drunk)) return SendUsage(playerid, "/setalldrunk "GREY"<level>", "Will make players get drunk! Use "ORAN"0"W" to remove drunkenness");
- else
- {
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- if(Drunk != 0) SetPlayerDrunkLevel(i, 9999 + Drunk);
- else SetPlayerDrunkLevel(i, 0);
- }
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's drunk level to "ORAN"%d", Name(playerid), playerid, Drunk);
- }
- }
- return 1;
- }
- CMD:setallint(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new Interior;
- if(sscanf(params, "i", Interior)) return SendUsage(playerid, "/setallint "GREY"<interior>", "Will set everyone's interior id to the sapecified interior");
- else
- {
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- SetPlayerInterior(i, Interior);
- }
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's interior to "ORAN"%d", Name(playerid), playerid, Interior);
- }
- }
- return 1;
- }
- CMD:setallworld(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new World;
- if(sscanf(params, "i", World)) return SendUsage(playerid, "/setallworld "GREY"<world>", "Will set everyone's Virtual World to the specified world");
- else
- {
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- SetPlayerVirtualWorld(i, World);
- }
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's virtual world to "ORAN"%d", Name(playerid), playerid, World);
- }
- }
- return 1;
- }
- CMD:giveallscore(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new zScore;
- 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")");
- else
- {
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)SetPlayerScore(i, (zScore) ? (GetPlayerScore(i) + zScore) : (GetPlayerScore(i) - zScore));
- if(zScore > 0)
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" score!", Name(playerid), playerid, zScore);
- else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%d"GREY" score from everyone!", Name(playerid), playerid, zScore);
- }
- }
- return 1;
- }
- CMD:setallscore(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new aScore;
- if(sscanf(params, "i", aScore)) return SendUsage(playerid, "/setallscore "GREY"<score>", "Will set everyone's score to the specified score");
- else
- {
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- SetPlayerScore(i, aScore);
- }
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's score to "ORAN"%d", Name(playerid), playerid, aScore);
- }
- }
- return 1;
- }
- CMD:giveallwanted(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new Wanted;
- 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")");
- else
- {
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- if(GetPlayerWantedLevel(i) >= 0)
- {
- SetPlayerWantedLevel(i, (Wanted) ? (GetPlayerWantedLevel(i) + Wanted) : (GetPlayerWantedLevel(i) - Wanted));
- if(GetPlayerWantedLevel(i) < 0) SetPlayerWantedLevel(i, 0);
- }
- }
- if(Wanted > 0) FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" wanted stars!", Name(playerid), playerid, Wanted);
- else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%d"GREY" wanted stars from everyone!", Name(playerid), playerid, Wanted);
- }
- }
- return 1;
- }
- CMD:giveallcookies(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new Cookiz;
- 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")");
- else
- {
- new String[10];
- if(Cookiz < 0)
- {
- format(String, sizeof String, "%d", Cookiz);
- strdel(String, 0, 1);
- }
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- if(Cookiz < 0)P_DATA[i][Cookies] -= strval(String);
- else P_DATA[i][Cookies] += Cookiz;
- if(P_DATA[i][Cookies] < 0) P_DATA[i][Cookies] = 0;
- }
- if(Cookiz > 0) FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" cookies!", Name(playerid), playerid, Cookiz);
- else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%d"GREY" cookies from everyone!", Name(playerid), playerid, Cookiz);
- }
- }
- return 1;
- }
- CMD:setrespect(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new Player, rType[2],Respect;
- if(sscanf(params, "us[2]i", Player, rType, Respect)) return SendUsage(playerid, "/setrespect "GREY"<id> <-/+> <respect>", "Will change player's negative/positive respect!");
- else
- {
- if(Respect < 0) return SendUsage(playerid, "/setrespect "GREY"<id> <-/+> <respect>", "Will change player's negative/positive respect!");
- if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
- CheckImune(playerid, Player);
- if(!strcmp(rType, "+", false)) SetPVarInt(Player, "0_Positive", Respect);
- else if(!strcmp(rType, "-", false))SetPVarInt(Player, "0_Negative", Respect);
- else return SendError(playerid, "The first parameter must contain either '+' or '-' without '. (+ Positive respect | - Negative respect)");
- if(playerid != Player)
- {
- 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);
- 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);
- 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);
- }
- else
- {
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his %s respect to "ORAN"%d!", Name(playerid), playerid, (strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Respect);
- FormatMSG(playerid, Color:GREY,"You set your %s respect to "ORAN"%d", (strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Respect);
- }
- #if UPDATE_TOP_ALWAYS == true
- new
- Query[256],
- DBResult: R1;
- format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
- R1 = DB::Query(_DB, Query);
- if(R1)
- {
- if(DB::Valid(R1))
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "UPDATE `Top` SET `%s` = '%d' WHERE `Name` = '%s'", (!strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Respect, Name(Player));
- DB::Query(_DB, Query);
- }
- else
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `%s`) VALUES('%s','%d')", (!strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Name(Player), Respect);
- DB::Query(_DB, Query);
- }
- }
- #endif
- }
- return 1;
- }
- CMD:giveallrespect(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new rType[2],Respect;
- 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)");
- else
- {
- if(Respect < 0) return SendUsage(playerid, "/giveallrespect "GREY"<-/+> <respect>", "Will give everyone respect(Either negative respect that even positive respect)");
- if(!strcmp(rType, "+", false))
- {
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- SetPVarInt(i, "0_Positive", GetPVarInt(i, "0_Positive") + Respect);
- #if UPDATE_TOP_ALWAYS == true
- new
- Query[256],
- DBResult: R1;
- format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
- R1 = DB::Query(_DB, Query);
- if(R1)
- {
- if(DB::Valid(R1))
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "UPDATE `Top` SET `Positive` = '%d' WHERE `Name` = '%s'", GetPVarInt(i, "0_Positive"), Name(i));
- DB::Query(_DB, Query);
- }
- }
- #endif
- }
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" positive respect!", Name(playerid), playerid, Respect);
- }
- }
- else if(!strcmp(rType, "-", false))
- {
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- SetPVarInt(i, "0_Negative", GetPVarInt(i, "0_Negative") + Respect);
- #if UPDATE_TOP_ALWAYS == true
- new
- Query[256],
- DBResult: R1;
- format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
- R1 = DB::Query(_DB, Query);
- if(R1)
- {
- if(DB::Valid(R1))
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "UPDATE `Top` SET `Negative` = '%d' WHERE `Name` = '%s'", GetPVarInt(i, "0_Negative"), Name(i));
- DB::Query(_DB, Query);
- }else DB::Free(R1);
- }
- #endif
- }
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" negative respect!", Name(playerid), playerid, Respect);
- }
- }
- else return SendError(playerid, "The first parameter must contain either '+' or '-' without '. (+ Positive respect | - Negative respect)");
- }
- return 1;
- }
- CMD:resetallrespect(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new rType[2];
- if(sscanf(params, "s[2]", rType)) return SendUsage(playerid, "/resetallrespect "GREY" <-/+>", "Will reset everyone's positive/negative respect!");
- else
- {
- if(!strcmp(rType, "+", false))
- {
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- #if UPDATE_TOP_ALWAYS == true
- new
- Query[256],
- DBResult: R1;
- format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
- R1 = DB::Query(_DB, Query);
- if(R1)
- {
- if(DB::Valid(R1))
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "UPDATE `Top` SET `Positive` = '0' WHERE `Name` = '%s'", Name(i));
- DB::Query(_DB, Query);
- }
- }
- #endif
- SetPVarInt(i, "0_Positive", 0);
- }
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" reseted everyone's positive respect!", Name(playerid), playerid);
- }
- }
- else if(!strcmp(rType, "-", false))
- {
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- #if UPDATE_TOP_ALWAYS == true
- new
- Query[256],
- DBResult: R1;
- format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
- R1 = DB::Query(_DB, Query);
- if(R1)
- {
- if(DB::Valid(R1))
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "UPDATE `Top` SET `Negative` = '0' WHERE `Name` = '%s'", Name(i));
- DB::Query(_DB, Query);
- }
- }
- #endif
- SetPVarInt(i, "0_Negative", 0);
- }
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" reseted everyone's negative respect!", Name(playerid), playerid);
- }
- }
- }
- return 1;
- }
- CMD:setallrespect(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new rType[2],Respect;
- 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)");
- else
- {
- if(Respect < 0) return SendUsage(playerid, "/setallrespect "GREY"<-/+> <respect>", "Will set everyone's respect(Either negative respect that even positive respect)");
- if(!strcmp(rType, "+", false))
- {
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- #if UPDATE_TOP_ALWAYS == true
- new
- Query[256],
- DBResult: R1;
- format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
- R1 = DB::Query(_DB, Query);
- if(R1)
- {
- if(DB::Valid(R1))
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "UPDATE `Top` SET `Positive` = '%d' WHERE `Name` = '%s'", Respect, Name(i));
- DB::Query(_DB, Query);
- }else DB::Free(R1);
- }
- #endif
- SetPVarInt(i, "0_Positive", Respect);
- }
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's positive respect to "ORAN"%d", Name(playerid), playerid, Respect);
- }
- }
- else if(!strcmp(rType, "-", false))
- {
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- #if UPDATE_TOP_ALWAYS == true
- new
- Query[256],
- DBResult: R1;
- format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
- R1 = DB::Query(_DB, Query);
- if(R1)
- {
- if(DB::Valid(R1))
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "UPDATE `Top` SET `Negative` = '%d' WHERE `Name` = '%s'", Respect, Name(i));
- DB::Query(_DB, Query);
- }else DB::Free(R1);
- }
- #endif
- SetPVarInt(i, "0_Negative", Respect);
- }
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's negative respect to "ORAN"%d", Name(playerid), playerid, Respect);
- }
- }
- else return SendError(playerid, "The first parameter must contain either '+' or '-' without '. (+ Positive respect | - Negative respect)");
- }
- return 1;
- }
- CMD:setallwanted(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new Wanted;
- if(sscanf(params, "i", Wanted)) return SendUsage(playerid, "/setallwanted "GREY"<level>", "Will make a player wanted of the specified level");
- else
- {
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- SetPlayerWantedLevel(i, Wanted);
- }
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's wanted level to "ORAN"%d", Name(playerid), playerid, Wanted);
- }
- }
- return 1;
- }
- CMD:healcar(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new Player;
- if(sscanf(params, "u", Player)) return SendUsage(playerid, "/healcar "GREY"<id>", "Will heal a player's car!");
- else
- {
- if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
- if(Player == playerid) return SendError(playerid, "You can use "ORAN"/cargod"W" if you want!");
- if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
- SetVehicleHealth(GetPlayerVehicleID(Player), 1200);
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" healed "ORAN"%s[%i]'s"GREY" vehicle!", Name(playerid), playerid, Name(Player), Player);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" healed your vehicle!", Name(playerid), playerid);
- FormatMSG(Player, Color:GREY, "You healed "ORAN"%s[%i]"GREY"'s vehicle!", Name(Player), Player);
- }
- return 1;
- }
- CMD:destroyv(PARAMS)
- {
- LevelCheck(playerid, 3);
- new Player;
- if(sscanf(params, "u", Player)) return SendUsage(playerid, "/destroyv "GREY"<id>", "Will destroy player's vehicle!");
- else
- {
- if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
- if(Player == playerid) return SendError(playerid, "Player entered is you!");
- if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
- P_DATA[Player][CarGod] = 0;
- SetVehicleHealth(GetPlayerVehicleID(Player), 0);
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" destroyed "ORAN"%s[%i]'s"GREY" vehicle!", Name(playerid), playerid, Name(Player), Player);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" destroyed your vehicle!", Name(playerid), playerid);
- FormatMSG(Player, Color:GREY, "You destroyed "ORAN"%s[%i]"GREY"'s vehicle!", Name(Player), Player);
- }
- return 1;
- }
- CMD:setvhealth(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new Player, vHealth;
- if(sscanf(params, "ui", Player, vHealth)) return SendUsage(playerid, "/setvh "GREY"<id> <health>", "Will set player's vehicle health!");
- else
- {
- if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
- if(Player == playerid) return SendError(playerid, "Player entered is you!");
- if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
- SetVehicleHealth(GetPlayerVehicleID(Player), vHealth);
- 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);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your vehicle's health to"ORAN"%d!", Name(playerid), playerid, vHealth);
- FormatMSG(Player, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s vehicle health to"ORAN"%d!", Name(Player), Player, vHealth);
- }
- return 1;
- }
- CMD:carcolor(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new Player, vColor[2];
- 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)");
- {
- if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
- if(Player == playerid) return SendError(playerid, "Player entered is you!");
- if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
- if(!vColor[0]) vColor[0] = random(255);
- if(!vColor[1]) vColor[1] = random(255);
- ChangeVehicleColor(GetPlayerVehicleID(Player), vColor[0], vColor[1]);
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed "ORAN"%s[%i]'s"GREY" vehicle colors", Name(playerid), playerid, Name(Player), Player);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" changed your vehicle's colors", Name(playerid), playerid);
- FormatMSG(Player, Color:GREY, "You changed "ORAN"%s[%i]"GREY"'s vehicle colors", Name(Player), Player);
- }
- return 1;
- }
- CMD:heal(PARAMS)
- {
- LoginCheck(playerid);
- new Player;
- if(sscanf(params, "u", Player))
- {
- if(P_DATA[playerid][Level] == 2)
- {
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" healed himself!", Name(playerid), playerid);
- SendClientMessage(playerid, Color:GREY, "You healed yourself!");
- }
- else if(P_DATA[playerid][Level] > 2)
- {
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" healed himself!", Name(playerid), playerid);
- SendClientMessage(playerid, Color:GREY, "You healed yourself!");
- return SendUsage(playerid, "/heal"GREY" <id>", "Will heal a specified player!");
- }
- }
- else
- {
- if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
- SetPlayerHealth(Player, 100.0);
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" healed "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" healed you!", Name(playerid), playerid);
- FormatMSG(playerid, Color:GREY, "You healed player "ORAN"%s[%i]", Name(Player), Player);
- }
- return 1;
- }
- CMD:healall(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- SetPlayerHealth(i, 100.0);
- }
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" healed everyone", Name(playerid), playerid);
- }
- return 1;
- }
- CMD:setallskin(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new Skin;
- if(sscanf(params, "i", Skin)) return SendUsage(playerid, "/setallskin "GREY"<skin>", "Will set everyone's skin to the specified ID");
- else
- {
- if(!IsValidSkin(Skin)) return SendError(playerid, "Invalid skin ID!");
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- SetPlayerSkin(i, Skin);
- }
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's skin to "ORAN"%d", Name(playerid), playerid, Skin);
- }
- }
- return 1;
- }
- CMD:setalltime(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new Time;
- if(sscanf(params, "i", Time)) return SendUsage(playerid, "/setalltime "GREY"<hour>", "Will change everyone's in-game time");
- else
- {
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- SetPlayerTime(i, Time, 0);
- }
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's time to "ORAN"%d:00", Name(playerid), playerid, Time);
- }
- }
- return 1;
- }
- CMD:setallweather(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new Weather;
- if(sscanf(params, "i", Weather)) return SendUsage(playerid, "/setallweather "GREY"<weather id>", "Will change everyone's weather");
- else
- {
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- SetPlayerWeather(i, Weather);
- }
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's weather to "ORAN"%d", Name(playerid), playerid, Weather);
- }
- }
- return 1;
- }
- CMD:setdrunk(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new Player, Drunk;
- if(sscanf(params, "ui", Player, Drunk)) return SendUsage(playerid, "/setdrunk "GREY"<id> <level>", "Will set a player drunk of the specified level");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- CheckImune(playerid, Player);
- SetPlayerDrunkLevel(Player, Drunk);
- if(Player != playerid)
- {
- 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);
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s drunk level to "ORAN"%d", Name(Player), Player, Drunk);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your drunk level to "ORAN"%d", Name(playerid), playerid, Drunk);
- }
- else
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set drunk level to "ORAN"%d", Name(playerid), playerid, Drunk);
- }
- return 1;
- }
- CMD:setwanted(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new Player, Wanted;
- if(sscanf(params, "ui", Player, Wanted)) return SendUsage(playerid, "/setwanted "GREY"<id> <level>", "Will set the specified player wanted of the specified level");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- CheckImune(playerid, Player);
- SetPlayerWantedLevel(Player, Wanted);
- if(Player != playerid)
- {
- 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);
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s wanted level to "ORAN"%d", Name(Player), Player, Wanted);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your wanted level to "ORAN"%d", Name(playerid), playerid, Wanted);
- }
- else
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his wanted level to "ORAN"%d", Name(playerid), playerid, Wanted);
- }
- return 1;
- }
- CMD:setinterior(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new Player, Interior;
- if(sscanf(params, "ui", Player, Interior)) return SendUsage(playerid, "/setinterior "GREY"<id> <interior>", "Will set player's interior");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- CheckImune(playerid, Player);
- SetPlayerInterior(Player, Interior);
- if(Player != playerid)
- {
- 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);
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s interior to "ORAN"%d", Name(Player), Player, Interior);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your interior to "ORAN"%d", Name(playerid), playerid, Interior);
- }
- else
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his interior to "ORAN"%d", Name(playerid), playerid, Interior);
- }
- return 1;
- }
- CMD:setworld(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new Player, World;
- if(sscanf(params, "ui", Player, World)) return SendUsage(playerid, "/setworld "GREY"<id> <world>", "Will change player's virtual world");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- CheckImune(playerid, Player);
- SetPlayerVirtualWorld(Player, World);
- if(Player != playerid)
- {
- 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);
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s virtual world to "ORAN"%d", Name(Player), Player, World);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your virtual world to "ORAN"%d", Name(playerid), playerid, World);
- }
- else
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his virtual world to "ORAN"%d", Name(playerid), playerid, World);
- }
- return 1;
- }
- CMD:setcash(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new Player, Cash;
- if(sscanf(params, "ui", Player, Cash)) return SendUsage(playerid, "/setcash "GREY"<id> <cash>", "Will set player's cash to the amount inserted");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- CheckImune(playerid, Player);
- ResetPlayerMoney(Player);
- GivePlayerMoney(Player, Cash);
- if(Player != playerid)
- {
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s cash to "GREE"$%d", Name(playerid), playerid, Name(Player), Player, Cash);
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s cash to "GREE"$%d", Name(Player), Player, Cash);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your cash to "GREE"$%d", Name(playerid), playerid, Cash);
- }
- else
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his cash to "GREE"$%d", Name(playerid), playerid, Cash);
- }
- return 1;
- }
- CMD:setscore(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new Player, aScore;
- if(sscanf(params, "ui", Player, aScore)) return SendUsage(playerid, "/setscore "GREY"<id> <score>", "Will set player's score to the specified score");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- CheckImune(playerid, Player);
- SetPlayerScore(Player, aScore);
- if(Player != playerid)
- {
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s score to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, aScore);
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s score to "ORAN"%d", Name(Player), Player, aScore);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your score to "ORAN"%d", Name(playerid), playerid, aScore);
- }
- else
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his score to "ORAN"%d", Name(playerid), playerid, aScore);
- }
- return 1;
- }
- CMD:setdeaths(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new Player, zDeaths;
- if(sscanf(params, "ui", Player, zDeaths) || zDeaths < 0) return SendUsage(playerid, "/setdeaths "GREY"<id> <deaths>", "Will change player's deaths");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- CheckImune(playerid, Player);
- SetPVarInt(Player, "0_Deaths", zDeaths);
- P_DATA[Player][Deaths] = zDeaths;
- if(Player != playerid)
- {
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s deaths to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, zDeaths);
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s deaths to "ORAN"%d", Name(Player), Player, zDeaths);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your deaths to "ORAN"%d", Name(playerid), playerid, zDeaths);
- }
- else
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his deaths to "ORAN"%d", Name(playerid), playerid, zDeaths);
- #if UPDATE_TOP_ALWAYS
- new
- Query[256],
- DBResult: R1;
- format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
- R1 = DB::Query(_DB, Query);
- if(R1)
- {
- if(DB::Valid(R1))
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "UPDATE `Top` SET `Deaths` = '%d' WHERE `Name` = '%s'", zDeaths, Name(Player));
- DB::Query(_DB, Query);
- }
- else
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Deaths`) VALUES('%s','%d')", Name(Player), zDeaths);
- DB::Query(_DB, Query);
- }
- }
- #endif
- }
- return 1;
- }
- CMD:setkills(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new Player, zKills;
- if(sscanf(params, "ui", Player, zKills) || zKills < 0) return SendUsage(playerid, "/setkills "GREY"<id> <kills>", "Will change player's kills");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- CheckImune(playerid, Player);
- SetPVarInt(Player, "0_Kills", zKills);
- P_DATA[Player][Kills] = zKills;
- if(Player != playerid)
- {
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s kills to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, zKills);
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s kills to "ORAN"%d", Name(Player), Player, zKills);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your kills to "ORAN"%d", Name(playerid), playerid, zKills);
- }
- else
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his kills to "ORAN"%d", Name(playerid), playerid, zKills);
- #if UPDATE_TOP_ALWAYS == true
- new
- Query[256],
- DBResult: R1;
- format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
- R1 = DB::Query(_DB, Query);
- if(R1)
- {
- if(DB::Valid(R1))
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "UPDATE `Top` SET `Kills` = '%d' WHERE `Name` = '%s'", zKills, Name(Player));
- DB::Query(_DB, Query);
- }
- else
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Kills`) VALUES('%s','%d')", Name(Player), zKills);
- DB::Query(_DB, Query);
- }
- }
- #endif
- }
- return 1;
- }
- CMD:setweather(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new Player, Weather;
- if(sscanf(params, "ui", Player, Weather)) return SendUsage(playerid, "/setweather "GREY"<id> <weather id>", "Will change player's weather to the specified weather ID");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- CheckImune(playerid, Player);
- SetPlayerWeather(Player, Weather);
- if(Player != playerid)
- {
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed "ORAN"\"%s[%i]"GREY"'s weather to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, Weather);
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s weather to "ORAN"%d", Name(Player), Player, Weather);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your weather to "ORAN"%d", Name(playerid), playerid, Weather);
- }
- else
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his weather to "ORAN"%d", Name(playerid), playerid, Weather);
- }
- return 1;
- }
- CMD:settime(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- new Player, Time;
- if(sscanf(params, "ui", Player, Time)) return SendUsage(playerid, "/settime "GREY"<id> <hour>", "Will change player's time");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- CheckImune(playerid, Player);
- if(Time < 0 || Time > 24) return SendError(playerid, "Invalid hour! (0 - 24)");
- SetPlayerTime(Player, Time, 0);
- if(Player != playerid)
- {
- 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);
- FormatMSG(Player, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s time to "ORAN"%d:00", Name(Player), Player, Time);
- }
- else
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his time to "ORAN"%d:00", Name(playerid), playerid, Time);
- }
- return 1;
- }
- CMD:setskin(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new Player, Skin;
- if(sscanf(params, "ui", Player, Skin)) return SendUsage(playerid, "/setskin "GREY"<id> <skin>", "Will change player's skin to the specified skin ID");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- CheckImune(playerid, Player);
- if(!IsValidSkin(Skin)) return SendError(playerid, "Invalid skin!");
- SetPlayerSkin(Player, Skin);
- if(Player != playerid)
- {
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed "ORAN"\"%s[%i]"GREY"'s skin to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, Skin);
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s skin to "ORAN"%d", Name(Player), Player, Skin);
- }
- else
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his skin to "ORAN"%d", Name(playerid), playerid, Skin);
- }
- return 1;
- }
- CMD:setarmour(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new Player, Float: Armour;
- if(sscanf(params, "uf", Player, Armour)) return SendUsage(playerid, "/setarmour "GREY"<id> <armour>", "Will set player's armour to the specified armour");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- CheckImune(playerid, Player);
- SetPlayerArmour(Player, Float: Armour);
- if(Player != playerid)
- {
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s armour to "ORAN"%.1f", Name(playerid), playerid, Name(Player), Player, Armour);
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s armour to "ORAN"%.1f", Name(Player), Player, Armour);
- }
- else
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his armour to "ORAN"%.1f", Name(playerid), playerid, Armour);
- }
- return 1;
- }
- CMD:sethealth(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new Player, Float: Health;
- if(sscanf(params, "uf", Player, Health)) return SendUsage(playerid, "/sethealth "GREY"<id> <health>", "Will set player's health to the specified health");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- CheckImune(playerid, Player);
- SetPlayerHealth(Player, Float: Health);
- if(Player != playerid)
- {
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s health to "ORAN"%.1f", Name(playerid), playerid, Name(Player), Player, Health);
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s health to "ORAN"%.1f", Name(Player), Player, Health);
- }
- else
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his health to "ORAN"%.1f", Name(playerid), playerid, Health);
- }
- return 1;
- }
- CMD:pm(PARAMS)
- {
- LoginCheck(playerid);
- if((P_DATA[playerid][Muted] || P_DATA[playerid][Muted]) && P_DATA[playerid][Level] != 5 && !IsPlayerAdmin(playerid))
- return SendError(playerid, "You are not allowed to send personal message while muted!");
- new Player, Message[129];
- if(sscanf(params, "us[129]", Player, Message)) return SendUsage(playerid, "/pm "GREY"<id> [message]", "Sends a personal message to the specified id");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- if(Player == playerid ) return SendError(playerid, "You cannot PM yourself!");
- FormatMSG(Player, Color:ORAN, "PM Received: {FFD48A}%s[%i] says: "W"%s", Name(playerid), playerid, Message);
- FormatMSG(playerid, Color:ORAN, "PM Sent: {FFD48A}to %s[%i]: %s", Name(Player), Player, Message);
- if(S_DATA[ReadPM])
- {
- SendAdminCMD(playerid, "PM Detected: {FFD48A}%s[%i] "GREY"to %s[%i]", Name(playerid), playerid, Name(Player), Player);
- SendAdminCMD(playerid, "Message: {FFD48A}%s", Message);
- }
- #if SAVE_IN_LOGS == true
- SaveInLog(PMS_LOG, "---------------------------\r\n\
- Sender %s\r\n\
- Receiver %s\r\n\
- Message: %s\r\n\
- Date: %s\r\n\
- ---------------------------\r\n\\r\n", Name(playerid), Name(Player), Message, zDate());
- #endif
- }
- return 1;
- }
- CMD:register(PARAMS)
- {
- if(P_DATA[playerid][Logged])
- return SendClientMessage(playerid, -1, ""ORAN"ACCOUNT: "W"Ya estás registrado y logueado ");
- new zStr[100];
- if(AccountExist(Name(playerid)))
- {
- format(zStr, sizeof (zStr), ""GREY"Hola "GREE"%s"GREY", ya tienes una cuenta creada\n\nInicia sesión con tu cuenta:", Name(playerid));
- SPD(playerid, Dialog:Login3, INPUT, ""W"Bienvenido", zStr, "Login", "Exit");
- }
- else
- {
- format(zStr, sizeof (zStr), ""GREY"Hola "ORAN"%s"GREY"\n\nEscribe la contraseña que desees:", Name(playerid));
- ShowPlayerDialog(playerid, Dialog:Register1, DIALOG_STYLE_INPUT, ""W"Registra una cuenta", zStr, "Register", "Exit");
- }
- return 1;
- }
- CMD:login(PARAMS)
- {
- if(P_DATA[playerid][Logged])
- return SendClientMessage(playerid, -1, ""ORAN"ACCOUNT: "W"Ya estás registrado y logueado ");
- new zStr[100];
- if(AccountExist(Name(playerid)))
- {
- format(zStr, sizeof (zStr), ""GREY"Hello "GREE"%s"GREY"!\n\nInicia sesión con tu cuenta:", Name(playerid));
- SPD(playerid, Dialog:Login3, INPUT, ""W"Bienvenido", zStr, "Login", "Exit");
- }
- else
- {
- format(zStr, sizeof (zStr), ""GREY"Hola "ORAN"%s"GREY", No tienes una cuenta creada\n\nEscribe la contraseña que desees:", Name(playerid));
- ShowPlayerDialog(playerid, Dialog:Register1, DIALOG_STYLE_INPUT, ""W"Registra la cuenta", zStr, "Registrar", "Salir");
- }
- return 1;
- }
- CMD:t(p){FormatMSG(p, -1, "%d", P_DATA[p][Logged]);return 1;}
- CMD:acp(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- SPD(playerid, Dialog:cPanel, LIST, ""ORAN"Server Control Panel", cPanel(), "Enable", "Disable");
- return 1;
- }
- CMD:clearchat(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new Yes[3];
- if(sscanf(params, "s[3]", Yes)) return SendUsage(playerid, "/clearchat "GREY"[yes]", "Will clear the chat");
- else
- {
- if(!strcmp(Yes, "yes"))
- {
- for(new m = 0; m < 10; m ++) { SendClientMessage(m, -1, " "); }
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" cleared the chat", Name(playerid), playerid);
- SendClientMessage(playerid, Color:GREY, "You cleared the chat.");
- }
- else SendUsage(playerid, "/clearchat "GREY"[yes]", "Will clear the chat");
- }
- return 1;
- }
- CMD:chat(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- if(!strlen(params))
- return SendUsage(playerid, "/chat "GREY"[block/unblock/spam/clear]");
- if(!strcmp(params, "unblock"))
- {
- if(!S_DATA[Chat]) return SendError(playerid, "Chat already unblocked!");
- S_DATA[Chat] = 0;
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unblocked the chat", Name(playerid), playerid);
- SendClientMessage(playerid, Color:GREY, "You unblocked the chat.");
- }
- else if(!strcmp(params, "block"))
- {
- BlockChat(playerid);
- }
- else if(!strcmp(params, "clear"))
- {
- for(new m = 0; m < 20; m ++) { SendClientMessageToAll(-1, "-"); }
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" cleared the chat", Name(playerid), playerid);
- SendClientMessage(playerid, Color:GREY, "You cleared the chat.");
- }
- else if(!strcmp(params, "spam"))
- {
- new Str[65],
- Preload[65] = "zxcvbnmlkjhgfdsaqwertyuioplmkjnhbgfvcdfrtghyasetgrhnhgrftghnhjki";
- for(new x = 0; x < 45; x++)
- {
- new rCo = random(sizeof(SpamColors)),
- rMe = random(65);
- format(Str, sizeof (Str), "%s%s", Str[rMe], Preload[rMe]);
- foreach(Player, i)
- {
- SendClientMessage(i, SpamColors[rCo], Str[x]);
- }
- }
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" spammed the chat", Name(playerid), playerid);
- SendClientMessage(playerid, Color:GREY, "You spammed the chat.");
- }
- else return SendUsage(playerid, "/chat "GREY"[block/unblock/spam/clear]");
- return 1;
- }
- CMD:respawncars(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- new Yes[3];
- if(sscanf(params, "s[3]", Yes)) return SendUsage(playerid, "/respawncars "GREY"[yes]", "Will respawn all server's unoccupied vehicles");
- else
- {
- if(!strcmp(Yes, "yes"))
- {
- for (new v = 0; v < MAX_VEHICLES; v++)
- {
- if(!VehicleOccupied(v))
- {
- SetVehicleToRespawn(v);
- }
- }
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" respawned all server unoccupied vehicles!", Name(playerid), playerid);
- SendClientMessage(playerid, Color:GREY, "You respawned all server unoccupied vehicles!");
- }else SendUsage(playerid, "/respawncars "GREY"[yes]", "Will rspawn all server's unoccupied vehicles");
- }
- return 1;
- }
- CMD:explode(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- if(sscanf(params, "u", params[0])) return SendUsage(playerid, "/explode "GREY"<id>", "Will create an explosion near specified player's location");
- else
- {
- CheckImune(playerid, params[0]);
- if(params[0] == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
- if(params[0] == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot unfreeze yourself!");
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" exploded player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
- FormatMSG(playerid, Color:GREY, "You exploded "ORAN"%s[%i]", Name(params[0]), params[0]);
- SendClientMessage(params[0], Color:GREY, "You have been exploded!");
- new Float: _P[3];
- GetPlayerPos(params[0],_P[0], _P[1], _P[2]);CreateExplosion(_P[0], _P[1], _P[2], 7, 10.0);
- }
- return 1;
- }
- CMD:slap(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- 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");
- else
- {
- CheckImune(playerid, params[0]);
- if(params[0] == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
- if(params[0] == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot slap yourself!");
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" slapped player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
- FormatMSG(playerid, Color:GREY, "You slapped "ORAN"%s[%i]", Name(params[0]), params[0]);
- SendClientMessage(params[0], Color:GREY, "You have been slapped!");
- new Float:Pos[3], Float: Health;
- GetPlayerPos(params[0], Pos[0], Pos[1], Pos[2]);
- SetPlayerPos(params[0], Pos[0], Pos[1], Pos[2] + 3.5);
- GetPlayerHealth(params[0], Health);
- SetPlayerHealth(params[0], Health - 30);
- }
- return 1;
- }
- CMD:unfreeze(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- if(sscanf(params, "u", params[0], params[1])) return SendUsage(playerid, "/unfreeze "GREY"<id>", "Will un-freeze the player that has been frozen");
- else
- {
- CheckImune(playerid, params[0]);
- if(params[0] == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
- if(params[0] == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot unfreeze yourself!");
- if(!P_DATA[params[0]][Frozen]) return SendClientMessage(playerid, -1, ""GREY"Player is not frozen!");
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unfreezed player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
- FormatMSG(playerid, Color:GREY, "You unfreezed "ORAN"%s[%i]", Name(params[0]), params[0]);
- SendClientMessage(params[0], Color:GREY, "You have been unfreezed!");
- P_DATA[params[0]][Frozen] = 0;
- UnFreeze(params[0]);
- #if SAVE_FREEZE == true
- new
- Query[256];
- format(Query, 256, "DELETE FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
- DB::Query(_DB, Query);
- #endif
- }
- return 1;
- }
- CMD:freeze(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- if(sscanf(params, "u", params[0])) return SendUsage(playerid, "/freeze "GREY"<id>", "Will freeze a specified player, he will cannot freeze-evade!");
- else
- {
- CheckImune(playerid, params[0]);
- if(params[0] == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
- if(params[0] == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot freeze yourself!");
- if(P_DATA[params[0]][Frozen]) return SendClientMessage(playerid, -1, ""GREY"Player is already frozen!");
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" freezed player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
- FormatMSG(playerid, Color:GREY, "You freezed "ORAN"%s[%i]", Name(params[0]), params[0]);
- SendClientMessage(params[0], Color:GREY, "You have been freezed!");
- P_DATA[params[0]][Frozen] = 1;
- Freeze(params[0]);
- #if SAVE_FREEZE == true
- new
- Query[256],
- DBResult:R1;
- format(Query, sizeof(Query), "SELECT `Key` FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(params [0]));
- R1 = DB::Query(_DB, Query);
- if(R1)
- {
- if(DB::Valid(R1))
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "INSERT INTO `Frozen` VALUES(NULL, '%s',1, '%s')",Name(params [0]), GetPlayerIPEx(params [0]));
- DB::Query(_DB, Query);
- }
- else
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "UPDATE `Frozen` SET `Frozen` = '1', `RealName` = '%s' WHERE `IP` = '%s'", Name(params [0]), GetPlayerIPEx(params [0]));
- DB::Query(_DB, Query);
- }
- }
- #endif
- }
- return 1;
- }
- CMD:unjail(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new Player;
- if(sscanf(params, "u", Player)) return SendUsage(playerid, "/unjail "GREY"<id>", "Will unjail the specified player");
- else
- {
- CheckImune(playerid, Player);
- if(Player == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
- if(Player == playerid && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, ""GREY"You cannot unjail yourself!");
- if(!P_DATA[Player][Jailed]) return SendClientMessage(playerid, -1, ""GREY"Player is not jailed!");
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unjailed player "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
- FormatMSG(playerid, Color:GREY, "You unjailed "ORAN"%s[%i]", Name(Player), Player);
- SendClientMessage(Player, Color:GREY, "You have been unjailed!");
- P_DATA[Player][Jailed] = 0;
- P_DATA[Player][JailTime] = 0;
- SetPlayerInterior(playerid, 0);
- SetPlayerPos(playerid, 0.0, 0.0, 0.0);
- SpawnPlayer(playerid);
- PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
- #if SAVE_JAIL == true
- new Query[256], DBResult:Result;
- format(Query, 256, "SELECT `Key` FROM `Jailed` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
- Result = DB::Query(_DB, Query);
- if(Result)
- {
- if(DB::Valid(Result))
- {
- DB::Free(Result);
- format(Query, 256, "DELETE FROM `Jailed` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
- DB::Query(_DB, Query);
- }
- else
- {
- DB::Free(Result);
- }
- }
- #endif
- }
- return 1;
- }
- CMD:jail(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new Player, Time, Reason[40];
- 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");
- else
- {
- CheckImune(playerid, Player);
- if(Player == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
- if(Player == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot jail yourself!");
- if(P_DATA[Player][Jailed]) return SendClientMessage(playerid, -1, ""GREY"Player is already jailed!");
- if(Time == 0)
- {
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" jailed player "ORAN"%s[%i] "GREY"[Reason: "W"%s"GREY"]", Name(playerid), playerid, Name(Player), Player, Reason);
- FormatMSG(playerid, Color:GREY, "You jailed "ORAN"%s[%i] "GREY"[Reason: "W"%s"GREY"][Time: "W"Forever]", Name(Player), Player, Reason, Time);
- SendClientMessage(Player, Color:GREY, "You have been jailed "W"["GREY"Time:"W" Forever[");
- }
- if(Time > 0)
- {
- 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);
- FormatMSG(playerid, Color:GREY, "You jailed "ORAN"%s[%i] "GREY"[Reason: "W"%s"GREY"][Time: "W"%d"GREY" Minutes]", Name(Player), Player, Reason, Time);
- FormatMSG(Player, Color:GREY, "You have been jailed "W"["GREY"Time:"W" %d "GREY"Minutes "W"]", Time);
- }
- P_DATA[Player][Jailed] = 1;
- P_DATA[Player][JailTime] = Time;
- SetTimerEx("JailPlayer", 1500, false, "i", Player);
- #if SAVE_JAIL == true
- new Query[256],DBResult:R1;
- format(Query, sizeof(Query), "SELECT `Key` FROM `Jailed` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
- R1 = DB::Query(_DB, Query);
- if(R1)
- {
- if(DB::Valid(R1))
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "INSERT INTO `Jailed` (`IP`,`Jailed`,`Time`,`RealName`) VALUES('%s','1','%d','%s')",Name(Player), Time, GetPlayerIPEx(Player));
- DB::Query(_DB, Query);
- }
- else
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "UPDATE `Jailed` SET `Jailed` = '1', `Time` = '%d', `RealName` = '%s' WHERE `IP` = '%s'", Time, GetPlayerIPEx(Player), Name(Player));
- DB::Query(_DB, Query);
- }
- }
- #endif
- }
- return 1;
- }
- CMD:settemplevel(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- new Player, TempLevel;
- 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");
- else
- {
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- if(Player == playerid ) return SendError(playerid, "Player entered is you!");
- if(Player < 0 || TempLevel > 5) return SendError(playerid, "Invalid level! Maximum level is "ORAN"5");
- P_DATA[Player][tLevel] = 1;
- P_DATA[Player][Level] = TempLevel;
- 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);
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s temporary level to "ORAN"%d", Name(Player), Player, TempLevel);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your temporary level to "ORAN"%d", Name(playerid), playerid, TempLevel);
- SendClientMessage(playerid, Color:ORAN, "Level will expire on exit!");
- }
- return 1;
- }
- CMD:setvip(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- if(sscanf(params, "ui", params[0], params[1])) return SendUsage(playerid, "/setvip "GREY"<id> <level>", "Will set a player to the specified VIP level");
- else
- {
- if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
- if(!P_DATA[params[0]][Logged]) return SendError(playerid, "Player must be logged in to change his level!");
- if(P_DATA[params[0]][Vip] == params[1]) return SendError(playerid, "Player is already that level!");
- if(params[1] < 0 || params[1] > 3) return SendError(playerid, "Invalid level! Maximum VIP level is "ORAN"3");
- if(params[0] == playerid)
- {
- #if SAVE_IN_LOGS == true
- SaveInLog(SETVIP_LOG, "Admin %s set his VIP level %d on %s", Name(playerid), params[1], zDate());
- #endif
- SendAdminCMD(-1, "Admin "ORAN"%s[%i]"GREY" set himself a VIP member level "ORAN"%d", Name(playerid), playerid, params[1]);
- FormatMSG(playerid, Color:GREY, "You set yourself a VIP member level "ORAN"%d", params[1]);
- }
- else
- {
- #if SAVE_IN_LOGS == true
- 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());
- #endif
- 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]);
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s VIP level to "ORAN"%d", Name(params[0]), params[0], params[1]);
- FormatMSG(params[0], Color:GREY,"Admin "ORAN"%s[%i]"GREY" set your VIP level to "ORAN"%d", Name(playerid), playerid, params[1]);
- }
- SetPVarInt(params[0], "0_Vip", params[1]);
- P_DATA[params[0]][Vip] = params[1];
- if(AccountExist(Name(params[0])))
- {
- new Query[100];
- format(Query, 120, "UPDATE `Accounts` SET `VIP` = '%d' WHERE `Name` = '%s'", params[1], Name(params[0]));
- DB::Query(_DB, Query);
- }
- }
- return 1;
- }
- CMD:ranks(PARAMS)
- {
- #if USE_RANKS == false
- return SendError(playerid, "Using ranks is disabled from script!");
- #else
- LoginCheck(playerid);
- new
- RankString[2_0_0_0];
- RankString = ""BLUE"# "GREY"The current server ranks:\n\n";
- for (new r = 0; r < sizeof(_Ranks); r++)
- {
- 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]);
- }
- ShowPlayerDialog(playerid, Dialog:Empty, BOX, ""BLUE"Server Ranks", RankString, "Close", "");
- return 1;
- #endif
- }
- CMD:setrank(PARAMS)
- {
- #if USE_RANKS == false
- return SendError(playerid, "Using ranks is disabled from script!");
- #else
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- 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")");
- else
- {
- if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
- if(!P_DATA[params[0]][Logged]) return SendError(playerid, "Player must be logged in to change his rank!");
- if(P_DATA[params[0]][Rank] == params[1]) return SendError(playerid, "Player is already that rank!");
- if(params[1] < 0 || params[1] > sizeof(_Ranks) - 1)
- {
- FormatMSG(playerid, Color:ORAN, "* "GREY"Invalid level! Maximum rank is "ORAN"%d "W"-"ORAN"%s", sizeof(_Ranks) - 1, _Ranks[sizeof(_Ranks) - 1][irName]);
- return 1;
- }
- if(params[0] == playerid)
- {
- #if SAVE_IN_LOGS == true
- SaveInLog(SETRANK_LOG, "Admin %s promoved set his rank to %d on %s", Name(playerid), params[1], zDate());
- #endif
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his rank to "ORAN"%d "GREY"|"ORAN" %s", Name(playerid), playerid, params[1], RankName(params[1]));
- FormatMSG(playerid, Color:GREY, "You set your rank to "ORAN"%d "GREY"|"ORAN" %s", params[1], RankName(params[1]));
- SetPVarInt(playerid, "0_Rank", params[1]) ;
- P_DATA[playerid][Rank] = params[1];
- }
- else
- {
- if(P_DATA[params[0]][Rank] < params[1])
- {
- #if SAVE_IN_LOGS == true
- 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());
- #endif
- 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]));
- GameTextForPlayer(params[0], "~n~~n~~n~~n~~n~~n~~n~~g~Ranked up!!", 6000, 1);
- 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]));
- 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]));
- }
- else
- {
- #if SAVE_IN_LOGS == true
- 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());
- #endif
- 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]));
- GameTextForPlayer(params[0], "~n~~n~~n~~n~~n~~n~~n~~r~Ranked down!!", 6000, 1);
- 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]));
- 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]));
- }
- P_DATA[params[0]][Rank] = params[1];
- SetPVarInt(params[0], "0_Rank", params[1]);
- }
- new Query[120];
- if(AccountExist(Name(params[0])))
- {
- format(Query, 120, "UPDATE `Accounts` SET `Rank` = '%d' WHERE `Name` = '%s'", params[1], Name(params[0]));
- DB::Query(_DB, Query);
- }
- #if UPDATE_TOP_ALWAYS == true
- new
- DBResult: R1;
- format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(params[0]));
- R1 = DB::Query(_DB, Query);
- if(R1)
- {
- if(DB::Valid(R1))
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "UPDATE `Top` SET `Rank` = '%d' WHERE `Name` = '%s'", params[1], Name(params[0]));
- DB::Query(_DB, Query);
- }
- else
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Rank`) VALUES('%s','%d')",Name(params[0]), params[1]);
- DB::Query(_DB, Query);
- }
- }
- #endif
- }
- return 1;
- #endif
- }
- CMD:setlevel(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- if(sscanf(params, "ud", params[0], params[1])) return SendUsage(playerid, "/setlevel "GREY"<id> <level>", "Will change a player's level position!");
- else
- {
- if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
- if(!P_DATA[params[0]][Logged]) return SendError(playerid, "Player must be logged in to change his level!");
- if(P_DATA[params[0]][Level] == params[1]) return SendError(playerid, "Player is already that level!");
- if(params[1] < 0 || params[1] > 5) return SendError(playerid, "Invalid level! Maximum level is "ORAN"5");
- if(params[0] == playerid)
- {
- #if SAVE_IN_LOGS == true
- SaveInLog(SETLEVEL_LOG, "Admin %s set his level to %d | %s on %s", Name(playerid), params[1], LevelName(params[1]), zDate());
- #endif
- SetPVarInt(playerid, "0_Level", params[1]) ;
- P_DATA[playerid][Level] = params[1];
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set himself as "ORAN"%s"GREY" of the server!", Name(playerid), playerid, LevelName(params[1]));
- FormatMSG(playerid, Color:GREY, "You set yourself as "ORAN"%s"GREY" of the server!", LevelName(params[1]));
- }
- else
- {
- if(P_DATA[params[0]][Level] < params[1])
- {
- #if SAVE_IN_LOGS == true
- 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());
- #endif
- 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]));
- GameTextForPlayer(params[0], "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~Promoved!", 6000, 1);
- 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]));
- 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]));
- }
- else
- {
- #if SAVE_IN_LOGS == true
- 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());
- #endif
- 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]));
- GameTextForPlayer(params[0], "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~Demoted!", 6000, 1);
- 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]));
- 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]));
- }
- SetPVarInt(params[0], "0_Level", params[1]) ;
- P_DATA[params[0]][Level] = params[1];
- }
- new Query[120];
- if(AccountExist(Name(params[0])))
- {
- format(Query, 120, "UPDATE `Accounts` SET `Level` = '%d' WHERE `Name` = '%s'", params[1], Name(params[0]));
- DB::Query(_DB, Query);
- }
- }
- return 1;
- }
- CMD:unmute(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- if(sscanf(params, "u", params[0])) return SendUsage(playerid, "/unmute "GREY"<id>", "Will unmute the specified player");
- else
- {
- CheckImune(playerid, params[0]);
- if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
- if(params[0] == playerid ) return SendError(playerid, "You cannot unmute yourself!");
- if(!P_DATA[params[0]][Muted]) return SendError(playerid, "Player is not muted!");
- P_DATA[params[0]][Muted] = 0;
- P_DATA[params[0]][MutedTime] = 0;
- KillTimer(MuteTimer[params[0]]);
- #if SAVE_MUTE == true
- new
- Query[256];
- format(Query, 256, "DELETE FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
- DB::Query(_DB, Query);
- #endif
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unmuted player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
- FormatMSG(playerid, Color:GREY, "You unmuted "ORAN"%s[%i]", Name(params[0]), params[0]);
- SendClientMessage(params[0], Color:GREY, "You have been unmuted!");
- }
- return 1;
- }
- CMD:spawnall(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- if(i != playerid)
- {
- SpawnPlayer(i);
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" spawned you and everyone!", Name(playerid), playerid);
- }
- }
- }
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" spawned everyone!", Name(playerid), playerid);
- SendClientMessage(playerid, Color:GREY, "You spawned everyone in the server!");
- return 1;
- }
- CMD:killall(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- if(i != playerid)
- {
- SetPlayerHealth(i, 0.0);
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" killed you and everyone!", Name(playerid), playerid);
- }
- }
- }
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" killed everyone!", Name(playerid), playerid);
- SendClientMessage(playerid, Color:GREY, "You killed everyone in the server!");
- return 1;
- }
- CMD:unfreezeall(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- if(i != playerid)
- {
- P_DATA[i][Frozen] = 0;
- UnFreeze(i);
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" defrosted you and everyone!", Name(playerid), playerid);
- }
- }
- }
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" defrosted everyone!", Name(playerid), playerid);
- SendClientMessage(playerid, Color:GREY, "You defrosted everyone in the server!");
- return 1;
- }
- CMD:freezeall(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- if(i != playerid)
- {
- P_DATA[i][Frozen] = 1;
- Freeze(i);
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" froze you and everyone!", Name(playerid), playerid);
- }
- }
- }
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" froze everyone!", Name(playerid), playerid);
- SendClientMessage(playerid, Color:GREY, "You froze everyone in the server! However, if the re-connect, they will be able to move again.");
- return 1;
- }
- CMD:banall(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- new
- File:zFile,
- zStr[100];
- zFile = fopen(BAN_LOG, io_append);
- format(zStr, sizeof (zStr), "\r\n\r\n\r\n][MASSIVE BAN ON %s[]\r\n", zDate ());
- fwrite(zFile, zStr);
- foreach(Player, i)
- {
- if(P_DATA[i][Level] < 3 || !P_DATA[i][Vip])
- {
- if(i != playerid)
- {
- #if SAVE_IN_LOGS == true
- if(zFile)
- {
- format(zStr, sizeof (zStr), "Player: %s[%i] has been banned by \"%s\" with reason \"Massive ban!\" on %s\r\n",
- Name(i),
- i,
- Name(playerid),
- zDate());
- fwrite(zFile, zStr);
- }
- #endif
- }
- }
- }
- fwrite(zFile, "][!! END OF MASSIVE BAN !![]");
- fclose(zFile);
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" banned everyone from the server except VIP members and level 3 admins!", Name(playerid), playerid);
- SendClientMessage(playerid, Color:GREY, "You banned everyone from the server!");
- return 1;
- }
- CMD:kickall(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- new
- File:zFile,
- zStr[100];
- zFile = fopen(KICK_LOG, io_append);
- format(zStr, sizeof (zStr), "\r\n\r\n\r\n][MASSIVE KICK ON %s[]\r\n", zDate ());
- fwrite(zFile, zStr);
- foreach(Player, i)
- {
- if(P_DATA[i][Level] < 3 || !P_DATA[i][Vip])
- {
- if(i != playerid)
- {
- KickEx(i, Name(i), "Massive kick!", false);
- }
- }
- }
- fwrite(zFile, "][!! END OF MASSIVE KICK !![]");
- fclose(zFile);
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" kicked everyone from the server except VIP members and level 3 admins!", Name(playerid), playerid);
- SendClientMessage(playerid, Color:GREY, "You kicked everyone from the server!");
- return 1;
- }
- CMD:slapall(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new
- Float:Pos[3],
- Float:Health
- ;
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- if(i != playerid)
- {
- GetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
- SetPlayerPos(i, Pos[0], Pos[1], Pos[2] + 3.5);
- GetPlayerHealth(i, Health);
- SetPlayerHealth(i, Health - 30);
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" unmuted you and everyone!", Name(playerid), playerid);
- }
- }
- }
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" slapped everyone!", Name(playerid), playerid);
- SendClientMessage(playerid, Color:GREY, "You slapped everyone in the server!");
- return 1;
- }
- CMD:unmuteall(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- if(i != playerid)
- {
- P_DATA[i][MutedAll] = 0;
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" unmuted you and everyone!", Name(playerid), playerid);
- }
- }
- }
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unmuted everyone!", Name(playerid), playerid);
- SendClientMessage(playerid, Color:GREY, "You unmuted everyone in the server!");
- return 1;
- }
- CMD:muteall(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- foreach(Player, i)
- {
- if(P_DATA[i][Level] != 5)
- {
- if(i != playerid)
- {
- P_DATA[i][MutedAll] = 1;
- FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" muted you and everyone!", Name(playerid), playerid);
- }
- }
- }
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" muted everyone!", Name(playerid), playerid);
- SendClientMessage(playerid, Color:GREY, "You muted everyone in the server! However, if the re-connect, they will be able to speak.");
- return 1;
- }
- CMD:mute(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- 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");
- else
- {
- CheckImune(playerid, params[0]);
- if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
- if(params[0] == playerid) return SendError(playerid, "You cannot mute yourself!");
- if(P_DATA[params[0]][Muted]) return SendError(playerid, "Player is already muted!");
- if(!params[1])
- {
- P_DATA[params[0]][Muted] = 1;
- P_DATA[params[0]][MutedTime] = 0;
- #if SAVE_MUTE == true
- new
- pQue[256];
- format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
- new DBResult:R1 = DB::Query(_DB, pQue);
- if(R1)
- {
- if(!DB::Valid(R1))
- {
- DB::Free(R1);
- format(pQue, sizeof (pQue), "INSERT INTO `Muted` VALUES (NULL, '%s', '1', '0', '%s')", GetPlayerIPEx(params[0]), Name(params[0]));
- DB::Query(_DB, pQue);
- }
- else
- {
- DB::Free(R1);
- format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '0', `RealName` = '%s' WHERE `IP` = '%s'", Name(params[0]), GetPlayerIPEx(params[0]));
- DB::Query(_DB, pQue);
- }
- }
- #endif
- SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" muted player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0], params[1]);
- FormatMSG(playerid, Color:GREY, "You muted "ORAN"%s[%i]", Name(params[0]), params[0]);
- SendClientMessage(params[0], Color:GREY, "You have been muted!");
- }
- else
- {
- P_DATA[params[0]][Muted] = 1;
- 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]);
- FormatMSG(playerid, Color:GREY, "You muted "ORAN"%s[%i] "GREY"["ORAN"Time: "W"%d"GREY" minutes[", Name(params[0]), params[0], params[1]);
- FormatMSG(params[0], Color:GREY, "You have been muted! "W"["GREE"Time: "W"%d"GREY" minutes"W"[", params[1]);
- #if SAVE_MUTE == true
- new
- pQue[256];
- format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
- new DBResult:R1 = DB::Query(_DB, pQue);
- if(R1)
- {
- if(!DB::Valid(R1))
- {
- DB::Free(R1);
- format(pQue, sizeof (pQue), "INSERT INTO `Muted` VALUES (NULL, '%s', '1', '%d', '%s')", GetPlayerIPEx(params[0]), params[1], Name(params[0]));
- DB::Query(_DB, pQue);
- }
- else
- {
- DB::Free(R1);
- format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '%d', `RealName` = '%s' WHERE `IP` = '%s'", params[1], Name(params[0]), GetPlayerIPEx(params[0]));
- DB::Query(_DB, pQue);
- }
- }
- #endif
- KillTimer(MuteTimer[params[0]]);
- MuteTimer[params[0]] = SetTimerEx("UnMutePlayer", 60_000, true, "i", params[0]);
- P_DATA[params[0]][MutedTime] = params[1];
- }
- }
- return 1;
- }
- CMD:kick(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- 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");
- else
- {
- if(playerid == params[0]) return SendError(playerid, "You can't kick yourself!");
- if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
- CheckImune(playerid, params[0]);
- KickEx(params[0], Name(playerid), params[1], true);
- }
- return 1;
- }
- CMD:unban(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- new Account[50];
- if(sscanf(params, "s[50]", Account)) return SendUsage(playerid, "/unban [name]","Will unban a banned account");
- else
- {
- new DBResult:Result, Query[129];
- format(Query, 129, "SELECT `IP` FROM `Banlist` WHERE `Name` = '%s'", Account);
- Result = DB::Query(_DB, Query);
- if(Result)
- {
- if(DB::Valid(Result))
- {
- new fIP[30];
- DB::GetField(Result, "IP", fIP, 30);
- if(strlen(fIP) > 0)
- {
- new Str[50];
- format(Str, sizeof (Str), "unbanip %s", fIP);
- SendRconCommand(Str), SendRconCommand("reloadbans");
- }
- DB::Free(Result);
- format(Query, 129, "DELETE FROM `Banlist` WHERE `Name` = '%s'", Account);
- DB::Query(_DB, Query);
- FormatMSG(playerid, Color:GREY, "Account "ORAN"%s"GREY" has been removed from the Banlist!", Account);
- }
- else
- {
- DB::Free(Result);
- SendError(playerid, "Account not found in the Banlist!");
- return 1;
- }
- }
- }
- return 1;
- }
- CMD:ban(PARAMS)
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- new Player, IpBan, Reason[40];
- 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");
- else
- {
- if(playerid == Player) return SendError(playerid, "You can't ban yourself!");
- if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
- CheckImune(playerid, Player);
- if(IpBan)
- {
- #if SAVE_IN_LOGS == true
- new
- zStr[256],
- File:zFile;
- format(zStr, sizeof (zStr), "Player: %s[%i] has been IP banned by \"%s\" with reason \"%s\" on %s\r\n",
- Name(playerid),
- playerid,
- Name(playerid),
- Reason,
- zDate());
- zFile = fopen(BAN_LOG, io_append);
- if(zFile)
- {
- fwrite(zFile, zStr);
- fclose(zFile);
- }
- #endif
- FormatMSG(playerid, Color:ORAN, "SERVER:"W" You have been banned from this server! "W"["GREY" %s"W"]", Reason);
- BanEx(Player, Reason);
- }
- else
- {
- BanEx2(Player, Name(playerid), Reason);
- FormatMSG(playerid, Color:ORAN, "SERVER:"W" You have been banned from this server! "W"["GREY" %s"W"]", Reason);
- }
- 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);
- }
- return 1;
- }
- stock AntiIP(const string[])
- {
- static
- RegEx:IP;
- if(!IP)IP = regex_build("(.*?)([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})(.*?)");
- return regex_match_exid(string, IP);
- }
- stock AntiSite(const string[])
- {
- static
- RegEx:Site;
- if(!Site)Site = regex_build("([\\w-]*://)?([\\w-]+\\.)+([\\w-]+)(/[^\\s]*)*");
- return regex_match_exid(string, Site);
- }
- public OnPlayerText(playerid, text[])
- {
- if(!P_DATA[playerid][Muted] || !P_DATA[playerid][MutedAll])
- {P_DATA[playerid][Msgs]++;}
- //If player is NOT the RCON admin and NEITHER the OWNER
- if(!IsPlayerAdmin(playerid) && P_DATA[playerid][Level] != 5)
- {
- //Then, take action!
- if((P_DATA[playerid][Muted] || P_DATA[playerid][MutedAll]))
- {
- if(!P_DATA[playerid][MutedTime])
- SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You are not allowed to chat! You have been muted!");
- else
- FormatMSG(playerid, Color:ORAN, "SERVER:"W" You are still muted! "ORAN"["GREY"Aprox: "W"%d minutes"ORAN"]",P_DATA[playerid][MutedTime]);
- return 0;
- }
- if(S_DATA[AntiRepeat])
- {
- if(!isnull(P_DATA[playerid][RepMSG]))
- {
- if(!strcmp(text, P_DATA[playerid][RepMSG], false))
- {
- SendClientMessage(playerid, Color:ORAN, "SERVER:"W" Please don't repeat yourself!");
- SendAdminCMD(playerid, "Player %s[%i] repeated himself!", Name(playerid), playerid);
- return 0;
- }
- }
- format(P_DATA[playerid][RepMSG], 129, text);
- }
- if(S_DATA[Chat])
- {
- return GameTextForPlayer(playerid, "~n~~n~~n~~n~~r~Chat has been disabled!~w~You cannot send any messages!", 5000, 3);
- }
- P_DATA[playerid][SpamMSG] ++;
- if(!P_DATA[playerid][Muted] && S_DATA[AntiSpam])
- {
- if(P_DATA[playerid][SpamMSG] > MAXIMUM_SPAM && !IsPlayerAdmin(playerid))
- return BanEx2(playerid, .zReason = "Extreme Spam!"),false;
- else if(P_DATA[playerid][SpamMSG] > MEDIUM_SPAM)
- return KickEx(playerid, .zReason = "Massive Spam"),false;
- else if(P_DATA[playerid][SpamMSG] > MINIMUM_SPAM)
- {
- P_DATA[playerid][Muted] = 1;
- P_DATA[playerid][MutedTime] = 1;
- SendClientMessage(playerid, Color:ORAN, "SERVER: "W"You have been muted "ORAN"1"W" minutes for spamming the chat!");
- MuteTimer[playerid] = SetTimerEx("UnMutePlayer", 60_000, true, "i", playerid);
- #if SAVE_MUTE == true
- new pQue[256];
- format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(playerid));
- new DBResult:R1 = DB::Query(_DB, pQue);
- if(R1)
- {
- if(!DB::Valid(R1))
- {
- DB::Free(R1);
- format(pQue, sizeof (pQue), "INSERT INTO `Muted` (`IP`, `Muted`, `Time`, `RealName`) VALUES ('%s', '1', '1', '%s')", GetPlayerIPEx(playerid), Name(playerid));
- DB::Query(_DB, pQue);
- }
- else
- {
- DB::Free(R1);
- format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '2', `RealName` = '%s' WHERE `IP` = '%s'", Name(playerid), GetPlayerIPEx(playerid));
- DB::Query(_DB, pQue);
- }
- }
- #endif
- return 0;
- }
- }
- }
- if(S_DATA[AntiAD])
- {
- if(!P_DATA[playerid][Muted] || !P_DATA[playerid][MutedAll])
- {
- if(P_DATA[playerid][Vip] > 0)
- {
- if(text[0] == VIP_CHAT_SYMBOL || text[0] == VIP_CHAT_SYMBOL2)
- {
- if(!S_DATA[VipChat] && P_DATA[playerid][Level] < 4)
- return SendError(playerid, "Only the Owner and the Administrator of the server can use the VIP Chat.");
- #if SAVE_IN_LOGS == true
- new
- Date[6];
- getdate(Date[0], Date[1], Date[2]);
- gettime(Date[3], Date[4], Date[5]);
- 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]);
- #endif
- new
- iStr[160];
- format(iStr, sizeof (iStr), "#### "GREY"%s:"W" %s", Name(playerid), text[1]);
- foreach(Player, i){
- if(P_DATA[i][Vip] > 0){
- SendClientMessage(i, Color:BLUE, iStr);
- }
- }
- return 0;
- }
- }
- if(P_DATA[playerid][Level] > 0)
- {
- if(text[0] == ADMIN_CHAT_SYMBOL || text[0] == ADMIN_CHAT_SYMBOL2)
- {
- if(!S_DATA[AdminChat] && P_DATA[playerid][Level] < 4)
- return SendError(playerid, "Only the Owner and the Administrator of the server can use the Admin Chat.");
- #if SAVE_IN_LOGS == true
- new
- Date[6];
- getdate(Date[0], Date[1], Date[2]);
- gettime(Date[3], Date[4], Date[5]);
- 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]);
- #endif
- new
- iStr[160];
- format(iStr, sizeof (iStr), "#### "GREY"%s:"W" %s", Name(playerid), text[1]);
- foreach(Player, i){
- if(P_DATA[i][Level] > 0){
- SendClientMessage(i, 0xFF0000FF, iStr);
- }
- }
- return 0;
- }
- }
- if(text[0] != ADMIN_CHAT_SYMBOL || text[0] != ADMIN_CHAT_SYMBOL2)
- {
- if(AntiIP(text) || AntiSite(text))
- {
- P_DATA[playerid][Warns]++;
- SendPlayerMessageToPlayer(playerid, playerid, text);
- FormatMSG(playerid, Color:ORAN, "*** "GREY"You have been warned for advertising! ("ORAN"%d"GREY"/"ORAN""#MAX_P_WARNS""GREY")", P_DATA[playerid][Warns]);
- if(P_DATA[playerid][Warns] >= MAX_P_WARNS)
- {
- SendClientMessage(playerid, Color:ORAN, "*** "GREY"You have been kicked from the server for advertising!");
- foreach(Player, x)
- {
- if(x != playerid)
- {
- FormatMSG(x, Color:ORAN, "*** "GREY"%s has kicked from the server for advertising.", Name(playerid));
- }
- }
- P_DATA[playerid][Warns] = 0;
- KickEx(playerid, .zReason = "Advertising in the chat");
- }
- return 0;
- }
- SendPlayerMessageToAll(playerid, text);
- }
- }
- }else SendPlayerMessageToAll(playerid, text);
- return 0;
- }
- public OnVehicleDeath(vehicleid)
- {
- foreach(Player, InV)
- {
- if(vehicleid == P_DATA[InV][aCar])
- {
- SendError(InV, "Your admin car has been dstroyed!");
- P_DATA[InV][aCar] = -1;
- UpdatePlayer3DTextLabelText(InV, ZaAdminCar[InV], 0xFF0000FF, "Destroyed!\n{000000}--------------\n"W"You can spawn another one!");
- SetTimerEx("dLabel", 4000, false, "i", InV);
- }
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(strlen(GPVSEx(playerid, "Type")))
- {
- if(PRESSED(KEY_FIRE) && !strcmp(GPVSEx(playerid, "Type"), "Unlimited", false))
- {
- if(!IsPlayerInVehicle(playerid, P_DATA[playerid][aCar])) return 0;
- AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
- P_DATA[playerid][NosTimer] = SetTimerEx("UnlimitedNos",17 * 1000, true, "i", playerid);
- }
- else if(RELEASED(KEY_FIRE) && !strcmp(GPVSEx(playerid, "Type"), "Unlimited", false))
- {
- KillTimer(P_DATA[playerid][NosTimer]),
- RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1010);
- }
- if(PRESSED(KEY_FIRE) && strcmp(GPVSEx(playerid, "Type"), "Unlimited", false))
- {
- if(!IsPlayerInVehicle(playerid, P_DATA[playerid][aCar])) return 0;
- AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
- GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~10~g~~h~x~b~~h~ nitro added!", 1500, 3);
- }
- }
- if(P_DATA[playerid][Vip] > 0)
- {
- if(newkeys & KEY_ACTION && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- new Float:V[3];
- GetVehicleVelocity(GetPlayerVehicleID(playerid), V[0], V[1], V[2]);
- if(floatabs(V[0]) < 3 && floatabs(V[1]) < 3 && floatabs(V[2]) < 3)
- {
- SetVehicleVelocity(GetPlayerVehicleID (playerid), V[0] * P_DATA[playerid][bSpeed], V[1] * P_DATA[playerid][bSpeed], V[2] * P_DATA[playerid][bSpeed] );
- }
- }
- if(PRESSED(KEY_LOOK_BEHIND) && P_DATA[playerid][Spin] == 1 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- new Float:P[3];
- GetVehiclePos(GetPlayerVehicleID(playerid), P[0], P[1], P[2] );
- SetVehiclePos(GetPlayerVehicleID(playerid), P[0], P[1], P[2] +1 );
- SetVehicleAngularVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, 3.0);
- GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~WOOSH!", 600, 3);
- }
- }
- return 1;
- }
- CMD:bspeed(PARAMS)
- {
- if(P_DATA[playerid][Vip] > 0)
- {
- if(!P_DATA[playerid][Boost])
- return SendError(playerid, "Speed Boost must be activated first! Activate it from "BLUE"/PCP");
- new Speed;
- if(sscanf(params, "d", Speed))
- {
- SendUsage(playerid, "/bspeed "GREY"<speed> "W"(Speed is betwen 0-30)", "Wil change speed boost!");
- return 1;
- }
- else
- {
- switch(P_DATA[playerid][Vip])
- {
- case (1):
- {
- if(Speed < 0 || Speed > 10)
- return SendError(playerid, "Level 1 VIP Members are allowed only up to "BLUE"10"W".");
- }
- case (2):
- {
- if(Speed < 0 || Speed > 20)
- return SendError(playerid, "Level 2 VIP Members are allowed only up to "BLUE"20"W".");
- }
- case (3):
- {
- if(Speed < 0 || Speed > 30)
- return SendError(playerid, "Level 3 VIP Members are allowed only up to "BLUE"30"W".");
- }
- }
- new Float:Speed2 = Speed;
- P_DATA[playerid][bSpeed] = (Speed) ? (Speed2 / 2.367) : (0.0) ;
- P_DATA[playerid][Boost] = 1;
- if(Speed)FormatMSG(playerid, ~1, "Speed Boost set to "BLUE"%d"W" ("BLUE"%.3f"W")", Speed, P_DATA[playerid][bSpeed]);
- else
- {
- P_DATA[playerid][Boost] = 0;
- P_DATA[playerid][bSpeed] = 0;
- SendClientMessage(playerid, Color:ORAN, "Speed Boost disabled!");
- }
- }
- }
- else
- {
- SendError(playerid, "Only VIP members allowed!");
- }
- return 1;
- }
- FormatList(playerid)
- {
- new Str[1024];
- strcat(Str, ""GREY"Name\n\
- "GREY"Money\n\
- "GREY"Score\n\
- "GREY"Cookies\n\
- "GREY"Respect\n\
- "GREY"Kills\n\
- "GREY"Deaths\n\
- "GREY"Messages\n\
- "GREY"Commands\n\
- "GREY"Fail Commands\n\
- "GREY"Online Time\n\
- "GREY"Admin Level\n\
- "GREY"VIP Level\n\
- "GREY"Change Password", 1024);
- if(playerid != GetPVarInt(playerid, "StatsOf"))
- {
- strcat(Str, "\n"ORAN"Ban Account\n\
- "ORAN"Delete Account", 1024);
- }
- return Str;
- }
- FormatInside(playerid, Player, what[] = "z", extra[] = " ", zelse[] =" ")
- {
- new Str[256];
- if(strcmp(what, "z", true))
- {
- if(Player == playerid){
- format(Str, sizeof (Str), ""GREY"Changing "ORAN"your"GREY" %s\n\n"ORAN"%s", what, extra);}
- else{
- format(Str, sizeof (Str), ""GREY"Changing "ORAN"%s"GREY"'s %s\n\n"ORAN"%s", Name(Player), what, extra);}
- }
- else
- 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);
- return Str;
- }
- NameExist(name[])
- {
- foreach(Player, i)
- {
- if(!strcmp(name, Name(i), false)) return 1;
- }
- return 0;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- if(playerid != clickedplayerid)
- {
- ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(clickedplayerid), ""BLUE"Send Personal Message\n\
- "BLUE"Give Respect\n\
- "BLUE"Give Money\n\
- "BLUE"See Stats\n\
- "ORAN"Report", "Select", "Exit");
- SetPVarInt(playerid, "ClickedTO", clickedplayerid);
- }else SendError(playerid, "Please select someone else other than you!");
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new Query[500];
- if(response)
- {
- iDialog<PCP>
- {
- switch(listitem)
- {
- case 1:
- {
- if(S_DATA[AutoLogin])
- {
- P_DATA[playerid][pAuto] = 1;
- SPD(playerid, Dialog:PCPBack, BOX, ""W"Auto-Login", ""BLUE"Auto-Login\n\n"W"This feature has been enabled!", "Back", "");
- }
- else
- {
- P_DATA[playerid][pAuto] = 0;
- SPD(playerid, Dialog:PCPBack, BOX, ""W"Auto-Login", ""BLUE"Auto-Login\n\n"W"This feature is not available!!", "Back", "");
- }
- }
- case 2:
- {
- P_DATA[playerid][BAPMs] = 1;
- SPD(playerid, Dialog:PCPBack, BOX, ""W"Block PM", ""BLUE"Block Personal Messages\n\n"W"This feature has been enabled!", "Back", "");
- }
- case 3:
- {
- cmd_stats(playerid,"");
- }
- case 4: cmd_pcp(playerid, "");
- case 5:
- {
- P_DATA[playerid][God] = 1;
- SPD(playerid, Dialog:PCPBack, BOX, ""W"Godlike", ""BLUE"Godlike\n\n"W"This feature has been enabled!\nYou won't loose health anymore.", "Back", "");
- }
- case 6:
- {
- P_DATA[playerid][CarGod] = 1;
- 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", "");
- }
- case 7:
- {
- P_DATA[playerid][Boost] = 1;
- 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", "");
- }
- case 8:
- {
- P_DATA[playerid][VIPTag] = 1;
- 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", "");
- Delete3DTextLabel(P_DATA[playerid][Tag3D]);
- P_DATA[playerid][Tag3D] = Create3DTextLabel("VIP Member", Color:BLUE, 0.0, 0.0, 0.0, 90.0, 0, 1);
- Attach3DTextLabelToPlayer(P_DATA[playerid][Tag3D], playerid, 0.0, 0.0, 1.2);
- }
- case 9: cmd_pcp(playerid, "");
- case 10:
- {
- P_DATA[playerid][Spin] = 1;
- 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", "");
- }
- case 11:
- {
- for(new i = 0; i < 5; i++)
- if(IsPlayerAttachedObjectSlotUsed(playerid, i))
- RemovePlayerAttachedObject(playerid, i);
- P_DATA[playerid][Incred] = 1;
- SetPlayerAttachedObject(playerid, 0, 18693, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
- SetPlayerAttachedObject(playerid, 1, 18693, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
- SetPlayerAttachedObject(playerid, 2, 18703, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
- SetPlayerAttachedObject(playerid, 3, 18703, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
- SetPlayerAttachedObject(playerid, 4, 18965, 2, 0.111052, 0.021643, -0.000846, 92.280899, 92.752510, 358.071044, 1.200000, 1.283168, 1.200000 );
- SPD(playerid, Dialog:PCPBack, BOX, ""W"Incredible", ""BLUE"Incredible\n\n"W"This feature has been enabled!\nCheck your character!", "Back", "");
- }
- case 12: cmd_pcp(playerid, "");
- case 13:
- {
- SPD(playerid, Dialog:PCPShout, INPUT, ""W"Shout to the server!", ""W"Insert the text you want to shout:", "Insert", "Back");
- }
- }
- }
- }
- else
- {
- iDialog<PCP>
- {
- switch(listitem)
- {
- case 1:
- {
- if(S_DATA[AutoLogin])
- {
- P_DATA[playerid][pAuto] = 0;
- SPD(playerid, Dialog:PCPBack, BOX, ""W"Auto-Login", ""BLUE"Auto-Login\n\n"W"This feature has been disabled!", "Back", "");
- }
- else
- {
- P_DATA[playerid][pAuto] = 0;
- SPD(playerid, Dialog:PCPBack, BOX, ""W"Auto-Login", ""BLUE"Auto-Login\n\n"W"This feature is not available!!", "Back", "");
- }
- }
- case 2:
- {
- P_DATA[playerid][BAPMs] = 0;
- SPD(playerid, Dialog:PCPBack, BOX, ""W"Block PM", ""BLUE"Block Personal Messages\n\n"W"This feature has been disabled!", "Back", "");
- }
- case 3:
- {
- cmd_stats(playerid,"");
- }
- case 4: cmd_pcp(playerid, "");
- case 5:
- {
- P_DATA[playerid][God] = 0;
- SPD(playerid, Dialog:PCPBack, BOX, ""W"Godlike", ""BLUE"Godlike\n\n"W"This feature has been disabled!\nYou will loose health.", "Back", "");
- }
- case 6:
- {
- P_DATA[playerid][CarGod] = 0;
- 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", "");
- }
- case 7:
- {
- P_DATA[playerid][Boost] = 0;
- SPD(playerid, Dialog:PCPBack, BOX, ""W"Vehicle Boost", ""BLUE"Vehicle Boost\n\n"W"This feature has been disabled!", "Back", "");
- }
- case 8:
- {
- P_DATA[playerid][VIPTag] = 0;
- 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", "");
- Delete3DTextLabel(P_DATA[playerid][Tag3D]);
- }
- case 9: cmd_pcp(playerid, "");
- case 10:
- {
- P_DATA[playerid][Spin] = 0;
- SPD(playerid, Dialog:PCPBack, BOX, ""W"Vehicle Spin", ""BLUE"Vehicle Spin\n\n"W"This feature has been disabled!", "Back", "");
- }
- case 11:
- {
- for(new i = 0; i < 5; i++)
- if(IsPlayerAttachedObjectSlotUsed(playerid, i))
- RemovePlayerAttachedObject(playerid, i);
- P_DATA[playerid][Incred] = 0;
- SPD(playerid, Dialog:PCPBack, BOX, ""W"Incredible", ""BLUE"Incredible\n\n"W"This feature has been enabled!\nCheck your character!", "Back", "");
- }
- case 12: cmd_pcp(playerid, "");
- case 13:
- {
- SPD(playerid, Dialog:PCPShout, INPUT, ""W"Shout to the server!", ""W"Insert the text you want to shout:", "Insert", "Back");
- }
- }
- }
- }
- iDialog<PCPBack>
- {
- cmd_pcp(playerid, "");
- }
- iDialog<PCPShout>
- {
- if(response)
- {
- if(strlen(inputtext))
- {
- SendClientMessageToAll(Color:BLUE, inputtext);
- }
- else SPD(playerid, Dialog:PCPShout, INPUT, ""W"Shout to the server!", ""W"Insert the text you want to shout:", "Insert", "Back");
- }
- else cmd_pcp(playerid, "");
- }
- iDialog<CLICK_REPORT>
- {
- if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
- {
- SendError(playerid, "Player is no longer connected to the server!");
- DeletePVar(playerid, "ClickedTO");
- return 1;
- }
- if(!response)
- return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
- "BLUE"Give Respect\n\
- "BLUE"Give Money\n\
- "BLUE"See Stats\n\
- "ORAN"Report", "Select", "Exit");
- new
- Report[256];
- if(sscanf(inputtext, "s[256]", Report) || !strlen(Report))
- return SendError(playerid, "Please insert a reason!"),
- OnDialogResponse(playerid, Dialog:CLICK, 1, 4, "");
- else
- {
- if(strlen(Report) < 10)
- return SendError(playerid, "The reason must be at least "BLUE"10"GREY" characters long!"),
- OnDialogResponse(playerid, Dialog:CLICK, 1, 4, "");
- new
- Player = GetPVarInt(playerid, "ClickedTO"),
- Str[256];
- 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);
- SPD(playerid, Dialog:Empty, BOX, ""W"Player reported!", Str, "Close", "");
- foreach(Player, i)
- {
- if(P_DATA[i][Level] > 2)
- {
- if(i != playerid)
- {
- FormatMSG(i, Color:BLUE, "REPORT: "GREY"Player "ORAN"%s[%i]"GREY" reported "ORAN"%s[%i]"GREY"", Name(playerid), playerid, Name(Player), Player);
- FormatMSG(i, Color:GREE, "MESSAGE:"GREY" %s", Report);
- }
- }
- }
- format(Str, sizeof(Str), "\r\n---------------------------------------------------------\r\n\
- Reporter: %s\r\n\
- Reported: %s\r\n\
- Message: %s\r\n\
- Date: %s\r\n\
- ---------------------------------------------------------\r\n",
- Name(playerid),
- Name(Player),
- Report,
- zDate());
- new
- File: ReportLog = fopen(REPORT_LOG, io_append);
- if(ReportLog)
- {
- fwrite(ReportLog, Str);
- fclose(ReportLog);
- }
- }
- }
- iDialog<CLICK_MONEY>
- {
- if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
- {
- SendError(playerid, "Player is no longer connected to the server!");
- DeletePVar(playerid, "ClickedTO");
- return 1;
- }
- if(!response)
- return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
- "BLUE"Give Respect\n\
- "BLUE"Give Money\n\
- "BLUE"See Stats\n\
- "ORAN"Report", "Select", "Exit");
- new
- pMoney;
- if(sscanf(inputtext, "i", pMoney) || !pMoney)
- return SendError(playerid, "Please insert a correct value!"),
- OnDialogResponse(playerid, Dialog:CLICK, 1, 2, "");
- else
- {
- new
- Player = GetPVarInt(playerid, "ClickedTO"),
- Str[256];
- if(GetPlayerMoney(playerid) < pMoney)
- return SendError(playerid, "Not enough money to send!"),
- OnDialogResponse(playerid, Dialog:CLICK, 1, 2, "");
- GivePlayerMoney(Player, pMoney);
- GivePlayerMoney(playerid, -pMoney);
- format(Str, sizeof(Str), ""W"You gave a "GREE"$%d"W" to:\n"BLUE"%s"W" ID: "BLUE"%d", pMoney, Name(Player), Player);
- SPD(playerid, Dialog:Empty, BOX, ""W"Money sent!", Str, "Close", "");
- FormatMSG(Player, Color:BLUE, "***"GREY" You received "GREE"$%d"GREY" from player "BLUE"%s[%i]", pMoney, Name(playerid), playerid);
- }
- }
- iDialog<CLICK_RP>
- {
- if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
- {
- SendError(playerid, "Player is no longer connected to the server!");
- DeletePVar(playerid, "ClickedTO");
- return 1;
- }
- if(!response)
- return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
- "BLUE"Give Respect\n\
- "BLUE"Give Money\n\
- "BLUE"See Stats\n\
- "ORAN"Report", "Select", "Exit");
- new
- Player = GetPVarInt(playerid, "ClickedTO"),
- Str[256],
- Time[5];
- switch(listitem)
- {
- case (0):
- {
- if(P_DATA[playerid][Vip] != 3)
- {
- format(Query, 256, "SELECT `Key` FROM `Positive` WHERE `Name` = '%s'", Name(playerid));
- new
- DBResult:R2 = DB::Query(_DB, Query);
- gettime(Time[0], Time[1]);
- getdate(.day = Time[2]);
- if(R2)
- {
- if(DB::Valid(R2))
- {
- new
- Field[64],
- T2[3];
- DB::GetField(R2, "Expiration", Field, sizeof (Field));
- DB::Free(R2);
- if(!isnull(Field))
- {
- sscanf(Field, "p<|>iii", Time[2], Time[0], Time[1]);
- gettime(T2[0], T2[1]);
- getdate(.day = T2[2]);
- if(Time[0] == 0) Time[0] = 24;
- if(T2[2] == Time[2])
- {
- if(T2[0] == Time[0])
- {
- if(T2[1] < Time[1])
- {
- SendError(playerid, "You are allowed to give only one "GREE"+"GREY" respect per hour!");
- FormatMSG(playerid, Color:GREY, "You can repeat the process after "BLUE"%d"GREY":"BLUE"%d "GREY"!", Time[0], Time[1]);
- return 1;
- }
- }
- else if(T2[0] < Time[0])
- {
- SendError(playerid, "You are allowed to give only one "GREE"+"GREY" respect per hour!");
- FormatMSG(playerid, Color:GREY, "You can repeat the process after "BLUE"%d"GREY":"BLUE"%d "GREY"!", Time[0], Time[1]);
- return 1;
- }
- }
- }
- 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));
- DB::Query(_DB, Query);
- }
- else
- {
- DB::Free(R2);
- 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]);
- DB::Query(_DB, Query);
- }
- }
- 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);
- }else format(Str, sizeof (Str), ""W"You gave a "GREE"Positive Respect"W" to:\n"BLUE"%s"W" ID: "BLUE"%d", Name(Player), Player);
- P_DATA[Player][Positive] += 1;
- SetPVarInt(Player, "0_Positive", P_DATA[Player][Positive]);
- FormatMSG(Player, Color:ORAN, "*** "GREY"You received a "GREE"+1"GREY" respect from "BLUE"%s[%i]", Name(playerid), playerid);
- SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Respect given", Str, "Close", "");
- }
- case (1):
- {
- if(P_DATA[playerid][Vip] != 3)
- {
- format(Query, 256, "SELECT `Key` FROM `Negative` WHERE `Name` = '%s'", Name(playerid));
- new
- DBResult:R2 = DB::Query(_DB, Query);
- gettime(Time[0], Time[1]);
- getdate(.day = Time[2]);
- if(R2)
- {
- if(DB::Valid(R2))
- {
- new
- Field[64],
- T2[3];
- DB::GetField(R2, "Expiration", Field, sizeof (Field));
- DB::Free(R2);
- if(!isnull(Field))
- {
- sscanf(Field, "p<|>iii", Time[2], Time[0], Time[1]);
- gettime(T2[0], T2[1]);
- getdate(.day = T2[2]);
- if(Time[0] == 0) Time[0] = 24;
- if(T2[2] == Time[2])
- {
- if(T2[0] == Time[0])
- {
- if(T2[1] < Time[1])
- {
- SendError(playerid, "You are allowed to give only one "ORAN"-"GREY" respect per hour!");
- FormatMSG(playerid, Color:GREY, "You can repeat the process after "BLUE"%d"GREY":"BLUE"%d "GREY"!", Time[0], Time[1]);
- return 1;
- }
- }
- else if(T2[0] < Time[0])
- {
- SendError(playerid, "You are allowed to give only one "ORAN"-"GREY" respect per hour!");
- FormatMSG(playerid, Color:GREY, "You can repeat the process after "BLUE"%d"GREY":"BLUE"%d "GREY"!", Time[0], Time[1]);
- return 1;
- }
- }
- }
- 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));
- DB::Query(_DB, Query);
- }
- else
- {
- DB::Free(R2);
- 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]);
- DB::Query(_DB, Query);
- }
- }
- 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);
- }else format(Str, sizeof (Str), ""W"You gave a "ORAN"Negative Respect"W" to:\n"BLUE"%s"W" ID: "BLUE"%d", Name(Player), Player);
- P_DATA[Player][Negative] += 1;
- SetPVarInt(Player, "0_Negative", P_DATA[Player][Negative]);
- FormatMSG(Player, Color:ORAN, "*** "GREY"You received a "ORAN"-1"GREY" respect from "BLUE"%s[%i]", Name(playerid), playerid);
- SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Respect given", Str, "Close", "");
- }
- }
- }
- iDialog<CLICK_PM>
- {
- if(!response)
- return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
- "BLUE"Give Respect\n\
- "BLUE"Give Money\n\
- "BLUE"See Stats\n\
- "ORAN"Report", "Select", "Exit");
- if(P_DATA[playerid][Muted])
- return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
- "BLUE"Give Respect\n\
- "BLUE"Give Money\n\
- "BLUE"See Stats\n\
- "ORAN"Report", "Select", "Exit"),
- SendError(playerid, "You are still muted! Check with "ORAN"/mutecheck"GREY" to see when it will be lifted!");
- if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
- {
- SendError(playerid, "Player is no longer connected to the server!");
- DeletePVar(playerid, "ClickedTO");
- return 1;
- }
- new
- Message[140];
- if(sscanf(inputtext, "s[140]", Message))
- return OnDialogResponse(playerid, Dialog:CLICK, 1, 0, ""),
- SendError(playerid, "Please enter a message to send!");
- else
- {
- if(strlen(Message) < 5)
- return OnDialogResponse(playerid, Dialog:CLICK, 1, 0, ""),
- SendError(playerid, "Message must be at least "BLUE"5"GREY" characters long.");
- new
- Player = GetPVarInt(playerid, "ClickedTO");
- FormatMSG(Player, Color:GREY, "From "BLUE"%s[%i]"W": %s", Name(playerid), playerid, Message);
- FormatMSG(playerid, Color:GREY, "PM Sent to "BLUE"%s[%i]"W": %s", Name(Player), Player, Message);
- if(S_DATA[ReadPM])
- {
- SendAdminCMD(playerid, "PM Detected: "BLUE"%s[%i] "GREY"to"BLUE" %s[%i]", Name(playerid), playerid, Name(Player), Player);
- SendAdminCMD(playerid, "Message: "BLUE"%s", Message);
- }
- }
- }
- iDialog<CLICK>
- {
- if(!response)
- return DeletePVar(playerid, "ClickedTO"),
- false;
- if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
- {
- SendError(playerid, "Player is no longer connected to the server!");
- DeletePVar(playerid, "ClickedTO");
- return 1;
- }
- switch(listitem)
- {
- case (0):
- {
- new
- Player = GetPVarInt(playerid, "ClickedTO"),
- Str[129];
- 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);
- SPD(playerid, Dialog:CLICK_PM, INPUT, "{FFFFFF}Send a Personal Message", Str, "Send", "Back");
- }
- case (1): SPD(playerid, Dialog:CLICK_RP, LIST, "{FFFFFF}Select Rspect type", ""GREE"Positive\n"ORAN"Negative", "Select", "Back");
- case (2):
- {
- new
- Player = GetPVarInt(playerid, "ClickedTO"),
- Str[129];
- 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);
- SPD(playerid, Dialog:CLICK_MONEY, INPUT, "{FFFFFF}Send money", Str, "Send", "Back");
- }
- case (3):
- {
- format(WhosStats, sizeof (WhosStats), ""ORAN"%s{FFFFFF}'s stats", Name(GetPVarInt(playerid, "ClickedTO")));
- FormatStats(GetPVarInt(playerid, "ClickedTO"));
- }
- case (4):
- {
- new
- Player = GetPVarInt(playerid, "ClickedTO"),
- Str[129];
- 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);
- SPD(playerid, Dialog:CLICK_REPORT, INPUT, "{FFFFFF}Reporting player", Str, "Send", "Back");
- }
- }
- }
- iDialog<TOP>
- {
- return cmd_top(playerid, "");
- }
- iDialog<TOP_RESPECT>
- {
- if(!response) cmd_top(playerid, "");
- else
- {
- switch(listitem)
- {
- case 0: ShowTopStats(playerid, "Positive", "Respected Players");
- case 1: ShowTopStats(playerid, "Negative", "Disrespected Players");
- }
- }
- }
- iDialog<TOP_SELECT>
- {
- if(!response) return 1;
- else
- {
- switch(listitem)
- {
- case 0: ShowTopStats(playerid, "Kills", "Killers");
- case 1: ShowTopStats(playerid, "Deaths", "Deaths");
- case 2: ShowTopStats(playerid, "Rank", "Ranked");
- case 3: SPD(playerid, Dialog:TOP_RESPECT, LIST, "{FFFFFF}Select type", ""W"Positive\n"W"Negative", "Select", "Back");
- case 4: ShowTopStats(playerid, "Hours", "Hours");
- case 5:
- {
- new Speed = GetTickCount(),
- DialString[3_0_0_0],
- String[2][128],
- sQuery[2][256],
- DBResult:Result1;
- format(sQuery[0], 256, "SELECT `Name` FROM `Top` ORDER BY (`Ratio` * 1) DESC limit %d", MAX_TOP_LIMIT);
- Result1 = DB::Query(_DB, sQuery[0]);
- format(DialString, sizeof (DialString), "{FFFFFF}Server top "ORAN" Kills/Deaths ratio\n\n\n"W"Pos. Player = Ratio");
- for (new Qr; Qr < DB::Valid(Result1); Qr++)
- {
- db_get_field(Result1, 0, String[0], 128);
- format(sQuery[1], 256, "SELECT `Ratio` FROM `Top` WHERE `Name` = '%s'", String[0]);
- new DBResult:Result2 = DB::Query(_DB, sQuery[1]);
- db_get_field(Result2, 0, String[1], 128);
- format(DialString, sizeof (DialString), "%s\n"BLUE"%d."GREY" %s "W": %s", DialString, Qr + 1, String[0], String[1]);
- db_next_row(Result1);
- DB::Free(Result2);
- }
- DB::Free(Result1);
- format(DialString, sizeof (DialString), "%s\n\n"W"Top list generated in "ORAN"%d "W"ms.", DialString, GetTickCount() - Speed);
- SPD(playerid, Dialog:TOP, BOX, ""W"TOP PLAYERS", DialString, "Close", "");
- }
- }
- }
- }
- switch(dialogid)
- {
- CaseDialog<NAME>
- {
- if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- new
- NewName[MAX_PLAYER_NAME];
- if(sscanf(inputtext, "s["#MAX_PLAYER_NAME"]", NewName))
- {
- OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, NAME, "");
- return 1;
- }
- else
- {
- if(strlen(NewName) > MAX_PLAYER_NAME || strlen(NewName) < 5)
- return SendError(playerid, "Invalid name length! Max: "ORAN""#MAX_PLAYER_NAME""GREY" Min: "ORAN"5"),
- OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, NAME, "");
- new
- Player = GetPVarInt(playerid, "StatsOf");
- if(Player == 0xFFFF)
- return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
- if(NameExist(NewName))
- return SendError(playerid, "The name entered is already used by someone else!"),
- OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, NAME, "");
- if(Player != playerid)
- {
- FormatMSG(playerid, Color:GREY, "You changed the name of "ORAN"%s"GREY" to "ORAN"%s"GREY"", Name(Player), NewName);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" changed your name to "ORAN"%s"GREY"", Name(playerid), playerid, NewName);
- }
- 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!");}
- SetPlayerName(Player, NewName);
- OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- }
- }
- CaseDialog<MONEY>
- {
- if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(sscanf(inputtext, "d", inputtext[0]))
- {
- OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, MONEY, "");
- return 1;
- }
- else
- {
- new
- Player = GetPVarInt(playerid, "StatsOf");
- if(Player == 0xFFFF)
- return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
- ResetPlayerMoney(Player), GivePlayerMoney(Player, inputtext[0]);
- OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(Player != playerid)
- {
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s money to "ORAN"$%d"GREY"", Name(Player), inputtext[0]);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your money to "ORAN"$%d"GREY"", Name(playerid), playerid, inputtext[0]);
- }
- else
- FormatMSG(playerid, Color:GREY, "You set your money to "ORAN"$%d"GREY" ", inputtext[0]);
- }
- }
- CaseDialog<SCORE>
- {
- if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(sscanf(inputtext, "d", inputtext[0]))
- {
- OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, SCORE, "");
- return 1;
- }
- else
- {
- new
- Player = GetPVarInt(playerid, "StatsOf");
- if(Player == 0xFFFF)
- return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
- SetPlayerScore(Player, inputtext[0]);
- OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(Player != playerid)
- {
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s score to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your score to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
- }
- else
- FormatMSG(playerid, Color:GREY, "You set your score to "ORAN"%d"GREY" ", inputtext[0]);
- }
- }
- CaseDialog<COOKIES>
- {
- if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(sscanf(inputtext, "d", inputtext[0]))
- {
- OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, COOKIES, "");
- return 1;
- }
- else
- {
- new
- Player = GetPVarInt(playerid, "StatsOf");
- if(Player == 0xFFFF)
- return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
- SetPVarInt(Player, "0_Cookies", inputtext[0]);
- P_DATA[Player][Cookies] = inputtext[0];
- OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(Player != playerid)
- {
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s cookies to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your cookies to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
- }
- else
- FormatMSG(playerid, Color:GREY, "You set your cookies to "ORAN"%d"GREY" ", inputtext[0]);
- }
- }
- CaseDialog<RESPECT>
- {
- if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- new
- _2DS[2][129],
- _Dialog,
- Player = GetPVarInt(playerid, "StatsOf");
- if(Player == 0xFFFF)
- return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
- switch(listitem)
- {
- case 0:{ if(Player != playerid)format(_2DS[0], 129, "Changing "ORAN"%s"GREY"'s Positive Respect\nPlease insert your respect value:", Name(Player));
- else _2DS[0] = "Changing "ORAN"your"GREY"'s Positive Respect\nPlease insert your respect value:";
- _2DS[1] = "{FFFFFF}Changing Positive"; _Dialog = Dialog:RESPECT_POS;}
- case 1:{ if(Player != playerid)format(_2DS[0], 129, "Changing "ORAN"%s"GREY"'s Negative Respect\nPlease insert your respect value:", Name(Player));
- else _2DS[0] = "Changing "ORAN"your"GREY"'s Positive Respect\nPlease insert your respect value:";
- _2DS[1] = "{FFFFFF}Changing Negative" ; _Dialog = Dialog:RESPECT_NEG;}
- }
- SPD(playerid, _Dialog, INPUT, _2DS[1], _2DS[0], "Set", "Back");
- }
- CaseDialog<RESPECT_POS>
- {
- if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(sscanf(inputtext, "d", inputtext[0]))
- {
- OnDialogResponse(playerid, Dialog:SetStatsTrue, true, 0, "");
- return 1;
- }
- else
- {
- new
- Player = GetPVarInt(playerid, "StatsOf");
- if(Player == 0xFFFF)
- return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
- SetPVarInt(Player, "0_Positive", inputtext[0]);
- P_DATA[Player][Positive] = inputtext[0];
- OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(Player != playerid)
- {
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s Positive Respect to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your Positive Respect to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
- }
- else
- FormatMSG(playerid, Color:GREY, "You set your Positive Respect to "ORAN"%d"GREY" ", inputtext[0]);
- #if UPDATE_TOP_ALWAYS == true
- new DBResult: R1;
- format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
- R1 = DB::Query(_DB, Query);
- if(R1)
- {
- if(DB::Valid(R1))
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "UPDATE `Top` SET `Positive` = '%d' WHERE `Name` = '%s'", inputtext[0], Name(Player));
- DB::Query(_DB, Query);
- }
- else
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Positive`) VALUES('%s','%d')", Name(Player), inputtext[0]);
- DB::Query(_DB, Query);
- }
- }
- #endif
- }
- }
- CaseDialog<RESPECT_NEG>
- {
- if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(sscanf(inputtext, "d", inputtext[0]))
- {
- OnDialogResponse(playerid, Dialog:SetStatsTrue, true, 1, "");
- return 1;
- }
- else
- {
- new
- Player = GetPVarInt(playerid, "StatsOf");
- if(Player == 0xFFFF)
- return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
- SetPVarInt(Player, "0_Negative", inputtext[0]);
- P_DATA[Player][Negative] = inputtext[0];
- OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(Player != playerid)
- {
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s Negative Respect to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your Negative Respect to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
- }
- else
- FormatMSG(playerid, Color:GREY, "You set your Negative Respect to "ORAN"%d"GREY" ", inputtext[0]);
- #if UPDATE_TOP_ALWAYS == true
- new DBResult: R1;
- format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
- R1 = DB::Query(_DB, Query);
- if(R1)
- {
- if(DB::Valid(R1))
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "UPDATE `Top` SET `Negative` = '%d' WHERE `Name` = '%s'", inputtext[0], Name(Player));
- DB::Query(_DB, Query);
- }
- else
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Negative`) VALUES('%s','%d')", Name(Player),inputtext[0]);
- DB::Query(_DB, Query);
- }
- }
- #endif
- }
- }
- CaseDialog<KILLS>
- {
- if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(sscanf(inputtext, "d", inputtext[0]))
- {
- OnDialogResponse(playerid, Dialog:SetStatsTrue, true, KILLS, "");
- return 1;
- }
- else
- {
- new
- Player = GetPVarInt(playerid, "StatsOf");
- if(Player == 0xFFFF)
- return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
- SetPVarInt(Player, "0_Kills", inputtext[0]);
- P_DATA[Player][Kills] = inputtext[0];
- OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(Player != playerid)
- {
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s kills to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your kills to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
- }
- else
- FormatMSG(playerid, Color:GREY, "You set your kills to "ORAN"%d"GREY" ", inputtext[0]);
- #if UPDATE_TOP_ALWAYS == true
- new DBResult: R1;
- format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
- R1 = DB::Query(_DB, Query);
- if(R1)
- {
- if(DB::Valid(R1))
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "UPDATE `Top` SET `Kills` = '%d', `Ratio` = '%f' WHERE `Name` = '%s'", inputtext[0], (Float:P_DATA[Player][Kills] / Float:P_DATA[Player][Deaths]), Name(Player));
- DB::Query(_DB, Query);
- }
- else
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `Deaths`,`Ratio`) VALUES('%s','%d','%f')",Name(Player), inputtext[0], (Float:P_DATA[Player][Kills] / Float:P_DATA[Player][Deaths]));
- DB::Query(_DB, Query);
- }
- }
- #endif
- }
- }
- CaseDialog<DEATHS>
- {
- if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(sscanf(inputtext, "d", inputtext[0]))
- {
- OnDialogResponse(playerid, Dialog:SetStatsTrue, true, DEATHS, "");
- return 1;
- }
- else
- {
- new
- Player = GetPVarInt(playerid, "StatsOf");
- if(Player == 0xFFFF)
- return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
- SetPVarInt(Player, "0_Deaths", inputtext[0]);
- P_DATA[Player][Deaths] = inputtext[0];
- OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(Player != playerid)
- {
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s deaths to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your deaths to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
- }
- else
- FormatMSG(playerid, Color:GREY, "You set your deaths to "ORAN"%d"GREY" ", inputtext[0]);
- #if UPDATE_TOP_ALWAYS == true
- new DBResult: R1;
- format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
- R1 = DB::Query(_DB, Query);
- if(R1)
- {
- if(DB::Valid(R1))
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "UPDATE `Top` SET `Deaths` = '%d', `Ratio` = '%f' WHERE `Name` = '%s'", inputtext[0], (Float:P_DATA[Player][Kills] / Float:P_DATA[Player][Deaths]), Name(Player));
- DB::Query(_DB, Query);
- }
- else
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `Deaths`,`Ratio`) VALUES('%s','%d','%f')",Name(Player), inputtext[0], (Float:P_DATA[playerid][Kills] / Float:P_DATA[playerid][Deaths]));
- DB::Query(_DB, Query);
- }
- }
- #endif
- }
- }
- CaseDialog<MESSAGES>
- {
- if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(sscanf(inputtext, "d", inputtext[0]))
- {
- OnDialogResponse(playerid, Dialog:SetStatsTrue, true, MESSAGES, "");
- return 1;
- }
- else
- {
- new
- Player = GetPVarInt(playerid, "StatsOf");
- if(Player == 0xFFFF)
- return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
- SetPVarInt(Player, "0_Messages", inputtext[0]);
- P_DATA[Player][Msgs] = inputtext[0];
- OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(Player != playerid)
- {
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s sent messages to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your sent messages to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
- }
- else
- FormatMSG(playerid, Color:GREY, "You set your sent messages to "ORAN"%d"GREY" ", inputtext[0]);
- }
- }
- CaseDialog<COMMANDS>
- {
- if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(sscanf(inputtext, "d", inputtext[0]))
- {
- OnDialogResponse(playerid, Dialog:SetStatsTrue, true, COMMANDS, "");
- return 1;
- }
- else
- {
- new
- Player = GetPVarInt(playerid, "StatsOf");
- if(Player == 0xFFFF)
- return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
- SetPVarInt(Player, "0_Commands", inputtext[0]);
- P_DATA[Player][Cmds] = inputtext[0];
- OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(Player != playerid)
- {
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s used commands to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your used commands to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
- }
- else
- FormatMSG(playerid, Color:GREY, "You set your used commands to "ORAN"%d"GREY" ", inputtext[0]);
- }
- }
- CaseDialog<FCOMMANDS>
- {
- if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(sscanf(inputtext, "d", inputtext[0]))
- {
- OnDialogResponse(playerid, Dialog:SetStatsTrue, true, FCOMMANDS, "");
- return 1;
- }
- else
- {
- new
- Player = GetPVarInt(playerid, "StatsOf");
- if(Player == 0xFFFF)
- return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
- SetPVarInt(Player, "0_Fail_Commands", inputtext[0]);
- P_DATA[Player][fCmds] = inputtext[0];
- OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(Player != playerid)
- {
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s fail commands to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your fail commands to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
- }
- else
- FormatMSG(playerid, Color:GREY, "You set your fail commands to "ORAN"%d"GREY" ", inputtext[0]);
- }
- }
- CaseDialog<ONLINE>
- {
- if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- new
- _2DS2[2][129],
- _Dialog,
- Player = GetPVarInt(playerid, "StatsOf");
- if(Player == 0xFFFF)
- return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
- switch(listitem)
- {
- case 0:{ if(Player != playerid)format(_2DS2[0], 129, ""GREY"Changing "ORAN"%s"GREY"'s Hours\nPlease insert the hour value:", Name(Player));
- else _2DS2[0] = ""GREY"Changing "ORAN"your"GREY" Hours\nPlease insert the hour value:";
- _2DS2[1] = "{FFFFFF}Changing Hours" ; _Dialog = Dialog:ONLINE_H; }
- case 1:{ if(Player != playerid)format(_2DS2[0], 129, ""GREY"Changing "ORAN"%s"GREY"'s Minutes\nPlease insert the hour value:", Name(Player));
- else _2DS2[0] = ""GREY"Changing "ORAN"your"GREY" Minutes\nPlease insert the hour value:";
- _2DS2[1] = "{FFFFFF}Changing Minutes" ; _Dialog = Dialog:ONLINE_M;}
- case 2:{ if(Player != playerid)format(_2DS2[0], 129, ""GREY"Changing "ORAN"%s"GREY"'s Seconds\nPlease insert the hour value:", Name(Player));
- else _2DS2[0] = ""GREY"Changing "ORAN"your"GREY" Seconds\nPlease insert the hour value:";
- _2DS2[1] = "{FFFFFF}Changing Seconds" ; _Dialog = Dialog:ONLINE_S;}
- }
- SPD(playerid, _Dialog, INPUT, _2DS2[1], _2DS2[0], "Set", "Back");
- }
- CaseDialog<ONLINE_H>
- {
- if(!response) return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
- if(sscanf(inputtext, "d", inputtext[0]))
- {
- OnDialogResponse(playerid, Dialog:ONLINE, true, 0, "");
- return 1;
- }
- else
- {
- new
- Player = GetPVarInt(playerid, "StatsOf");
- if(Player == 0xFFFF)
- return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
- P_DATA[Player][Hours] = inputtext[0];
- P_DATA[Player][ConnTime] = gettime();
- OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
- if(Player != playerid)
- {
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s online hours to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your online hours to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
- }
- else
- FormatMSG(playerid, Color:GREY, "You set your online hours to "ORAN"%d"GREY" ", inputtext[0]);
- #if UPDATE_TOP_ALWAYS == true
- new DBResult: R1;
- format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
- R1 = DB::Query(_DB, Query);
- if(R1)
- {
- if(DB::Valid(R1))
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "UPDATE `Top` SET `Hours` = '%d' WHERE `Name` = '%s'", inputtext[0], Name(Player));
- DB::Query(_DB, Query);
- }
- else
- {
- DB::Free(R1);
- format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `Hours`) VALUES('%s','%d')",Name(Player), inputtext[0]);
- DB::Query(_DB, Query);
- }
- }
- #endif
- }
- }
- CaseDialog<ONLINE_M>
- {
- if(!response) return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
- if(sscanf(inputtext, "d", inputtext[0]))
- {
- OnDialogResponse(playerid, Dialog:ONLINE, true, 1, "");
- return 1;
- }
- else
- {
- if(inputtext[0] > 60 || inputtext[0] < 0)
- return OnDialogResponse(playerid, Dialog:ONLINE, true, 1, ""),
- SendError(playerid, "Minutes must be from "ORAN"0"GREY" to "ORAN"60"GREY".");
- new
- Player = GetPVarInt(playerid, "StatsOf");
- if(Player == 0xFFFF)
- return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
- P_DATA[Player][Minutes] = inputtext[0];
- P_DATA[Player][ConnTime] = gettime();
- OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
- if(Player != playerid)
- {
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s online minutes to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your online minutes to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
- }
- else
- FormatMSG(playerid, Color:GREY, "You set your online minutes to "ORAN"%d"GREY" ", inputtext[0]);
- }
- }
- CaseDialog<ONLINE_S>
- {
- if(!response) return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
- if(sscanf(inputtext, "d", inputtext[0]))
- {
- OnDialogResponse(playerid, Dialog:ONLINE, true, 2, "");
- return 1;
- }
- else
- {
- if(inputtext[0] > 60 || inputtext[0] < 0)
- return OnDialogResponse(playerid, Dialog:ONLINE, true, 2, ""),
- SendError(playerid, "Seconds must be from "ORAN"0"GREY" to "ORAN"60"GREY".");
- new
- Player = GetPVarInt(playerid, "StatsOf");
- if(Player == 0xFFFF)
- return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
- P_DATA[Player][Seconds] = inputtext[0];
- P_DATA[Player][ConnTime] = gettime();
- OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
- if(Player != playerid)
- {
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s online seonds to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your online seonds to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
- }
- else
- FormatMSG(playerid, Color:GREY, "You set your online seonds to "ORAN"%d"GREY" ", inputtext[0]);
- }
- }
- CaseDialog<LEVEL>
- {
- if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(sscanf(inputtext, "d", inputtext[0]))
- {
- OnDialogResponse(playerid, Dialog:SetStatsTrue, true, LEVEL, "");
- return 1;
- }
- else
- {
- new
- Player = GetPVarInt(playerid, "StatsOf");
- if(Player == 0xFFFF)
- return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
- if(inputtext[0] < 0 || inputtext[0] > 5)
- return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, LEVEL, ""),
- SendError(playerid, "Invalid level! Min. "ORAN"0"GREY" Max. "ORAN"5");
- SetPVarInt(Player, "0_Level", inputtext[0]);
- P_DATA[Player][Level] = inputtext[0];
- OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(Player != playerid)
- {
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY" as "ORAN"%s"GREY" of the server!", Name(Player), LevelName(inputtext[0]));
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s"GREY" set you as "ORAN"%s"GREY" of the server!", Name(playerid), playerid, LevelName(inputtext[0]));
- }
- else
- FormatMSG(playerid, Color:GREY, "You set yourself as "ORAN"%s"GREY" of the server!", LevelName(inputtext[0]));
- }
- }
- CaseDialog<VLEVEL>
- {
- if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(sscanf(inputtext, "d", inputtext[0]))
- {
- OnDialogResponse(playerid, Dialog:SetStatsTrue, true, VLEVEL, "");
- return 1;
- }
- else
- {
- new
- Player = GetPVarInt(playerid, "StatsOf");
- if(Player == 0xFFFF)
- return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
- if(inputtext[0] < 0 || inputtext[0] > 3)
- return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, LEVEL, ""),
- SendError(playerid, "Invalid level! Min. "ORAN"0"GREY" Max. "ORAN"3");
- SetPVarInt(Player, "0_Vip", inputtext[0]);
- P_DATA[Player][Vip] = inputtext[0];
- OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(Player != playerid)
- {
- FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s VIP Level to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your VIP Level to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
- }
- else
- FormatMSG(playerid, Color:GREY, "You set your VIP Level to "ORAN"%d"GREY" ", inputtext[0]);
- }
- }
- CaseDialog<CPASS>
- {
- if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- new NewPass[30];
- if(sscanf(inputtext, "s[30]", NewPass))
- {
- OnDialogResponse(playerid, Dialog:SetStatsTrue, true, CPASS, "");
- return 1;
- }
- else
- {
- new
- Player = GetPVarInt(playerid, "StatsOf");
- if(Player == 0xFFFF)
- return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
- if(strlen(NewPass) < MIN_PASS_LEN || strlen(NewPass) > MAX_PASS_LEN)
- return SendError(playerid, "An error has occured. Invalid Password length!"),
- OnDialogResponse(playerid, Dialog:SetStatsTrue, true, CPASS, "");
- new Buf[129];
- WP_Hash(Buf, (129), NewPass);
- format(Query, 280, "UPDATE `Accounts` SET `Password` = '%s' WHERE `Name` = '%s'", Buf, Name(Player));
- DB::Query(_DB, Query);
- if(Player != playerid)
- FormatMSG(playerid, Color:GREY, "You changed "ORAN"%s"GREY"'s password to "ORAN"%s", Name(Player), NewPass);
- else
- FormatMSG(playerid, Color:GREY, "You changed your password to "ORAN"%s", NewPass);
- }
- }
- CaseDialog<BACCOUNT>
- {
- if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- new Reason[129];
- if(sscanf(inputtext, "s[129]", Reason))
- {
- OnDialogResponse(playerid, Dialog:SetStatsTrue, true, BACCOUNT, "");
- return 1;
- }
- else
- {
- if(strlen(Reason) < 5 || strlen(Reason) > 129)
- return SendError(playerid, "The reason must be Min. "ORAN"5"GREY" Max. "ORAN"129"GREY" characters long!"),
- OnDialogResponse(playerid, Dialog:SetStatsTrue, true, BACCOUNT, "");
- new
- Player = GetPVarInt(playerid, "StatsOf");
- if(Player == 0xFFFF)
- return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
- format(Query, 129, "INSERT INTO `Banlist` VALUES('%s', '%s', '%s', '%s', '%s')", GetPlayerIPEx(Player), Name(Player), Reason, Name(playerid), zDate());
- DB::Query(_DB, Query);
- OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(Player != playerid)
- {
- FormatMSG(playerid, Color:GREY, "You banned "ORAN"%s"GREY"'s account with reason "ORAN"%s", Name(Player), Reason);
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s"GREY" banned your account with reason:", Name(playerid));
- FormatMSG(Player, Color:GREY, "REASON: "ORAN"%s",Reason);
- }
- else
- return 0;
- KickEx(Player, "System", "Account banned with [/setstats]", false);
- }
- }
- CaseDialog<DACCOUNT>
- {
- if(!response)
- return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- new
- Player = GetPVarInt(playerid, "StatsOf");
- if(Player == 0xFFFF)
- return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
- OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
- if(Player != playerid)
- {
- FormatMSG(playerid, Color:GREY, "You deleted "ORAN"%s"GREY"'s account.", Name(Player));
- FormatMSG(Player, Color:GREY, "Admin "ORAN"%s"GREY" deleted your account", Name(playerid));
- SendClientMessage(Player, Color:GREY, "You will be kicked in 2 seconds!");
- SendClientMessage(Player, Color:GREY, "Later you can come back without an account.");
- format(Query, 120, "DELETE FROM `Accounts` WHERE `Name` = '%s'", Name(Player));
- DB::Query(_DB, Query);
- }
- else
- return 0;
- KickEx(Player, "System", "Account banned with [/setstats]", false);
- }
- }
- iDialog<SetStatsTrue>
- {
- if(response)
- {
- new id = GetPVarInt(playerid, "StatsOf");
- switch(listitem)
- {
- case NAME: \
- SPD(playerid, Dialog:NAME, INPUT, "{FFFFFF}Changing Name", \
- FormatInside(playerid, id, "Name", "Please insert the new name!"), "Insert", "Back");
- case MONEY: \
- SPD(playerid, Dialog:MONEY, INPUT, "{FFFFFF}Changing Money", \
- FormatInside(playerid, id, "Money", "Please insert the new money value!"),"Insert", "Back");
- case SCORE: \
- SPD(playerid, Dialog:SCORE, INPUT, "{FFFFFF}Changing Score", \
- FormatInside(playerid, id, "Score", "Please insert the new score!"),"Insert", "Back");
- case COOKIES: \
- SPD(playerid, Dialog:COOKIES, INPUT, "{FFFFFF}Changing Cookies", \
- FormatInside(playerid, id, "Cookies", "Please insert the new cookies!"), "Insert", "Back");
- case RESPECT: \
- SPD(playerid, Dialog:RESPECT, LIST, "{FFFFFF}Changing Respect", \
- "Positive\nNegative", "Select", "Back");
- case KILLS: \
- SPD(playerid, Dialog:KILLS, INPUT, "{FFFFFF}Changing Kills", \
- FormatInside(playerid, id, "Kills", "Please insert the new kills!"), "Insert", "Back");
- case DEATHS: \
- SPD(playerid, Dialog:DEATHS, INPUT, "{FFFFFF}Changing Deaths", \
- FormatInside(playerid, id, "Deaths", "Please insert the new deaths!"), "Insert", "Back");
- case MESSAGES: \
- SPD(playerid, Dialog:MESSAGES, INPUT, "{FFFFFF}Changing Messages Sent", \
- FormatInside(playerid, id, "Messages", "Please insert the new messages!"), "Insert", "Back");
- case COMMANDS: \
- SPD(playerid, Dialog:COMMANDS, INPUT, "{FFFFFF}Changing Commands Used", \
- FormatInside(playerid, id, "Used Commands", "Please insert the new used commands value!"), "Insert", "Back");
- case FCOMMANDS: \
- SPD(playerid, Dialog:FCOMMANDS,INPUT, "{FFFFFF}Changing Fail Commands", \
- FormatInside(playerid, id, "Fail Commands", "Please insert the new failed commands value !"), "Insert", "Back");
- case ONLINE: \
- SPD(playerid, Dialog:ONLINE, LIST, "{FFFFFF}Changing Online Time", \
- "Hours\nMinutes\nSeconds", "Select", "Back");
- case LEVEL: \
- SPD(playerid, Dialog:LEVEL, INPUT, "{FFFFFF}Changing Admin Level", \
- FormatInside(playerid, id, "Admin Level", "Please insert the new admin level!"), "Insert", "Back");
- case VLEVEL: \
- SPD(playerid, Dialog:VLEVEL, INPUT, "{FFFFFF}Changing VIP Level", \
- FormatInside(playerid, id, "VIP Level", "Please insert the new VIP level!"), "Insert", "Back");
- case CPASS: \
- SPD(playerid, Dialog:CPASS, INPUT, "{FFFFFF}Changing Password", \
- FormatInside(playerid, id, "Password", "Please insert the new password!"), "Insert", "Back");
- case BACCOUNT: \
- SPD(playerid, Dialog:BACCOUNT, INPUT, "{FFFFFF}Banning Account", \
- FormatInside(playerid, id, .zelse = "Banning", .extra = "Account"), "Yes" , "Back");
- case DACCOUNT: \
- SPD(playerid, Dialog:DACCOUNT, BOX, "{FFFFFF}Deleting Account", \
- FormatInside(playerid, id, .zelse = "Deleting", .extra = "Account"), "Yes" , "Back");
- }
- }else DeletePVar(playerid, "StatsOf");
- }
- iDialog<SetStatsSure>
- {
- if(response)
- {
- new zStr[30];
- format(zStr, 30, "%s", Name(GetPVarInt(playerid, "StatsOf")));
- ShowPlayerDialog(playerid, Dialog:SetStatsTrue, LIST, zStr, FormatList(playerid), "Change", "Exit");
- }else DeletePVar(playerid, "StatsOf");
- }
- iDialog<cPanel_Back> cmd_acp(playerid, "");
- iDialog<ACCP_LOAD>
- {
- if(!response)
- return cmd_accp(playerid, "");
- new Accp_String[16], Accp_Vars[6], DBResult:Result;
- format(Query, sizeof(Query), "SELECT `ACCP` FROM `Accounts` WHERE `Name` = '%s'", Name(playerid));
- Result = DB::Query(_DB, Query);
- if(Result)
- {
- if(DB::Valid(Result))
- {
- new Field[50];
- DB::GetField(Result, "ACCP", Field, sizeof(Field));
- SetPVarString(playerid, "ACCP_DATA", Field);
- DB::Free(Result);
- if(!sscanf(GPVSEx(playerid, "ACCP_DATA"), "p<:>s[16]iiiiii",Accp_String,
- Accp_Vars[0],
- Accp_Vars[1],
- Accp_Vars[2],
- Accp_Vars[3],
- Accp_Vars[4],
- Accp_Vars[5]))
- {
- SetPVarString(playerid, "Type", Accp_String);
- P_DATA[playerid][A_Component1] = Accp_Vars[0];
- P_DATA[playerid][A_Component2] = Accp_Vars[1];
- P_DATA[playerid][A_Component3] = Accp_Vars[2];
- P_DATA[playerid][A_Component4] = Accp_Vars[3];
- P_DATA[playerid][A_Wheels] = Accp_Vars[4];
- P_DATA[playerid][A_Color ] = Accp_Vars[5];
- }
- if(P_DATA[playerid][A_Component1] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component1]);
- if(P_DATA[playerid][A_Component2] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component2]);
- if(P_DATA[playerid][A_Component3] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component3]);
- if(P_DATA[playerid][A_Component4] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component4]);
- if(P_DATA[playerid][A_Wheels] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Wheels]);
- if(P_DATA[playerid][A_Color] != 0)ChangeVehicleColor(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Color], P_DATA[playerid][A_Color]);
- SendClientMessage(playerid, Color:GREY, "The components of your Admin Vehicle have been loaded!");
- }
- else
- {
- SendClientMessage(playerid, Color:GREY, "Failed to load the components from the database!");
- }
- }
- }
- iDialog<ACCP_DISCARD>
- {
- if(!response)
- return cmd_accp(playerid, "");
- if(P_DATA[playerid][A_Component1] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component1]);
- if(P_DATA[playerid][A_Component2] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component2]);
- if(P_DATA[playerid][A_Component3] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component3]);
- if(P_DATA[playerid][A_Component4] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component4]);
- if(P_DATA[playerid][A_Wheels] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Wheels]);
- if(P_DATA[playerid][A_Color] != 0)ChangeVehicleColor(GetPlayerVehicleID(playerid), 0, 0);
- P_DATA[playerid][A_Component1] = 0;
- P_DATA[playerid][A_Component2] = 0;
- P_DATA[playerid][A_Component3] = 0;
- P_DATA[playerid][A_Component4] = 0;
- P_DATA[playerid][A_Wheels] = 0;
- P_DATA[playerid][A_Color] = 0;
- SendClientMessage(playerid, Color:GREY, "The components of your Admin Vehicle have been discarted! You can "BLUE"Save Changes"GREY" from Admin Car cPanel again!");
- }
- iDialog<ACCP_SAVE>
- {
- if(!response) return cmd_accp(playerid, "");
- CheckComponents(playerid,"No changes have been made to your Admin Car!");
- new zQuery[300];
- format(zQuery, 300, "UPDATE `Accounts` SET ACCP = '%s:%d:%d:%d:%d:%d:%d', ACCPSav = '1' WHERE `Name` = '%s'",
- (strlen(GPVSEx(playerid, "Type")) ? (GPVSEx(playerid, "Type")) : ("None")),
- (P_DATA[playerid][A_Component1]) ? (P_DATA[playerid][A_Component1]) : (0),
- (P_DATA[playerid][A_Component2]) ? (P_DATA[playerid][A_Component2]) : (0),
- (P_DATA[playerid][A_Component3]) ? (P_DATA[playerid][A_Component3]) : (0),
- (P_DATA[playerid][A_Component4]) ? (P_DATA[playerid][A_Component4]) : (0),
- (P_DATA[playerid][A_Wheels]) ? (P_DATA[playerid][A_Wheels]) : (0) ,
- (P_DATA[playerid][A_Color]) ? (P_DATA[playerid][A_Color]) : (0),
- Name(playerid));
- DB::Query(_DB, zQuery);
- P_DATA[playerid][Accp_Saved] = 1;
- SendClientMessage(playerid, Color:GREY, "The components of Admin Vehicle have been saved! Later select "BLUE"Load Changes"GREY" from Admin Car cPanel!");
- }
- iDialog<ACCP_COMPS>
- {
- if(!response) return OnDialogResponse(playerid, Dialog:ACCP, 1, 2, "");
- AddVehicleComponent(GetPlayerVehicleID(playerid), ACCP_Components[listitem][iComponent]);
- FormatMSG(playerid, Color:GREY, "You added "ORAN"%s"GREY" on your Admin Car!", ACCP_Components[listitem][icName]);
- switch(listitem)
- {
- case 0,1: P_DATA[playerid][A_Component1] = ACCP_Components[listitem][iComponent];
- case 2,3,4: P_DATA[playerid][A_Component2] = ACCP_Components[listitem][iComponent];
- case 5: P_DATA[playerid][A_Component3] = ACCP_Components[listitem][iComponent];
- case 6: P_DATA[playerid][A_Component4] = ACCP_Components[listitem][iComponent];
- }
- return cmd_accp(playerid,"");
- }
- iDialog<ACCP_WHEELS>
- {
- if(!response) return OnDialogResponse(playerid, Dialog:ACCP, 1, 2, "");
- AddVehicleComponent(GetPlayerVehicleID(playerid), Wheels[listitem][iWheel]);
- FormatMSG(playerid, Color:GREY, "You added wheels "ORAN"%s"GREY" on your Admin Car!",Wheels[listitem][iwName]);
- P_DATA[playerid][A_Wheels] = Wheels[listitem][iWheel];
- return cmd_accp(playerid,"");
- }
- iDialog<ACCP_COLORS>
- {
- if(!response) return cmd_accp(playerid,"");
- ChangeVehicleColor(GetPlayerVehicleID(playerid),ACCP_Colors[listitem][ivColor], ACCP_Colors[listitem][ivColor]);
- FormatMSG(playerid, Color:GREY, "You changed your vehicle's color to color to %s%s!", ACCP_Colors[listitem][ivcRGB], ACCP_Colors[listitem][ivcName]);
- P_DATA[playerid][A_Color] = ACCP_Colors[listitem][ivColor];
- return cmd_accp(playerid,"");
- }
- iDialog<ACCP_C_C>
- {
- if(!response) return cmd_accp(playerid,"");
- switch(listitem)
- {
- case (0):
- {
- new Str[1024];
- for (new c = 0; c < sizeof(Wheels); c++)
- {format(Str, sizeof (Str), "%s"GREY"ID: "ORAN"%d "GREY" NAME: "ORAN"%s\n",Str, Wheels[c][iWheel], Wheels[c][iwName]);}
- SPD(playerid, Dialog:ACCP_WHEELS, LIST, "Change: "ORAN"Wheels", Str, "Change", "Back");
- }
- case (1):
- {
- new Str[1024];
- for (new c = 0; c < sizeof(ACCP_Components); c++)
- {format(Str, sizeof (Str), "%s"GREY"%s\n",Str, ACCP_Components[c][icName]);}
- SPD(playerid, Dialog:ACCP_COMPS, LIST, "Add: "ORAN"Components", Str, "Change", "Back");
- }
- }
- }
- iDialog<ACCP>
- {
- if(response)
- {
- switch(listitem)
- {
- case (0): SPD(playerid, Dialog:ACCP_NOS, LIST, "Add: "ORAN"Nos", ""GREY"2x\n\
- "GREY"5x\n\
- "GREY"10x\n\
- "GREY"Unlimited\n\
- "ORAN"Remove Nos", "Add", "Back");
- case (1):
- {
- new Str[512];
- for (new c = 0; c < sizeof(ACCP_Colors); c++)
- { format(Str, sizeof (Str), "%s%s%s\n", Str, ACCP_Colors[c][ivcRGB], ACCP_Colors[c][ivcName]); }
- SPD(playerid, Dialog:ACCP_COLORS, LIST, "Change: "ORAN"Colors", Str, "Change", "Back");
- }
- case (2): SPD(playerid, Dialog:ACCP_C_C, LIST, "Add: "ORAN"Components", ""GREY"Wheels\n\
- "GREY"Components", "Add", "Back");
- case (3):
- {
- CheckComponents(playerid, "There are no changes to save!");
- SPD(playerid, Dialog:ACCP_SAVE, BOX, "Save: "ORAN"Changes!", ""GREY"Saving changes made to your vehicle can be used everytime, anywhere!\n\
- Changes will be saved into your account.\n\
- Later select the "BLUE"Load Changes"GREY" item on your Admin Car cPanel.\n\
- It's totally free and usable anytime!\n\n\
- Want to "ORAN"save"GREY" or go "ORAN"back"GREY" ?", "Save", "Back");
- }
- case (4):
- {
- if(!P_DATA[playerid][Accp_Saved])
- return SendError(playerid, "You didn't save any changes to your vehicle!"), cmd_accp(playerid, "");
- SPD(playerid, Dialog:ACCP_LOAD, BOX, "Load: "ORAN"Changes!", ""GREY"With this you will load the changes you saved last time\n\
- If you want to remove the changes select the "ORAN"Discard Changes"GREY" from Admin Car cPanel!\n\n\
- Want to "ORAN"load"GREY" or go "ORAN"back"GREY" ?", "Load", "Back");
- }
- case (5):
- {
- CheckComponents(playerid, "There are no changes to discard due to the fact that there aren't any!");
- SPD(playerid, Dialog:ACCP_DISCARD, BOX, "Discard: "ORAN"Changes!", ""GREY"You are about to discard the changes made to your vehicle!\n\
- Ani component, nos type, wheels, colors selected for your Admin Car WILL BE DELETED!!\n\n\
- Want to "ORAN"discard"GREY" or go "ORAN"back"GREY" ?", "Discard", "Back");
- }
- }
- }
- }
- iDialog<ACCP_NOS>
- {
- if(!response) return cmd_accp(playerid,"");
- switch(listitem)
- {
- case (0): AddVehicleComponent(GetPlayerVehicleID(playerid), 1009),SetPVarString(playerid, "Type", "2x");
- case (1): AddVehicleComponent(GetPlayerVehicleID(playerid), 1008),SetPVarString(playerid, "Type", "5x");
- case (2): AddVehicleComponent(GetPlayerVehicleID(playerid), 1010),SetPVarString(playerid, "Type", "10x");
- case (3): AddVehicleComponent(GetPlayerVehicleID(playerid), 1010),SetPVarString(playerid, "Type", "Unlimited");
- case (4):
- {
- if(!strcmp(GPVSEx(playerid, "Type"), "None", false))
- return SendError(playerid, "You don't have NOS installed!"),
- OnDialogResponse(playerid, Dialog:ACCP, 1, 0, "");
- SendClientMessage(playerid, Color:ORAN, "ACCP: "GREY"You removed your Nitro from vehicle!");
- RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1010),
- RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1009),
- RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1008),
- SetPVarString(playerid, "Type", "None");
- }
- }
- if(listitem != 4)
- {
- FormatMSG(playerid, Color:ORAN, "ACCP: "GREY" You have added "ORAN"%s"GREY" nitro to your vehicle!", GPVSEx(playerid, "Type"));
- if(!strcmp(GPVSEx(playerid, "Type"), "Unlimited", false))
- SendClientMessage(playerid, Color:ORAN, "NOTE:"GREY" Hold your left mouse button for unlimited nos!");
- else
- SendClientMessage(playerid, Color:ORAN, "NOTE:"GREY" Press "ORAN"2"GREY" or "ORAN"Left Mouse Button"GREY" to recharge when exhausted!");
- return cmd_accp(playerid,"");
- }
- }
- iDialog<cPanel_Ping>
- {
- if(!response)
- {
- S_DATA[Ping] = 0;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Ping Kicker",
- ""W"Feature "ORAN"\"Ping Kicker\""W" has been disabled!\n\
- Players won't be kicked from the server for high ping.", "Back", "");
- }
- else
- {
- new sPing[10];
- if(sscanf(inputtext, "s[10]", sPing)) return OnDialogResponse(playerid, Dialog:cPanel, 1, 2, "");
- else
- {
- if(!IsNumeric(sPing))
- {
- if(!strcmp(sPing, "off", true))
- {
- S_DATA[Ping] = 0;
- new INI:
- ServerData = INI_Open(SERVER_FILE);
- INI_WriteInt(ServerData, INI_Server_Info[2][isName], 0);
- INI_Close(ServerData);
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Ping Kicker", \
- ""W"Feature "ORAN"\"Ping Kicker\""W" has been disabled!\n\
- Players won't be kicked if they have a high ping", "Back", "");
- return 0;
- }
- else
- {
- SPD(playerid, Dialog:cPanel_Ping, INPUT, ""W"cPanel: "ORAN"Ping Kicker","\n\n\
- "GREY"Please write down the ping needed for the player to get kicked.\n\
- If you write "ORAN"OFF"GREY" the "ORAN"Ping Kicker"GREY" will be disabled.", "Enter", "Disable");
- }
- }
- else
- {
- if(strval(sPing) < MIN_PING_LIMIT || strval(sPing) > MAX_PING_LIMIT)
- return SPD(playerid, Dialog:cPanel_Ping, INPUT, ""W"cPanel: "ORAN"Ping Kicker",
- ""ORAN"ERROR:"W" Min. Ping: "ORAN""#MIN_PING_LIMIT" "W"| Max. Ping: "ORAN""#MAX_PING_LIMIT"\n\n\
- "GREY"Please write down the ping needed for the player to get kicked.\n\
- If you write "ORAN"OFF"GREY" the "ORAN"Ping Kicker"GREY" will be disabled.", "Enter", "Disable");
- S_DATA[Ping] = strval(sPing);
- new INI: ServerData = INI_Open(SERVER_FILE);
- INI_WriteInt(ServerData, INI_Server_Info[2][isName], strval(sPing));
- INI_Close(ServerData);
- new zStr[256];
- format(zStr, sizeof (zStr), ""W"Feature "ORAN"\"Ping Kicker\""W" has been enabled!\n\
- Players will be kicked if they exceed the "ORAN"%d"W" ping limit!", strval(sPing));
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Ping Kicker", zStr, "Back", "");
- }
- }
- }
- }
- iDialog<cPanel>
- {
- if(response)
- {
- new INI:
- ServerData = INI_Open(SERVER_FILE);
- switch(listitem)
- {
- case 0:
- {
- INI_WriteInt(ServerData, INI_Server_Info[0][isName], 1);
- S_DATA[AntiSpam] = 1;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti-Spam",\
- ""W"Feature "ORAN"\"Anti-Spam\""W" has been enabled!\n\
- Players won't be able to spam the chat and will be kicked for abuse.", "Back", "");
- }
- case 1:
- {
- INI_WriteInt(ServerData, INI_Server_Info[1][isName], 1);
- S_DATA[AntiCSpam] = 1;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Command Spam",\
- ""W"Feature "ORAN"\"Anti Command Spam\""W" has been enabled!\n\
- Players won't be able to spam the chat with commands.", "Back", "");
- }
- case 2:
- {
- SPD(playerid, Dialog:cPanel_Ping, INPUT, ""W"cPanel: "ORAN"Ping Kicker","\n\n\
- "GREY"Please write down the ping needed for the player to get kicked.\n\
- If you write "ORAN"OFF"GREY" the "ORAN"Ping Kicker"GREY" will be disabled.", "Enter", "Disable");
- }
- case 3:
- {
- INI_WriteInt(ServerData, INI_Server_Info[3][isName], 1);
- S_DATA[RCONProt] = 1;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"RCON Protection",\
- ""W"Feature "ORAN"\"Rcon Protection\""W" has been enabled!\n\
- After "ORAN""#MAX_RCON_ATTEMPTS" attempts players will be banned\n\
- from the server for repeated login attempts", "Back", "");
- }
- case 4:
- {
- INI_WriteInt(ServerData, INI_Server_Info[4][isName], 1);
- S_DATA[TellPlayer] = 1;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Tell Player",\
- ""W"Feature "ORAN"\"Tell Player\""W" has been enabled!\n\
- Players will receive a message when typing an admin command\n\
- telling them that their admin level is not high enough!", "Back", "");
- }
- case 5:
- {
- INI_WriteInt(ServerData, INI_Server_Info[5][isName], 0);
- S_DATA[Chat] = 0;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Block Chat",\
- ""W"The "ORAN"Chat"W" has been unblocked!\n\
- Players are able to speak in the chat!", "Back", "");
- }
- case 6:
- {
- INI_WriteInt(ServerData, INI_Server_Info[6][isName], 1);
- S_DATA[ReadPM] = 1;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Read Personal Messages",\
- ""W"Feature "ORAN"\"Read PMs\""W" has been enabled!\n\
- Administrators will be able to see the messages\n\
- sent by members to others!", "Back", "");
- }
- case 7:
- {
- INI_WriteInt(ServerData, INI_Server_Info[7][isName], 1);
- S_DATA[ReadCMD] = 1;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Read Commands",\
- ""W"Feature "ORAN"\"Read Commands\""W" has been enabled!\n\
- Administrators will be able to see the commands a player used!", "Back", "");
- }
- case 8:
- {
- INI_WriteInt(ServerData, INI_Server_Info[8][isName], 1);
- S_DATA[AKA] = 1;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"AKA",\
- ""W"Feature "ORAN"\"AKA\""W" has been enabled!\n\
- Admins will see the AKA names of a player!", "Back", "");
- }
- case 9:
- {
- SPD(playerid, Dialog:cPanel2, LIST, ""ORAN"Server Control Panel"W" Page: 2", cPanel2(), "Enable", "Disable");
- }
- }
- INI_Close(ServerData);
- }
- else
- {
- new INI:
- ServerData = INI_Open(SERVER_FILE);
- switch(listitem)
- {
- case 0:
- {
- INI_WriteInt(ServerData, INI_Server_Info[0][isName], 0);
- S_DATA[AntiSpam] = 0;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti-Spam",\
- ""W"Feature "ORAN"\"Anti-Spam\""W" has been disabled!\n\
- Players will be able to spam the chat.", "Back", "");
- }
- case 1:
- {
- INI_WriteInt(ServerData, INI_Server_Info[1][isName], 0);
- S_DATA[AntiCSpam] = 0;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Command Spam",\
- ""W"Feature "ORAN"\"Anti Command Spam\""W" has been disabled!\n\
- Players will be able to spam the chat with commands.", "Back", "");
- }
- case 2:
- {
- INI_WriteInt(ServerData, INI_Server_Info[2][isName], 0);
- S_DATA[Ping] = 0;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Ping Kicker",\
- ""W"Feature "ORAN"\"Ping Kicker\""W" has been disabled!\n\
- Players won't be kicked for a high ping.", "Back", "");
- }
- case 3:
- {
- INI_WriteInt(ServerData, INI_Server_Info[3][isName], 0);
- S_DATA[RCONProt] = 0;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"RCON Protection",\
- ""W"Feature "ORAN"\"Rcon Protection\""W" has been disabled!\n\
- Players won't be banned from the server for RCON login attempts.", "Back", "");
- }
- case 4:
- {
- INI_WriteInt(ServerData, INI_Server_Info[4][isName], 0);
- S_DATA[TellPlayer] = 0;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Tell Player",\
- ""W"Feature "ORAN"\"Tell Player\""W" has been disabled!\n\
- Players won't be informed that their level is not high enough\n\
- to execute the admin command, actually, no message will be sent.", "Back", "");
- }
- case 5:
- {
- INI_WriteInt(ServerData, INI_Server_Info[5][isName], 1);
- S_DATA[Chat] = 1;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Block Chat",\
- ""W"The "ORAN"Chat"W" has been blocked!\n\
- Players won't be able to speak in the chat", "Back", "");
- }
- case 6:
- {
- INI_WriteInt(ServerData, INI_Server_Info[6][isName], 0);
- S_DATA[ReadPM] = 0;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Read Personal Messages",\
- ""W"Feature "ORAN"\"Read PMs\""W" has been disabled!\n\
- Personal Messages are now PERSONAL!", "Back", "");
- }
- case 7:
- {
- INI_WriteInt(ServerData, INI_Server_Info[7][isName], 0);
- S_DATA[ReadCMD] = 0;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Read Commands",\
- ""W"Feature "ORAN"\"Read Commands\""W" has been disabled!\n\
- Reading Commands is now disabled, Admins won't see.!", "Back", "");
- }
- case 8:
- {
- INI_WriteInt(ServerData, INI_Server_Info[8][isName], 0);
- S_DATA[AKA] = 0;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"AKA",\
- ""W"Feature "ORAN"\"AKA\""W" has been disabled!\n\
- Admins won't see the AKA the players logged with!", "Back", "");
- }
- }
- INI_Close(ServerData);
- }
- }
- iDialog<cPanel2>
- {
- if(response)
- {
- new INI:
- ServerData = INI_Open(SERVER_FILE);
- switch(listitem)
- {
- case 0:
- {
- INI_WriteInt(ServerData, INI_Server_Info[9][isName], 1);
- S_DATA[ShowFunction] = 1;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Show Function",\
- ""W"Feature "ORAN"\"Show Function\""W" has been enabled!\n\
- When admins type an admin command, they will see the \""ORAN"Function: "W"blabla\"", "Back", "");
- }
- case 1:
- {
- INI_WriteInt(ServerData, INI_Server_Info[10][isName], 1);
- S_DATA[AntiRepeat] = 1;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Message Repeat",\
- ""W"Feature "ORAN"\"Anti Message Repeat\""W" has been enabled!\n\
- Players will be warned if they continue to send same message in the chat!", "Back", "");
- }
- case 2:
- {
- INI_WriteInt(ServerData, INI_Server_Info[11][isName], 1);
- S_DATA[AutoLogin] = 1;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Auto Login",\
- ""W"Feature "ORAN"\"Auto Login\""W" has been enabled!\n\
- When players connect and the IP with which they left matches\n\
- the one they connected with and the name is same they will\n\
- auto login into their account without password request\n\n\
- "ORAN"# Could be unsafe! Use carfully!", "Back", "");
- }
- case 3:
- {
- #if USE_RANKS == true
- INI_WriteInt(ServerData, INI_Server_Info[12][isName], 1);
- S_DATA[AnnRank] = 1;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Announce Rank",\
- ""W"Feature "ORAN"\"Announce Rank\""W" has been enabled!\n\
- When a player will rank up, will tell to the whole server\n\
- This feature can get frustrating when the server is crowded!", "Back", "");
- #else
- cmd_acp(playerid, "");
- SendError(playerid, "Using Ranks is disabled from script!");
- #endif
- }
- case 4:
- {
- INI_WriteInt(ServerData, INI_Server_Info[13][isName], 1);
- S_DATA[AntiAD] = 1;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
- ""W"Feature "ORAN"\"Anti Advertising\""W" has been enabled!\n\
- Players that will advertise will be warned then kicked!", "Back", "");
- }
- case 5:
- {
- INI_WriteInt(ServerData, INI_Server_Info[14][isName], 0);
- S_DATA[AdminChat] = 1;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
- ""W"Feature "ORAN"\"Bloch Admin Chat\""W" has been enabled!\n\
- All admins will be able to chat trough Admin Chat", "Back", "");
- }
- case 6:
- {
- INI_WriteInt(ServerData, INI_Server_Info[15][isName], 0);
- S_DATA[VipChat] = 1;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
- ""W"Feature "ORAN"\"Block VIP Chat\""W" has been enabled!\n\
- VIP members can now chat freely trough VIP Chat.", "Back", "");
- }
- case 7:
- {
- cmd_acp(playerid, "");
- }
- }
- INI_Close(ServerData);
- }
- else
- {
- new INI:
- ServerData = INI_Open(SERVER_FILE);
- switch(listitem)
- {
- case 0:
- {
- INI_WriteInt(ServerData, INI_Server_Info[9][isName], 0);
- S_DATA[ShowFunction] = 0;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Show Function",\
- ""W"Feature "ORAN"\"Show Function\""W" has been disabled!\n\
- When admins type an admin command, they won't see the \"Function: blabla\"", "Back", "");
- }
- case 1:
- {
- INI_WriteInt(ServerData, INI_Server_Info[10][isName], 0);
- S_DATA[AntiRepeat] = 0;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Message Repeat",\
- ""W"Feature "ORAN"\"Anti Message Repeat\""W" has been disabled!\n\
- Players are now allowed to repeate themselves in the chat!", "Back", "");
- }
- case 2:
- {
- INI_WriteInt(ServerData, INI_Server_Info[11][isName], 0);
- S_DATA[AutoLogin] = 0;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Auto Login",\
- ""W"Feature "ORAN"\"Auto Login\""W" has been disabled!\n\
- On connection player will need to enter their passwords\n\
- to enter their accounts!\n\n\
- "GREE"# Safest Way!", "Back", "");
- }
- case 3:
- {
- #if USE_RANKS == true
- INI_WriteInt(ServerData, INI_Server_Info[12][isName], 0);
- S_DATA[AnnRank] = 0;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Announce Rank",\
- ""W"Feature "ORAN"\"Announce Rank\""W" has been disabled!\n\
- Only the ranked up player will see the message!", "Back", "");
- #else
- cmd_acp(playerid, "");
- SendError(playerid, "Using Ranks is disabled from script!");
- #endif
- }
- case 4:
- {
- INI_WriteInt(ServerData, INI_Server_Info[13][isName], 0);
- S_DATA[AntiAD] = 0;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
- ""W"Feature "ORAN"\"Anti Advertising\""W" has been disabled!\n\
- Players will now be able to send IP in chat!!!", "Back", "");
- }
- case 5:
- {
- INI_WriteInt(ServerData, INI_Server_Info[14][isName], 0);
- S_DATA[AdminChat] = 0;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
- ""W"Feature "ORAN"\"Bloch Admin Chat\""W" has been disabled!\n\
- Only Administrators and Owners will be able to Admin Chat", "Back", "");
- }
- case 6:
- {
- INI_WriteInt(ServerData, INI_Server_Info[15][isName], 0);
- S_DATA[VipChat] = 0;
- SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
- ""W"Feature "ORAN"\"Block VIP Chat\""W" has been disabled!\n\
- VIP members won't be able to chat trough VIP Chat.", "Back", "");
- }
- case 7:
- {
- cmd_acp(playerid, "");
- }
- }
- INI_Close(ServerData);
- }
- }
- switch(dialogid)
- {
- CaseDialog<Register1> if(response)RegisterPlayer(playerid, Dialog:Register1, inputtext);
- CaseDialog<Login>
- {
- #if SECURITY_QUESTION == true
- SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""W"Please write your password!", "Login", "Forg. Pass");
- #else
- SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""W"Please write your password!", "Login", "Kick");
- #endif
- }
- CaseDialog<Register>
- {
- if(! response) return KickEx(playerid, .zReason = "Not registering", .tell = true);
- if(strlen(inputtext))
- {
- if(strlen(inputtext) < MIN_PASS_LEN || strlen(inputtext) > MAX_PASS_LEN)
- return ShowPlayerDialog
- (
- playerid,
- Dialog:Register,
- DIALOG_STYLE_INPUT,
- ""W"Register an account",
- ""ORAN"ERROR:"W" An error has occured while trying to register the account, please try again!!\n\n\
- Please write your desired password.", "Register", "Kick");
- #if SECURITY_QUESTION == false
- RegisterPlayer(playerid, Dialog:Register, inputtext);
- #else
- SetPVarString(playerid, "TempPass", inputtext);
- 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", "");
- #endif
- }
- else
- {
- new zStr[256];
- format(zStr, sizeof (zStr), "{FF0000}Escribe una contraseña\n\n"W"Escribe la ocntraseña deseada", Name(playerid), GetServerHostName());
- ShowPlayerDialog(playerid, Dialog:Register, DIALOG_STYLE_INPUT, ""W"Registra una cuenta", zStr, "Registrar", "Salir");
- }
- }
- CaseDialog<SQuestion>
- {
- if(response || !response)
- {
- if(strlen(inputtext))
- {
- if(strlen(inputtext) > 10 && strlen(inputtext) < 90)
- {
- if(strfind(inputtext, "?", true) != -1)
- {
- SetPVarString(playerid, "Question", inputtext);
- new Str[190];
- format(Str, 190, ""W"Your secret question is:\n "BLUE"%s\n\n"W"Please insert the answer:", inputtext);
- SPD(playerid, Dialog:SAnswer, INPUT, ""W"Secret Answer",Str, "Insert", "Back");
- }
- 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", "");
- }
- 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", "");
- }
- 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", "");
- }
- }
- CaseDialog<SAnswer2>
- {
- RegisterPlayer(playerid, Dialog:Register1, GPVSEx(playerid, "TempPass"));
- }
- CaseDialog<SAnswer>
- {
- if(response)
- {
- new Str[190];
- if(strlen(inputtext))
- {
- if(strlen(inputtext) > 4 && strlen(inputtext) < 90)
- {
- SetPVarString(playerid, "Answer", inputtext);
- 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);
- SPD(playerid, Dialog:SAnswer2, BOX, ""W"Account login",Str, "Continue", "");
- format(Query, 200, "UPDATE `Accounts` SET `Question` = '%s', `Answer` = '%s' WHERE `Name` = '%s'", GPVSEx(playerid, "Question"), inputtext, Name(playerid));
- DB::Query(_DB, Query);
- }
- else
- {
- 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"));
- SPD(playerid, Dialog:SAnswer, INPUT, ""W"Secret Answer",Str, "Insert", "Back");
- }
- }
- else
- {
- 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"));
- SPD(playerid, Dialog:SAnswer, INPUT, ""W"Secret Answer",Str, "Insert", "Back");
- }
- }
- else
- {
- DeletePVar(playerid, "Question");
- 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", "");
- }
- }
- CaseDialog<Login2>
- {
- if(response)
- {
- if(strlen(inputtext))LoginPlayer(playerid, inputtext);
- else
- {
- #if SECURITY_QUESTION == true
- SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""ORAN"ERROR:"W" No password entered!\n\n"W"Please write your password!", "Login", "Forg. Pass");
- #else
- SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""ORAN"ERROR:"W" No password entered!\n\n"W"Please write your password!", "Login", "Kick");
- #endif
- }
- }
- else
- {
- #if SECURITY_QUESTION == true
- SPD(playerid, Dialog:ForgPass, INPUT, ""W"Forgot Password", ""W"Please insert the answer to your secret question for password retrival", "Insert", "Back");
- #else
- KickEx(playerid, "System", "Not logging in");
- #endif
- }
- }
- CaseDialog<ForgPass>
- {
- if(response)
- {
- if(strlen(inputtext))
- {
- new DBResult:Result;
- format(Query, 200, "SELECT `Question`, `Answer`, `RPassword` FROM `Accounts` WHERE `Name` = '%s';", Name(playerid));
- Result = DB::Query(_DB, Query);
- if(Result)
- {
- if(DB::Valid(Result))
- {
- new Field[129];
- DB::GetField(Result, "Answer", Field, sizeof(Field));
- SetPVarString(playerid, "TempAnswer", Field);
- DB::GetField(Result, "Question", Field, sizeof(Field));
- SetPVarString(playerid, "Question", Field);
- if(!strcmp(GPVSEx(playerid, "TempAnswer"), inputtext, false))
- {
- DB::GetField(Result, "RPassword", Field, sizeof(Field));
- new Str[100];
- format(Str, 100, ""W"The answer is correct!\n\nYour password is:"BLUE" %s", Field);
- 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", "");
- DB::Free(Result);
- DeletePVar(playerid, "TempAnswer");
- }
- else
- {
- DB::Free(Result);
- 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");
- }
- }
- }
- }else SPD(playerid, Dialog:ForgPass, INPUT, ""W"Forgot Password", ""W"Please insert the answer to your secret question for password retrival", "Insert", "Back");
- }
- else
- {
- #if SECURITY_QUESTION == true
- SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""W"Please write your password!", "Login", "Forg. Pass");
- #else
- SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""W"Please write your password!", "Login", "Kick");
- #endif
- }
- }
- CaseDialog<Login3>
- {
- if(response)
- {
- if(strlen(inputtext)) LoginPlayer(playerid, inputtext);
- else
- {
- #if SECURITY_QUESTION == true
- SPD(playerid, Dialog:Login3, INPUT, ""W"Account login", ""ORAN"ERROR:"W" No password entered!\n\n"W"Please write your password!", "Login", "Forg. Pass");
- #else
- SPD(playerid, Dialog:Login3, INPUT, ""W"Account login", ""ORAN"ERROR:"W" No password entered!\n\n"W"Please write your password!", "Login", "Kick");
- #endif
- }
- }
- }
- }
- return 0;
- }
- Public:dLabel(InV) return DeletePlayer3DTextLabel(InV, ZaAdminCar[InV]);
- Public:UnlimitedNos(playerid)AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
- Public:LoadAKA(playerid, name[], value[])
- {
- new pIP[30];
- GetPlayerIp(playerid, pIP, 30);
- if(!strcmp(name, pIP)) SetPVarString(playerid, "pAKA", value);
- }
- Public:PingKick()
- {
- foreach(Player, i)
- {
- if(S_DATA[Ping] != 0)
- {
- if(GetPlayerPing(i) > S_DATA[Ping] && P_DATA[i][Level] < IPGKICK)
- {
- new Str[30];
- format(Str, sizeof (Str), "Exceeding Ping Limit of %d", S_DATA[Ping]);
- KickEx(i, .zAdmin = "System", .zReason = Str, .tell = true);
- }
- }
- }
- }
- Public:BlockChat(playerid)
- {
- if(S_DATA[Chat]) return SendError(playerid, "Chat already blocked!");
- S_DATA[Chat] = 1;
- SendAdminCMD(-1, "Admin "ORAN"%s[%i]"GREY" blocked the chat.", Name(playerid), playerid);
- SendClientMessage(playerid, Color:GREY, "You blocked the chat.");
- foreach(Player, i)
- {
- if(P_DATA[i][Level] <= 0)
- {
- SendClientMessage(i, -1, "- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *");
- FormatMSG(i, -1, "Chat has been disabled by the Owner: %s", Name(playerid));
- SendClientMessage(i, -1, "- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *");
- }
- }
- return 1;
- }
- Public:JailPlayer(playerid)
- {
- KillTimer(JailTimer[playerid]);
- UnFreeze(playerid);
- SetPlayerPos(playerid, 197.6661, 173.8179, 1003.0234);
- SetPlayerInterior(playerid,3);
- SetCameraBehindPlayer(playerid);
- if(P_DATA[playerid][Frozen])
- {
- Freeze(playerid);
- }
- JailTimer[playerid] = SetTimerEx("UnjailPlayer", 60_000, true, "d", playerid);
- P_DATA[playerid][Jailed] = 1;
- }
- Public:UnjailPlayer(playerid)
- {
- --P_DATA[playerid][JailTime];
- if(!P_DATA[playerid][JailTime])
- {
- KillTimer(JailTimer[playerid]);
- UnjailPlayer(playerid);
- P_DATA[playerid][Jailed] = 0;
- P_DATA[playerid][JailTime] = 0;
- SetPlayerInterior(playerid, 0);
- SetPlayerPos(playerid, 0.0, 0.0, 0.0);
- PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
- SpawnPlayer(playerid);
- SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You have been un-jailed by the system!");
- #if SAVE_JAIL == true
- new
- Query[256];
- format(Query, 256, "DELETE FROM `Jailed` WHERE `IP` = '%s'", GetPlayerIPEx(playerid));
- DB::Query(_DB, Query);
- #endif
- }
- else if(P_DATA[playerid][JailTime] == 1){
- GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~b~~h~JAIL INFO~n~~b~~h~One~w~ minute left", 10000, 3);}
- else if(P_DATA[playerid][JailTime] > 1)
- {
- new Str[129];
- format(Str, 129, "~n~~n~~n~~n~~n~~n~~b~~h~JAIL INFO~n~~b~~h~%d~w~ minutes left", P_DATA[playerid][JailTime]);
- GameTextForPlayer(playerid, Str, 10000, 3);
- }
- return 1;
- }
- PcPanel(playerid)
- {
- new Str[2_0_0_0];
- format(Str, sizeof (Str), ""ORAN"Exit cPanel\n\
- "W"Auto-Login\t\t%s\n\
- "W"Block PMs\t\t%s\n\
- "W"My stats",
- (S_DATA[AutoLogin] && P_DATA[playerid][pAuto]) ? (""GREE"Enabled") : (""ORAN"Disabled"),
- P_DATA[playerid][BAPMs] ? (""GREE"Enabled") : (""ORAN"Disabled"));
- switch(P_DATA[playerid][Vip])
- {
- case 1:
- {
- format(Str, sizeof (Str), "%s\n"BLUE"VIP LEVEL 1\n\
- "W"Godlike\t\t%s\n\
- "W"Vehicle God\t\t%s\n\
- "W"Vehicle Boost\t\t%s\n\
- "W"Wear VIP Tag\t\t%s",
- Str,
- P_DATA[playerid][God] ? (""GREE"Enabled") : (""ORAN"Disabled"),
- P_DATA[playerid][CarGod] ? (""GREE"Enabled") : (""ORAN"Disabled"),
- P_DATA[playerid][Boost] ? (""GREE"Enabled") : (""ORAN"Disabled"),
- P_DATA[playerid][VIPTag] ? (""GREE"Enabled") : (""ORAN"Disabled"));
- }
- case 2:
- {
- format(Str, sizeof (Str), "%s\n"BLUE"VIP LEVEL 1\n\
- "W"Godlike\t\t\t%s\n\
- "W"Vehicle God\t\t%s\n\
- "W"Vehicle Boost\t\t%s\n\
- "W"Wear VIP Tag\t\t%s\n\
- "BLUE"VIP LEVEL 2\n\
- "W"Vehicle Spin\t\t%s\n\
- "W"Incredible\t\t%s",
- Str,
- P_DATA[playerid][God] ? (""GREE"Enabled") : (""ORAN"Disabled"),
- P_DATA[playerid][CarGod] ? (""GREE"Enabled") : (""ORAN"Disabled"),
- P_DATA[playerid][Boost] ? (""GREE"Enabled") : (""ORAN"Disabled"),
- P_DATA[playerid][VIPTag] ? (""GREE"Enabled") : (""ORAN"Disabled"),
- P_DATA[playerid][Spin] ? (""GREE"Enabled") : (""ORAN"Disabled"),
- P_DATA[playerid][Incred] ? (""GREE"Enabled") : (""ORAN"Disabled"));
- }
- case 3:
- {
- format(Str, sizeof (Str), "%s\n"BLUE"VIP LEVEL 1\n\
- "W"Godlike\t\t\t%s\n\
- "W"Vehicle God\t\t%s\n\
- "W"Vehicle Boost\t\t%s\n\
- "W"Wear VIP Tag\t\t%s\n\
- "BLUE"VIP LEVEL 2\n\
- "W"Vehicle Spin\t\t%s\n\
- "W"Incredible\t\t%s\n\
- "BLUE"VIP LEVEL 3\n\
- "W"Shout",
- Str,
- P_DATA[playerid][God] ? (""GREE"Enabled") : (""ORAN"Disabled"),
- P_DATA[playerid][CarGod] ? (""GREE"Enabled") : (""ORAN"Disabled"),
- P_DATA[playerid][Boost] ? (""GREE"Enabled") : (""ORAN"Disabled"),
- P_DATA[playerid][VIPTag] ? (""GREE"Enabled") : (""ORAN"Disabled"),
- P_DATA[playerid][Spin] ? (""GREE"Enabled") : (""ORAN"Disabled"),
- P_DATA[playerid][Incred] ? (""GREE"Enabled") : (""ORAN"Disabled"));
- }
- }
- return Str;
- }
- cPanel()
- {
- new PingString[50], Str[1024];
- if(S_DATA[Ping] != 0) format(PingString, sizeof (PingString), ""GREE"Enabled"W"\tPing Limit: "ORAN"%d", S_DATA[Ping]); else PingString = ""ORAN"Disabled";
- format(Str, sizeof (Str), ""W"Anti Spam\t\t%s\n\
- "W"Anti Command Spam\t%s\n\
- "W"Ping Kicker\t\t%s\n\
- "W"RCON Protection\t%s\n\
- "W"Tell Player\t\t%s\n\
- "W"Chat\t\t\t%s\n\
- "W"Read Commands\t%s\n\
- "W"Read PMs\t\t%s\n\
- "W"AKA\t\t\t%s\n\
- "GREY"..: Page 2\n\
- "ORAN"..: Exit",
- S_DATA[AntiSpam] ? (""GREE"Enabled") : (""ORAN"Disabled"),
- S_DATA[AntiCSpam] ? (""GREE"Enabled") : (""ORAN"Disabled"),
- PingString,
- S_DATA[RCONProt] ? (""GREE"Enabled") : (""ORAN"Disabled"),
- S_DATA[TellPlayer] ? (""GREE"Enabled") : (""ORAN"Disabled"),
- S_DATA[Chat] ? (""ORAN"Blocked") : (""GREE"Free to chat"),
- S_DATA[ReadPM] ? (""GREE"Reading") : (""ORAN"Not Reading"),
- S_DATA[ReadCMD] ? (""GREE"Reading") : (""ORAN"Not Reading"),
- S_DATA[AKA] ? (""GREE"Enabled") : (""ORAN"Disabled"));
- return Str;
- }
- cPanel2()
- {
- new Str[512];
- format(Str, sizeof (Str), ""W"Show Function\t\t%s\n\
- "W"Anti Message Repeat\t%s\n\
- "W"Autologin\t\t%s\n\
- "W"Announce Rank-Up\t%s\n\
- "W"Anti Advertising\t%s\n\
- "W"Admin Chat\t\t%s\n\
- "W"VIP Chat\t\t%s\n\
- "GREY"..: Back\n\
- "ORAN"..: Exit",
- S_DATA[ShowFunction] ? (""GREE"Enabled") : (""ORAN"Disabled"),
- S_DATA[AntiRepeat] ? (""GREE"Enabled") : (""ORAN"Disabled"),
- S_DATA[AutoLogin] ? (""GREE"Enabled") : (""ORAN"Disabled"),
- S_DATA[AnnRank] ? (""GREE"Enabled") : (""ORAN"Disabled"),
- S_DATA[AntiAD] ? (""GREE"Enabled") : (""ORAN"Disabled"),
- S_DATA[AdminChat] ? (""GREE"Allowed") : (""ORAN"Not Allowed"),
- S_DATA[VipChat] ? (""GREE"Allowed") : (""ORAN"Not Allowed"));
- return Str;
- }
- OnlineCheck(type[], C)
- {
- new cS[126];
- if(!strcmp(type, "Admins"))
- {
- if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" Administrators online!\n\n", C);
- else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" Administrator online!\n\n");
- }
- else if(!strcmp(type, "Vips"))
- {
- if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" VIP Members online!\n\n", C);
- else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" VIP Member online!\n\n");
- }
- else if(!strcmp(type, "Jailed"))
- {
- if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" Jailed players online!\n\n", C);
- else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" Jailed player online!\n\n");
- }
- else if(!strcmp(type, "Muted"))
- {
- if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" Muted players online!\n\n", C);
- else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" Muted player online!\n\n");
- }
- else if(!strcmp(type, "Frozen"))
- {
- if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" Frozen players online!\n\n", C);
- else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" Frozen player online!\n\n");
- }
- return cS;
- }
- Public: LowerSpam()
- {
- foreach(Player, playerid)
- {
- if(P_DATA[playerid][SpamMSG] > 0) P_DATA[playerid][SpamMSG]--;
- if(P_DATA[playerid][cSpam] > 0) P_DATA[playerid][cSpam]--;
- }
- }
- fNMB(nmb)
- {
- new Str[4];
- format(Str, sizeof (Str), "%d", nmb);
- return Str;
- }
- FormatStats(playerid)
- {
- #if USE_RANKS == true
- format(StatsString, sizeof (StatsString), "\n"W"Viewing %s\n\n\
- "W"Level: "ORAN"%s\n\
- "W"Vip: "ORAN"%s\n\
- "W"Kills: "ORAN"%d\n\
- "W"Deaths: "ORAN"%d\n\
- "W"Ratio: "ORAN"%.3f\n\
- "W"Rank: "ORAN"%s\n\
- "W"Cookies: "ORAN"%d\n\
- "W"Respect: "GREE"+%d"W"/"ORAN"-%d\n",
- WhosStats,
- LevelName(GetPVarInt(playerid, "0_Level")),
- (GetPVarInt(playerid, "0_Vip")) ? (fNMB(GetPVarInt(playerid, "0_Vip"))) : ("NO!"),
- GetPVarInt(playerid, "0_Kills"),
- GetPVarInt(playerid, "0_Deaths"),
- (Float:GetPVarInt(playerid, "0_Kills") / Float:GetPVarInt(playerid, "0_Deaths")),
- RankName(GetPVarInt(playerid, "0_Rank")),
- GetPVarInt(playerid, "0_Cookies"),
- GetPVarInt(playerid, "0_Positive"),
- GetPVarInt(playerid, "0_Negative"));
- #else
- format(StatsString, sizeof (StatsString), "\n"W"Viewing %s\n\n\
- "W"Level: "ORAN"%s\n\
- "W"Vip: "ORAN"%s\n\
- "W"Kills: "ORAN"%d\n\
- "W"Deaths: "ORAN"%d\n\
- "W"Ratio: "ORAN"%.3f\n\
- "W"Cookies: "ORAN"%d\n\
- "W"Respect: "GREE"+%d"W"/"ORAN"-%d\n",
- WhosStats,
- LevelName(GetPVarInt(playerid, "0_Level")),
- (GetPVarInt(playerid, "0_Vip")) ? (fNMB(GetPVarInt(playerid, "0_Vip"))) : ("NO!"),
- GetPVarInt(playerid, "0_Kills"),
- GetPVarInt(playerid, "0_Deaths"),
- (Float:GetPVarInt(playerid, "0_Kills") / Float:GetPVarInt(playerid, "0_Deaths")),
- GetPVarInt(playerid, "0_Cookies"),
- GetPVarInt(playerid, "0_Positive"),
- GetPVarInt(playerid, "0_Negative"));
- #endif
- format(StatsString, sizeof (StatsString), "%s\
- "W"Money: "ORAN"%d\n\
- "W"Score: "ORAN"%d\n\
- "W"Online: "ORAN"%s\n\
- "W"Commands: "ORAN"%d\n\
- "W"Fail Cmds: "ORAN"%d\n\
- "W"Messages: "ORAN"%d\n\
- "W"Kicks: "ORAN"%d\n\
- "W"Account date: "ORAN"%s\n\
- "W"Account ID: "ORAN"%d\n\n",
- StatsString,
- GetPlayerMoney(playerid),
- GetPlayerScore(playerid),
- FormatOnline(playerid),
- P_DATA[playerid][Cmds],
- P_DATA[playerid][fCmds],
- P_DATA[playerid][Msgs],
- P_DATA[playerid][Kicks],
- GPVSEx(playerid, "AccountDate"),
- P_DATA[playerid][AccID]);
- return 1;
- }
- #if USE_RANKS == true
- RankName(rank) return _RankNames[rank];
- #endif
- LevelName(iLevel)
- {
- new zLevel[35];
- if (iLevel == 0) format(zLevel, 35, "%s", _Levels[0]);
- else if(iLevel == 1) format(zLevel, 35, "%s", _Levels[1]);
- else if(iLevel == 2) format(zLevel, 35, "%s", _Levels[2]);
- else if(iLevel == 3) format(zLevel, 35, "%s", _Levels[3]);
- else if(iLevel == 4) format(zLevel, 35, "%s", _Levels[4]);
- else if(iLevel >= 5) format(zLevel, 35, "%s", _Levels[5]);
- else zLevel = "<< Error >>";
- return zLevel;
- }
- LoginPlayer(playerid, const pPass[], pAutoLogin = false)
- {
- new Buf[129], Query[280], DBResult:Result;
- WP_Hash(Buf, (129), pPass);
- format(Query, 280, "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s' AND `Password` = '%s'", Name(playerid), Buf);
- Result = DB::Query(_DB, Query);
- if(Result)
- {
- if(DB::Valid(Result))
- {
- DB::Free(Result);
- new Accp_String[16], Accp_Vars[6], Str[256];
- LoadPlayerData(playerid);
- P_DATA[playerid][Logged] = 1;
- sscanf(GPVSEx(playerid, "Online"), "p<:>iii", P_DATA[playerid][Hours],P_DATA[playerid][Minutes],P_DATA[playerid][Seconds]);
- if(!sscanf(GPVSEx(playerid, "ACCP_DATA"), "p<:>s[16]iiiiii",Accp_String,
- Accp_Vars[0],
- Accp_Vars[1],
- Accp_Vars[2],
- Accp_Vars[3],
- Accp_Vars[4],
- Accp_Vars[5]))
- {
- SetPVarString(playerid, "Type", Accp_String);
- P_DATA[playerid][A_Component1] = Accp_Vars[0];
- P_DATA[playerid][A_Component2] = Accp_Vars[1];
- P_DATA[playerid][A_Component3] = Accp_Vars[2];
- P_DATA[playerid][A_Component4] = Accp_Vars[2];
- P_DATA[playerid][A_Wheels] = Accp_Vars[3];
- P_DATA[playerid][A_Color] = Accp_Vars[4];
- }
- else
- {
- SetPVarString(playerid, "Type", "None");
- P_DATA[playerid][A_Component1] = 0;
- P_DATA[playerid][A_Component2] = 0;
- P_DATA[playerid][A_Component3] = 0;
- P_DATA[playerid][A_Component4] = 0;
- P_DATA[playerid][A_Wheels] = 0;
- P_DATA[playerid][A_Color] = 0;
- }
- SetPVarInt(playerid, "0_Level", P_DATA[playerid][Level]);
- SetPVarInt(playerid, "0_Vip", P_DATA[playerid][Vip]);
- SetPVarInt(playerid, "0_Kills", P_DATA[playerid][Kills]);
- SetPVarInt(playerid, "0_Deaths", P_DATA[playerid][Deaths]);
- SetPVarInt(playerid, "0_Messages", P_DATA[playerid][Msgs]);
- SetPVarInt(playerid, "0_Commands", P_DATA[playerid][Cmds]);
- SetPVarInt(playerid, "0_Fail_Commands", P_DATA[playerid][fCmds]);
- SetPVarInt(playerid, "0_Cookies", P_DATA[playerid][Cookies]);
- SetPVarInt(playerid, "0_God", P_DATA[playerid][God]);
- SetPVarInt(playerid, "0_CarGod", P_DATA[playerid][CarGod]);
- SetPVarInt(playerid, "0_Positive", P_DATA[playerid][Positive]);
- SetPVarInt(playerid, "0_Negative", P_DATA[playerid][Negative]);
- SetPVarInt(playerid, "0_Rank", P_DATA[playerid][Rank]);
- if(!pAutoLogin)
- {
- if(P_DATA[playerid][Level] > 0 && P_DATA[playerid][Vip] > 0)
- {
- 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]);
- if(P_DATA[playerid][VIPTag])
- {
- Delete3DTextLabel(P_DATA[playerid][Tag3D]);
- P_DATA[playerid][Tag3D] = Create3DTextLabel("VIP Member", Color:BLUE, 0.0, 0.0, 0.0, 90.0, 0, 1);
- }
- }
- else if(P_DATA[playerid][Level] > 0 && P_DATA[playerid][Vip] <= 0)
- format(Str, sizeof (Str), ""W"Welcome "ORAN"%s.\n\n"W"-------------------\nAdmin: "ORAN"%s",Name(playerid), LevelName(P_DATA[playerid][Level]));
- else if(P_DATA[playerid][Level] <= 0 && P_DATA[playerid][Vip] > 0)
- {
- format(Str, sizeof (Str), ""W"Welcome "ORAN"%s.\n\n"W"-------------------\nVIP: "ORAN"%d",Name(playerid), P_DATA[playerid][Vip]);
- if(P_DATA[playerid][VIPTag])
- {
- Delete3DTextLabel(P_DATA[playerid][Tag3D]);
- P_DATA[playerid][Tag3D] = Create3DTextLabel("VIP Member", Color:BLUE, 0.0, 0.0, 0.0, 90.0, 0, 1);
- }
- }
- else if(P_DATA[playerid][Level] == 0 && P_DATA[playerid][Vip] == 0)
- format(Str, sizeof (Str), ""W"Welcome "ORAN"%s.\n\n"W"-------------------",Name(playerid));
- format(Str, sizeof (Str), "%s\n"W"Online: "ORAN"%s\n"W"Kills: "ORAN"%d\n"W"Deaths: "ORAN"%d"W"\n-------------------\n",
- Str,
- FormatOnline(playerid),
- P_DATA[playerid][Kills],
- P_DATA[playerid][Deaths]);
- SPD(playerid, 9000, BOX, ""W"Succesfully logged in!", Str, "Close", "");
- }
- else
- {
- 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")");
- SPD(playerid, 9000, BOX, ""W"Succesfully logged in!", Str, "Close", "");
- }
- }
- else
- {
- --P_DATA[playerid][LogFail];
- new zStr[256];
- if(P_DATA[playerid][LogFail] != 0)
- {
- 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]);
- #if SECURITY_QUESTION == true
- SPD(playerid, Dialog:Login2, INPUT, ""W"Account login error", zStr, "Login", "Forg. Pass");
- #else
- SPD(playerid, Dialog:Login2, INPUT, ""W"Account login error", zStr, "Login", "Kick");
- #endif
- }
- else if(P_DATA[playerid][LogFail] <= 0)
- {
- GameTextForPlayer(playerid, "~r~Kicked from the server~n~~w~REASON: ~g~Exceeding login fails.", 60000, 3);
- KickEx(playerid, .zReason = "Exceeding login tries", .tell = true);
- }
- }
- }
- }
- CMD:mutecheck(PARAMS)
- {
- if(!P_DATA[playerid][Muted]) return SendClientMessage(playerid, Color:ORAN, "SERVER: "W"You are not muted!");
- if(P_DATA[playerid][MutedTime] > 0)
- {
- FormatMSG(playerid, Color:ORAN, "SERVER:"W" You will be unmuted after "ORAN"%d"W" seconds!", P_DATA[playerid][MutedTime]);
- }
- else if(P_DATA[playerid][MutedTime] == 0)
- {
- SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You will never be unmuted automatically! (Even after connect!)");
- }
- return 1;
- }
- Public:GodLike()
- {
- foreach(Player, i)
- {
- if(GetPVarInt(i, "0_God") == 1 || P_DATA[i][God])
- {
- new Float: H;
- GetPlayerHealth(i, H);
- if(H < 300) SetPlayerHealth(i, 9999);
- }
- if(GetPVarInt(i, "0_CarGod") == 1 || P_DATA[i][CarGod])
- {
- if(IsPlayerInAnyVehicle(i))
- {
- SetVehicleHealth(GetPlayerVehicleID(i), 1000);
- RepairVehicle(GetPlayerVehicleID(i));
- }
- }
- }
- }
- GetPlayerIPEx(playerid)
- {
- new pIP[30];
- GetPlayerIp(playerid, pIP, sizeof(pIP));
- return pIP;
- }
- SavePlayerData(playerid)
- {
- new Query[700];
- if(AccountExist(Name(playerid)))
- {
- format(Query, sizeof(Query), "UPDATE `Accounts` SET \
- `Online` = '%s', \
- `Level` = '%d', \
- `VIP` = '%d', \
- `Rank` = '%d', \
- `Autologin` = '%d', \
- `Money` = '%d', \
- `Score` = '%d', \
- `Kills` = '%d', \
- `Deaths` = '%d', \
- `Cookies` = '%d', \
- `Positive` = '%d', \
- `Negative` = '%d' WHERE `Name` = '%s'",
- FormatOnline(playerid),
- P_DATA[playerid][Level],
- P_DATA[playerid][Vip],
- P_DATA[playerid][Rank],
- P_DATA[playerid][pAuto],
- GetPlayerMoney(playerid),
- GetPlayerScore(playerid),
- P_DATA[playerid][Kills],
- P_DATA[playerid][Deaths],
- P_DATA[playerid][Cookies],
- P_DATA[playerid][Positive],
- P_DATA[playerid][Negative],
- Name(playerid));
- DB::Query(_DB, Query);
- format(Query, sizeof(Query), "UPDATE `Accounts` SET \
- `Messages` = '%d', \
- `Commands` = '%d', \
- `fCommands` = '%d', \
- `Warns` = '%d', \
- `Kicks` = '%d', \
- `God` = '%d', \
- `Cargod` = '%d', \
- `ACCPSav` = '%d', \
- `BlockPM` = '%d', \
- `Boost` = '%d', \
- `bSpeed` = '%f', \
- `WearTag` = '%d', \
- `Incred` = '%d', \
- `Spin` = '%d' WHERE `Name` = '%s'",
- P_DATA[playerid][Msgs],
- P_DATA[playerid][Cmds],
- P_DATA[playerid][fCmds],
- P_DATA[playerid][Warns],
- P_DATA[playerid][Kicks],
- P_DATA[playerid][God],
- P_DATA[playerid][CarGod],
- P_DATA[playerid][Accp_Saved],
- P_DATA[playerid][BAPMs],
- P_DATA[playerid][Boost],
- Float:P_DATA[playerid][bSpeed],
- P_DATA[playerid][VIPTag],
- P_DATA[playerid][Incred],
- P_DATA[playerid][Spin],
- Name(playerid));
- DB::Query(_DB, Query);
- }
- else
- {
- printf("Account: %s doesn't exist! Server tried to save data on it!", Name(playerid));
- }
- format(Query, sizeof (Query),"SELECT `Key` FROM `Top` WHERE `Name` = '%s' LIMIT 1", Name(playerid));
- new DBResult:Q_RESULT;
- Q_RESULT = DB::Query(_DB, Query);
- if(DB::Valid(Q_RESULT))
- {
- DB::Free(Q_RESULT);
- format(Query, sizeof (Query),"UPDATE `Top` SET `Kills` = '%d',`Deaths` = '%d',`Hours` = '%d',`Rank` = '%d',`Ratio` = '%f',`Negative` = '%d',`Positive` = '%d' WHERE `Name` = '%s'",
- P_DATA[playerid][Kills],
- P_DATA[playerid][Deaths],
- P_DATA[playerid][Hours],
- P_DATA[playerid][Rank],
- (Float:P_DATA[playerid][Kills] / Float:P_DATA[playerid][Deaths]),
- P_DATA[playerid][Negative],
- P_DATA[playerid][Positive],
- Name(playerid));
- DB::Free(Q_RESULT);
- DB::Query(_DB, Query);
- }
- else
- {
- format(Query, sizeof (Query), "INSERT INTO `Top` (`Name`,`Kills`,`Deaths`,`Hours`,`Rank`,`Ratio`,`Negative`,`Positive`) VALUES('%s','%d','%d','%d','%d','%f','%d','%d')",
- Name(playerid),
- P_DATA[playerid][Kills],
- P_DATA[playerid][Deaths],
- P_DATA[playerid][Hours],
- P_DATA[playerid][Rank],
- (Float:P_DATA[playerid][Kills] / Float:P_DATA[playerid][Deaths]),
- P_DATA[playerid][Negative],
- P_DATA[playerid][Positive]);
- DB::Query(_DB, Query);
- }
- #if TRACK_ACCOUNTS == true
- new
- Str[24],fStr[2_0_0_0], Player = playerid;
- format(Str, sizeof(Str) + strlen(STATS_LOC), ""#STATS_LOC"%s.ini", Name(Player));
- new
- Online[3];
- TotalGameTime(Player, Online[0], Online[1], Online[2]);
- format(fStr, 2_0_0_0, "Date: %s (saved on disconnect)\r\n------------------------------------------\r\n\
- Registration Date: %s\r\n\
- IP: %s\r\n\
- Account ID: %d\r\n\
- Level: %d\r\n\
- VIP: %d\r\n\
- Rank: %d\r\n\
- Commands Used: %d\r\n\
- Failed Commands: %d\r\n\
- Messages Sent: %d\r\n\
- Cookies: %d\r\n",
- zDate (),
- GPVSEx(Player, "AccountDate"),
- PlayerIP[Player],
- P_DATA[Player][AccID],
- P_DATA[Player][Level],
- P_DATA[Player][Vip],
- P_DATA[Player][Rank],
- P_DATA[Player][Cmds],
- P_DATA[Player][fCmds],
- P_DATA[Player][Msgs],
- P_DATA[Player][Cookies]);
- format(fStr, 2_0_0_0, "%s\
- Online: %d:%d:%d\r\n\
- Respect: %d/-%d\r\n\
- Money: %d\r\n\
- Score: %d\r\n\
- Deaths: %d\r\n\
- Kills: %d\r\n\
- Ratio: %.3f\r\n\
- Kicks Received: %d\r\n",
- fStr,
- Online[0], Online[1], Online[2],
- P_DATA[Player][Positive],
- P_DATA[Player][Negative],
- GetPlayerMoney(Player),
- GetPlayerScore(Player),
- P_DATA[Player][Deaths],
- P_DATA[Player][Kills],
- (Float:P_DATA[Player][Deaths] / Float:P_DATA[Player][Kills]),
- P_DATA[Player][Kicks]);
- new
- File:Stats = fopen(Str, io_append);
- if(Stats)
- {
- if(fexist(Str)) fwrite(Stats, "\r\n\r\n\r\n");
- fwrite(Stats, fStr);
- fclose(Stats);
- }
- #endif
- return 1;
- }
- RegisterPlayer(playerid, returndialog, inputtext[])
- {
- if(!strlen(inputtext) || strlen(inputtext) < MIN_PASS_LEN || strlen(inputtext) > MAX_PASS_LEN)
- return ShowPlayerDialog
- (
- playerid,
- returndialog,
- DIALOG_STYLE_INPUT,
- ""W"Register an account",
- ""ORAN"ERROR:"W" An error has occured while trying to register the account, please try again!!\n\n\
- Please write your desired password.", "Register", "Kick");
- new Buf[129], Query[500], zStr[450];
- WP_Hash(Buf, (129), inputtext);
- format(Query, sizeof(Query), "INSERT INTO `Accounts` \
- VALUES(NULL, '%s', '%s', '%s', '00:00:00', '%s', '0', '0', \
- '0', '0', '2000', '0', '0', '0', '0', '0', '0', \
- '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', \
- '0', '0', '%s', '%s', '%s', '0', '0', '0')", GetPlayerIPEx(playerid), Name(playerid), Buf, zDate(), inputtext, GPVSEx(playerid, "Question"), GPVSEx(playerid, "Answer"));
- DB::Query(_DB, Query);
- format(Query, sizeof(Query), "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s'", Name(playerid));
- new DBResult:Result = DB::Query(_DB, Query);
- if(Result)
- {
- if(DB::Valid(Result))
- {
- new Field[15];
- DB::GetField(Result, "Key", Field, sizeof(Field));
- S_DATA[sAccounts] = strval(Field);
- P_DATA[playerid][AccID] = strval(Field);
- DB::Free(Result);
- }
- }
- #if SECURITY_QUESTION == true
- format(zStr, sizeof (zStr), ""W"Account succesfully created!\n\n\
- "ORAN"["W" Account Information "ORAN"]\n\
- "W"Account: "BLUE"%s\n\
- "W"Password: "BLUE"%s\n\
- "W"Account ID: "BLUE"%d\n\
- "W"Created On: "BLUE"%s\n", Name(playerid), inputtext, S_DATA[sAccounts], zDate());
- format(zStr, sizeof (zStr), "%s\
- "W"Secret Question: "BLUE"%s\n\
- "W"Secret Answer: "BLUE"%s\n\n\n\
- Thanks for registering an account.\n\
- Please procceed with login.", zStr, GPVSEx(playerid, "Question"), GPVSEx(playerid, "Answer"));
- #else
- format(zStr, sizeof (zStr), ""W"Account succesfully created!\n\n\
- "ORAN"["W" Account Information "ORAN"]\n\
- "W"Account: "BLUE"%s\n\
- "W"Password: "BLUE"%s\n\
- "W"Account ID: "BLUE"%d\n\
- "W"Created On: "BLUE"%s\n\n\
- Thanks for registering an account.\n\
- Please procceed with login.", Name(playerid), inputtext, S_DATA[sAccounts], zDate());
- #endif
- SPD(playerid, Dialog:Login, BOX, ""W"Account Information", zStr, "Continue", "");
- new INI:
- Accounts = INI_Open(USER_ID);
- INI_WriteInt(Accounts, "Accounts_Created", S_DATA[sAccounts]);
- INI_WriteString(Accounts, "Last_Account", Name(playerid));
- INI_WriteString(Accounts, "Last_Account_Date", zDate());
- INI_Close(Accounts);
- return 1;
- }
- FormatOnline(playerid)
- {
- new zStr[15], T[3];
- TotalGameTime(playerid, T[0], T[1], T[2]);
- format(zStr, sizeof (zStr), "%d:%d:%d", T[0], T[1], T[2]);
- return zStr;
- }
- ClearVars(playerid)
- {
- DestroyVehicle(P_DATA[playerid][GiveCar]);
- Delete3DTextLabel(P_DATA[playerid][Tag3D]);
- P_DATA[playerid][Kills] = 0;
- P_DATA[playerid][Deaths] = 0;
- P_DATA[playerid][Hours] = 0;
- P_DATA[playerid][Rank] = 0;
- P_DATA[playerid][Msgs] = 0;
- P_DATA[playerid][Cmds] = 0;
- P_DATA[playerid][fCmds] = 0;
- P_DATA[playerid][Cookies] = 0;
- P_DATA[playerid][Negative] = 0;
- P_DATA[playerid][Positive] = 0;
- P_DATA[playerid][Money] = 0;
- P_DATA[playerid][Score] = 0;
- P_DATA[playerid][Banned] = 0;
- P_DATA[playerid][Kicks] = 0;
- P_DATA[playerid][Logged] = 0;
- P_DATA[playerid][Muted] = 0;
- P_DATA[playerid][Frozen] = 0;
- P_DATA[playerid][Jailed] = 0;
- P_DATA[playerid][MutedTime] = 0;
- P_DATA[playerid][JailTime] = 0;
- P_DATA[playerid][tLevel] = 0;
- P_DATA[playerid][PMSent] = 0;
- P_DATA[playerid][RepMSG] = EOS;
- P_DATA[playerid][Warns] = 0;
- P_DATA[playerid][aCar] = -1;
- P_DATA[playerid][pAuto] = 0;
- P_DATA[playerid][MutedAll] = 0;
- P_DATA[playerid][Accp_Saved] = 0;
- P_DATA[playerid][A_Color] = 0;
- P_DATA[playerid][A_Component1] = 0;
- P_DATA[playerid][A_Component2] = 0;
- P_DATA[playerid][A_Component3] = 0;
- P_DATA[playerid][A_Component4] = 0;
- P_DATA[playerid][A_Wheels] = 0;
- P_DATA[playerid][Spin] = 0;
- P_DATA[playerid][VIPTag] = 0;
- P_DATA[playerid][Spec_ID] = 0xFFFF;
- P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_NONE;
- }
- Public:ParseUserID(name[], value[])if(!strcmp(name, "Accounts_Created")) S_DATA[sAccounts] = strval(value);
- Public:LoadServerData(name[], value[])
- {
- if(!strcmp(name, INI_Server_Info[0][isName])) S_DATA[AntiSpam] = strval(value);
- if(!strcmp(name, INI_Server_Info[1][isName])) S_DATA[AntiCSpam] = strval(value);
- if(!strcmp(name, INI_Server_Info[2][isName])) S_DATA[Ping] = strval(value);
- if(!strcmp(name, INI_Server_Info[3][isName])) S_DATA[RCONProt] = strval(value);
- if(!strcmp(name, INI_Server_Info[4][isName])) S_DATA[TellPlayer] = strval(value);
- if(!strcmp(name, INI_Server_Info[5][isName])) S_DATA[Chat] = strval(value);
- if(!strcmp(name, INI_Server_Info[6][isName])) S_DATA[ReadPM] = strval(value);
- if(!strcmp(name, INI_Server_Info[7][isName])) S_DATA[ReadCMD] = strval(value);
- if(!strcmp(name, INI_Server_Info[8][isName])) S_DATA[AKA] = strval(value);
- if(!strcmp(name, INI_Server_Info[9][isName])) S_DATA[ShowFunction] = strval(value);
- if(!strcmp(name, INI_Server_Info[10][isName])) S_DATA[AntiRepeat] = strval(value);
- if(!strcmp(name, INI_Server_Info[11][isName])) S_DATA[AutoLogin] = strval(value);
- if(!strcmp(name, INI_Server_Info[12][isName])) S_DATA[AnnRank] = strval(value);
- if(!strcmp(name, INI_Server_Info[13][isName])) S_DATA[AntiAD] = strval(value);
- if(!strcmp(name, INI_Server_Info[14][isName])) S_DATA[AdminChat] = strval(value);
- if(!strcmp(name, INI_Server_Info[15][isName])) S_DATA[VipChat] = strval(value);
- }
- Public:LoadPlayerData(playerid)
- {
- new Query[750], DBResult:Result;
- format(Query, 750, "SELECT `IP`, `Level`, `VIP`, \
- `Rank`, `Money`, `Score`, \
- `Kills`, `Deaths`, `Cookies`, \
- `Positive`, `Negative`, `Messages`, \
- `Commands`, `fCommands`, `Warns`, \
- `Kicks`, `God`, `Cargod`, \
- `ACCP`, `ACCPSav`, `BlockPM`, \
- `Key`, `Boost`, `bSpeed` `JoinDate`, `Online`, \
- `Spin`, `WearTAG`, `Incred` FROM `Accounts` WHERE `Name` = '%s';", Name(playerid));
- Result = DB::Query(_DB, Query);
- if(Result)
- {
- if(DB::Valid(Result))
- {
- new Field[30];
- _GetField<"Key">Store<AccID>
- _GetField<"Level">Store<Level>
- _GetField<"VIP">Store<Vip>
- _GetField<"Rank">Store<Rank>
- _GetField<"Kills">Store<Kills>
- _GetField<"Deaths">Store<Deaths>
- _GetField<"Cookies">Store<Cookies>
- _GetField<"Positive">Store<Positive>
- _GetField<"Negative">Store<Negative>
- _GetField<"Messages">Store<Msgs>
- _GetField<"Commands">Store<Cmds>
- _GetField<"fCommands">Store<fCmds>
- _GetField<"Warns">Store<Warns>
- _GetField<"Kicks">Store<Kicks>
- _GetField<"God">Store<God>
- _GetField<"Cargod">Store<CarGod>
- _GetField<"ACCPSav">Store<Accp_Saved>
- _GetField<"BlockPM">Store<BAPMs>
- _GetField<"Boost">Store<Boost>
- _GetField<"Spin">Store<Spin>
- _GetField<"WearTAG">Store<VIPTag>
- _GetField<"Incred">Store<Incred>
- DB::GetField(Result, "bSpeed", Field, sizeof(Field));
- P_DATA[playerid][bSpeed] = floatstr(Field);
- DB::GetField(Result, "IP", Field, sizeof(Field));
- PlayerIP[playerid] = Field;
- DB::GetField(Result, "Money", Field, sizeof(Field));
- GivePlayerMoney(playerid, strval(Field));
- DB::GetField(Result, "Score", Field, sizeof(Field));
- SetPlayerScore(playerid, GetPlayerScore(playerid) + strval(Field));
- DB::GetField(Result, "ACCP", Field, sizeof(Field));
- SetPVarString(playerid, "ACCP_DATA", Field);
- DB::GetField(Result, "Online", Field, sizeof(Field));
- SetPVarString(playerid, "Online", Field);
- DB::GetField(Result, "JoinDate", Field, sizeof(Field));
- SetPVarString(playerid, "AccountDate", Field);
- DB::Free(Result);
- }
- }
- }
- Public:UnMutePlayer(playerid)
- {
- --P_DATA[playerid][MutedTime];
- if(!P_DATA[playerid][MutedTime])
- {
- KillTimer(MuteTimer[playerid]);
- UnMutePlayer(playerid);
- P_DATA[playerid][MutedTime] = 0;
- P_DATA[playerid][Muted] = 0;
- SendClientMessage(playerid, -1, ""ORAN"SERVER:"W" You have been unmuted by the system!");
- #if SAVE_MUTE == true
- new
- Query[256];
- format(Query, 256, "DELETE FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(playerid));
- DB::Query(_DB, Query);
- #endif
- }
- else if(P_DATA[playerid][MutedTime] == 1){
- GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~r~~h~MUTE INFO~n~~r~~h~One~w~ minute left", 10000, 3);}
- else if(P_DATA[playerid][MutedTime] > 1)
- {
- new Str[129];
- 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]);
- GameTextForPlayer(playerid, Str, 10000, 3);
- }
- return 1;
- }
- GPVSEx(playerid, zPVSTR[] )
- {
- new zStr[129];
- GetPVarString(playerid, zPVSTR, zStr, 129);
- return zStr;
- }
- BanEx2(playerid, zAdmin[] = "System", zReason[] = "No Reason")
- {
- new
- zStr[256];
- #if SAVE_IN_LOGS == true
- new
- File:zFile;
- format(zStr, sizeof (zStr), "Player: %s[%i] has been banned by \"%s\" with reason \"%s\" on %s\r\n",
- Name(playerid),
- playerid,
- zAdmin,
- zReason,
- zDate());
- zFile = fopen(BAN_LOG, io_append);
- if(zFile)
- {
- fwrite(zFile, zStr);
- fclose(zFile);
- }
- #else
- #pragma unused zAdmin
- #endif
- new Query[129];
- format(Query, 129, "INSERT INTO `Banlist` VALUES('%s', '%s', '%s', '%s', '%s')", GetPlayerIPEx(playerid), Name(playerid), zReason, zAdmin, zDate());
- FormatMSG(playerid, Color:ORAN, "SERVER:"W" You have been banned from this server! "W"["GREY" %s"W"]", zReason);
- KickAfter(playerid);
- return 1;
- }
- Public:KickAfterTimer(playerid) return Kick(playerid);
- KickAfter(playerid, time = 1200 ){ SetTimerEx("KickAfterTimer", time, false, "i", playerid);}
- BadRcon(zIP[], zPassword[], zAdmin[] = "System", zReason[] = "RCON Login Attempt")
- {
- new
- zStr[256];
- #if SAVE_IN_LOGS == true
- new
- File:zFile;
- format(zStr, sizeof (zStr), "IP \"%s\" has been banned by \"%s\" with reason \"%s\" and password \"%s\" on %s\r\n",
- zIP,
- zAdmin,
- zReason,
- zPassword,
- zDate());
- zFile = fopen(RCON_LOG, io_append);
- if(zFile)
- {
- fwrite(zFile, zStr);
- fclose(zFile);
- }
- #else
- #pragma unused zPassword
- #endif
- format(zStr, sizeof (zStr), ""ORAN"Ban Info: "W"IP "ORAN"\"%s\""W" has been IP banned by "ORAN"\"%s\" "W"with reason"ORAN" \"%s\"",
- zIP,
- zAdmin,
- zReason);
- SendMessageToAdmins(.zMessage = zStr);
- format(zStr, sizeof (zStr), "banip %s", zIP);
- SendRconCommand(zStr);
- return 1;
- }
- KickEx(playerid, zAdmin[] = "System", zReason[] = "No Reason", tell = true)
- {
- new zStr[256];
- #if SAVE_IN_LOGS == true
- new
- File:zFile;
- format(zStr, sizeof (zStr), "Player: %s[%i] has been kicked by \"%s\" with reason \"%s\" on %s\r\n",
- Name(playerid),
- playerid,
- zAdmin,
- zReason,
- zDate());
- zFile = fopen(KICK_LOG, io_append);
- if(zFile)
- {
- fwrite(zFile, zStr);
- fclose(zFile);
- }
- #endif
- if(tell)
- {
- format(zStr, sizeof (zStr), ""ORAN"Kick Info: "W"Player "ORAN"%s[%i]"W" has been kicked by "ORAN"\"%s\" "W"with reason"ORAN" \"%s\"",
- Name(playerid),
- playerid,
- zAdmin,
- zReason);
- SendMessageToAdmins(.zMessage = zStr);
- }
- P_DATA[playerid][Kicks] += 1;
- new Query[120];
- if(AccountExist(Name(playerid)))
- {
- format(Query, 120, "UPDATE `Accounts` SET `Kicks` = '%d' WHERE `Name` = '%s'", P_DATA[playerid][Kicks], Name(playerid));
- DB::Query(_DB, Query);
- }
- KickAfter(playerid);
- return 1;
- }
- SendMessageToAdmins(zColor = -1, zMessage[], level = 1)
- {
- foreach(Player, A)
- {
- if(P_DATA[A][Level] >= level)
- {
- SendClientMessage(A, zColor, zMessage);
- }
- }
- return 1;
- }
- zDate(ms = false)
- {
- new zStr[30];
- if(ms)
- {
- new Date[6];
- getdate(Date[0], Date[1], Date[2]);
- gettime(Date[3], Date[4], Date[5]);
- format(zStr, sizeof (zStr), "%d/%d/%d %d:%d:%d", Date[2], Date[1], Date[0], Date[3], Date[4], Date[5]);
- }
- else
- {
- new Date[5];
- getdate(Date[0], Date[1], Date[2]);
- gettime(Date[3], Date[4]);
- format(zStr, sizeof (zStr), "%d/%d/%d %d:%d", Date[2], Date[1], Date[0], Date[3], Date[4]);
- }
- return zStr;
- }
- Name(playerid)
- {
- new zName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, zName, MAX_PLAYER_NAME);
- return zName;
- }
- TotalGameTime(playerid, &h=0, &m=0, &s=0)
- {
- P_DATA[playerid][TotalTime] = ((gettime() - P_DATA[playerid][ConnTime]) + (P_DATA[playerid][Hours]*60*60) + (P_DATA[playerid][Minutes]*60) + (P_DATA[playerid][Seconds]));
- h = floatround(P_DATA[playerid][TotalTime] / 3600, floatround_floor);
- m = floatround(P_DATA[playerid][TotalTime] / 60, floatround_floor) % 60;
- s = floatround(P_DATA[playerid][TotalTime] % 60, floatround_floor);
- return P_DATA[playerid][TotalTime];
- }
- Public:VehicleOccupied(v)
- {
- foreach(Player, i)
- {
- if(IsPlayerInVehicle(i, v)) return 1;
- }
- return 0;
- }
- SendError(playerid, error[])
- {
- new Str[256];
- format(Str, sizeof (Str), "* "GREY"%s", error);
- SendClientMessage(playerid, Color:ORAN, Str);
- return 1;
- }
- SendUsage(playerid, usage[], function[] = "don't send function" )
- {
- new Str[256];
- format(Str, sizeof (Str), "Usage: {FFFFFF} %s", usage);
- SendClientMessage(playerid, Color:GREE, Str);
- if(strcmp(function, "don't send function") && S_DATA[ShowFunction])
- {
- format(Str, sizeof (Str), "Function: {FFFFFF} %s", function);
- SendClientMessage(playerid, Color:FUNC, Str);
- }
- return 1;
- }
- MiniFormat(number, extra[] = ";")
- {
- new fStr[256];
- if(strcmp(extra, ";"))format(fStr, sizeof (fStr), "%d %s", number, extra);
- else format(fStr, sizeof (fStr), "%d", number);
- return fStr;
- }
- EX(ex)
- {
- new ex2[10];
- format(ex2, sizeof (ex2), "Yes | %d", ex);
- return ex2;
- }
- stock IsValidSkin(SkinID)
- {
- switch(SkinID)
- {
- case 0..41: return 1; case 43..64: return 1; case 66..73: return 1;
- case 75..85: return 1; case 87..118: return 1; case 120..148: return 1;
- case 150..207: return 1; case 209..264: return 1; case 274..288: return 1;
- case 290..299: return 1;
- default: return 0;
- }
- return 0;
- }
- IsValidWeapon(weaponid)
- {
- switch(weaponid)
- {
- case 1..18: return 1;
- case 22..46: return 1;
- }
- return 0;
- }
- GetVModelFromName(vName[])
- {
- for (new i = 400; i <= 611; i++)
- if(strfind(vNames[i - 400], vName, true) != -1)
- return i;
- return -1;
- }
- GetWeaponIDFromName(WeaponName[])
- {
- if(strfind("molotov", WeaponName, true) !=-1) return 18;
- for (new i = 0; i <= 46; i++)
- {
- switch(i)
- {
- case 0, 19, 20, 21, 44, 45: continue;
- default:
- {
- new name[32]; GetWeaponName(i, name, 32);
- if(strfind(name, WeaponName, true) != -1)
- return i;
- }
- }
- }
- return -1;
- }
- stock GetServerHostName()
- {
- new gString[128];
- GetServerVarAsString("hostname", gString, sizeof(gString));
- return gString;
- }
- stock IsNumeric(string[])
- {
- for (new i = 0, j = strlen(string);i < j; i++)
- {
- if(string[i] > '9' || string[i] < '0')
- return 0;
- }
- return 1;
- }
- stock
- FormatNumber(
- { _, Float, Text3D, Menu, Text, DB, DBResult, bool, File, hex, bit, bit_byte, Bit }:xVariable, iDecimals = -1, iThousandSeparator = ',', iDecimalPoint = '.', iTag = tagof(xVariable))
- {
- static
- s_szReturn[32],
- s_szThousandSeparator[2] = { ' ', EOS },
- s_iDecimalPos,
- s_iChar,
- s_iSepPos
- ;
- if(iTag == tagof(bool:))
- {
- if(xVariable)
- memcpy(s_szReturn, "true", 0, 5 * (cellbits / 8));
- else
- memcpy(s_szReturn, "false", 0, 6 * (cellbits / 8));
- return s_szReturn;
- }
- else if(iTag == tagof(Float:))
- {
- if(iDecimals == -1)
- iDecimals = 8;
- format(s_szReturn, sizeof(s_szReturn), "%.*f", iDecimals, xVariable);
- }
- else if(iTag == tagof(hex:) || iTag == tagof(Hex:))
- {
- format(s_szReturn, sizeof(s_szReturn), "0x" "%04h%04h", (xVariable & (0xFFFF0000)) >>> 16, xVariable & (0x0000FFFF));
- return s_szReturn;
- }
- else if(iTag == tagof(bit:) || iTag == tagof(Bit:))
- {
- format(s_szReturn, sizeof(s_szReturn), "0b" "%08b%08b%08b%08b", (xVariable & 0xFF000000) >>> 24, (xVariable & 0x00FF0000) >>> 16, (xVariable & 0x0000FF00) >>> 8, (xVariable & 0x000000FF));
- return s_szReturn;
- }
- else if(iTag == tagof(bit_byte:))
- {
- format(s_szReturn, sizeof(s_szReturn), "0b" "%08b", (xVariable & 0x000000FF));
- return s_szReturn;
- }
- else
- {
- format(s_szReturn, sizeof(s_szReturn), "%d", xVariable);
- if(iDecimals > 0)
- {
- strcat(s_szReturn, ".");
- while (iDecimals--)
- strcat(s_szReturn, "0");
- }
- }
- s_iDecimalPos = strfind(s_szReturn, ".");
- if(s_iDecimalPos == -1)
- s_iDecimalPos = strlen(s_szReturn);
- else
- s_szReturn[s_iDecimalPos] = iDecimalPoint;
- if(s_iDecimalPos >= 4 && iThousandSeparator)
- {
- s_szThousandSeparator[0] = iThousandSeparator;
- s_iChar = s_iDecimalPos;
- s_iSepPos = 0;
- while (--s_iChar > 0)
- {
- if(++s_iSepPos == 3)
- {
- strins(s_szReturn, s_szThousandSeparator, s_iChar);
- s_iSepPos = 0;
- }
- }
- }
- return s_szReturn;
- }
- stock AccountExist(name[])
- {
- new Buffer[240], Entry, DBResult:Result;
- format(Buffer, sizeof(Buffer), "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s'",name);
- Result = DB::Query(_DB, Buffer);
- if(Result)
- {
- if(DB::Valid(Result))
- {
- Entry = 1;
- DB::Free(Result);
- }
- else Entry = 0;
- }
- return Entry;
- }
- Public:Display()
- {
- 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");
- 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");
- print("\124\124\t \48\65\100\109\105\110 \118"#Version"\t\t\124\124");
- 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");
- print("\124\124\t\t\t\t\124\124");
- print("\124\124\t\77\97\100\101 \98\121 \90\104\51\114\48\t\t\124\124");
- print("\124\124\t\t\t\t\124\124");
- print("\124\124\t\76\111\97\100\101\100 \83\117\99\99\101\115\102\117\108\108\121\t\124\124");
- print("\124\124\t\t\t\t\124\124");
- printf("\124\124\t%s\t\t\124\124", zDate());
- print("\124\124\t\t\t\t\124\124");
- 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");
- print("\124\124\t\t\t\t\124\124");
- 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");
- print("\124\124 \75\101\101\112 \116\104\101 \99\114\101\100\105\116\115\33 \124\t\124\124");
- 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");
- print("\124\124\t\t\t\t\124\124");
- 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");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement