Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- #include <sscanf2>
- #include <YSI\y_ini>
- #include <ZCMD>
- #include <foreach>
- #include <streamer>
- native WP_Hash(buffer[], len, const str[]);
- // Features
- //==============================================================================
- // - Dialog based registration and login system.
- // - Whirlpool hashed passwords.
- // - Efficent script! Uses YCMD, sscanf 2.0, y_ini and foreach, efficent PVar usage - deletes the PVar instead of setting it to 0 to free memory :).
- // - Advanced IRC system - easy to setup and use!
- // - User friendly.
- // - Anti RCON login.
- // - Anti command spam.
- // - Anti text spam.
- // - Anti text repeat.
- // - Auto-ip login.
- // - Easy to translate the script into your language.
- // - Efficent connect time updating - no timers involved!
- // - Various ban methods: temporaly bans, range bans. You also have the ability to unban players ingame using /unban !
- // - Nice use of colour embedding to allow for a more structured filterscript.
- // - Ability to send messages to IRC from in-game and also PM users on IRC from in-game. Works for all players not only administrators.
- // - Ability to disable commands in-game for a certain player using /toggle(all)cmd.
- //==============================================================================
- // Commands
- //==============================================================================
- //##############################################################################
- // Player Commands
- //##############################################################################
- // - /stats /irc /ircpm /report
- //##############################################################################
- // Admin Commands
- //##############################################################################
- // - /setlevel /register /login /toggleengine /heal /kick /ban /setname /setgravity
- // - /setvhealth /setarmour /sethealth /setscore /setmoney /setweather /setskin
- // - /setworld /setinterior /slap /akill /jetpack /crash /disarm /dedisarm
- // - /mute /unmute /freeze /unfreeze /cage /uncage /amsg /asay /listweapons
- // - /clearchat /spectate /setvip /changepass /getinfo /warn /clearwarnings
- // - /giveweapon /giveallweapon /crashall /slapall /akillall /freezeall /unfreezeall
- // - /warnall /clearallwarnings /muteall /unmuteall /disarmall /dedisarmall
- // - /uncageall /cageall /kickall /banall /healall /toggleallengines /setallvhealth
- // - /setallarmour /setallhealth /setallmoney /setallscore /setallskin /setallworld
- // - /setallinterior /rangeban /tempban /up /down /north /south /east /west /vehicle
- // - /destroyvehicle /removecar /givemoney /givescore /giveallmoney /giveallscore
- // - /goto /gotop /gotopos /send /sendp /get /getp /acmds /reconnect /reconnectall
- // - /togglecmd /toggleallcmd /godmode
- //##############################################################################
- // IRC Commands
- //##############################################################################
- // - !say !asay !ssay !irccmds !getid !getname !pm !amsg !admins !vip !getinfo
- // - !iban !tempban !rangeban !banall !ikick !kickall !cage !cageall !uncage
- // - !freeze !freezeall !unfreeze !unfreezeall !warn !warnall !clearwarnings
- // - !mute !unmute !muteall !unmuteall !disarm !dedisarm !disarmall
- // - !giveallweapon !crash !crashall !botjoin !botleave !botregister
- // - !togglecmd !toggleallcmd !akill !slap !giveweapon !clearallwarnings
- // - !uncageall !botidentify !dedisarmall
- //==============================================================================
- // Configuration
- //==============================================================================
- /*
- - To disable a feature, simply comment out the feature such as shown below:
- //#define EXAMPLE_CONFIGURATION
- - To enable a feature, simply remove the comment infront of the feature such as shown below:
- #define EXAMPLE_CONFIGURATION
- */
- //==============================================================================
- #define GA_USE_ANTIRCON
- #define GA_USE_AUTOLOGIN
- #define GA_HIGH_PING_KICK
- #define GA_ANTI_CMDSPAM
- #define GA_ANTI_CHATSPAM
- //#define GA_SAVE_LOGS
- //#define GA_USE_IRC
- #if defined GA_USE_IRC
- #include <irc>
- #define IRC_SERVER "irc.gamerxserver.com" // The IRC server to connect to
- #define IRC_PORT 6667 // The port to connect to the IRC server.
- #define IRC_USE_SSL false
- #define IRC_CONNECT_DELAY 5 // Time to wait between connecting each bot (in seconds).
- #define IRC_CONNECT_ATTEMPTS 5 // How many attempts it will try to connect to the IRC server.
- #define IRC_REGISTER_DELAY 30000 // Time to wait before registering each bot (in ms).
- #define IRC_CHANNEL "#AdminScript" // Normal channel
- #define IRC_ECHO_CHANNEL "#AdminScript.echo" // Echo channel
- #define IRC_ADMIN_ECHO_CHANNEL "#AdminScript.aecho" // Admin echo channel
- #define IRC_MAX_BOTS 2 // Bots it will try to connect
- #define IRC_BOT_NICKNAME "AdminScript" // The bots nickname. If the bots nickname is f.ex: MAdmin, the nick will be MAdmin[botid] (MAdmin[1], MAdmin[2], etc) on connect.
- #define IRC_BOT_PASSWORD "changeme" // The bots password which it will identify it when it connects :)
- #define IRC_BOT_EMAIL "AdminScript@google.com"
- new gGroupID, gBotID[IRC_MAX_BOTS char];
- #endif
- #define GA_MUST_LOGIN_TO_SPAWN
- #define GA_MUST_REGISTER
- #define GA_MUST_LOGIN
- #define GA_ANTI_CMDSPAM_KICK_ADMINS
- #define GA_ANTI_TEXTREPEAT_KICK_ADMINS
- #define GA_ANTI_TEXTSPAM_KICK_ADMINS
- #define GA_SAVE_DEATHS
- #define GA_SAVE_KILLS
- #define GA_SAVE_SKIN
- #define GA_SAVE_SCORE
- #define GA_SAVE_MONEY
- #define GA_SAVE_WANTEDLEVEL
- #define GA_SAVE_DRUNKLEVEL
- #define GA_SAVE_FIGHTSTYLE
- #define GA_SAVE_WEAPONS
- #define GA_SAVE_ADMINWEAPONS
- //==============================================================================
- /*
- - All GA_TIME_BETWEEN_[...] values are in seconds.
- */
- #define GA_TIMER_RATE 999
- #define GA_MINUTES_BETWEEN_AUTOSAVE 10
- #define GA_MAX_RCONLOGIN_ATTEMPTS 3
- #define GA_MAX_LOGIN_ATTEMPTS 3
- #define GA_MAX_CMD_SPAM 7
- #define GA_MAX_TEXT_SPAM 7
- #define GA_MAX_TEXT_REPEAT 5
- #define GA_TIME_BETWEEN_CMDS 4
- #define GA_TIME_BETWEEN_TEXT 4
- #define GA_TIME_FOR_MUST_LOGIN 120
- #define GA_TIME_FOR_MUST_REGISTER 180
- #define GA_KICK_DELAY 500
- #define SERVER 0
- #define ADMIN 1
- #define NPC_LEVEL_LIMIT 10
- #define MAX_VIP_LVL 5
- #define MAX_ADMIN_LVL 10
- #define ALL_CMDS_LVL 10
- #define GA_MIN_PASSWORD 4
- #define GA_MAX_PASSWORD 30
- #define GA_MAX_PING 1000
- #define MAX_WARNINGS 3
- #define WARN_ACTION 0 // 0 = kick | 1 = ban
- #define BANEVADE_ACTION 1 // 0 = kick | 1 = ban
- #define GA_INFOMENU 1500
- #define GA_REGISTERMENU 1501
- #define GA_LOGINMENU 1502
- //==============================================================================
- #define SERVER_NAME "My Server Name"
- #define ACCOUNTPATH "/MAdmin/Accounts/%s.ini"
- #define ACCOUNTPATH_LENGTH (50)
- #define TEMPBAN "/MAdmin/Tempbans.txt"
- #define BANFILE "/MAdmin/Bans.txt"
- #define GA_DC_HEADER "{A9C4E4}MAdmin {00CC33}v1.0 {A9C4E4}by {00CC33}[03]Kakioshe"
- #define INVALID_CMD_MSG "Invalid command. Type /commands for a list of commands."
- #define ANTI_CMD_SPAM_MSG "Please wait before using another command."
- #define SERVER_KICK "<-[SERVER KICK]-> %s (%d) - Reason: %s."
- #define ADMIN_KICK "<-[ADMIN KICK]-> %s (%d) - Reason: %s."
- #define ADMIN_WARN "<-[ADMIN WARN]-> %s (%d) - Reason: %s."
- #define ADMIN_MUTE "<-[ADMIN MUTE]-> %s (%d) - Reason: %s."
- #define ADMIN_UNMUTE "<-[ADMIN UNMUTE]-> %s (%d) has been unmuted."
- #define ADMIN_CAGE "<-[ADMIN CAGE]-> %s (%d) - Reason: %s."
- #define ADMIN_UNCAGE "<-[ADMIN UNCAGE]-> %s (%d) has been uncaged."
- #define ADMIN_FREEZE "<-[ADMIN FREEZE]-> %s (%d) - Reason: %s."
- #define ADMIN_UNFREEZE "<-[ADMIN UNFREEZE]-> %s (%d) has been unfrozen."
- #define KICK_PLAYER_MSG "You've been kicked from the server. Reason: %s"
- #define KICK_GAMETEXT "~n~ ~w~You've been ~r~kicked ~w~from the ~y~server~w~!"
- #define SERVER_BAN "<-[SERVER BAN]-> %s (%d) - Reason: %s."
- #define ADMIN_BAN "<-[ADMIN BAN]-> %s (%d) - Reason: %s."
- #define I_KICK_MSG "You've kicked %s (%d). Reason: %s."
- #define I_BAN_MSG "You've banned %s (%d). Reason: %s."
- #define I_BAN_INFORMATION "You've been "DC_ERROR"banned "DC_DIALOG"from the server.\n\n\n"DC_INFO"Your IP:"DC_DIALOG" %s\n"DC_INFO"Your username:"DC_DIALOG" %s\n"DC_INFO"Ban type:"DC_DIALOG" %s\n"DC_INFO"Ban reason:"DC_DIALOG" %s"
- #define I_KICK_INFORMATION "You've been "DC_ERROR"kicked "DC_DIALOG"from the server.\n\n\n"DC_INFO"Your IP:"DC_DIALOG" %s\n"DC_INFO"Your username:"DC_DIALOG" %s\n"DC_INFO"Kick type:"DC_DIALOG" %s\n"DC_INFO"Kick reason:"DC_DIALOG" %s"
- #define BAN_PLAYER_MSG "You've been banned from the server. Reason: %s"
- #define BAN_GAMETEXT "~n~ ~w~You've been ~r~banned ~w~from the ~y~server~w~!"
- #define E_INVALID_PASSWORD_LENGTH "Invalid password length. Your password must be between "#GA_MIN_PASSWORD" and "#GA_MAX_PASSWORD" characters."
- #define E_INVALID_PASSWORD "Invalid password. Attempt %d/"#GA_MAX_LOGIN_ATTEMPTS"."
- #define E_NEED_TO_LOGIN "This player needs to be registered and logged in for you to use this command on them."
- #define E_NOT_CONNECTED "Invalid player."
- #define E_NOT_SPAWNED1 "You need to spawn to be able to use this command."
- #define E_NOT_SPAWNED2 "You can only use this command on spawned players."
- #define E_NPC "You need to be level "#NPC_LEVEL_LIMIT" or above to use this command on this NPC."
- #define ADMIN_CMD_MSG "*** ADMIN CMD: %s (%d) Has Used The Command /%s."
- #define E_HIGHER_LEVEL "You can not use this command on this player as they're a higher level than you and/or an RCON admin."
- #define E_CANT_USE_ON_YOURSELF "You can not use this command on yourself."
- #define I_REGISTRATION_CANCEL ""DC_ERROR"Warning!"DC_DIALOG" You've decided "DC_ERROR"not"DC_DIALOG" to register. Your stats will "DC_ERROR"not"DC_DIALOG" be saved unless you register.\n\nYou can bring up this menu again by typing "DC_INFO"/register"DC_DIALOG"."
- #define I_ACCOUNT_REGISTERED "Account "DC_INFO"%s "DC_DIALOG"successfully registered with the password "DC_INFO"%s"DC_DIALOG".\nRemember it for later use.\n\n"DC_INFO"You've been automaticly logged in."
- #define I_LOGIN_CANCEL ""DC_ERROR"Warning!"DC_DIALOG" You've decided "DC_ERROR"not"DC_DIALOG" to login. Your stats will "DC_ERROR"not"DC_DIALOG" be saved unless you login.\n\nYou can bring up this menu again by typing "DC_INFO"/login"DC_DIALOG"."
- #define I_LOGIN_SUCCESS "Successfully logged in.\n\n"DC_INFO"Admin level:"DC_DIALOG" %d.\n"DC_INFO"VIP level:"DC_DIALOG" %d."
- #define I_AUTO_LOGIN_SUCCESS "You've been automaticly logged in.\n\n"DC_INFO"Admin level:"DC_DIALOG" %d.\n"DC_INFO"VIP level:"DC_DIALOG" %d."
- #define E_MUTED "You're muted. You can not talk."
- #define E_STOP_SPAM "Stop spamming! If you continue spamming you will be kicked."
- #define E_STOP_REPEAT "Stop repeating yourself!"
- //==============================================================================
- // Variables
- //==============================================================================
- new CMDSString[1500], IsDisarmed[MAX_PLAYERS char], pwhash[MAX_PLAYERS][130], GodMode[MAX_PLAYERS char], PlayerIP[MAX_PLAYERS][16];
- new GA_Timer, GA_Seconds, GA_Minutes;
- new FreezeTime[MAX_PLAYERS][2], CageTime[MAX_PLAYERS][2], MuteTime[MAX_PLAYERS][2], DisarmTime[MAX_PLAYERS][2], TDTime[MAX_PLAYERS][2];
- new Text:AnnouncementTextdraw[MAX_PLAYERS], MessageSent[MAX_PLAYERS][2 char];
- //==============================================================================
- // Macros
- //==============================================================================
- #undef MAX_PLAYER_NAME
- #define MAX_PLAYER_NAME 24
- #define UpdatePVarInt(%0,%1,%2) SetPVarInt(%0, %1, (GetPVarInt(%0, %1) + %2))
- #define SetPlayerMoney(%0,%1) ResetPlayerMoney(%0), GivePlayerMoney(%0, %1)
- #define YesNo(%0) ((%0) == (1)) ? ("Yes") : ("No")
- #define Answer(%0,%1,%2) (%0) == (1) ? (%1) : (%2)
- #define AddS(%0) (%0 != 1 && %0 != -1) ? ("s") : ("")
- #define SendMSG(%0,%1,%2,%3) do{new _str[128]; format(_str, 128, %2, %3); SendClientMessage(%0, %1, _str);}while(FALSE)
- #define SendMSGToAll(%0,%1,%2) do{new _str[128]; format(_str, 128, %1, %2); SendClientMessageToAll(%0, _str);}while(FALSE)
- #define ShowPlayerDialogEx(%0,%1,%2,%3,%4,%5,%6,%7) do{CMDSString = ""; format(CMDSString, sizeof(CMDSString), %6, %7); ShowPlayerDialog(%0, %1, %2, %3, CMDSString, %4, %5);}while(FALSE)
- #define DeCapitalize(%1) for(new ToLowerChar; ToLowerChar < strlen(%1); ToLowerChar++) if(%1[ToLowerChar] > 64 && %1[ToLowerChar] < 91 ) %1[ToLowerChar] += 32
- #if defined GA_USE_IRC
- #define IRC_GroupSayEx(%0,%1,%2,%3) do{CMDSString = ""; format(CMDSString, sizeof(CMDSString), %2, %3); IRC_GroupSay(%0, %1, CMDSString);}while(FALSE)
- #define IRC_GroupNoticeEx(%0,%1,%2,%3) do{CMDSString = ""; format(CMDSString, sizeof(CMDSString), %2, %3); IRC_GroupNotice(%0, %1, CMDSString);}while(FALSE)
- #endif
- #define GivePlayerScore(%0,%1) SetPlayerScore(%0, (GetPlayerScore(%0) + %1))
- #define function%0(%1) forward %0(%1); public %0(%1)
- //==============================================================================
- // Colours
- //==============================================================================
- #define COLOUR_ERROR 0xFF0000AA
- #define COLOUR_ADMIN 0xCC00CCAA
- #define COLOUR_INFO 0x00CC33AA
- #define COLOUR_DIALOG 0xA9C4E4AA
- #define COLOUR_IRC 0x0066CCFF
- #define COLOUR_SAMP 0xA9C4E4FF
- #define COLOUR_PM 0xFFFF2AFF
- //==============================================================================
- #define DC_SAMP "{A9C4E4}"
- #define DC_DIALOG "{A9C4E4}"
- #define DC_ERROR "{FF0000}"
- #define DC_ADMIN "{CC00CC}"
- #define DC_INFO "{00CC33}"
- #define DC_TD_BLUE "{2B346E}"
- #define DC_TD_PURPLE "{925FDA}"
- #define DC_TD_GREEN "{2F5A26}"
- #define DC_TD_BLACK "{000000}"
- #define DC_TD_RED "{9C1619}"
- #define DC_TD_YELLOW "{C4A656}"
- #define DC_TD_WHITE "{C3C3C3}"
- #define DC_TD_ARROW "{6B696B}"
- //==============================================================================
- public OnFilterScriptInit()
- {
- new filename[ACCOUNTPATH_LENGTH];
- if(!fexist(TEMPBAN))
- {
- fcreate(TEMPBAN);
- printf("The file "TEMPBAN" didn't exist. Creating the file...");
- }
- if(!fexist(BANFILE))
- {
- fcreate(BANFILE);
- printf("The file "BANFILE" didn't exist. Creating the file...");
- }
- foreach(Character, i)
- {
- GetPlayerIp(i, PlayerIP[i], 16);
- if(IsPlayerNPC(i) && GetPVarType(i, "Level") >= 1)
- {
- SetPVarInt(i, "Level", MAX_ADMIN_LVL);
- if(GetPlayerState(i) == PLAYER_STATE_ONFOOT || IsPlayerInAnyVehicle(i))
- {
- SetPVarInt(i, "Spawned", 1);
- }
- continue;
- }
- if(BanCheck(i)) continue;
- format(filename, sizeof(filename), ACCOUNTPATH, UserFileName(pNick(i)));
- switch(fexist(filename))
- {
- case 0: ShowPlayerDialogEx(i, GA_REGISTERMENU, DIALOG_STYLE_INPUT, GA_DC_HEADER, "Register", "Cancel", "Welcome to "DC_INFO"%s"DC_DIALOG", %s!\n\nThis account is "DC_ERROR"not "DC_DIALOG"registered.\nPlease register an account to avoid stat loss.\nEnter the password for your new account below:", SERVER_NAME, pNick(i));
- case 1:
- {
- #if defined GA_USE_AUTOLOGIN
- INI_ParseFile(filename, "InitLogin", false, true, i, true, false);
- switch(strcmp(GetPVarStringEx(i, "GA_TMP_LASTIP"), GetPlayerIpEx(i), true))
- {
- case 0:
- {
- SetPVarInt(i, "LoggedIn", 1);
- format(filename, sizeof(filename), ACCOUNTPATH, UserFileName(pNick(i)));
- INI_ParseFile(filename, "LoginPlayer", false, true, i, true, false);
- GameTextForPlayer(i, " ~n~ ~n~~p~Auto-Login Successfull!", 6000, 6);
- ShowPlayerDialogEx(i, GA_INFOMENU, DIALOG_STYLE_MSGBOX, GA_DC_HEADER, "Close", "", I_AUTO_LOGIN_SUCCESS, GetPVarInt(i, "Level"), GetPVarInt(i, "VIP"));
- }
- case 1: ShowPlayerDialogEx(i, GA_LOGINMENU, DIALOG_STYLE_INPUT, GA_DC_HEADER, "Login", "Cancel", "Welcome back to "DC_INFO"%s"DC_DIALOG", %s!\n\nThis account is registered.\nEnter the password for this account to login:", SERVER_NAME, pNick(i));
- }
- #else
- ShowPlayerDialogEx(i, GA_LOGINMENU, DIALOG_STYLE_INPUT, GA_DC_HEADER, "Login", "Cancel", "Welcome back to "DC_INFO"%s"DC_DIALOG", %s!\n\nThis account is registered.\nEnter the password for this account to login:", SERVER_NAME, pNick(i));
- #endif
- }
- }
- CreateTextDraw(i);
- if(GetPlayerState(i) == PLAYER_STATE_ONFOOT || IsPlayerInAnyVehicle(i))
- {
- SetPVarInt(i, "Spawned", 1);
- }
- SetPVarInt(i, "ConnectTime", GetTickCount());
- FreezeTime[i][0] = CageTime[i][0] = MuteTime[i][0] = DisarmTime[i][0] = MessageSent[i]{0} = IsDisarmed{i} = GodMode{i} = TDTime[i][0] = 0;
- FreezeTime[i][1] = CageTime[i][1] = MuteTime[i][1] = DisarmTime[i][1] = MessageSent[i]{1} = TDTime[i][1] = 0;
- }
- #if defined GA_USE_IRC
- new string[50];
- print("Attempting to connect "#IRC_MAX_BOTS" bots...");
- for(new bot = 1; bot <= IRC_MAX_BOTS; bot++)
- {
- format(string, sizeof(string), "%s[%d]", IRC_BOT_NICKNAME, bot);
- gBotID{(bot-1)} = IRC_Connect(IRC_SERVER, IRC_PORT, string, string, string, IRC_USE_SSL);
- IRC_SetIntData(gBotID{(bot-1)}, E_IRC_CONNECT_DELAY, (IRC_CONNECT_DELAY * bot));
- IRC_SetIntData(gBotID{(bot-1)}, E_IRC_CONNECT_ATTEMPTS, IRC_CONNECT_ATTEMPTS);
- }
- gGroupID = IRC_CreateGroup();
- print("Connect initalized...");
- #endif
- GA_Timer = SetTimer("GA_Update", GA_TIMER_RATE, 1);
- print("Starting MAdmin timer (timer rate "#GA_TIMER_RATE")...");
- print("\n\n>> MAdmin v1.0 by [03]Kakioshe has been successfully loaded!\n\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- KillTimer(GA_Timer);
- #if defined GA_USE_IRC
- print("Disconnecting IRC bots...");
- for(new bot = 0; bot < IRC_MAX_BOTS; bot++)
- {
- IRC_Quit(gBotID{bot}, "Thank you for using MAdmin v1.0 by [03]Kakioshe");
- }
- IRC_DestroyGroup(gGroupID);
- print("Bots disconnected...");
- #endif
- print("Saving player stats and deleting PVars...");
- foreach(Player, i)
- {
- SavePlayerStats(i);
- pwhash[i] = "";
- MAdmin_DeletePVars(i);
- }
- print("All players stats have been saved and PVars deleted...");
- print("\n\n>> MAdmin v1.0 by [03]Kakioshe has been successfully unloaded!\n\n");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- GetPlayerIp(playerid, PlayerIP[playerid], 16);
- SetPVarInt(playerid, "ConnectTime", GetTickCount());
- if(IsPlayerNPC(playerid))
- {
- SetPVarInt(playerid, "Level", MAX_ADMIN_LVL);
- SetPVarInt(playerid, "Spawned", 1);
- return 1;
- }
- if(BanCheck(playerid)) return 1;
- if(GetPVarInt(playerid, "Relogin") == 1)
- {
- DeletePVar(playerid, "Relogin");
- SendClientMessage(playerid, COLOUR_SAMP, "Reconnect successfull! Connected to "DC_INFO""SERVER_NAME""DC_SAMP"!");
- GameTextForPlayer(playerid, "~n~~g~Connected to ~n~~p~"SERVER_NAME"!", 6000, 3);
- }
- new filename[ACCOUNTPATH_LENGTH];
- format(filename, sizeof(filename), ACCOUNTPATH, UserFileName(pNick(playerid)));
- switch(fexist(filename))
- {
- case 0: ShowPlayerDialogEx(playerid, GA_REGISTERMENU, DIALOG_STYLE_INPUT, GA_DC_HEADER, "Register", "Cancel", "Welcome to "DC_INFO"%s"DC_DIALOG", %s!\n\nThis account is "DC_ERROR"not "DC_DIALOG"registered.\nPlease register an account to avoid stat loss.\nEnter the password for your new account below:", SERVER_NAME, pNick(playerid));
- case 1:
- {
- #if defined GA_USE_AUTOLOGIN
- INI_ParseFile(filename, "InitLogin", false, true, playerid, true, false);
- switch(strcmp(GetPVarStringEx(playerid, "GA_TMP_LASTIP"), GetPlayerIpEx(playerid), true))
- {
- case 0:
- {
- SetPVarInt(playerid, "LoggedIn", 1);
- format(filename, sizeof(filename), ACCOUNTPATH, UserFileName(pNick(playerid)));
- INI_ParseFile(filename, "LoginPlayer", false, true, playerid, true, false);
- GameTextForPlayer(playerid, " ~n~ ~n~~p~Auto-Login Successfull!", 6000, 6);
- ShowPlayerDialogEx(playerid, GA_INFOMENU, DIALOG_STYLE_MSGBOX, GA_DC_HEADER, "Close", "", I_AUTO_LOGIN_SUCCESS, GetPVarInt(playerid, "Level"), GetPVarInt(playerid, "VIP"));
- }
- case 1: ShowPlayerDialogEx(playerid, GA_LOGINMENU, DIALOG_STYLE_INPUT, GA_DC_HEADER, "Login", "Cancel", "Welcome back to "DC_INFO"%s"DC_DIALOG", %s!\n\nThis account is registered.\nEnter the password for this account to login:", SERVER_NAME, pNick(playerid));
- }
- #else
- ShowPlayerDialogEx(playerid, GA_LOGINMENU, DIALOG_STYLE_INPUT, GA_DC_HEADER, "Login", "Cancel", "Welcome back to "DC_INFO"%s"DC_DIALOG", %s!\n\nThis account is registered.\nEnter the password for this account to login:", SERVER_NAME, pNick(playerid));
- #endif
- }
- }
- CreateTextDraw(playerid);
- FreezeTime[playerid][0] = CageTime[playerid][0] = MuteTime[playerid][0] = MessageSent[playerid]{0} = DisarmTime[playerid][0] = IsDisarmed{playerid} = GodMode{playerid} = TDTime[playerid][0] = 0;
- FreezeTime[playerid][1] = CageTime[playerid][1] = MuteTime[playerid][1] = MessageSent[playerid]{1} = DisarmTime[playerid][1] = TDTime[playerid][1] = 0;
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "7[connect] 3%s (%d) has joined the server.", pNick(playerid), playerid);
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[connect] 3%s (%d) has joined the server (IP: %s).", pNick(playerid), playerid, GetPlayerIpEx(playerid));
- #endif
- TextDrawHideForPlayer(playerid, AnnouncementTextdraw[playerid]);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- SavePlayerStats(playerid);
- IsDisarmed{playerid} = 0, GodMode{playerid} = 0;
- if(GetPVarInt(playerid, "Relogin") == 1)
- {
- new string[25];
- format(string, sizeof(string), "unbanip %s", GetPlayerIpEx(playerid));
- SendRconCommand(string);
- SendClientMessage(playerid, COLOUR_SAMP, "Connecting to "DC_INFO""SERVER_NAME""DC_SAMP"...");
- GameTextForPlayer(playerid, "~n~~g~Connecting to ~n~~p~"SERVER_NAME"...", 6000, 3);
- }
- #if defined GA_USE_IRC
- switch(reason)
- {
- case 0:
- {
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "7[disconnect] 3%s (%d) has left the server (Timeout).", pNick(playerid), playerid);
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[disconnect] 3%s (%d) has left the server (Timeout) - (IP: %s).", pNick(playerid), playerid, GetPlayerIpEx(playerid));
- }
- case 1:
- {
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "7[disconnect] 3%s (%d) has left the server (Quit).", pNick(playerid), playerid);
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[disconnect] 3%s (%d) has left the server (Quit) - (IP: %s).", pNick(playerid), playerid, GetPlayerIpEx(playerid));
- }
- case 2:
- {
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "7[disconnect] 3%s (%d) has left the server (Kicked/Banned).", pNick(playerid), playerid);
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[disconnect] 3%s (%d) has left the server (Kicked/Banned) - (IP: %s).", pNick(playerid), playerid, GetPlayerIpEx(playerid));
- }
- }
- #endif
- TextDrawHideForPlayer(playerid, AnnouncementTextdraw[playerid]);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetPVarInt(playerid, "Spawned", 1);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[spawn] 3%s (%d) has spawned.", pNick(playerid), playerid);
- #endif
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- DeletePVar(playerid, "Spawned");
- UncagePlayer(playerid);
- #if defined GA_USE_IRC
- switch(IsPlayerConnected(killerid))
- {
- case 0: IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "7[death] 3%s (%d) died (%s).", pNick(playerid), playerid, GetDeathReason(killerid, reason));
- case 1: IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "7[death] 3%s (%d) was killed by %s (%d) (%s).", pNick(playerid), playerid, pNick(killerid), killerid, GetDeathReason(killerid, reason));
- }
- #endif
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(GetPVarInt(playerid, "Muted") == 1)
- {
- SendClientMessage(playerid, COLOUR_ERROR, E_MUTED);
- return 0;
- }
- if(GetPVarInt(playerid, "CapsDisabled") == 1)
- {
- DeCapitalize(text);
- SendPlayerMessageToAll(playerid, text);
- }
- SetPVarInt(playerid, "TextSpam", (GetPVarInt(playerid, "TextSpam") + 1));
- if(GetSecondsBetweenAction(GetPVarInt(playerid, "LastChat")) >= GA_TIME_BETWEEN_TEXT)
- {
- DeletePVar(playerid, "TextSpam");
- }
- if(GetPVarInt(playerid, "TextSpam") >= GA_MAX_TEXT_SPAM)
- {
- switch(IsAdmin(playerid))
- {
- case 0:
- {
- KickEx(playerid, SERVER, "Chat Spam");
- return 0;
- }
- case 1:
- {
- #if defined GA_ANTI_TEXTSPAM_KICK_ADMINS
- KickEx(playerid, SERVER, "Chat Spam");
- return 0;
- #endif
- }
- }
- }
- if(GA_MAX_TEXT_SPAM >= 4 && (GetPVarInt(playerid, "TextSpam") == (GA_MAX_TEXT_SPAM-2) || GetPVarInt(playerid, "TextSpam") == (GA_MAX_TEXT_SPAM-1)))
- {
- switch(IsAdmin(playerid))
- {
- case 0: return SendClientMessage(playerid, COLOUR_ERROR, E_STOP_SPAM);
- case 1:
- {
- #if defined GA_ANTI_TEXTREPEAT_KICK_ADMINS
- return SendClientMessage(playerid, COLOUR_ERROR, E_STOP_SPAM);
- #endif
- }
- }
- }
- switch(strcmp(text, GetPVarStringEx(playerid, "LastMessage"), false))
- {
- case 0:
- {
- UpdatePVarInt(playerid, "RepeatingTextCount", 1);
- if(GA_MAX_TEXT_REPEAT >= 4 && (GetPVarInt(playerid, "RepeatingTextCount") == (GA_MAX_TEXT_REPEAT-2) || GetPVarInt(playerid, "RepeatingTextCount") == (GA_MAX_TEXT_REPEAT-1)))
- {
- switch(IsAdmin(playerid))
- {
- case 0: return SendClientMessage(playerid, COLOUR_ERROR, E_STOP_REPEAT);
- case 1:
- {
- #if defined GA_ANTI_TEXTREPEAT_KICK_ADMINS
- return SendClientMessage(playerid, COLOUR_ERROR, E_STOP_REPEAT);
- #endif
- }
- }
- }
- if(GetPVarInt(playerid, "RepeatingTextCount") >= GA_MAX_TEXT_REPEAT)
- {
- switch(IsAdmin(playerid))
- {
- case 0:
- {
- KickEx(playerid, SERVER, "Repeating Same Text More Than "#GA_MAX_TEXT_REPEAT" Times");
- return 0;
- }
- case 1:
- {
- #if defined GA_ANTI_TEXTREPEAT_KICK_ADMINS
- KickEx(playerid, SERVER, "Repeating Same Text More Than "#GA_MAX_TEXT_REPEAT" Times");
- return 0;
- #endif
- }
- }
- }
- }
- case 1: DeletePVar(playerid, "RepeatingTextCount");
- }
- SetPVarInt(playerid, "LastChat", GetTickCount());
- SetPVarString(playerid, "LastMessage", text);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "7[chat] 3%s (%d): %s", pNick(playerid), playerid, text);
- #endif
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- foreach(Player, i)
- {
- if(GetPVarInt(i, "SpectatingPlayer") == playerid && GetPVarInt(i, "Spectating") == 1)
- {
- if(newstate == PLAYER_STATE_ONFOOT)
- {
- SetPlayerInterior(i, GetPlayerInterior(playerid));
- SetPlayerVirtualWorld(i, GetPlayerVirtualWorld(playerid));
- TogglePlayerSpectating(i, 1);
- PlayerSpectatePlayer(i, playerid);
- }
- if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
- {
- SetPlayerInterior(i, GetPlayerInterior(playerid));
- SetPlayerVirtualWorld(i, GetPlayerVirtualWorld(playerid));
- TogglePlayerSpectating(i, 1);
- PlayerSpectateVehicle(i, GetPlayerVehicleID(playerid));
- }
- break;
- }
- }
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- #if defined GA_MUST_LOGIN_TO_SPAWN
- if(GetPVarType(playerid, "LoggedIn") == PLAYER_VARTYPE_NONE)
- {
- ShowPlayerDialogEx(playerid, GA_LOGINMENU, DIALOG_STYLE_INPUT, GA_DC_HEADER, "Login", "Cancel", "You "DC_ERROR"must "DC_DIALOG"login to spawn, "DC_INFO"%s!\n\n"DC_DIALOG"Enter the password for your account below:", pNick(playerid));
- return 0;
- }
- #endif
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- foreach(Player, i)
- {
- if(GetPVarInt(i, "SpectatingPlayer") == playerid && GetPVarInt(i, "Spectating") == 1)
- {
- SetPlayerInterior(i, newinteriorid);
- break;
- }
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- #if defined GA_USE_ANTIRCON
- if(!success)
- {
- foreach(Player, i)
- {
- if(IsPlayerAdmin(i)) continue;
- if(!strcmp(GetPlayerIpEx(i), ip, true))
- {
- UpdatePVarInt(i, "RconLogins", 1);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[rcon login] 3%s (%d) attempted to login to RCON (Attempt: %d/"#GA_MAX_RCONLOGIN_ATTEMPTS").", pNick(i), i, GetPVarInt(i, "RconLogins"));
- #endif
- if(GetPVarInt(i, "RconLogins") >= GA_MAX_RCONLOGIN_ATTEMPTS)
- {
- BanEx2(i, SERVER, "Failed to login to RCON "#GA_MAX_RCONLOGIN_ATTEMPTS" times");
- }
- break;
- }
- }
- }
- #endif
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- if(IsDisarmed{playerid} == 1)
- {
- SetPlayerArmedWeapon(playerid, 0);
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new INI:file, filename[ACCOUNTPATH_LENGTH], buf[129];
- //strreplace2(inputtext, "%", " ");
- format(filename, sizeof(filename), ACCOUNTPATH, UserFileName(pNick(playerid)));
- if(dialogid == GA_REGISTERMENU)
- {
- switch(response)
- {
- case 0:
- {
- #if defined GA_MUST_REGISTER
- ShowPlayerDialogEx(playerid, GA_REGISTERMENU, DIALOG_STYLE_INPUT, GA_DC_HEADER, "Register", "Cancel", "You must register an account to play on %s!\n\nEnter the password for your new account below:", SERVER_NAME);
- #else
- ShowPlayerDialogEx(playerid, GA_INFOMENU, DIALOG_STYLE_MSGBOX, GA_DC_HEADER, "Close", "", I_REGISTRATION_CANCEL, "");
- #endif
- }
- case 1:
- {
- new year, month, day, hour, minute, second, RegDate[20];
- if(strlen(inputtext) < GA_MIN_PASSWORD || strlen(inputtext) > GA_MAX_PASSWORD) return SendClientMessage(playerid, COLOUR_ERROR, E_INVALID_PASSWORD_LENGTH);
- fcreate(filename);
- getdate(year, month, day);
- gettime(hour, minute, second);
- format(RegDate, sizeof(RegDate), "%02d/%02d/%02d %02d:%02d:%02d", day, month, year, hour, minute, second);
- WP_Hash(buf, sizeof(buf), inputtext);
- file = INI_Open(filename);
- INI_WriteString(file, "PasswordHash", buf);
- INI_WriteString(file, "RegisteredIP", GetPlayerIpEx(playerid));
- INI_WriteString(file, "LastIP", GetPlayerIpEx(playerid));
- INI_WriteString(file, "RegisterDate", RegDate);
- INI_WriteString(file, "LastVisit", RegDate);
- INI_Close(file);
- ShowPlayerDialogEx(playerid, GA_INFOMENU, DIALOG_STYLE_MSGBOX, GA_DC_HEADER, "Close", "", I_ACCOUNT_REGISTERED, pNick(playerid), inputtext);
- GameTextForPlayer(playerid, " ~n~ ~n~~p~Account registered!", 6000, 6);
- PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
- SetPVarInt(playerid, "LoggedIn", 1);
- SavePlayerStats(playerid);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[registration] 3%s (%d) registered from IP %s.", pNick(playerid), playerid, GetPlayerIpEx(playerid));
- #endif
- }
- }
- return 1;
- }
- if(dialogid == GA_LOGINMENU)
- {
- switch(response)
- {
- case 0:
- {
- #if defined GA_MUST_LOGIN
- ShowPlayerDialogEx(playerid, GA_LOGINMENU, DIALOG_STYLE_INPUT, GA_DC_HEADER, "Login", "Cancel", "You "DC_ERROR"must "DC_DIALOG"login to play on "DC_INFO"%s!\n\n"DC_DIALOG"Enter the password for this account to login:", SERVER_NAME);
- #else
- ShowPlayerDialogEx(playerid, GA_INFOMENU, DIALOG_STYLE_MSGBOX, GA_DC_HEADER, "Close", "", I_LOGIN_CANCEL, "");
- #endif
- }
- case 1:
- {
- if(strlen(inputtext) < GA_MIN_PASSWORD || strlen(inputtext) > GA_MAX_PASSWORD) return SendClientMessage(playerid, COLOUR_ERROR, E_INVALID_PASSWORD_LENGTH);
- WP_Hash(buf, sizeof(buf), inputtext);
- if(strcmp(pwhash[playerid], buf, true))
- {
- UpdatePVarInt(playerid, "PasswordAttempts", 1);
- new attempts = GetPVarInt(playerid, "PasswordAttempts");
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[failed login] 3%s (%d) failed to login from IP %s (Attempt: %d/"#GA_MAX_LOGIN_ATTEMPTS").", pNick(playerid), playerid, GetPlayerIpEx(playerid), attempts);
- #endif
- SendMSG(playerid, COLOUR_ERROR, E_INVALID_PASSWORD, attempts);
- if(attempts >= GA_MAX_LOGIN_ATTEMPTS)
- {
- switch(GetPVarInt(playerid, "tmpLevel"))
- {
- case 0: KickEx(playerid, SERVER, "Failed Login");
- default: BanEx2(playerid, SERVER, "Failed Administrator Login");
- }
- }
- }
- else
- {
- SetPVarInt(playerid, "LoggedIn", 1);
- INI_ParseFile(filename, "LoginPlayer", false, true, playerid, true, false);
- DeletePVar(playerid, "PasswordAttempts");
- GameTextForPlayer(playerid, " ~n~ ~n~~p~Login Successfull!", 6000, 6);
- ShowPlayerDialogEx(playerid, GA_INFOMENU, DIALOG_STYLE_MSGBOX, GA_DC_HEADER, "Close", "", I_LOGIN_SUCCESS, GetPVarInt(playerid, "Level"), GetPVarInt(playerid, "VIP"));
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[login] 3%s (%d) logged in from IP %s.", pNick(playerid), playerid, GetPlayerIpEx(playerid));
- #endif
- }
- }
- }
- return 1;
- }
- return 0;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- public OnPlayerCommandPerformed(playerid, cmdtext[], success)
- {
- switch(success)
- {
- case 1:
- {
- if(GetSecondsBetweenAction(GetPVarInt(playerid, "LastCommand")) < GA_TIME_BETWEEN_CMDS)
- {
- UpdatePVarInt(playerid, "CommandSpam", 1);
- new CommandSpam = GetPVarInt(playerid, "CommandSpam");
- if(CommandSpam >= GA_MAX_CMD_SPAM)
- {
- switch(IsAdmin(playerid))
- {
- case 0: return KickEx(playerid, SERVER, "Command Spam");
- #if defined GA_ANTI_CMDSPAM_KICK_ADMINS
- case 1: return KickEx(playerid, SERVER, "Command Spam");
- #endif
- }
- }
- if(GA_MAX_CMD_SPAM >= 4 && (CommandSpam == (GA_MAX_CMD_SPAM-2) || CommandSpam == (GA_MAX_CMD_SPAM-1)))
- {
- switch(IsAdmin(playerid))
- {
- case 0: return SendClientMessage(playerid, COLOUR_ERROR, ANTI_CMD_SPAM_MSG);
- #if defined GA_ANTI_CMDSPAM_KICK_ADMINS
- case 1: return SendClientMessage(playerid, COLOUR_ERROR, ANTI_CMD_SPAM_MSG);
- #endif
- }
- }
- }
- if(GetSecondsBetweenAction(GetPVarInt(playerid, "LastCommand")) > GA_TIME_BETWEEN_CMDS && GetPVarType(playerid, "CommandSpam") != PLAYER_VARTYPE_NONE)
- {
- DeletePVar(playerid, "CommandSpam");
- }
- SetPVarInt(playerid, "LastCommand", GetTickCount());
- return 1;
- }
- }
- return SendClientMessage(playerid, COLOUR_ERROR, INVALID_CMD_MSG);
- }
- //##############################################################################
- new Float:GI_X2, Float:GI_Y2, Float:GI_Z2;
- stock Float:GX(playerid)
- {
- GetPlayerPos(playerid, GI_X2, GI_Y2, GI_Z2);
- return GI_X2;
- }
- stock Float:GY(playerid)
- {
- GetPlayerPos(playerid, GI_X2, GI_Y2, GI_Z2);
- return GI_Y2;
- }
- stock Float:GZ(playerid)
- {
- GetPlayerPos(playerid, GI_X2, GI_Y2, GI_Z2);
- return GI_Z2;
- }
- stock SetPlayerPosEx(playerid, Float:GA_X, Float:GA_Y, Float:GA_Z, interior = -1, world = -1)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(interior == -1)
- {
- interior = GetPlayerInterior(playerid);
- }
- if(world == -1)
- {
- world = GetPlayerVirtualWorld(playerid);
- }
- SetPlayerInterior(playerid, interior), SetPlayerVirtualWorld(playerid, world);
- switch(IsPlayerInAnyVehicle(playerid))
- {
- case 0: SetPlayerPos(playerid, GA_X, GA_Y, GA_Z);
- case 1: LinkVehicleToInterior(vehicleid, interior), SetVehicleVirtualWorld(vehicleid, world), SetVehiclePos(vehicleid, GA_X, GA_Y, GA_Z);
- }
- return 1;
- }
- //==============================================================================
- // Commands
- //==============================================================================
- CMD:acmds(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- #pragma unused params
- CMDSString = "";
- new lvl = GetPVarInt(playerid, "Level");
- if(lvl < 3) strcat(CMDSString, ""DC_INFO"Common Commands:"DC_DIALOG" /godmode /heal /jetpack /listweapons /clearchat /spectate /getinfo\n");
- if(lvl >= 3 || IsPlayerAdmin(playerid)) strcat(CMDSString, ""DC_INFO"Common Commands:"DC_DIALOG" /godmode /heal /jetpack /listweapons /clearchat /spectate /getinfo /reconnect\n");
- if(lvl >= 1 || IsPlayerAdmin(playerid)) strcat(CMDSString, ""DC_INFO"Punishment Commands:"DC_DIALOG" /kick /ban /tempban /akill /slap /crash /(de)disarm /(un)mute /(un)freeze /(un)cage\n");
- if(lvl >= 1 || IsPlayerAdmin(playerid)) strcat(CMDSString, ""DC_INFO"Punishment Commands:"DC_DIALOG" /warn /clearwarnings\n");
- if(lvl == 2 || IsPlayerAdmin(playerid)) strcat(CMDSString, ""DC_INFO"Give/Set Commands:"DC_DIALOG" /setvhealth /setarmour /sethealth /giveweapon\n");
- if(lvl >= 3 || IsPlayerAdmin(playerid)) strcat(CMDSString, ""DC_INFO"Give/Set Commands:"DC_DIALOG" /setvhealth /setarmour /sethealth /setmoney /setweather /setinterior /setworld /setskin /setscore /giveweapon /givemoney /givescore\n");
- if(lvl >= 1 || IsPlayerAdmin(playerid)) strcat(CMDSString, ""DC_INFO"Tele Commands:"DC_DIALOG" /up /down /north /south /east /west /goto /gotop /gotopos /send /sendp /get /getp\n");
- if(lvl >= 1 || IsPlayerAdmin(playerid)) strcat(CMDSString, ""DC_INFO"Vehicle Commands:"DC_DIALOG" /toggleengine /vehicle /destroyvehicle /removecar\n");
- if(lvl >= 1 || IsPlayerAdmin(playerid)) strcat(CMDSString, ""DC_INFO"Messaging Commands:"DC_DIALOG" /text /textp /amsg /asay\n");
- if(lvl >= ALL_CMDS_LVL || IsPlayerAdmin(playerid)) strcat(CMDSString, ""DC_INFO"\"All\" Commands:"DC_DIALOG" /giveallweapon /crashall /slapall /akillall /(un)freezeall /warnall /clearallwarnings\n");
- if(lvl >= ALL_CMDS_LVL || IsPlayerAdmin(playerid)) strcat(CMDSString, ""DC_INFO"\"All\" Commands:"DC_DIALOG" /(un)muteall /(de)disarmall /(un)cageall /banall /healall /setallarmour\n");
- if(lvl >= ALL_CMDS_LVL || IsPlayerAdmin(playerid)) strcat(CMDSString, ""DC_INFO"\"All\" Commands:"DC_DIALOG" /setallhealth /setallmoney /setallscore /setallskin /setallworld /setallinterior\n");
- if(lvl >= ALL_CMDS_LVL || IsPlayerAdmin(playerid)) strcat(CMDSString, ""DC_INFO"\"All\" Commands:"DC_DIALOG" /giveallscore /giveallmoney /reconnectall\n");
- if(lvl >= MAX_ADMIN_LVL || IsPlayerAdmin(playerid)) strcat(CMDSString, ""DC_INFO"RCON/Level "#MAX_ADMIN_LVL" Commands:"DC_DIALOG" /setlevel /setvip /rangeban /setname /setgravity /togglecmd /toggleallcmd");
- ShowPlayerDialog(playerid, GA_INFOMENU, DIALOG_STYLE_MSGBOX, GA_DC_HEADER, CMDSString, "Close", "");
- return 1;
- }
- else return 0;
- }
- CMD:setlevel(playerid, params[])
- {
- if(IsAdminEx(playerid, MAX_ADMIN_LVL))
- {
- new id, amount;
- if(sscanf(params, "ud", id, amount)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /setlevel (nick/id) (level: 0-"#MAX_ADMIN_LVL")");
- if(GetPVarType(id, "LoggedIn") == PLAYER_VARTYPE_NONE) return SendClientMessage(playerid, COLOUR_ERROR, E_NEED_TO_LOGIN);
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- if(amount < 0 || amount > MAX_ADMIN_LVL) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /setlevel (nick/id) (level: 0-"#MAX_ADMIN_LVL")");
- else
- {
- SetPVarInt(id, "Level", amount);
- SendMSG(id, COLOUR_INFO, "Administrator %s (%d) has set your administrator level to %d.", pNick(playerid), playerid, amount);
- SendMSG(playerid, COLOUR_INFO, "You've set %s's (%d) administrator level to %d.", pNick(id), id, amount);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[setlevel] 3%s (%d) set %s (%d) to administrator level %d.", pNick(playerid), playerid, pNick(id), id, amount);
- #endif
- if(amount > 0)
- {
- SendClientMessage(id, COLOUR_INFO, "Type /admincommands (/acmds) For A List Of Commands.");
- }
- SendAdminCommand(playerid, "setlevel");
- #if defined GA_SAVE_LOGS
- new log[128];
- format(log, sizeof(log), "%s (%d) was set to level %d by %s (%d).", pNick(id), id, amount, pNick(playerid), playerid);
- SaveLog("/MAdmin/Logs/AdministratorLogs.txt", log);
- #endif
- SavePlayerStats(id);
- }
- return 1;
- }
- else return 0;
- }
- CMD:setvip(playerid, params[])
- {
- if(IsAdminEx(playerid, MAX_ADMIN_LVL))
- {
- new id, amount;
- if(sscanf(params, "ud", id, amount)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /setvip (nick/id) (level: 0-"#MAX_VIP_LVL")");
- if(GetPVarType(id, "LoggedIn") == PLAYER_VARTYPE_NONE) return SendClientMessage(playerid, COLOUR_ERROR, E_NEED_TO_LOGIN);
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- if(amount < 0 || amount > MAX_VIP_LVL) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /setvip (nick/id) (level: 0-"#MAX_VIP_LVL")");
- else
- {
- SetPVarInt(id, "VIP", amount);
- SendMSG(id, COLOUR_INFO, "Administrator %s (%d) has set your VIP level to %d.", pNick(playerid), playerid, amount);
- SendMSG(playerid, COLOUR_INFO, "You've set %s (%d) to a level %d VIP", pNick(id), id, amount);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[setvip] 3%s (%d) set %s (%d) to VIP level %d.", pNick(playerid), playerid, pNick(id), id, amount);
- #endif
- #if defined GA_SAVE_LOGS
- new log[128];
- format(log, sizeof(log), "%s (%d) was set to a level %d VIP by %s (%d).", pNick(id), id, amount, pNick(playerid), playerid);
- SaveLog("/MAdmin/Logs/VIPLogs.txt", log);
- #endif
- SavePlayerStats(id);
- SendAdminCommand(playerid, "setvip");
- return 1;
- }
- }
- else return 0;
- }
- CMD:setname(playerid, params[])
- {
- if(IsAdminEx(playerid, MAX_ADMIN_LVL))
- {
- new id, name[(MAX_PLAYER_NAME + 1)], pName1[MAX_PLAYER_NAME], pName2[MAX_PLAYER_NAME];
- if(sscanf(params, "us["#MAX_PLAYER_NAME"]", id, name)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /setname (nick/id) (new name)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- if(name[MAX_PLAYER_NAME]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 3 and "#MAX_PLAYER_NAME" characters.");
- else
- {
- GetPlayerName(id, pName1, MAX_PLAYER_NAME), GetPlayerName(playerid, pName2, MAX_PLAYER_NAME);
- switch(SetPlayerName(id, name))
- {
- case 0: return SendClientMessage(playerid, COLOUR_ERROR, "This player is already using this name.");
- case -1: return SendClientMessage(playerid, COLOUR_ERROR, "Unable to set the players name (name in use or the name contains invalid characters).");
- case 1:
- {
- SendMSG(id, COLOUR_INFO, "Administrator %s (%d) has set your name to a \"%s\".", pName2, playerid, name);
- SendMSG(playerid, COLOUR_INFO, "You've set %s's (%d) name to \"%s\".", pName1, id, name);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[setname] 3%s (%d) set %s's (%d) name to \"%s\".", pNick(playerid), playerid, pNick(id), id, name);
- #endif
- SendAdminCommand(playerid, "setname");
- }
- }
- return 1;
- }
- }
- else return 0;
- }
- CMD:setgravity(playerid, params[])
- {
- if(IsAdminEx(playerid, MAX_ADMIN_LVL))
- {
- new Float:amount;
- if(sscanf(params, "f", amount)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /setgravity (float: gravity)");
- else
- {
- SetGravity(amount);
- SendMSGToAll(COLOUR_INFO, "Administrator %s (%d) has set the gravity to %f", pNick(playerid), playerid, amount);
- SendMSG(playerid, COLOUR_INFO, "You've set the gravity to %f.", amount);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[setgravity] 3%s (%d) set the gravity to %f.", pNick(playerid), playerid, amount);
- #endif
- SendAdminCommand(playerid, "setgravity");
- return 1;
- }
- }
- else return 0;
- }
- CMD:setscore(playerid, params[])
- {
- if(IsAdminEx(playerid, 3))
- {
- new id, amount;
- if(sscanf(params, "ud", id, amount)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /setscore (nick/id) (amount)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- if(id == playerid && !IsAdminEx(playerid, MAX_ADMIN_LVL)) return SendClientMessage(playerid, COLOUR_ERROR, E_CANT_USE_ON_YOURSELF);
- else
- {
- SetPlayerScore(id, amount);
- SendMSG(playerid, COLOUR_INFO, "You've set %s's (%d) score to %d.", pNick(id), id, amount);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[setscore] 3%s (%d) set %s's (%d) score to %d.", pNick(playerid), playerid, pNick(id), id, amount);
- #endif
- SendAdminCommand(playerid, "setscore");
- return 1;
- }
- }
- else return 0;
- }
- CMD:givescore(playerid, params[])
- {
- if(IsAdminEx(playerid, 3))
- {
- new id, amount;
- if(sscanf(params, "ud", id, amount)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /givescore (nick/id) (amount)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- if(id == playerid && !IsAdminEx(playerid, MAX_ADMIN_LVL)) return SendClientMessage(playerid, COLOUR_ERROR, E_CANT_USE_ON_YOURSELF);
- else
- {
- GivePlayerScore(id, amount);
- SendMSG(playerid, COLOUR_INFO, "You've given %s (%d) %d score.", pNick(id), id, amount);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[givescore] 3%s (%d) gave %s (%d) %d score (Current score: %d).", pNick(playerid), playerid, pNick(id), id, amount, GetPlayerScore(id));
- #endif
- SendAdminCommand(playerid, "givescore");
- return 1;
- }
- }
- else return 0;
- }
- CMD:setallscore(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new amount = strval(params);
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /setallscore (amount)");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- SetPlayerScore(i, amount);
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've set all non-administrators score to %d (%d in total).", amount, count);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[setallscore] 3%s (%d) set all non-administrators score to %d.", pNick(playerid), playerid, amount);
- #endif
- SendAdminCommand(playerid, "setallscore");
- return 1;
- }
- }
- else return 0;
- }
- CMD:giveallscore(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new amount = strval(params);
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /giveallscore (amount)");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- GivePlayerScore(i, amount);
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've given all non-administrators %d score (%d in total).", amount, count);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[setscore] 3%s (%d) gave all non-administrators %d score..", pNick(playerid), playerid, amount);
- #endif
- SendAdminCommand(playerid, "giveallscore");
- return 1;
- }
- }
- else return 0;
- }
- CMD:setskin(playerid, params[])
- {
- if(IsAdminEx(playerid, 3))
- {
- new id, amount;
- if(sscanf(params, "ud", id, amount)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /setscore (nick/id) (skin ID)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- if(!IsValidSkin(amount)) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid skin ID.");
- else
- {
- SetPlayerSkin(id, amount);
- SendMSG(id, COLOUR_INFO, "Administrator %s (%d) has set your skin to %d.", pNick(playerid), playerid, amount);
- SendMSG(playerid, COLOUR_INFO, "You've set %s's (%d) skin to %d.", pNick(id), id, amount);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[setskin] 3%s (%d) set %s's (%d) skin to %d.", pNick(playerid), playerid, pNick(id), id, amount);
- #endif
- SendAdminCommand(playerid, "setskin");
- return 1;
- }
- }
- else return 0;
- }
- CMD:setallskin(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new amount = strval(params);
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /setallskin (skin ID)");
- if(!IsValidSkin(amount)) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid skin ID.");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- SetPlayerSkin(i, amount);
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've set all non-administrators skin to %d (%d in total).", amount, count);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[setallskin] 3%s (%d) set all non-administrators skin to %d.", pNick(playerid), playerid, amount);
- #endif
- SendAdminCommand(playerid, "setallskin");
- return 1;
- }
- }
- else return 0;
- }
- CMD:setworld(playerid, params[])
- {
- if(IsAdminEx(playerid, 4))
- {
- new id, amount;
- if(sscanf(params, "ud", id, amount)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /setworld (nick/id) (virtual world)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- SetPlayerVirtualWorld(id, amount);
- SendMSG(playerid, COLOUR_INFO, "You've set %s's (%d) virtual world to %d.", pNick(id), id, amount);
- SendAdminCommand(playerid, "setworld");
- return 1;
- }
- }
- else return 0;
- }
- CMD:setallworld(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new amount = strval(params);
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /setallworld (world)");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- SetPlayerVirtualWorld(i, amount);
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've set all non-administrators virtual world to %d (%d in total).", amount, count);
- SendAdminCommand(playerid, "setallworld");
- return 1;
- }
- }
- else return 0;
- }
- CMD:setinterior(playerid, params[])
- {
- if(IsAdminEx(playerid, 4))
- {
- new id, amount;
- if(sscanf(params, "ud", id, amount)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /setinterior (nick/id) (interior)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- SetPlayerInterior(id, amount);
- SendMSG(playerid, COLOUR_INFO, "You've set %s's (%d) interior to %d.", pNick(id), id, amount);
- SendAdminCommand(playerid, "setinterior");
- return 1;
- }
- }
- else return 0;
- }
- CMD:setallinterior(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new amount = strval(params);
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /setallinterior (interior)");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- SetPlayerInterior(i, amount);
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've set all non-administrators interior to %d (%d in total).", amount, count);
- SendAdminCommand(playerid, "setallinterior");
- return 1;
- }
- }
- else return 0;
- }
- CMD:setweather(playerid, params[])
- {
- if(IsAdminEx(playerid, 3))
- {
- new amount;
- if(sscanf(params, "d", amount)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /setweather (nick/id) (weather id)");
- else
- {
- SetWeather(amount);
- SendMSGToAll(COLOUR_INFO, "Administrator %s (%d) has set the weather to %d.", pNick(playerid), playerid, amount);
- SendMSG(playerid, COLOUR_INFO, "You've set the weather to %d.", amount);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[setweather] 3%s (%d) set the weather to %d.", pNick(playerid), playerid, amount);
- #endif
- SendAdminCommand(playerid, "setweather");
- return 1;
- }
- }
- else return 0;
- }
- CMD:setmoney(playerid, params[])
- {
- if(IsAdminEx(playerid, 3))
- {
- new id, amount;
- if(sscanf(params, "ud", id, amount)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /setmoney (nick/id) (amount)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- if(id == playerid && !IsAdminEx(playerid, MAX_ADMIN_LVL)) return SendClientMessage(playerid, COLOUR_ERROR, E_CANT_USE_ON_YOURSELF);
- else
- {
- SetPlayerMoney(id, amount);
- SendMSG(playerid, COLOUR_INFO, "You've set %s's (%d) money to $%d.", pNick(id), id, amount);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[setmoney] 3%s (%d) set %s's (%d) money to $%d.", pNick(playerid), playerid, pNick(id), id, amount);
- #endif
- SendAdminCommand(playerid, "setmoney");
- return 1;
- }
- }
- else return 0;
- }
- CMD:givemoney(playerid, params[])
- {
- if(IsAdminEx(playerid, 3))
- {
- new id, amount;
- if(sscanf(params, "ud", id, amount)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /givemoney (nick/id) (amount)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- if(id == playerid && !IsAdminEx(playerid, MAX_ADMIN_LVL)) return SendClientMessage(playerid, COLOUR_ERROR, E_CANT_USE_ON_YOURSELF);
- else
- {
- GivePlayerMoney(id, amount);
- SendMSG(playerid, COLOUR_INFO, "You've given %s (%d) $%d.", pNick(id), id, amount);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[givemoney] 3%s (%d) given %s (%d) $%d (Current cash: $%d)", pNick(playerid), playerid, pNick(id), id, amount, GetPlayerMoney(id));
- #endif
- SendAdminCommand(playerid, "givemoney");
- return 1;
- }
- }
- else return 0;
- }
- CMD:setallmoney(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new amount = strval(params);
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /setallmoney (amount)");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- SetPlayerMoney(i, amount);
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've set all non-administrators money to $%d (%d in total).", amount, count);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[setallmoney] 3%s (%d) set all non-administrators money to $%d.", pNick(playerid), playerid, amount);
- #endif
- SendAdminCommand(playerid, "setallmoney");
- return 1;
- }
- }
- else return 0;
- }
- CMD:giveallmoney(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new amount = strval(params);
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /giveallmoney (amount)");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- GivePlayerMoney(i, amount);
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've given all non-administrators $%d (%d in total).", amount, count);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[setmoney] 3%s (%d) gave all non-administrators $%d.", pNick(playerid), playerid, amount);
- #endif
- SendAdminCommand(playerid, "giveallmoney");
- return 1;
- }
- }
- else return 0;
- }
- CMD:sethealth(playerid, params[])
- {
- if(IsAdminEx(playerid, 2))
- {
- new id, Float:amount;
- if(sscanf(params, "uf", id, amount)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /sethealth (nick/id) (float: health)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- SetPlayerHealth(id, amount);
- SendMSG(playerid, COLOUR_INFO, "You've set %s's (%d) health to %0.2f.", pNick(id), id, amount);
- SendAdminCommand(playerid, "sethealth");
- return 1;
- }
- }
- else return 0;
- }
- CMD:setallhealth(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new Float:amount = floatstr(params);
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /setallhealth (float: armour)");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- SetPlayerHealth(i, amount);
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've set all non-administrators health to %0.2f (%d in total).", amount, count);
- SendAdminCommand(playerid, "setallhealth");
- return 1;
- }
- }
- else return 0;
- }
- CMD:setarmour(playerid, params[])
- {
- if(IsAdminEx(playerid, 2))
- {
- new id, Float:amount;
- if(sscanf(params, "uf", id, amount)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /setarmour (nick/id) (float: armour)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- SetPlayerArmour(id, amount);
- SendMSG(playerid, COLOUR_INFO, "You've set %s's (%d) armour to %0.2f.", pNick(id), id, amount);
- SendAdminCommand(playerid, "setarmour");
- return 1;
- }
- }
- else return 0;
- }
- CMD:setallarmour(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new Float:amount = floatstr(params);
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /setallarmour (float: armour)");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- SetPlayerArmour(i, amount);
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've set all non-administrators armour to %0.2f (%d in total).", amount, count);
- SendAdminCommand(playerid, "setallarmour");
- return 1;
- }
- }
- else return 0;
- }
- CMD:setvhealth(playerid, params[])
- {
- if(IsAdminEx(playerid, 2))
- {
- new id, Float:amount;
- if(sscanf(params, "uf", id, amount)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /setvhealth (nick/id) (float: vehicle health)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, COLOUR_INFO, "This player is not in a vehicle.");
- else
- {
- SetVehicleHealth(GetPlayerVehicleID(id), amount);
- SendMSG(playerid, COLOUR_INFO, "You've set %s's (%d) vehicle health to %0.2f.", pNick(id), id, amount);
- SendAdminCommand(playerid, "setvhealth");
- return 1;
- }
- }
- else return 0;
- }
- CMD:setallvhealth(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new Float:amount = floatstr(params);
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /setallvhealth (float: vehicle health)");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i) || !IsPlayerInAnyVehicle(i)) continue;
- SetVehicleHealth(GetPlayerVehicleID(i), amount);
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've set all non-administrators vehicle health to %0.2f (%d in total).", amount, count);
- SendAdminCommand(playerid, "setallvhealth");
- return 1;
- }
- }
- else return 0;
- }
- CMD:toggleengine(playerid, params[])
- {
- if(IsAdminEx(playerid, 2))
- {
- new id, amount, engine, lights, alarm, doors, bonnet, boot, objective;
- if(sscanf(params, "ud", id, amount)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /toggleengine (nick/id) (toggle: 0/1)");
- if(amount != 0 && amount != 1) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /toggleengine (nick/id) (toggle: 0/1)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- SendMSG(playerid, COLOUR_INFO, "You've turned %s's (%d) vehicle engine %s.", pNick(id), id, Answer(amount, "on", "off"));
- GetVehicleParamsEx(GetPlayerVehicleID(id), engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(GetPlayerVehicleID(id), amount, lights, alarm, doors, bonnet, boot, objective);
- SendAdminCommand(playerid, "toggleengine");
- return 1;
- }
- }
- else return 0;
- }
- CMD:toggleallengines(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new amount = strval(params), engine, lights, alarm, doors, bonnet, boot, objective, count;
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /toggleallengines (toggle: 0/1)");
- if(amount != 0 && amount != 1) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /toggleallengines (toggle: 0/1)");
- else
- {
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- GetVehicleParamsEx(GetPlayerVehicleID(i), engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(GetPlayerVehicleID(i), amount, lights, alarm, doors, bonnet, boot, objective);
- SendMSG(playerid, COLOUR_INFO, "Administrator %s (%d) has turned your vehicle engine %s.", pNick(playerid), playerid, Answer(amount, "on", "off"));
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've turned %s all non-administrators vehicle engine (%d in total).", Answer(amount, "on", "off"), count);
- SendAdminCommand(playerid, "toggleallengines");
- return 1;
- }
- }
- else return 0;
- }
- CMD:heal(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id, type[9];
- if(sscanf(params, "uS(all)[8]", id, type)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /heal (nick/id) (type: health/armour/vehicle/all)");
- if(type[8]) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /heal (nick/id) (type: health/armour/vehicle/all)");
- if(strcmp(type, "health", true) && strcmp(type, "armour", true) && strcmp(type, "vehicle", true) && strcmp(type, "all", true)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /heal (nick/id) (type: health/armour/vehicle/all)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- DeCapitalize(type);
- SendMSG(playerid, COLOUR_INFO, "You've healed %s (%d). Healing mode: %s", pNick(id), id, type);
- if(!strcmp(type, "health"))
- {
- SetPlayerHealth(id, 100.0);
- }
- if(!strcmp(type, "armour"))
- {
- SetPlayerArmour(id, 100.0);
- }
- if(!strcmp(type, "vehicle"))
- {
- if(IsPlayerInAnyVehicle(id))
- {
- SetVehicleHealth(GetPlayerVehicleID(id), 1000.0);
- RepairVehicle(GetPlayerVehicleID(id));
- }
- }
- if(!strcmp(type, "all"))
- {
- SetPlayerArmour(id, 100.0);
- SetPlayerHealth(id, 100.0);
- if(IsPlayerInAnyVehicle(id))
- {
- SetVehicleHealth(GetPlayerVehicleID(id), 1000.0);
- RepairVehicle(GetPlayerVehicleID(id));
- }
- }
- SendAdminCommand(playerid, "heal");
- return 1;
- }
- }
- else return 0;
- }
- CMD:healall(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new type[9], count;
- if(sscanf(params, "S(all)[8]", type)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /healall (type: health/armour/vehicle/all)");
- if(type[8]) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /heal (nick/id) (type: health/armour/vehicle/all)");
- if(strcmp(type, "health", true) && strcmp(type, "armour", true) && strcmp(type, "vehicle", true) && strcmp(type, "all", true)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /heal (nick/id) (type: health/armour/vehicle/all)");
- else
- {
- if(!strcmp(type, "health"))
- {
- foreach(Player, i)
- {
- SetPlayerHealth(i, 100.0);
- count++;
- }
- }
- if(!strcmp(type, "armour"))
- {
- foreach(Player, i)
- {
- SetPlayerArmour(i, 100.0);
- count++;
- }
- }
- if(!strcmp(type, "vehicle"))
- {
- foreach(Player, i)
- {
- if(IsPlayerInAnyVehicle(i))
- {
- SetVehicleHealth(GetPlayerVehicleID(i), 1000.0);
- RepairVehicle(GetPlayerVehicleID(i));
- count++;
- }
- }
- }
- if(!strcmp(type, "all"))
- {
- foreach(Player, i)
- {
- SetPlayerArmour(i, 100.0);
- SetPlayerHealth(i, 100.0);
- if(IsPlayerInAnyVehicle(i))
- {
- SetVehicleHealth(GetPlayerVehicleID(i), 1000.0);
- RepairVehicle(GetPlayerVehicleID(i));
- count++;
- }
- }
- }
- DeCapitalize(type);
- SendMSG(playerid, COLOUR_INFO, "You've healed all non-administrators (%d in total). Healing mode: %s", count, type);
- SendAdminCommand(playerid, "healall");
- return 1;
- }
- }
- else return 0;
- }
- CMD:ban(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id, reason[51], INI:file, filename[ACCOUNTPATH_LENGTH];
- if(sscanf(params, "uS(No Reason Specified)[50]", id, reason)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /ban (nick/id) (optional: reason)");
- if(reason[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 50 characters.");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- format(filename, sizeof(filename), ACCOUNTPATH, UserFileName(pNick(id)));
- if(fexist(filename))
- {
- file = INI_Open(filename);
- INI_WriteInt(file, "Banned", 1);
- INI_Close(file);
- }
- BanEx2(id, ADMIN, reason, playerid);
- SendAdminCommand(playerid, "ban");
- return 1;
- }
- }
- else return 0;
- }
- CMD:unban(playerid, params[])
- {
- if(IsAdminEx(playerid, 3))
- {
- new INI:file, File:bfile, filename[ACCOUNTPATH_LENGTH], line[128], ip[16], reason[61], kicker[8], admin[(MAX_PLAYER_NAME + 1)], user[(MAX_PLAYER_NAME + 1)], date[21];
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /unban (account)");
- format(filename, sizeof(filename), ACCOUNTPATH, UserFileName(params));
- if(!fexist(filename)) return SendClientMessage(playerid, COLOUR_ERROR, "This account does not exist.");
- else
- {
- INI_ParseFile(filename, "UnbanPlayer", false, true, playerid, true, false);
- if(GetPVarType(playerid, "UnbanPlayerBanned") == PLAYER_VARTYPE_NONE) return SendClientMessage(playerid, COLOUR_ERROR, "This account is not banned.");
- file = INI_Open(filename);
- INI_WriteInt(file, "Banned", 0);
- INI_Close(file);
- #if defined GA_USE_SAMPBAN
- format(filename, sizeof(filename), "unbanip %s", GetPVarStringEx(playerid, "UnbanPlayerIP"));
- SendRconCommand(filename);
- #else
- bfile = fopen(BANFILE, io_read);
- if(file)
- {
- while(fread(bfile, line, sizeof(line)))
- {
- sscanf(line, "p<|>s[16]s["#MAX_PLAYER_NAME"]s[60]s[7]s["#MAX_PLAYER_NAME"]s[20]", ip, user, reason, kicker, admin, date);
- if(!strcmp(GetPVarStringEx(playerid, "UnbanPlayerIP"), ip, true))
- {
- fdelete_line(BANFILE, line);
- break;
- }
- }
- }
- #endif
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[unban] 3%s (%d) unbanned the account %s.", pNick(playerid), playerid, params);
- #endif
- SendMSG(playerid, COLOUR_INFO, "You've unbanned the account %s.", params);
- SendAdminCommand(playerid, "unban");
- return 1;
- }
- }
- else return 0;
- }
- CMD:tempban(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id, days, reason[51], year, month, day;
- if(sscanf(params, "udS(No Reason Specified)[50]", id, days, reason)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /tempban (nick/id) (days) (optional: reason)");
- if(reason[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 50 characters.");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- new File:tmpban = fopen(TEMPBAN, io_append);
- if(tmpban)
- {
- getdate(year, month, day);
- day += days;
- switch(IsMonth31(month))
- {
- case 1:
- {
- if(day > 31)
- {
- month += 1;
- if(month > 12)
- {
- year += 1;
- while(day > 31) day -=31;
- }
- else while(day > 31) day -= 31;
- }
- }
- case 0:
- {
- if(day > 30)
- {
- month += 1;
- if(month > 12)
- {
- year += 1;
- while(day > 30) day -= 30;
- }
- else while(day > 30) day -= 30;
- }
- if(IsMonth29(year) && month == 2)
- {
- if(day > 29)
- {
- month += 1;
- if(month > 12)
- {
- year += 1;
- while(day > 29) day -= 29;
- }
- else while(day > 29) day -= 29;
- }
- }
- if(!IsMonth29(year) && month == 2)
- {
- if(day > 28)
- {
- month += 1;
- if(month > 12)
- {
- year += 1;
- while(day > 28) day -= 28;
- }
- else while(day > 28) day -= 28;
- }
- }
- }
- }
- CMDSString = "";
- new date[3], time[3];
- getdate(date[2], date[1], date[0]), gettime(time[0], time[1], time[2]);
- format(CMDSString, sizeof(CMDSString), "%d|%d|%d|%s|%s|%02d/%02d/%02d - %02d:%02d:%02d\n\r", day, month, year, GetPlayerIpEx(id), pNick(id), date[0], date[1], date[2], time[0], time[1], time[2]);
- fwrite(tmpban, CMDSString);
- fclose(tmpban);
- }
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[tempban] 3%s (%d) temporaly banned %s (%d) for %d day%s - Expires at %d/%d/%d. Reason: %s.", pNick(playerid), playerid, pNick(id), id, days, AddS(days), day, month, year, reason);
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "*** %d DAY%s BAN: %s (%d) - Reason: %s.", days, AddS(days), pNick(id), id, reason);
- #endif
- SendMSG(playerid, COLOUR_INFO, "You've banned %s (%d) for %d day%s - Expires at %d/%d/%d. Reason: %s.", pNick(id), id, days, AddS(days), day, month, year, reason);
- SendMSGToAll(COLOUR_ADMIN, "*** %d DAY%s BAN: %s (%d) - Reason: %s.", days, AddS(days), pNick(id), id, reason);
- #if defined GA_SAVE_LOGS
- format(CMDSString, sizeof(CMDSString), "%s (%d) Has Been Temporaly Banned By %s (%d) for %d day%s. Expires at %d/%d/%d. Ban Reason: %s.\n\r", pNick(id), id, pNick(playerid), playerid, days, AddS(days), day, month, year, reason);
- SaveLog("/MAdmin/Logs/TempBans.txt", CMDSString);
- #endif
- ClearChat(0, id);
- SendMSG(id, COLOUR_INFO, "You've been temporaly banned from the server for %d day%s. Expires at: %d/%d/%d. Reason: %s", days, AddS(days), day, month, year, reason);
- GameTextForPlayer(id, KICK_GAMETEXT, (999999 * 999999), 3);
- Kick(id);
- SendAdminCommand(playerid, "tempban");
- return 1;
- }
- }
- else return 0;
- }
- CMD:rangeban(playerid, params[])
- {
- if(IsAdminEx(playerid, MAX_ADMIN_LVL))
- {
- new id, ranges, INI:file, filename[ACCOUNTPATH_LENGTH];
- if(sscanf(params, "uD(1)", id, ranges)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /rangeban (nick/id) (optional: IP ranges)");
- if(ranges < 0 || ranges > 3) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid IP range amount. The IP range must be between 1 and 3.");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- format(filename, sizeof(filename), ACCOUNTPATH, UserFileName(pNick(id)));
- if(fexist(filename))
- {
- file = INI_Open(filename);
- INI_WriteInt(file, "Banned", 1);
- INI_Close(file);
- }
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[rangeban] 3%s (%d) rangebanned %s (%d) - (Ranges banned: %d).", pNick(playerid), playerid, pNick(id), id, ranges);
- #endif
- SendMSG(playerid, COLOUR_INFO, "You've rangebanned %s (%d) [IP: %s]. Total ranges banned: %d.", pNick(id), id, GetPlayerIpEx(id), ranges);
- RangeBan(id, ranges);
- SendAdminCommand(playerid, "rangeban");
- return 1;
- }
- }
- else return 0;
- }
- /*
- CMD:togglecmd(playerid, params[])
- {
- if(IsAdminEx(playerid, MAX_ADMIN_LVL))
- {
- new id, cmd[51], toggle;
- if(sscanf(params, "us[50]d", id, cmd, toggle)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /togglecmd (nick/id) (command) (toggle: 0/1)");
- if(cmd[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid command length. The command must be between 1 and 50 characters.");
- if(toggle != 0 && toggle != 1) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /togglecmd (nick/id) (command) (toggle: 0/1)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- new bool:mode = !!toggle;
- Command_SetPlayerNamed(cmd, id, mode);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[togglecmd] 3%s (%d) %s the command %s for %s (%d).", pNick(playerid), playerid, Answer(toggle, "Enabled", "Disabled"), cmd, pNick(id), id);
- #endif
- SendMSG(playerid, COLOUR_INFO, "You've %s the command %s for %s (%d).", Answer(toggle, "Enabled", "Disabled"), cmd, pNick(id), id);
- SendAdminCommand(playerid, "togglecmd");
- return 1;
- }
- }
- else return 0;
- }
- CMD:toggleallcmd(playerid, params[])
- {
- if(IsAdminEx(playerid, MAX_ADMIN_LVL))
- {
- new cmd[51], toggle;
- if(sscanf(params, "s[50]d", cmd, toggle)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /toggleallcmd (command) (toggle: 0/1)");
- if(cmd[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid command length. The command must be between 1 and 50 characters.");
- if(toggle != 0 && toggle != 1) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /toggleallcmd (command) (toggle: 0/1)");
- else
- {
- new count, bool:mode = !!toggle;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- Command_SetPlayerNamed(cmd, i, mode);
- count++;
- }
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[toggleallcmd] 3%s (%d) %s the command %s for all non-administrators.", pNick(playerid), playerid, Answer(toggle, "Enabled", "Disabled"), cmd);
- #endif
- SendMSG(playerid, COLOUR_INFO, "You've %s the command %s for all non-administrators.", Answer(toggle, "Enabled", "Disabled"), cmd);
- SendAdminCommand(playerid, "toggleallcmd");
- return 1;
- }
- }
- else return 0;
- }
- */
- CMD:banall(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /banall (reason)");
- if(params[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 50 characters.");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- BanEx2(i, ADMIN, params, playerid, 0);
- count++;
- }
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[banall] 3%s (%d) banned all non-administrators. Reason: %s.", pNick(playerid), playerid, params);
- #endif
- SendMSG(playerid, COLOUR_INFO, "You've banned all non-administrators (%d in total). Reason: %s.", count, params);
- SendAdminCommand(playerid, "banall");
- return 1;
- }
- }
- else return 0;
- }
- CMD:reconnect(playerid, params[])
- {
- if(IsAdminEx(playerid, 3))
- {
- new id, reason[51];
- if(sscanf(params, "uS(No Reason Specified)[50]", id, reason)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /reconnect (nick/id) (optional: reason)");
- if(reason[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 50 characters.");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- new tmp[23];
- for(new i = 0; i < 100; i++)
- {
- SendClientMessage(id, COLOUR_INFO, " ");
- }
- GameTextForPlayer(id, "~n~~g~Reconnecting to ~n~~p~"SERVER_NAME"!~n~~w~Do ~r~not ~p~quit ~w~the game!", 6000, 3);
- SendMSG(id, COLOUR_INFO, "Administrator %s (%d) has forced a reconnect on you. Reason: %s.", pNick(playerid), playerid, reason);
- SendMSG(playerid, COLOUR_INFO, "You've forced a reconnect on %s (%d). Reason: %s.", pNick(id), id, reason);
- SendClientMessage(id, COLOUR_SAMP, "Reconnecting to "DC_INFO""SERVER_NAME""DC_SAMP"... Do not quit the game.");
- format(tmp, sizeof(tmp), "banip %s", GetPlayerIpEx(id));
- SendRconCommand(tmp);
- SetPVarInt(id, "Relogin", 1);
- SendAdminCommand(playerid, "reconnect");
- return 1;
- }
- }
- else return 0;
- }
- CMD:reconnectall(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /reconnectall (reason)");
- if(params[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 50 characters.");
- else
- {
- new count, tmp[23];
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- GameTextForPlayer(i, "~n~~g~Reconnecting to ~n~~p~"SERVER_NAME"!~n~~w~Do ~r~not ~p~quit ~w~the game!", 6000, 3);
- SendMSG(i, COLOUR_INFO, "Administrator %s (%d) has forced a reconnect on you. Reason: %s.", pNick(playerid), playerid, params);
- SendClientMessage(i, COLOUR_SAMP, "Reconnecting to "DC_INFO""SERVER_NAME""DC_SAMP"... Do not quit the game.");
- format(tmp, sizeof(tmp), "banip %s", GetPlayerIpEx(i));
- SendRconCommand(tmp);
- SetPVarInt(i, "Relogin", 1);
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've reconnected all non-administrators (%d in total). Reason: %s.", count, params);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[reconnectall] 3%s (%d) reconnected all non-administrators. Reason: %s.", pNick(playerid), playerid, params);
- #endif
- SendAdminCommand(playerid, "reconnectall");
- return 1;
- }
- }
- else return 0;
- }
- CMD:kick(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id, reason[51];
- if(sscanf(params, "uS(No Reason Specified)[50]", id, reason)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /kick (nick/id) (optional: reason)");
- if(reason[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 50 characters.");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- KickEx(id, ADMIN, reason, playerid);
- SendAdminCommand(playerid, "kick");
- return 1;
- }
- }
- else return 0;
- }
- CMD:kickall(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /kickall (reason)");
- if(params[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 50 characters.");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- KickEx(i, ADMIN, params, playerid, 0);
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've kicked all non-administrators (%d in total). Reason: %s.", count, params);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[kickall] 3%s (%d) kicked all non-administrators. Reason: %s.", pNick(playerid), playerid, params);
- #endif
- SendAdminCommand(playerid, "kickall");
- return 1;
- }
- }
- else return 0;
- }
- CMD:cage(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id, reason[51], seconds;
- if(sscanf(params, "uD(0)S(No Reason Specified)[50]", id, seconds, reason)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /cage (nick/id) (optional: seconds - enter 0 for unlimited) (optional: reason)");
- if(reason[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 50 characters.");
- if(seconds < 0) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid time input. The time can not be negative. Enter 0 for unlimited time.");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- CageTime[id][0] = GetTickCount(), CageTime[id][1] = seconds;
- CagePlayer(id);
- SetPVarInt(id, "Caged", 1);
- SendMSG(id, COLOUR_INFO, "Administrator %s (%d) has caged you. Reason: %s.", pNick(playerid), playerid, reason);
- SendMSG(playerid, COLOUR_INFO, "You've caged %s (%d). Reason: %s.", pNick(id), id, reason);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "13"ADMIN_CAGE"", pNick(id), id, reason);
- #endif
- SendMSGToAll(COLOUR_ADMIN, ADMIN_CAGE, pNick(id), id, reason);
- SendAdminCommand(playerid, "cage");
- return 1;
- }
- }
- else return 0;
- }
- CMD:cageall(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new reason[51], seconds;
- if(sscanf(params, "D(0)S(No Reason Specified)[50]", seconds, reason)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /cageall (optional: seconds - enter 0 for unlimited) (optional: reason)");
- if(reason[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 50 characters.");
- if(seconds < 0) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid time input. The time can not be negative. Enter 0 for unlimited time.");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- CageTime[i][0] = GetTickCount(), CageTime[i][1] = seconds;
- CagePlayer(i);
- SetPVarInt(i, "Caged", 1);
- SendMSG(i, COLOUR_INFO, "Administrator %s (%d) has caged you. Reason: %s.", pNick(playerid), playerid, reason);
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've caged all non-administrators (%d in total). Reason: %s.", count, reason);
- SendAdminCommand(playerid, "cageall");
- return 1;
- }
- }
- else return 0;
- }
- CMD:uncage(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /uncage (nick/id)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- CageTime[id][1] = 0;
- UncagePlayer(id);
- SendMSG(id, COLOUR_INFO, "Administrator %s (%d) has uncaged you.", pNick(playerid), playerid);
- SendMSG(playerid, COLOUR_INFO, "You've uncaged %s (%d).", pNick(id), id);
- DeletePVar(id, "Caged");
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "13"ADMIN_UNCAGE"", pNick(id), id);
- #endif
- SendMSGToAll(COLOUR_ADMIN, ADMIN_UNCAGE, pNick(id), id);
- SendAdminCommand(playerid, "uncage");
- return 1;
- }
- }
- else return 0;
- }
- CMD:uncageall(playerid, params[])
- {
- #pragma unused params
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i) || GetPVarInt(i, "Caged") == PLAYER_VARTYPE_NONE) continue;
- CageTime[i][1] = 0;
- UncagePlayer(i);
- SendMSG(i, COLOUR_INFO, "Administrator %s (%d) has uncaged you.", pNick(playerid), playerid);
- DeletePVar(i, "Caged");
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've uncaged all non-administrators (%d in total).", count);
- SendAdminCommand(playerid, "uncageall");
- return 1;
- }
- else return 0;
- }
- CMD:freeze(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id, reason[51], seconds;
- if(sscanf(params, "uD(0)S(No Reason Specified)[50]", id, seconds, reason)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /freeze (nick/id) (optional: seconds - enter 0 for unlimited) (optional: reason)");
- if(reason[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 50 characters.");
- if(seconds < 0) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid time input. The time can not be negative. Enter 0 for unlimited time.");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- FreezeTime[id][0] = GetTickCount(), FreezeTime[id][1] = seconds;
- TogglePlayerControllable(id, 0);
- SetPVarInt(id, "Frozen", 1);
- SendMSG(id, COLOUR_INFO, "Administrator %s (%d) has frozen you. Reason: %s.", pNick(playerid), playerid, reason);
- SendMSG(playerid, COLOUR_INFO, "You've frozen %s (%d). Reason: %s.", pNick(id), id, reason);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "13"ADMIN_FREEZE"", pNick(id), id, reason);
- #endif
- SendMSGToAll(COLOUR_ADMIN, ADMIN_FREEZE, pNick(id), id, reason);
- SendAdminCommand(playerid, "freeze");
- return 1;
- }
- }
- else return 0;
- }
- CMD:freezeall(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new reason[51], seconds;
- if(sscanf(params, "D(0)S(No Reason Specified)[50]", seconds, reason)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /freezeall (optional: seconds - enter 0 for unlimited) (optional: reason)");
- if(reason[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 50 characters.");
- if(seconds < 0) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid time input. The time can not be negative. Enter 0 for unlimited time.");
- else
- {
- new count;
- foreach(Player, i)
- {
- FreezeTime[i][0] = GetTickCount(), FreezeTime[i][1] = seconds;
- TogglePlayerControllable(i, 0);
- SetPVarInt(i, "Frozen", 1);
- SendMSG(i, COLOUR_INFO, "Administrator %s (%d) has frozen you. Reason: %s.", pNick(playerid), playerid, reason);
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've frozen all non-administrators (%d in total). Reason: %s.", count, reason);
- SendAdminCommand(playerid, "freezeall");
- return 1;
- }
- }
- else return 0;
- }
- CMD:unfreeze(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /unfreeze (nick/id)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- FreezeTime[id][1] = 0;
- TogglePlayerControllable(id, 1);
- SendMSG(id, COLOUR_INFO, "Administrator %s (%d) has unfrozen you.", pNick(playerid), playerid);
- SendMSG(playerid, COLOUR_INFO, "You've unfrozen %s (%d).", pNick(id), id);
- DeletePVar(id, "Frozen");
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "13"ADMIN_UNFREEZE"", pNick(id), id);
- #endif
- SendMSGToAll(COLOUR_ADMIN, ADMIN_UNFREEZE, pNick(id), id);
- SendAdminCommand(playerid, "unfreeze");
- return 1;
- }
- }
- else return 0;
- }
- CMD:unfreezeall(playerid, params[])
- {
- #pragma unused params
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i) || GetPVarInt(i, "Frozen") == PLAYER_VARTYPE_NONE) continue;
- FreezeTime[i][1] = 0;
- TogglePlayerControllable(i, 1);
- SendMSG(i, COLOUR_INFO, "Administrator %s (%d) has unfrozen you.", pNick(playerid), playerid);
- DeletePVar(i, "Frozen");
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've unfrozen all non-administrators (%d in total).", count);
- SendAdminCommand(playerid, "unfreezeall");
- return 1;
- }
- else return 0;
- }
- CMD:spectate(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id;
- if(sscanf(params, "u", id) && GetPVarInt(playerid, "Spectating") == PLAYER_VARTYPE_NONE) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /spectate (nick/id)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- if(id == playerid) return SendClientMessage(playerid, COLOUR_ERROR, E_CANT_USE_ON_YOURSELF);
- if(GetPVarType(playerid, "Spectating") == PLAYER_VARTYPE_NONE)
- {
- new Float:Pos;
- GetPlayerFacingAngle(playerid, Pos);
- SetPVarInt(playerid, "Spectating", 1);
- SetPVarInt(playerid, "SpectatingPlayer", id);
- SetPVarFloat(playerid, "OldPosX", GX(playerid));
- SetPVarFloat(playerid, "OldPosY", GY(playerid));
- SetPVarFloat(playerid, "OldPosZ", GZ(playerid));
- SetPVarFloat(playerid, "OldAngle", Pos);
- SetPVarInt(playerid, "OldWorld", GetPlayerVirtualWorld(playerid));
- SetPVarInt(playerid, "OldInterior", GetPlayerVirtualWorld(playerid));
- SetPlayerInterior(playerid, GetPlayerInterior(id));
- SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
- TogglePlayerSpectating(playerid, 1);
- switch(IsPlayerInAnyVehicle(id))
- {
- case 0: PlayerSpectatePlayer(playerid, id);
- case 1: PlayerSpectateVehicle(playerid, GetPlayerVehicleID(id));
- }
- SendMSG(playerid, COLOUR_INFO, "You're now spectating %s (%d).", pNick(id), id);
- SendAdminCommand(playerid, "spectate");
- return 1;
- }
- if(GetPVarInt(playerid, "Spectating") == 1)
- {
- DeletePVar(playerid, "Spectating");
- DeletePVar(playerid, "SpectatingPlayer");
- TogglePlayerSpectating(playerid, 0);
- SetPlayerVirtualWorld(playerid, GetPVarInt(playerid, "OldWorld"));
- SetPlayerInterior(playerid, GetPVarInt(playerid, "OldInterior"));
- SetPlayerPos(playerid, GetPVarFloat(playerid, "OldPosX"), GetPVarFloat(playerid, "OldPosY"), GetPVarFloat(playerid, "OldPosZ"));
- SetPlayerFacingAngle(playerid, GetPVarFloat(playerid, "OldAngle"));
- SendMSG(playerid, COLOUR_INFO, "You've stopped spectating %s (%d).", pNick(id), id);
- return 1;
- }
- return 1;
- }
- else return 0;
- }
- CMD:warn(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id, reason[51];
- if(sscanf(params, "uS(No Reason Specified)[50]", id, reason)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /warn (nick/id) (optional: reason)");
- if(reason[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 50 characters.");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- UpdatePVarInt(id, "Warnings", 1);
- SendMSG(id, COLOUR_INFO, "Administrator %s (%d) has given you a warning. Total warnings: %d/"#MAX_WARNINGS". Reason: %s.", pNick(playerid), playerid, GetPVarInt(id, "Warnings"), reason);
- SendMSG(playerid, COLOUR_INFO, "You've given %s (%d) a warning. Reason: %s.", pNick(id), id, reason);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "13"ADMIN_WARN"", pNick(id), id, reason);
- #endif
- SendMSGToAll(COLOUR_ADMIN, ADMIN_WARN, pNick(id), id, reason);
- if(GetPVarInt(id, "Warnings") == MAX_WARNINGS)
- {
- switch(WARN_ACTION)
- {
- case 0: KickEx(id, SERVER, "Max Warnings Reached ("#MAX_WARNINGS"/"#MAX_WARNINGS")");
- case 1: BanEx2(id, SERVER, "Max Warnings Reached ("#MAX_WARNINGS"/"#MAX_WARNINGS")");
- }
- }
- SendAdminCommand(playerid, "warn");
- return 1;
- }
- }
- else return 0;
- }
- CMD:warnall(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /warnall (reason)");
- if(params[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 50 characters.");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- UpdatePVarInt(i, "Warnings", 1);
- SendMSG(i, COLOUR_INFO, "Administrator %s (%d) has given you a warning. Total warnings: %d/"#MAX_WARNINGS". Reason: %s.", pNick(playerid), playerid, GetPVarInt(i, "Warnings"), params);
- if(GetPVarInt(i, "Warnings") == MAX_WARNINGS)
- {
- switch(WARN_ACTION)
- {
- case 0: KickEx(i, SERVER, "Max Warnings Reached ("#MAX_WARNINGS"/"#MAX_WARNINGS")");
- case 1: BanEx2(i, SERVER, "Max Warnings Reached ("#MAX_WARNINGS"/"#MAX_WARNINGS")");
- }
- }
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've given all non-administrators on the server a warning (%d players). Reason: %s.", count, params);
- SendAdminCommand(playerid, "warnall");
- return 1;
- }
- }
- else return 0;
- }
- CMD:clearallwarnings(playerid, params[])
- {
- #pragma unused params
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new count;
- foreach(Player, i)
- {
- if(GetPVarType(i, "Warnings") == PLAYER_VARTYPE_NONE || IsAdmin(i)) continue;
- DeletePVar(i, "Warnings");
- SendMSG(i, COLOUR_INFO, "Administrator %s (%d) has removed all your warnings.", pNick(playerid), playerid);
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've removed the warnings for all non-administrators (%d in total).", count);
- SendAdminCommand(playerid, "clearallwarnings");
- return 1;
- }
- else return 0;
- }
- CMD:clearwarnings(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /clearwarnings (nick/id)");
- if(GetPVarType(id, "Warnings") == PLAYER_VARTYPE_NONE) return SendClientMessage(playerid, COLOUR_ERROR, "This player do not have any warnings to clear.");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- DeletePVar(id, "Warnings");
- SendMSG(id, COLOUR_INFO, "Administrator %s (%d) has removed all your warnings.", pNick(playerid), playerid);
- SendMSG(playerid, COLOUR_INFO, "You've removed %s's (%d) warnings.", pNick(id), id);
- SendAdminCommand(playerid, "clearwarnings");
- return 1;
- }
- }
- else return 0;
- }
- CMD:mute(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id, reason[51], seconds;
- if(sscanf(params, "uD(0)S(No Reason Specified)[50]", id, seconds, reason)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /mute (nick/id) (optional: seconds - enter 0 for unlimited) (optional: reason)");
- if(reason[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 50 characters.");
- if(seconds < 0) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid time input. The time can not be negative. Enter 0 for unlimited time.");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- MuteTime[id][0] = GetTickCount(), MuteTime[id][1] = seconds;
- SetPVarInt(id, "Muted", 1);
- SendMSG(id, COLOUR_INFO, "Administrator %s (%d) has muted you. Reason: %s.", pNick(playerid), playerid, reason);
- SendMSG(playerid, COLOUR_INFO, "You've muted %s (%d). Reason: %s.", pNick(id), id, reason);
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "13"ADMIN_MUTE"", pNick(id), id, reason);
- #endif
- SendMSGToAll(COLOUR_ADMIN, ADMIN_MUTE, pNick(id), id, reason);
- SendAdminCommand(playerid, "mute");
- return 1;
- }
- }
- else return 0;
- }
- CMD:unmute(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /unmute (nick/id)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- MuteTime[id][1] = 0;
- SendMSG(id, COLOUR_INFO, "Administrator %s (%d) has unmuted you.", pNick(playerid), playerid);
- SendMSG(playerid, COLOUR_INFO, "You've unmuted %s (%d).", pNick(id), id);
- DeletePVar(id, "Muted");
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "13"ADMIN_UNMUTE"", pNick(id), id);
- #endif
- SendMSGToAll(COLOUR_ADMIN, ADMIN_UNMUTE, pNick(id), id);
- SendAdminCommand(playerid, "unmute");
- return 1;
- }
- }
- else return 0;
- }
- CMD:muteall(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new reason[51], seconds;
- if(sscanf(params, "D(0)S(No Reason Specified)[50]", seconds, reason)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /muteall (optional: seconds - enter 0 for unlimited) (optional: reason)");
- if(reason[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 50 characters.");
- if(seconds < 0) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid time input. The time can not be negative. Enter 0 for unlimited time.");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- MuteTime[i][0] = GetTickCount(), MuteTime[i][1] = seconds;
- SetPVarInt(i, "Muted", 1);
- SendMSG(i, COLOUR_INFO, "Administrator %s (%d) has muted you. Reason: %s.", pNick(playerid), playerid, reason);
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've muted all non-administrators (%d in total). Reason: %s.", count, reason);
- SendAdminCommand(playerid, "muteall");
- return 1;
- }
- }
- else return 0;
- }
- CMD:unmuteall(playerid, params[])
- {
- #pragma unused params
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i) || GetPVarInt(i, "Muted") == PLAYER_VARTYPE_NONE) continue;
- MuteTime[i][1] = 0;
- SetPVarInt(i, "Muted", 1);
- SendMSG(i, COLOUR_INFO, "Administrator %s (%d) has unmuted you.", pNick(playerid), playerid);
- }
- SendMSG(playerid, COLOUR_INFO, "You've unmuted all non-administrators (%d in total).", count);
- SendAdminCommand(playerid, "unmuteall");
- return 1;
- }
- else return 0;
- }
- CMD:godmode(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new amount = strval(params);
- if(isnull(params) || (amount != 0 && amount != 1)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /godmode (toggle: 0/1)");
- if(GodMode{playerid} == amount)
- {
- SendMSG(playerid, COLOUR_ERROR, "You have already %s godmode.", Answer(amount, "enabled", "disabled"));
- return 0;
- }
- else
- {
- switch(amount)
- {
- case 0: SendClientMessage(playerid, COLOUR_INFO, "Godmode disabled. Type /godmode 1 to enable it.");
- case 1: SendClientMessage(playerid, COLOUR_INFO, "Godmode enabled. Type /godmode 0 to disable it.");
- }
- GodMode{playerid} = amount;
- SendAdminCommand(playerid, "godmode");
- return 1;
- }
- }
- else return 0;
- }
- CMD:disarm(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id, reason[51], seconds;
- if(sscanf(params, "uD(0)S(No Reason Specified)[50]", id, seconds, reason)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /disarm (nick/id) (optional: seconds - enter 0 for unlimited) (optional: reason)");
- if(reason[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 50 characters.");
- if(seconds < 0) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid time input. The time can not be negative. Enter 0 for unlimited time.");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- DisarmTime[id][0] = GetTickCount(), DisarmTime[id][1] = seconds;
- SendMSG(id, COLOUR_INFO, "Administrator %s (%d) has disarmed you. Reason: %s.", pNick(playerid), playerid, reason);
- SendMSG(playerid, COLOUR_INFO, "You've disarmed %s (%d). Reason: %s.", pNick(id), id, reason);
- IsDisarmed{id} = 1;
- SendAdminCommand(playerid, "disarm");
- return 1;
- }
- }
- else return 0;
- }
- CMD:disarmall(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new reason[51], seconds;
- if(sscanf(params, "D(0)S(No Reason Specified)[50]", seconds, reason)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /disarmall (optional: seconds - enter 0 for unlimited) (optional: reason)");
- if(reason[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 50 characters.");
- if(seconds < 0) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid time input. The time can not be negative. Enter 0 for unlimited time.");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- DisarmTime[i][0] = GetTickCount(), DisarmTime[i][1] = seconds;
- SendMSG(i, COLOUR_INFO, "Administrator %s (%d) has disarmed you. Reason: %s.", pNick(playerid), playerid, reason);
- IsDisarmed{i} = 1;
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've disarmed all non-administrators (%d in total). Reason: %s.", count, reason);
- SendAdminCommand(playerid, "disarmall");
- return 1;
- }
- }
- else return 0;
- }
- CMD:dedisarmall(playerid, params[])
- {
- #pragma unused params
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i) || !IsDisarmed{i}) continue;
- DisarmTime[i][1] = 0;
- SendMSG(i, COLOUR_INFO, "Administrator %s (%d) have de-disarmed you.", pNick(playerid), playerid);
- IsDisarmed{i} = 0;
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've de-disarmed all non-administrators (%d in total).", count);
- SendAdminCommand(playerid, "dedisarmall");
- return 1;
- }
- else return 0;
- }
- CMD:dedisarm(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /dedisarm (nick/id)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- DisarmTime[id][1] = 0;
- SendMSG(id, COLOUR_INFO, "Administrator %s (%d) have de-disarmed you.", pNick(playerid), playerid);
- SendMSG(playerid, COLOUR_INFO, "You've de-disarmed %s (%d).", pNick(id), id);
- IsDisarmed{id} = 0;
- SendAdminCommand(playerid, "dedisarm");
- return 1;
- }
- }
- else return 0;
- }
- CMD:giveweapon(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id, weapon[21], ammo;
- if(sscanf(params, "us[20]d", id, weapon, ammo)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /giveweapon (nick/id) (weapon name) (ammo)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- if(GetWeaponIDFromName(weapon) == -1) return SendClientMessage(playerid, COLOUR_ERROR, "Multiple weapon mames found. Please be more specific.");
- if(GetWeaponIDFromName(weapon) == -2 || weapon[20]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid weapon name.");
- else
- {
- switch(GetWeaponIDFromName(weapon))
- {
- case 1, 10..13, 17..18, 35..39, 42..45:
- {
- switch(IsAdmin(id))
- {
- case 0: return SendClientMessage(playerid, COLOUR_ERROR, "You can not give this weapon to this player.");
- case 1: GivePlayerWeapon(id, GetWeaponIDFromName(weapon), ammo);
- }
- }
- default:
- {
- GivePlayerWeapon(id, GetWeaponIDFromName(weapon), ammo);
- }
- }
- new weapname[32];
- GetWeaponName(GetWeaponIDFromName(weapon), weapname, sizeof(weapname));
- SendMSG(id, COLOUR_INFO, "Administrator %s (%d) has given you a %s (ID: %d) with %d ammo.", pNick(playerid), playerid, weapname, GetWeaponIDFromName(weapname), ammo);
- SendMSG(playerid, COLOUR_INFO, "You've given %s (%d) a %s (ID: %d) with %d ammo.", pNick(id), id, weapname, GetWeaponIDFromName(weapname), ammo);
- SendAdminCommand(playerid, "giveweapon");
- }
- return 1;
- }
- else return 0;
- }
- CMD:giveallweapon(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new weapon[21], ammo;
- if(sscanf(params, "s[20]d", weapon, ammo)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /giveweapon (weapon name) (ammo)");
- if(GetWeaponIDFromName(weapon) == -1) return SendClientMessage(playerid, COLOUR_ERROR, "Multiple weapon mames found. Please be more specific.");
- if(GetWeaponIDFromName(weapon) == -2 || weapon[20]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid weapon name.");
- else
- {
- switch(GetWeaponIDFromName(weapon))
- {
- case 1, 10..13, 17..18, 35..39, 42..45:
- {
- foreach(Player, i)
- {
- switch(IsAdmin(i))
- {
- case 1: GivePlayerWeapon(i, GetWeaponIDFromName(weapon), ammo);
- }
- }
- }
- default:
- {
- foreach(Player, i)
- {
- GivePlayerWeapon(i, GetWeaponIDFromName(weapon), ammo);
- }
- }
- }
- new weapname[32];
- GetWeaponName(GetWeaponIDFromName(weapon), weapname, sizeof(weapname));
- SendMSGToAll(COLOUR_INFO, "Administrator %s (%d) has given everyone on the server a %s (ID: %d) with %d ammo.", pNick(playerid), playerid, weapname, GetWeaponIDFromName(weapname), ammo);
- SendAdminCommand(playerid, "giveallweapon");
- }
- return 1;
- }
- else return 0;
- }
- CMD:crash(playerid, params[])
- {
- if(IsAdminEx(playerid, 4))
- {
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /crash (nick/id)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[crash] 3%s (%d) crashed %s's (%d) game.", pNick(playerid), playerid, pNick(id), id);
- #endif
- SendMSG(playerid, COLOUR_INFO, "You've crashed %s's (%d) game.", pNick(id), id);
- ApplyAnimation(id, "GANG", "DRUGS_BUY", 10, 0, 0, 0, 0, (5 * 1000));
- SendAdminCommand(playerid, "crash");
- return 1;
- }
- }
- else return 0;
- }
- CMD:crashall(playerid, params[])
- {
- #pragma unused params
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- ApplyAnimation(i, "GANG", "DRUGS_BUY", 10, 0, 0, 0, 0, (5 * 1000));
- count++;
- }
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[crash] 3%s (%d) crashed all non-administrators game.", pNick(playerid), playerid);
- #endif
- SendMSG(playerid, COLOUR_INFO, "You've crashed the game for all non-administrators (%d in total).", count);
- SendAdminCommand(playerid, "crashall");
- return 1;
- }
- else return 0;
- }
- CMD:slap(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id, Float:amount, reason[51];
- if(sscanf(params, "uF(10.0)S(No Reason Specified)[50]", id, amount, reason)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /slap (nick/id) (optional: amount) (optional: reason)");
- if(reason[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 50 characters.");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- SetPlayerPos(id, GX(id), GY(id), (GZ(id) + amount));
- SendMSG(playerid, COLOUR_INFO, "You've slapped %s (%d). Reason: %s.", pNick(id), id, reason);
- SendMSG(id, COLOUR_INFO, "Administrator %s (%d) has slapped you. Reason: %s.", pNick(playerid), playerid, reason);
- SendAdminCommand(playerid, "slap");
- return 1;
- }
- }
- else return 0;
- }
- CMD:slapall(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- new Float:amount, reason[51];
- if(sscanf(params, "F(10.0)S(No Reason Specified)[50]", amount, reason)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /slapall (optional: amount) (optional: reason)");
- if(reason[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 50 characters.");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- SetPlayerPos(i, GX(i), GY(i), (GZ(i) + amount));
- SendMSG(i, COLOUR_INFO, "Administrator %s (%d) has slapped you. Reason: %s.", pNick(playerid), playerid, reason);
- count++;
- }
- SendMSG(playerid, COLOUR_INFO, "You've slapped all non-administrators (%d in total). Reason: %s.", count, reason);
- SendAdminCommand(playerid, "slapall");
- return 1;
- }
- }
- else return 0;
- }
- CMD:akill(playerid, params[])
- {
- if(IsAdminEx(playerid, 3))
- {
- new id, reason[51];
- if(sscanf(params, "uS(No Reason Specified)[50]", id, reason)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /akill (nick/id) (optional: reason)");
- if(reason[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 50 characters.");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- SetPlayerHealth(id, 0.00);
- SendMSG(id, COLOUR_INFO, "Administrator %s (%d) has admin-killed you. Reason: %s.", pNick(playerid), playerid, reason);
- SendMSG(playerid, COLOUR_INFO, "You've admin-killed %s (%d). Reason: %s.", pNick(id), id, reason);
- SendAdminCommand(playerid, "akill");
- return 1;
- }
- }
- else return 0;
- }
- CMD:akillall(playerid, params[])
- {
- if(IsAdminEx(playerid, ALL_CMDS_LVL))
- {
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /akillall (reason)");
- if(params[50]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 50 characters.");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- SetPlayerHealth(i, 0.00);
- SendMSG(i, COLOUR_INFO, "Administrator %s (%d) has admin-killed you. Reason: %s.", pNick(playerid), playerid, params);
- }
- SendMSG(playerid, COLOUR_INFO, "You've admin-killed all non-administrators (%d in total). Reason: %s.", count, params);
- SendAdminCommand(playerid, "akillall");
- return 1;
- }
- }
- else return 0;
- }
- CMD:up(playerid, params[])
- {
- new Float:amount = floatstr(params);
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /up (float: amount)");
- if(strval(params) <= 0.0) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid amount. Use /down instead.");
- return SetPlayerPosEx(playerid, GX(playerid), GY(playerid), (GZ(playerid) + amount));
- }
- CMD:down(playerid, params[])
- {
- new Float:amount = floatstr(params);
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /down (float: amount)");
- if(strval(params) <= 0.0) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid amount. Use /up instead.");
- return SetPlayerPosEx(playerid, GX(playerid), GY(playerid), (GZ(playerid) - amount));
- }
- CMD:north(playerid, params[])
- {
- new Float:amount = floatstr(params);
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /north (float: amount)");
- if(strval(params) <= 0.0) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid amount. Use /south intstead.");
- return SetPlayerPosEx(playerid, GX(playerid), (GY(playerid) + amount), GZ(playerid));
- }
- CMD:south(playerid, params[])
- {
- new Float:amount = floatstr(params);
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /south (float: amount)");
- if(strval(params) <= 0.0) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid amount. Use /north instead.");
- return SetPlayerPosEx(playerid, GX(playerid), (GY(playerid) - amount), GZ(playerid));
- }
- CMD:east(playerid, params[])
- {
- new Float:amount = floatstr(params);
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /east (float: amount)");
- if(strval(params) <= 0.0) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid amount. Use /west instead.");
- return SetPlayerPosEx(playerid, (GX(playerid) + amount), GY(playerid), GZ(playerid));
- }
- CMD:west(playerid, params[])
- {
- new Float:amount = floatstr(params);
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /west (float: amount)");
- if(amount <= 0.0) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid amount. Use /east instead.");
- return SetPlayerPosEx(playerid, (GX(playerid) - amount), GY(playerid), GZ(playerid));
- }
- CMD:goto(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /goto (nick/id)");
- if(GetPVarType(playerid, "Spawned") == PLAYER_VARTYPE_NONE) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_SPAWNED1);
- if(!IsPlayerConnected(id) || (IsPlayerNPC(id) && IsPlayerAdmin(playerid))) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(GetPVarType(id, "Spawned") == PLAYER_VARTYPE_NONE) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_SPAWNED2);
- if(id == playerid) return SendClientMessage(playerid, COLOUR_ERROR, E_CANT_USE_ON_YOURSELF);
- else
- {
- new interior = GetPlayerInterior(id), world = GetPlayerVirtualWorld(id), vehicleid = GetPlayerVehicleID(playerid), Float:Pos[3];
- GetPlayerPos(id, Pos[0], Pos[1], Pos[2]), SetPlayerVirtualWorld(playerid, world), SetPlayerInterior(playerid, interior);
- switch(IsPlayerInAnyVehicle(playerid))
- {
- case 0: SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- case 1: SetVehiclePos(vehicleid, Pos[0], Pos[1], (Pos[2] + 2)), LinkVehicleToInterior(vehicleid, interior), SetVehicleVirtualWorld(vehicleid, world);
- }
- SendAdminCommand(playerid, "goto");
- }
- return 1;
- }
- else return 0;
- }
- CMD:gotop(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /getp (nick/id)");
- if(GetPVarType(playerid, "Spawned") == PLAYER_VARTYPE_NONE) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_SPAWNED1);
- if(GetPVarType(id, "Spawned") == PLAYER_VARTYPE_NONE) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_SPAWNED2);
- if(!IsPlayerConnected(id) || (IsPlayerNPC(id) && IsPlayerAdmin(playerid))) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(id == playerid) return SendClientMessage(playerid, COLOUR_ERROR, E_CANT_USE_ON_YOURSELF);
- else
- {
- new Float:Pos[3];
- GetPlayerPos(id, Pos[0], Pos[1], Pos[2]);
- SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
- SetPlayerInterior(playerid, GetPlayerInterior(id));
- SendAdminCommand(playerid, "gotop");
- }
- return 1;
- }
- else return 0;
- }
- CMD:gotopos(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new Float:Pos[3];
- if(sscanf(params, "fff", Pos[0], Pos[1], Pos[2])) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /gotopos (X) (Y) (Z)");
- if(GetPVarType(playerid, "Spawned") == PLAYER_VARTYPE_NONE) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_SPAWNED1);
- else
- {
- switch(IsPlayerInAnyVehicle(playerid))
- {
- case 0: SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- case 1: SetVehiclePos(playerid, Pos[0], Pos[1], Pos[2]);
- }
- SendAdminCommand(playerid, "gotopos");
- }
- return 1;
- }
- else return 0;
- }
- CMD:get(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /get (nick/id)");
- if(GetPVarType(playerid, "Spawned") == PLAYER_VARTYPE_NONE) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_SPAWNED1);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(GetPVarType(id, "Spawned") == PLAYER_VARTYPE_NONE) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_SPAWNED2);
- if(!IsPlayerConnected(id) || IsPlayerNPC(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- if(id == playerid) return SendClientMessage(playerid, COLOUR_ERROR, E_CANT_USE_ON_YOURSELF);
- else
- {
- new Float:Pos[3], vehicleid = GetPlayerVehicleID(id), interior = GetPlayerInterior(playerid), world = GetPlayerVirtualWorld(playerid);
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]), SetPlayerVirtualWorld(id, world), SetPlayerInterior(id, interior);
- switch(IsPlayerInAnyVehicle(id))
- {
- case 0: SetPlayerPos(id, Pos[0], Pos[1], Pos[2]);
- case 1: SetVehiclePos(vehicleid, Pos[0], Pos[1], (Pos[2] + 2)), LinkVehicleToInterior(vehicleid, interior), SetVehicleVirtualWorld(vehicleid, world);
- }
- SendAdminCommand(playerid, "get");
- return 1;
- }
- }
- else return 0;
- }
- CMD:getp(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /getp (nick/id)");
- if(GetPVarType(playerid, "Spawned") == PLAYER_VARTYPE_NONE) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_SPAWNED1);
- if(GetPVarType(id, "Spawned") == PLAYER_VARTYPE_NONE) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_SPAWNED2);
- if(!IsPlayerConnected(id) || IsPlayerNPC(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(id == playerid) return SendClientMessage(playerid, COLOUR_ERROR, E_CANT_USE_ON_YOURSELF);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- else
- {
- new Float:Pos[3];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- SetPlayerPos(id, Pos[0], Pos[1], Pos[2]);
- SetPlayerVirtualWorld(id, GetPlayerVirtualWorld(playerid));
- SetPlayerInterior(id, GetPlayerInterior(playerid));
- SendAdminCommand(playerid, "getp");
- }
- return 1;
- }
- else return 0;
- }
- CMD:send(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id, id2;
- if(sscanf(params, "uu", id, id2)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /send (player 1) (player 2)");
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(GetPVarType(id, "Spawned") == PLAYER_VARTYPE_NONE) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_SPAWNED2);
- if(!IsPlayerConnected(id) || IsPlayerNPC(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(id2 == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(id == playerid || id2 == playerid) return SendClientMessage(playerid, COLOUR_ERROR, E_CANT_USE_ON_YOURSELF);
- else
- {
- new vehicleid = GetPlayerVehicleID(id), interior = GetPlayerInterior(id2), world = GetPlayerVirtualWorld(id2), Float:Pos[3];
- GetPlayerPos(id2, Pos[0], Pos[1], Pos[2]), SetPlayerVirtualWorld(id, world), SetPlayerInterior(id, interior);
- switch(IsPlayerInAnyVehicle(id))
- {
- case 0: SetPlayerPos(id, Pos[0], Pos[1], Pos[2]);
- case 1: SetVehiclePos(vehicleid, Pos[0], Pos[1], (Pos[2]+3)), LinkVehicleToInterior(vehicleid, interior), SetVehicleVirtualWorld(vehicleid, world);
- }
- SendAdminCommand(playerid, "send");
- return 1;
- }
- }
- else return 0;
- }
- CMD:sendp(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id, id2;
- if(sscanf(params, "uu", id, id2)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /sendp (player 1) (player 2)");
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(GetPVarType(id, "Spawned") == PLAYER_VARTYPE_NONE) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_SPAWNED2);
- if(!IsPlayerConnected(id) || IsPlayerNPC(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(id2 == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(id == playerid || id2 == playerid) return SendClientMessage(playerid, COLOUR_ERROR, E_CANT_USE_ON_YOURSELF);
- else
- {
- new Float:Pos[3];
- GetPlayerPos(id2, Pos[0], Pos[1], Pos[2]);
- SetPlayerPos(id, Pos[0], Pos[1], Pos[2]);
- SetPlayerVirtualWorld(id, GetPlayerVirtualWorld(id2));
- SetPlayerInterior(id, GetPlayerInterior(id2));
- SendAdminCommand(playerid, "sendp");
- }
- return 1;
- }
- else return 0;
- }
- CMD:amsg(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /amsg (message)");
- if(params[80]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 80 characters.");
- else
- {
- foreach(Player, i)
- {
- if(!IsAdmin(i)) continue;
- SendMSG(i, COLOUR_INFO, "(Admin Message: %s): %s", pNick(playerid), params);
- }
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "5(Admin Message: %s): %s", pNick(playerid), params);
- #endif
- return 1;
- }
- }
- else return 0;
- }
- CMD:text(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new seconds, msg[350];
- if(sscanf(params, "ds[250]", seconds, msg)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /text (seconds) (message) - Use /texthelp for more help and information.");
- if(msg[250]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 250 characters.");
- if(seconds < 1) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid time input. The time can not be below 1.");
- if(strfind(msg, "~") != -1) return SendClientMessage(playerid, COLOUR_ERROR, "Illegal character (~) found in the announcement message. Use /texthelp for more help.");
- else
- {
- new GiantString[301], tcount = GetTickCount();
- format(GiantString, sizeof(GiantString), "%s", CheckForTextdrawColours(msg));
- if(strlen(params) < 300)
- {
- foreach(Player, i)
- {
- TDTime[i][0] = tcount, TDTime[i][1] = seconds;
- TextDrawSetString(AnnouncementTextdraw[i], GiantString);
- ShowAnnouncementTDForPlayer(i);
- }
- }
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "7>> Admin Announce for %d seconds: %s", seconds, DeleteTextdrawColours(msg));
- #endif
- SendAdminCommand(playerid, "text");
- }
- return 1;
- }
- else return 0;
- }
- CMD:textp(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id, seconds, msg[350];
- if(sscanf(params, "uds[250]", id, seconds, msg)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /text (nick/id) (seconds) (message) - Use /texthelp for more help and information.");
- if(msg[250]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 250 characters.");
- if(seconds < 1) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid time input. The time can not be below 1.");
- if(strfind(msg, "~") != -1) return SendClientMessage(playerid, COLOUR_ERROR, "Illegal character (~) found in the announcement message. Use /texthelp for more help.");
- else
- {
- format(msg, sizeof(msg), "%s", CheckForTextdrawColours(msg));
- if(!msg[349])
- {
- TDTime[id][0] = GetTickCount(), TDTime[id][1] = seconds;
- TextDrawSetString(AnnouncementTextdraw[id], msg);
- ShowAnnouncementTDForPlayer(id);
- }
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[player announce] 3%s (%d) for user %s (%d) for %d seconds: %s", pNick(playerid), playerid, pNick(id), id, seconds, DeleteTextdrawColours(msg));
- #endif
- SendAdminCommand(playerid, "textp");
- }
- return 1;
- }
- else return 0;
- }
- CMD:texthelp(playerid, params[])
- {
- #pragma unused params
- if(IsAdminEx(playerid, 1))
- {
- CMDSString = "";
- strcat(CMDSString, ""DC_TD_BLUE"$cb - blue\n"DC_TD_PURPLE"$cp - purple\n"DC_TD_RED"$cr - red\n"DC_TD_GREEN"$cg - green\n"DC_TD_WHITE"$cw - white\n"DC_TD_YELLOW"$cy - yellow\n"DC_DIALOG"$cl - black\n");
- strcat(CMDSString, "$cn (new Line)\n$ch (make colour lighter)\n");
- strcat(CMDSString, ""DC_TD_ARROW"$cu (arrow up)\n$cd (arrow down)\n$< (arrow left)\n$> (arrow right)");
- ShowPlayerDialog(playerid, GA_INFOMENU, DIALOG_STYLE_MSGBOX, GA_DC_HEADER, CMDSString, "Close", "");
- return 1;
- }
- else return 0;
- }
- #define DC_TD_BLUE "{2B346E}"
- #define DC_TD_PURPLE "{925FDA}"
- #define DC_TD_GREEN "{2F5A26}"
- #define DC_TD_BLACK "{000000}"
- #define DC_TD_RED "{9C1619}"
- #define DC_TD_YELLOW "{C4A656}"
- #define DC_TD_WHITE "{C3C3C3}"
- #define DC_TD_ARROW "{6B696B}"
- CMD:vehicle(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new tmp[50], colour[2], Float:Angle;
- if(sscanf(params, "s[50]D(-1)D(-1)", tmp, colour[0], colour[1])) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /vehicle (modelid/name) (optional: colour 1) (optional: colour 2)");
- else
- {
- new modelid = GetVehicleModelIDFromName(tmp);
- GetPlayerFacingAngle(playerid, Angle);
- new veh = CreateVehicle(modelid, (GX(playerid) + 2), GY(playerid), GZ(playerid), Angle, colour[0], colour[1], -1);
- LinkVehicleToInterior(veh, GetPlayerInterior(playerid)), SetVehicleVirtualWorld(veh, GetPlayerVirtualWorld(playerid));
- SendMSG(playerid, COLOUR_INFO, "You've spawned a %s (ID: %d. Colours: %d and %d). Use /destroyvehicle to destroy a vehicle.", GetModelIDName(modelid), modelid, colour[0], colour[1]);
- SendAdminCommand(playerid, "vehicle");
- }
- return 1;
- }
- else return 0;
- }
- CMD:destroyvehicle(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new vehicleid = strval(params);
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /destroyvehicle (vehicle ID)");
- if(vehicleid < 1 || vehicleid >= MAX_VEHICLES || GetVehicleModel(vehicleid) == 0) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid vehicle ID.");
- else
- {
- DestroyVehicle(vehicleid);
- SendMSG(playerid, COLOUR_INFO, "You've destroyed vehicle ID %d.", vehicleid);
- SendAdminCommand(playerid, "destroyvehicle");
- }
- return 1;
- }
- else return 0;
- }
- CMD:removecar(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /removecar (nick/id)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, COLOUR_ERROR, "This player is not in a vehicle.");
- else
- {
- SetPlayerPos(id, GX(id), GY(id), (GZ(id) + 5));
- SendMSG(playerid, COLOUR_INFO, "You've ejected %s (%d) from his vehicle.", pNick(id), id);
- SendAdminCommand(playerid, "removecar");
- }
- return 1;
- }
- else return 0;
- }
- CMD:asay(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /amsg (message)");
- if(params[80]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 80 characters.");
- else
- {
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "13Administrator %s: %s", pNick(playerid), params);
- #endif
- SendMSGToAll(COLOUR_INFO, "Administrator %s: %s", pNick(playerid), params);
- return 1;
- }
- }
- else return 0;
- }
- CMD:report(playerid, params[])
- {
- new id, reason[61];
- if(sscanf(params, "us[60]", id, reason)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /report (nick/id) (reason)");
- if(reason[60]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 60 characters.");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- else
- {
- new log[128];
- format(log, sizeof(log), "Player complaint recieved from %s (%d) about %s (%d): %s.", pNick(playerid), playerid, pNick(id), id, reason);
- SaveLog("/MAdmin/Logs/Reports.txt", log);
- foreach(Player, i)
- {
- if(!IsAdmin(i)) continue;
- SendClientMessage(i, COLOUR_ADMIN, log);
- }
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "13Player complaint recieved from %s (%d) about %s (%d): %s.", pNick(playerid), playerid, pNick(id), id, reason);
- SendMSG(playerid, COLOUR_INFO, "Your report about %s (%d) has been sent to all online administrators, echoed to IRC and saved to a log file.", pNick(id), id);
- #else
- SendMSG(playerid, COLOUR_INFO, "Your report about %s (%d) has been sent to all online administrators and saved to a log file.", pNick(id), id);
- #endif
- }
- return 1;
- }
- #if defined GA_USE_IRC
- CMD:irc(playerid, params[])
- {
- if(isnull(params)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /irc (message)");
- if(strlen(params) > 80) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 80 characters.");
- else
- {
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "5Message from %s (%d) in-game: %s", pNick(playerid), playerid, params);
- SendClientMessage(playerid, COLOUR_INFO, "Your message has been sent to IRC (channel: "IRC_ECHO_CHANNEL").");
- }
- return 1;
- }
- CMD:ircpm(playerid, params[])
- {
- new user[31], msg[61];
- if(sscanf(params, "s[30]s[60]", user, msg)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /ircpm (user) (message)");
- if(user[30] || (!IRC_IsUserOnChannel(ReturnRandomBotID(), IRC_ECHO_CHANNEL, user) && !IRC_IsUserOnChannel(ReturnRandomBotID(), IRC_CHANNEL, user) && !IRC_IsUserOnChannel(ReturnRandomBotID(), IRC_ADMIN_ECHO_CHANNEL, user))) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid user. There is no user connected to IRC with that name.");
- if(msg[60]) return SendClientMessage(playerid, COLOUR_ERROR, "Invalid length. The length must be between 1 and 60 characters.");
- else
- {
- IRC_GroupNoticeEx(gGroupID, user, "5PM from %s (%d) in-game: %s", pNick(playerid), playerid, msg);
- SendMSG(playerid, COLOUR_INFO, "Your message has been sent to %s on IRC.", user);
- }
- return 1;
- }
- #endif
- CMD:jetpack(playerid, params[])
- {
- #pragma unused params
- if(IsAdminEx(playerid, 1))
- {
- switch(GetPlayerSpecialAction(playerid))
- {
- case 0, 1, 3..23: SetPlayerSpecialAction(playerid, 2), SendClientMessage(playerid, COLOUR_INFO, "Jetpack enabled. Type /jetpack to take it off.");
- case 2: SetPlayerSpecialAction(playerid, 0), SendClientMessage(playerid, COLOUR_INFO, "Jetpack disabled.");
- }
- return 1;
- }
- else return 0;
- }
- CMD:clearchat(playerid, params[])
- {
- #pragma unused params
- if(IsAdminEx(playerid, 2))
- {
- ClearChat();
- SendAdminCommand(playerid, "clearchat");
- return 1;
- }
- else return 0;
- }
- CMD:listweapons(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id, slot, ammo, weap, Count, WeapName[30], WeapSTR[256], weapons[50], string[60];
- WeapSTR = ""DC_ADMIN"Weapon\t\tAmmo\n\n";
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /listweapons (nick/id)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- for(slot = 1; slot < 13; slot++)
- {
- GetPlayerWeaponData(id, slot, weap, ammo);
- {
- if(ammo != 0)
- {
- Count++;
- }
- }
- }
- if(Count == 0) return SendClientMessage(playerid, COLOUR_ERROR, "This player has no weapons.");
- if(Count >= 1)
- {
- for(slot = 1; slot < 13; slot++)
- {
- GetPlayerWeaponData(id, slot, weap, ammo);
- if(ammo > 0)
- {
- GetWeaponName(weap, WeapName, sizeof(WeapName));
- if(ammo == 65535 || ammo == 1)
- {
- format(weapons, sizeof(weapons), ""DC_INFO"%s"DC_DIALOG"\t\t(1)\n", WeapName);
- strcat(WeapSTR, weapons);
- }
- else
- { if(slot != 4 && slot != 5 && slot != 3)
- {
- format(weapons, sizeof(weapons), ""DC_INFO"%s"DC_DIALOG"\t\t(%d)\n", WeapName, ammo);
- strcat(WeapSTR, weapons);
- }
- if(slot == 4 && slot == 5 && slot != 3)
- {
- format(weapons, sizeof(weapons), ""DC_INFO"%s"DC_DIALOG"\t\t\t(%d)\n", WeapName, ammo);
- strcat(WeapSTR, weapons);
- }
- if(slot == 3)
- {
- format(weapons, sizeof(weapons), ""DC_INFO"%s"DC_DIALOG"\t(%d)\n", WeapName, ammo);
- strcat(WeapSTR, weapons);
- }
- }
- }
- format(string, sizeof(string), ""DC_INFO"%s"DC_DIALOG" (%d)'s Weapons:", pNick(id), id);
- ShowPlayerDialog(playerid, GA_INFOMENU, DIALOG_STYLE_MSGBOX, string, WeapSTR, "Close", "");
- }
- }
- }
- return 1;
- }
- else return 0;
- }
- CMD:getinfo(playerid, params[])
- {
- if(IsAdminEx(playerid, 1))
- {
- new id, filename[ACCOUNTPATH_LENGTH], Float:health[3], string[256];
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /getinfo (nick/id)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- if(IsHigherAdminLevel(playerid, id)) return SendClientMessage(playerid, COLOUR_ERROR, E_HIGHER_LEVEL);
- if(IsPlayerNPC(id) && GetPVarInt(playerid, "Level") < NPC_LEVEL_LIMIT) return SendClientMessage(playerid, COLOUR_ERROR, E_NPC);
- else
- {
- CMDSString = "";
- GetPlayerHealth(id, health[0]), GetPlayerArmour(id, health[1]), GetVehicleHealth(GetPlayerVehicleID(id), health[2]);
- format(filename, sizeof(filename), ACCOUNTPATH, UserFileName(pNick(id)));
- format(string, sizeof(string), ""DC_INFO"User:"DC_DIALOG" %s (%d)\n"DC_INFO"Admin Level:"DC_DIALOG" %d\n"DC_INFO"VIP Level:"DC_DIALOG" %d\n"DC_INFO"IP:"DC_DIALOG" %s\n"DC_INFO"Health:"DC_DIALOG" %0.2f\n"DC_INFO"Armour:"DC_DIALOG" %0.2f\n"DC_INFO"Vehicle Health:"DC_DIALOG" %0.2f\n", pNick(id), id, GetPVarInt(id, "Level"), GetPVarInt(id, "VIP"), GetPlayerIpEx(id), health[0], health[1], health[2]);
- strcat(CMDSString, string);
- format(string, sizeof(string), ""DC_INFO"Registered:"DC_DIALOG" %s\n"DC_INFO"Logged In:"DC_DIALOG" %s\n"DC_INFO"Money:"DC_DIALOG" $%d\n"DC_INFO"Score:"DC_DIALOG" %d\n"DC_INFO"Kills:"DC_DIALOG" %d\n"DC_INFO"Deaths:"DC_DIALOG" %d\n\nType "DC_INFO"/listweapons"DC_DIALOG" to list this players current weapons.",
- YesNo(fexist(filename)), YesNo(GetPVarInt(id, "LoggedIn")), GetPlayerMoney(id), GetPlayerScore(id), GetPVarInt(id, "Kills"), GetPVarInt(id, "Deaths"));
- strcat(CMDSString, string);
- ShowPlayerDialog(playerid, GA_INFOMENU, DIALOG_STYLE_MSGBOX, GA_DC_HEADER, CMDSString, "Close", "");
- return 1;
- }
- }
- else return 0;
- }
- CMD:stats(playerid, params[])
- {
- new id, time[3], string[256], kills, deaths, Float:kdr;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOUR_ERROR, "Usage: /stats (nick/id)");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_ERROR, E_NOT_CONNECTED);
- else
- {
- CMDSString = "";
- kills = GetPVarInt(id, "Kills"), deaths = GetPVarInt(id, "Deaths");
- switch(kills)
- {
- case 0: kdr = 0.00;
- default:
- {
- switch(deaths)
- {
- case 0: kdr = kills;
- default: kdr = kills / deaths;
- }
- }
- }
- time[2] = GetPVarInt(id, "DaysConnected"), time[1] = GetPVarInt(id, "HoursConnected"), time[0] = GetPVarInt(id, "MinutesConnected");
- format(string, sizeof(string), ""DC_INFO"User:"DC_DIALOG" %s (%d)\n"DC_INFO"Score:"DC_DIALOG" %d\n"DC_INFO"Money:"DC_DIALOG" $%d\n"DC_INFO"Kills:"DC_DIALOG" %d\n"DC_INFO"Deaths:"DC_DIALOG" %d\n", pNick(id), id, GetPlayerScore(id), GetPlayerMoney(id), GetPVarInt(id, "Kills"), GetPVarInt(id, "Deaths"));
- strcat(CMDSString, string);
- format(string, sizeof(string), ""DC_INFO"Kill/Death Ratio:"DC_DIALOG" %0.2f\n"DC_INFO"Time connected:"DC_DIALOG" %d day%s, %d hour%s and %d minute%s", kdr, time[2], AddS(time[2]), time[1], AddS(time[1]), time[0], AddS(time[0]));
- strcat(CMDSString, string);
- ShowPlayerDialog(playerid, GA_INFOMENU, DIALOG_STYLE_MSGBOX, GA_DC_HEADER, CMDSString, "Close", "");
- }
- return 1;
- }
- CMD:register(playerid, params[])
- {
- #pragma unused params
- if(GetPVarInt(playerid, "LoggedIn") == 1) return SendClientMessage(playerid, COLOUR_ERROR, "You're already registered and logged in.");
- if(IsRegistered(playerid))
- {
- ShowPlayerDialogEx(playerid, GA_LOGINMENU, DIALOG_STYLE_INPUT, GA_DC_HEADER, "Login", "Cancel", "This account ("DC_INFO"%s"DC_DIALOG") is registered.\nEnter the password for this account to login:", pNick(playerid));
- return 0;
- }
- else ShowPlayerDialogEx(playerid, GA_REGISTERMENU, DIALOG_STYLE_INPUT, GA_DC_HEADER, "Register", "Cancel", "You're about to create an account on "DC_INFO"%s"DC_DIALOG".\n\nEnter the password for your new account below:", SERVER_NAME);
- return 1;
- }
- CMD:login(playerid, params[])
- {
- #pragma unused params
- if(GetPVarInt(playerid, "LoggedIn") == 1) return SendClientMessage(playerid, COLOUR_ERROR, "You're already logged in.");
- if(!IsRegistered(playerid))
- {
- ShowPlayerDialogEx(playerid, GA_REGISTERMENU, DIALOG_STYLE_INPUT, GA_DC_HEADER, "Register", "Cancel", "You're about to create an account on "DC_INFO"%s"DC_DIALOG".\n\nEnter the password for your new account below:", SERVER_NAME);
- return 0;
- }
- else ShowPlayerDialogEx(playerid, GA_LOGINMENU, DIALOG_STYLE_INPUT, GA_DC_HEADER, "Login", "Cancel", "This account ("DC_INFO"%s"DC_DIALOG") is registered.\nEnter the password for this account to login:", pNick(playerid));
- return 1;
- }
- CMD:changepass(playerid, params[])
- {
- new buf[129], INI:file, filename[ACCOUNTPATH_LENGTH];
- if(GetPVarType(playerid, "LoggedIn") == PLAYER_VARTYPE_NONE) return SendClientMessage(playerid, COLOUR_ERROR, "You need to be logged in to use this command.");
- if(strlen(params) < GA_MIN_PASSWORD || strlen(params) > GA_MAX_PASSWORD) return SendClientMessage(playerid, COLOUR_ERROR, E_INVALID_PASSWORD_LENGTH);
- format(filename, sizeof(filename), ACCOUNTPATH, UserFileName(pNick(playerid)));
- WP_Hash(buf, sizeof(buf), params);
- file = INI_Open(filename);
- INI_WriteString(file, "PasswordHash", buf);
- INI_Close(file);
- PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
- SendMSG(playerid, COLOUR_INFO, "The password for your account (%s) has been successfully changed to \"%s\". Remember it for later use.", pNick(playerid), params);
- return 1;
- }
- //==============================================================================
- // Updating
- //==============================================================================
- function GA_Update()
- {
- //new connect;
- GA_Seconds++;
- if(GA_Seconds == 60)
- {
- GA_Seconds = 0;
- GA_Minutes++;
- if(GA_Minutes == 60)
- {
- GA_Minutes = 0;
- }
- }
- foreach(Player, i)
- {
- //connect = GetSecondsBetweenAction(GetPVarInt(i, "ConnectTime"));
- if(GA_Minutes == GA_MINUTES_BETWEEN_AUTOSAVE)
- {
- SavePlayerStats(i);
- }
- if(GetSecondsBetweenAction(FreezeTime[i][0]) >= FreezeTime[i][1] && FreezeTime[i][1] != 0)
- {
- SendClientMessage(i, COLOUR_INFO, "You've been automaticly unfrozen by the server.");
- TogglePlayerControllable(i, 1);
- FreezeTime[i][1] = 0;
- DeletePVar(i, "Frozen");
- }
- if(GetSecondsBetweenAction(CageTime[i][0]) >= CageTime[i][1] && CageTime[i][1] != 0)
- {
- SendClientMessage(i, COLOUR_INFO, "You've been automaticly uncaged by the server.");
- UncagePlayer(i);
- CageTime[i][1] = 0;
- DeletePVar(i, "Caged");
- }
- if(GetSecondsBetweenAction(DisarmTime[i][0]) >= DisarmTime[i][1] && DisarmTime[i][1] != 0)
- {
- SendClientMessage(i, COLOUR_INFO, "You've been automaticly dedisarmed by the server.");
- DisarmTime[i][1] = 0;
- IsDisarmed{i} = 0;
- DeletePVar(i, "Disarmed");
- }
- if(GetSecondsBetweenAction(MuteTime[i][0]) >= MuteTime[i][1] && MuteTime[i][1] != 0)
- {
- SendClientMessage(i, COLOUR_INFO, "You've been automaticly unmuted by the server.");
- MuteTime[i][1] = 0;
- DeletePVar(i, "Muted");
- }
- if(GetSecondsBetweenAction(TDTime[i][0]) >= TDTime[i][1] && TDTime[i][1] != 0)
- {
- if(GetPVarType(i, "AnnouncementTextdrawShown") == 1)
- {
- TDTime[i][1] = 0;
- TextDrawHideForPlayer(i, AnnouncementTextdraw[i]);
- DeletePVar(i, "AnnouncementTextdrawShown");
- }
- }
- if(GodMode{i} == 1)
- {
- SetPlayerHealth(i, 10000.00), SetPlayerArmour(i, 10000.00);
- if(IsPlayerInAnyVehicle(i))
- {
- new vehicleid = GetPlayerVehicleID(i);
- SetVehicleHealth(i, 100000.00), RepairVehicle(vehicleid);
- }
- }
- /*
- #if defined GA_MUST_LOGIN
- if(GetPVarType(i, "LoggedIn") == PLAYER_VARTYPE_NONE)
- {
- if(connect >= ((GA_TIME_FOR_MUST_LOGIN - 30) * 1000)) && MessageSent[i]{0} == 0)
- {
- new amount = (GA_TIME_FOR_MUST_LOGIN - 30);
- SendMSG(i, , "You must login within %d second%s or you will be kicked.", amount, AddS(amount));
- MessageSent[i]{0} = 1;
- }
- if(connect >= (GA_TIME_FOR_MUST_LOGIN * 1000))
- {
- KickEx(i, SERVER, "Failed To Login Within The Time Limit");
- continue;
- }
- }
- #endif
- #if defined GA_MUST_REGISTER
- if(!IsRegistered(i))
- {
- if(connect >= ((GA_TIME_FOR_MUST_REGISTER - 30) * 1000) && MessageSent[i]{1} == 0)
- {
- new amount = (GA_TIME_FOR_MUST_REGISTER - 30);
- SendMSG(i, COLOUR_INFO, "You must register within %d second%s or you will be kicked.", amount, AddS(amount));
- MessageSent[i]{1} = 1;
- }
- if(connect >= (GA_TIME_FOR_MUST_REGISTER * 1000))
- {
- KickEx(i, SERVER, "Failed To Register Within The Time Limit");
- continue;
- }
- }
- #endif
- */
- #if defined GA_HIGH_PING_KICK
- if(GetPlayerPing(i) > GA_MAX_PING && GetPlayerPing(i) != 65535)
- {
- KickEx(i, SERVER, "Ping Exceeding "#GA_MAX_PING"");
- continue;
- }
- #endif
- }
- return 1;
- }
- //==============================================================================
- // Internet Relay Chat (IRC)
- //==============================================================================
- #if defined GA_USE_IRC
- //==============================================================================
- //------------------------------------------------------------------------------
- // IRC Callbacks
- //------------------------------------------------------------------------------
- function IRC_RegisterDelay(botid)
- {
- new string[50];
- format(string, sizeof(string), "ns register %s %s", IRC_BOT_PASSWORD, IRC_BOT_EMAIL);
- IRC_SendRaw(botid, string);
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[bot register] 3attempting to register bot ID %d with the password \"%s\" and the e-mail \"%s\".", botid, IRC_BOT_PASSWORD, IRC_BOT_EMAIL);
- return 1;
- }
- public IRC_OnJoinChannel(botid, channel[])
- {
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[bot join] 3bot ID %d joined the channel %s.", botid, channel);
- return 1;
- }
- public IRC_OnLeaveChannel(botid, channel[], message[])
- {
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[bot leave] 3bot ID %d left the channel %s (%s).", botid, channel, message);
- return 1;
- }
- public IRC_OnConnect(botid, ip[], port)
- {
- new string[50];
- printf("[MAdmin - IRC] Bot ID %d connected (%d/"#IRC_MAX_BOTS") to %s (%d).", botid, botid, ip, port);
- IRC_JoinChannel(botid, IRC_CHANNEL);
- IRC_JoinChannel(botid, IRC_ECHO_CHANNEL);
- IRC_JoinChannel(botid, IRC_ADMIN_ECHO_CHANNEL);
- IRC_AddToGroup(gGroupID, botid);
- format(string, sizeof(string), "identify %s", IRC_BOT_PASSWORD);
- IRC_SendRaw(botid, string);
- return 1;
- }
- public IRC_OnDisconnect(botid, ip[], port, reason[])
- {
- printf("[MAdmin - IRC] Bot ID %d disconnected. Reason: %s.\nAttempting to reconnect to %s (%d)...", botid, reason, ip, port);
- gBotID{(botid-1)} = 0;
- IRC_RemoveFromGroup(gGroupID, botid);
- return 1;
- }
- public IRC_OnKickedFromChannel(botid, channel[], oppeduser[], oppedhost[], message[])
- {
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[bot kicked] 3bot ID %d was kicked from the channel %s by %s (%s). Reason: %s.", botid, channel, oppeduser, oppedhost, message);
- return 1;
- }
- public IRC_OnConnectAttemptFail(botid, ip[], port, reason[])
- {
- printf("[MAdmin - IRC] Bot ID %d failed to connect to %s (%d). Reason: %s.", botid, ip, port, reason);
- return 1;
- }
- #if defined GA_SAVE_LOGS
- public IRC_OnReceiveRaw(botid, message[])
- {
- strcat(message, "\n\r");
- SaveLog("/MAdmin/Logs/IRC Log.txt", message);
- return 1;
- }
- #endif
- //------------------------------------------------------------------------------
- // IRC Functions
- //------------------------------------------------------------------------------
- stock ReturnRandomBotID()
- {
- random_bot:
- new rand = random(IRC_MAX_BOTS);
- switch(gBotID{rand})
- {
- case 0: goto random_bot;
- default: return gBotID{rand};
- }
- return 0;
- }
- //------------------------------------------------------------------------------
- // IRC Commands
- //------------------------------------------------------------------------------
- IRCCMD:irccmds(botid, channel[], user[], host[], params[])
- {
- if(!strcmp(channel, IRC_ECHO_CHANNEL, true) || !strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) || !strcmp(channel, IRC_CHANNEL, true))
- {
- switch(IRC_IsVoice(botid, channel, user))
- {
- case 0: IRC_GroupNotice(gGroupID, user, "IRC commands: !stats !getname !getid !pm !players");
- case 1: IRC_GroupNotice(gGroupID, user, "IRC voice (+v) commands: !say !stats !getname !getid !pm !players");
- }
- if(IRC_IsHalfop(botid, channel, user))
- {
- IRC_GroupNotice(gGroupID, user, "IRC halfop (+h) commands: !vip !admins");
- }
- if(IRC_IsOp(botid, channel, user))
- {
- IRC_GroupNotice(gGroupID, user, "IRC op (+o) commands: !asay !amsg !getinfo !akill !slap !iban !tempban !ikick !(un)cage !(un)freeze !(un)mute !(de)disarm !warn !clearwarnings !giveweapon");
- }
- if(IRC_IsAdmin(botid, channel, user))
- {
- IRC_GroupNotice(gGroupID, user, "IRC admin (+a) commands: !ssay !crash");
- }
- if(IRC_IsOwner(botid, channel, user))
- {
- IRC_GroupNotice(gGroupID, user, "IRC owner (+q) commands: !rangeban !banall !kickall !(un)cageall !(un)freezeall !warnall !(un)muteall !clearallwarnings !(de)disarmall");
- IRC_GroupNotice(gGroupID, user, "IRC owner (+q) commands: !giveallweapon !crashall !botjoin !botleave !botregister !botidentify !toggle(all)cmd");
- }
- }
- return 1;
- }
- IRCCMD:getid(botid, channel[], user[], host[], params[])
- {
- new pName[MAX_PLAYER_NAME];
- if(isnull(params) || strlen(params) > MAX_PLAYER_NAME) return IRC_GroupNotice(gGroupID, user, "4Usage: !getid (name: 0-"#MAX_PLAYER_NAME" characters)");
- else
- {
- new count;
- CMDSString = "";
- foreach(Player, i)
- {
- GetPlayerName(i, pName, MAX_PLAYER_NAME);
- for(new j, k = (strlen(pName)-strlen(params)); j <= k; j++)
- {
- if(!strcmp(params, pName[j], true, strlen(params)))
- {
- format(CMDSString, sizeof(CMDSString), "%s%s (%d), ", CMDSString, pName, i);
- count++;
- break;
- }
- }
- }
- switch(strlen(CMDSString))
- {
- case 0: IRC_GroupSayEx(gGroupID, channel, "No matches for \"%s\".", params);
- default: IRC_GroupSayEx(gGroupID, channel, "Matches for \"%s\": %s", params, CMDSString);
- }
- }
- return 1;
- }
- IRCCMD:getname(botid, channel[], user[], host[], params[])
- {
- new id;
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "u", id)) return IRC_GroupNotice(gGroupID, user, "4Usage: !getname (nick/id)");
- if(!IsPlayerConnected(id)) return IRC_GroupNotice(gGroupID, user, "4Invalid Player!");
- IRC_GroupSayEx(gGroupID, channel, "02ID %d's name is %s", id, pNick(id));
- return 1;
- }
- IRCCMD:say(botid, channel[], user[], host[], params[])
- {
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(isnull(params) || strlen(params) > 60) return IRC_GroupNotice(gGroupID, user, "4Invalid length. The length must be between 1 and 60 characters.");
- if(!IRC_IsVoice(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need voice (+v) or above to use this command.");
- IRC_GroupSayEx(gGroupID, channel, "02*** %s on IRC (%s): %s", user, channel, params);
- SendMSGToAll(COLOUR_IRC, "*** %s on IRC (%s): %s", user, channel, params);
- return 1;
- }
- IRCCMD:pm(botid, channel[], user[], host[], params[])
- {
- new id, msg[61];
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "us[60]", id, msg)) return IRC_GroupNotice(gGroupID, user, "4Usage: !pm (nick/id) (message: 0-60 characters)");
- if(!IsPlayerConnected(id)) return IRC_GroupNotice(gGroupID, user, "4Invalid Player!");
- if(GetPVarInt(id, "NoPM") == 1) return IRC_GroupNotice(gGroupID, user, "4This player is currently not accepting PMs at the moment.");
- if(isnull(msg) || msg[60]) return IRC_GroupNotice(gGroupID, user, "4Invalid length. The length must be between 1 and 60 characters.");
- else
- {
- IRC_GroupSayEx(gGroupID, channel, "5PM sent to %s (%d): %s", pNick(id), id, msg);
- SendMSG(id, COLOUR_PM, "PM from %s on IRC (%s): %s", user, channel, msg);
- }
- return 1;
- }
- IRCCMD:ssay(botid, channel[], user[], host[], params[])
- {
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(isnull(params) || strlen(params) > 60) return IRC_GroupNotice(gGroupID, user, "4Invalid length. The length must be between 1 and 60 characters.");
- if(!IRC_IsAdmin(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need admin (+a) or above to use this command.");
- IRC_GroupSayEx(gGroupID, channel, "02*** Anonymous user on IRC (%s): %s", channel, params);
- SendMSGToAll(COLOUR_IRC, "*** Anonymous user on IRC (%s): %s", channel, params);
- return 1;
- }
- IRCCMD:asay(botid, channel[], user[], host[], params[])
- {
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(isnull(params) || strlen(params) > 60) return IRC_GroupNotice(gGroupID, user, "4Invalid length. The length must be between 1 and 60 characters.");
- if(!IRC_IsOp(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need op (+o) or above to use this command.");
- IRC_GroupSayEx(gGroupID, channel, "02*** Administrator %s on IRC (%s): %s", user, channel, params);
- SendMSGToAll(COLOUR_ADMIN, "*** Administrator %s on IRC (%s): %s", user, channel, params);
- return 1;
- }
- IRCCMD:vip(botid, channel[], user[], host[], params[])
- {
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(isnull(params) || strlen(params) > 60) return IRC_GroupNotice(gGroupID, user, "4Invalid length. The length must be between 1 and 60 characters.");
- if(!IRC_IsHalfop(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need halfop (+h) or above to use this command.");
- IRC_GroupSayEx(gGroupID, channel, "02*** VIP %s on IRC (%s): %s", user, channel, params);
- SendMSGToAll(COLOUR_IRC, "*** VIP %s on IRC (%s): %s", user, channel, params);
- return 1;
- }
- IRCCMD:amsg(botid, channel[], user[], host[], params[])
- {
- if(strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ADMIN_ECHO_CHANNEL".");
- if(isnull(params) || strlen(params) > 60) return IRC_GroupNotice(gGroupID, user, "4Invalid length. The length must be between 1 and 60 characters.");
- if(!IRC_IsOp(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need op (+o) or above to use this command.");
- foreach(Player, i)
- {
- if(!IsAdmin(i)) continue;
- SendMSG(i, COLOUR_INFO, "(Admin Message: %s): %s", user, params);
- }
- IRC_GroupSayEx(gGroupID, channel, "5(Admin Message: %s): %s", user, params);
- return 1;
- }
- IRCCMD:admins(botid, channel[], user[], host[], params[])
- {
- new count = 1;
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(!IRC_IsHalfop(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need halfop (+h) or above to use this command.");
- foreach(Player, i)
- {
- if(!IsAdmin(i)) continue;
- IRC_GroupNoticeEx(gGroupID, user, "9%d. 7%s 5(%d)", count, pNick(i), i);
- count++;
- }
- return 1;
- }
- IRCCMD:vips(botid, channel[], user[], host[], params[])
- {
- new count = 1;
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(!IRC_IsHalfop(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need halfop (+h) or above to use this command.");
- foreach(Player, i)
- {
- if(GetPVarType(i, "VIP") == PLAYER_VARTYPE_NONE) continue;
- IRC_GroupNoticeEx(gGroupID, user, "9%d. 7%s 5(%d)", count, pNick(i), i);
- count++;
- }
- return 1;
- }
- IRCCMD:players(botid, channel[], user[], host[], params[])
- {
- new count[3];
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- foreach(Player, i)
- {
- count[0]++;
- if(IsAdmin(i))
- {
- count[1]++;
- }
- if(GetPVarType(i, "VIP") >= 1)
- {
- count[2]++;
- }
- }
- IRC_GroupNoticeEx(gGroupID, user, "Total players online: %d (%d admin%s and %d VIP%s).", count[0], count[1], AddS(count[1]), count[2], AddS(count[2]));
- return 1;
- }
- IRCCMD:getinfo(botid, channel[], user[], host[], params[])
- {
- new id, filename[ACCOUNTPATH_LENGTH], Float:health[3];
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "u", id)) return IRC_GroupNotice(gGroupID, user, "4Usage: !getinfo (nick/id)");
- if(!IsPlayerConnected(id)) return IRC_GroupNotice(gGroupID, user, "4Invalid Player!");
- if(!IRC_IsOp(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need op (+o) or above to use this command.");
- else
- {
- GetPlayerHealth(id, health[0]), GetPlayerArmour(id, health[1]), GetVehicleHealth(GetPlayerVehicleID(id), health[2]);
- format(filename, sizeof(filename), ACCOUNTPATH, UserFileName(pNick(id)));
- IRC_GroupNoticeEx(gGroupID, user, "*** Player info for %s (%d) [IP: %s] ***", pNick(id), id, GetPlayerIpEx(id));
- IRC_GroupNoticeEx(gGroupID, user, "* Admin Level: %d. VIP Level: %d. Registered: %s. Logged In: %s. Money: $%d. Score: %d. Kills: %d. Deaths: %d.", GetPVarInt(id, "Level"), GetPVarInt(id, "VIP"), YesNo(fexist(filename)), YesNo(GetPVarInt(id, "LoggedIn")), GetPlayerMoney(id), GetPlayerScore(id), GetPVarInt(id, "Kills"), GetPVarInt(id, "Deaths"));
- IRC_GroupNoticeEx(gGroupID, user, "* Health: %0.2f. Armour: %0.2f. Vehicle Health: %0.2f.", health[0], health[1], health[2]);
- IRC_GroupSay(gGroupID, user, "* Use !listweapons to list this players current weapons.");
- }
- return 1;
- }
- IRCCMD:akill(botid, channel[], user[], host[], params[])
- {
- new id, reason[51];
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "uS(No Reason Specified)[50]", id, reason)) return IRC_GroupNotice(gGroupID, user, "4Usage: !akill (nick/id) (optional: reason)");
- if(reason[50]) return IRC_GroupNotice(gGroupID, user, "4Invalid length. The length must be between 1 and 50 characters.");
- if(!IsPlayerConnected(id)) return IRC_GroupNotice(gGroupID, user, "4Invalid Player!");
- if(!IRC_IsOp(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need op (+o) or above to use this command.");
- if(IsPlayerNPC(id) && !IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command on NPCs.");
- else
- {
- SetPlayerHealth(id, 0.00);
- SendMSG(id, COLOUR_INFO, "Administrator %s on IRC (%s) has admin-killed you. Reason: %s.", user, channel, reason);
- IRC_GroupNoticeEx(gGroupID, user, "You've admin-killed %s (%d). Reason: %s.", pNick(id), id, reason);
- }
- return 1;
- }
- IRCCMD:slap(botid, channel[], user[], host[], params[])
- {
- new id, Float:amount, reason[51];
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "uF(10.0)S(No Reason Specified)[50]", id, amount, reason)) return IRC_GroupNotice(gGroupID, user, "4Usage: !akill (nick/id) (optional: reason)");
- if(reason[50]) return IRC_GroupNotice(gGroupID, user, "4Invalid length. The length must be between 1 and 50 characters.");
- if(!IsPlayerConnected(id)) return IRC_GroupNotice(gGroupID, user, "4Invalid Player!");
- if(!IRC_IsOp(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need op (+o) or above to use this command.");
- if(IsPlayerNPC(id) && !IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command on NPCs.");
- else
- {
- SetPlayerPos(id, GX(id), GY(id), (GZ(id) + amount));
- SendMSG(id, COLOUR_INFO, "Administrator %s on IRC (%s) has slapped you. Reason: %s.", user, channel, reason);
- IRC_GroupNoticeEx(gGroupID, user, "You've slapped %s (%d). Reason: %s.", pNick(id), id, reason);
- }
- return 1;
- }
- IRCCMD:iban(botid, channel[], user[], host[], params[])
- {
- new id, reason[51], INI:file, filename[ACCOUNTPATH_LENGTH];
- if(!IRC_IsOp(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need op (+o) or above to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "uS(No Reason Specified)[50]", id, reason)) return IRC_GroupNotice(gGroupID, user, "4Usage: !iban (nick/id) (optional: reason)");
- if(reason[50]) return IRC_GroupNotice(gGroupID, user, "4Invalid length. The length must be between 1 and 50 characters.");
- if(!IsPlayerConnected(id)) return IRC_GroupNotice(gGroupID, user, "4Invalid Player!");
- if(IsPlayerNPC(id) && !IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command on NPCs.");
- else
- {
- format(filename, sizeof(filename), ACCOUNTPATH, UserFileName(pNick(id)));
- if(fexist(filename))
- {
- file = INI_Open(filename);
- INI_WriteInt(file, "Banned", 1);
- INI_Close(file);
- }
- IRC_GroupNoticeEx(gGroupID, user, "You've banned %s (%d). Reason: %s.", pNick(id), id, reason);
- BanEx2(id, ADMIN, reason);
- }
- return 1;
- }
- IRCCMD:tempban(botid, channel[], user[], host[], params[])
- {
- new id, days, reason[51], year, month, day;
- if(!IRC_IsOp(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need op (+o) or above to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "udS(No Reason Specified)[50]", id, days, reason)) return IRC_GroupNotice(gGroupID, user, "4Usage: !tempban (nick/id) (days) (optional: reason)");
- if(reason[50]) return IRC_GroupNotice(gGroupID, user, "4Invalid length. The length must be between 1 and 50 characters.");
- if(!IsPlayerConnected(id)) return IRC_GroupNotice(gGroupID, user, "4Invalid Player!");
- if(IsPlayerNPC(id) && !IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command on NPCs.");
- else
- {
- new File:tmpban = fopen(TEMPBAN, io_append);
- if(tmpban)
- {
- getdate(year, month, day);
- day += days;
- switch(IsMonth31(month))
- {
- case 1:
- {
- if(day > 31)
- {
- month += 1;
- if(month > 12)
- {
- year += 1;
- while(day > 31) day -=31;
- }
- else while(day > 31) day -= 31;
- }
- }
- case 0:
- {
- if(day > 30)
- {
- month += 1;
- if(month > 12)
- {
- year += 1;
- while(day > 30) day -= 30;
- }
- else while(day > 30) day -= 30;
- }
- if(IsMonth29(year) && month == 2 && day > 29)
- {
- month += 1;
- if(month > 12)
- {
- year += 1;
- while(day > 29) day -= 29;
- }
- else while(day > 29) day -= 29;
- }
- if(!IsMonth29(year) && month == 2 && day > 28)
- {
- month += 1;
- if(month > 12)
- {
- year += 1;
- while(day > 28) day -= 28;
- }
- else while(day > 28) day -= 28;
- }
- }
- }
- CMDSString = "";
- new date[3], time[3];
- getdate(date[2], date[1], date[0]), gettime(time[0], time[1], time[2]);
- format(CMDSString, sizeof(CMDSString), "%d|%d|%d|%s|%s|%02d/%02d/%02d - %02d:%02d:%02d\n\r", day, month, year, GetPlayerIpEx(id), pNick(id), date[0], date[1], date[2], time[0], time[1], time[2]);
- fwrite(tmpban, CMDSString);
- fclose(tmpban);
- }
- IRC_GroupNoticeEx(gGroupID, user, "You've banned %s (%d) for %d day%s - Expires at %d/%d/%d. Reason: %s.", pNick(id), id, days, AddS(days), day, month, year, reason);
- SendMSGToAll(COLOUR_ADMIN, "*** %d DAY%s BAN: %s (%d) - Reason: %s.", days, AddS(days), pNick(id), id, reason);
- #if defined GA_SAVE_LOGS
- format(CMDSString, sizeof(CMDSString), "%s (%d) has been temporaly banned by %s for %d day%s. Expires at %d/%d/%d. Ban reason: %s.\n\r", pNick(id), id, user, days, AddS(days), day, month, year, reason);
- SaveLog("/MAdmin/Logs/TempBans.txt", CMDSString);
- #endif
- ClearChat(0, id);
- SendMSG(id, COLOUR_INFO, "You've been temporaly banned from the server for %d day%s. Expires at: %d/%d/%d. Reason: %s", days, AddS(days), day, month, year, reason);
- GameTextForPlayer(id, KICK_GAMETEXT, (999999 * 999999), 3);
- Kick(id);
- }
- return 1;
- }
- IRCCMD:rangeban(botid, channel[], user[], host[], params[])
- {
- new id, ranges, INI:file, filename[ACCOUNTPATH_LENGTH];
- if(!IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "uD(1)", id, ranges)) return IRC_GroupNotice(gGroupID, user, "4Usage: !rangeban (nick/id) (optional: IP ranges)");
- if(ranges < 0 || ranges > 3) return IRC_GroupNotice(gGroupID, user, "4Invalid IP range amount. The IP range must be between 1 and 3.");
- if(!IsPlayerConnected(id)) return IRC_GroupNotice(gGroupID, user, "4Invalid Player!");
- if(IsPlayerNPC(id) && !IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command on NPCs.");
- else
- {
- format(filename, sizeof(filename), ACCOUNTPATH, UserFileName(pNick(id)));
- if(fexist(filename))
- {
- file = INI_Open(filename);
- INI_WriteInt(file, "Banned", 1);
- INI_Close(file);
- }
- IRC_GroupNoticeEx(gGroupID, user, "You've rangebanned %s (%d) [IP: %s]. Total ranges banned: %d.", pNick(id), id, GetPlayerIpEx(id), ranges);
- RangeBan(id, ranges);
- }
- return 1;
- }
- /*
- IRCCMD:togglecmd(botid, channel[], user[], host[], params[])
- {
- new id, cmd[51], toggle;
- if(!IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "us[50]d", id, cmd, toggle)) return IRC_GroupNotice(gGroupID, user, "4Usage: !togglecmd (nick/id) (command) (toggle: 0/1)");
- if(cmd[50]) return IRC_GroupNotice(gGroupID, user, "4Invalid command length. The command must be between 1 and 50 characters.");
- if(toggle != 0 && toggle != 1) return IRC_GroupNotice(gGroupID, user, "4Usage: !togglecmd (nick/id) (command) (toggle: 0/1)");
- if(!IsPlayerConnected(id)) return IRC_GroupNotice(gGroupID, user, "4Invalid Player!");
- else
- {
- new bool:mode = !!toggle;
- Command_SetPlayerNamed(cmd, id, mode);
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[togglecmd] 3%s %s the command %s for %s (%d).", user, Answer(toggle, "Enabled", "Disabled"), cmd, pNick(id), id);
- IRC_GroupNoticeEx(gGroupID, user, "You've %s the command %s for %s (%d).", Answer(toggle, "Enabled", "Disabled"), cmd, pNick(id), id);
- }
- return 1;
- }
- IRCCMD:toggleallcmd(botid, channel[], user[], host[], params[])
- {
- new cmd[51], toggle;
- if(!IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "s[50]d", cmd, toggle)) return IRC_GroupNotice(gGroupID, user, "4Usage: !toggleallcmd (command) (toggle: 0/1)");
- if(cmd[50]) return IRC_GroupNotice(gGroupID, user, "4Invalid command length. The command must be between 1 and 50 characters.");
- if(toggle != 0 && toggle != 1) return IRC_GroupNotice(gGroupID, user, "4Usage: !toggleallcmd (command) (toggle: 0/1)");
- else
- {
- new count, bool:mode = !!toggle;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- Command_SetPlayerNamed(cmd, i, mode);
- count++;
- }
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[toggleallcmd] 3%s %s the command %s for all non-administrators (%d in total).", user, Answer(toggle, "Enabled", "Disabled"), cmd, count);
- IRC_GroupNoticeEx(gGroupID, user, "You've %s the command %s for all non-administrators (%d in total).", Answer(toggle, "Enabled", "Disabled"), cmd, count);
- }
- return 1;
- }*/
- IRCCMD:banall(botid, channel[], user[], host[], params[])
- {
- if(!IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(isnull(params)) return IRC_GroupNotice(gGroupID, user, "4Usage: !banall (reason)");
- if(params[50]) return IRC_GroupNotice(gGroupID, user, "4Invalid length. The length must be between 1 and 50 characters.");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- SendMSG(i, COLOUR_INFO, "You've been banned from the server. Reason: %s", params);
- GameTextForPlayer(i, KICK_GAMETEXT, (999999 * 999999), 3);
- BanEx(i, params);
- count++;
- }
- IRC_GroupNoticeEx(gGroupID, user, "You've banned all non-administrators (%d in total). Reason: %s.", count, params);
- }
- return 1;
- }
- IRCCMD:ikick(botid, channel[], user[], host[], params[])
- {
- new id, reason[51];
- if(!IRC_IsOp(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need op (+o) or above to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "uS(No Reason Specified)[50]", id, reason)) return IRC_GroupNotice(gGroupID, user, "4Usage: !ikick (nick/id) (optional: reason)");
- if(reason[50]) return IRC_GroupNotice(gGroupID, user, "4Invalid length. The length must be between 1 and 50 characters.");
- if(!IsPlayerConnected(id)) return IRC_GroupNotice(gGroupID, user, "4Invalid Player!");
- if(IsPlayerNPC(id) && !IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command on NPCs.");
- else
- {
- IRC_GroupNoticeEx(gGroupID, user, "You've kicked %s (%d). Reason: %s.", pNick(id), id, reason);
- KickEx(id, ADMIN, reason);
- }
- return 1;
- }
- IRCCMD:kickall(botid, channel[], user[], host[], params[])
- {
- if(!IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(isnull(params)) return IRC_GroupNotice(gGroupID, user, "4Usage: !kickall (reason)");
- if(params[50]) return IRC_GroupNotice(gGroupID, user, "4Invalid length. The length must be between 1 and 50 characters.");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- SendMSG(i, COLOUR_INFO, "You've been kicked from the server. Reason: %s", params);
- GameTextForPlayer(i, KICK_GAMETEXT, (999999 * 999999), 3);
- Kick(i);
- count++;
- }
- IRC_GroupNoticeEx(gGroupID, user, "You've kicked all non-administrators (%d in total). Reason: %s.", count, params);
- }
- return 1;
- }
- IRCCMD:cage(botid, channel[], user[], host[], params[])
- {
- new id, reason[51], seconds;
- if(!IRC_IsOp(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need op (+o) or above to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "uD(0)S(No Reason Specified)[50]", id, seconds, reason)) return IRC_GroupNotice(gGroupID, user, "4Usage: !cage (nick/id) (optional: seconds - enter 0 for unlimited) (optional: reason)");
- if(reason[50]) return IRC_GroupNotice(gGroupID, user, "4Invalid length. The length must be between 1 and 50 characters.");
- if(!IsPlayerConnected(id)) return IRC_GroupNotice(gGroupID, user, "4Invalid Player!");
- if(IsPlayerNPC(id) && !IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command on NPCs.");
- if(seconds < 0) return IRC_GroupNotice(gGroupID, user, "4Invalid time input. The time can not be negative. Enter 0 for unlimited time.");
- else
- {
- CageTime[id][0] = GetTickCount(), CageTime[id][1] = seconds;
- CagePlayer(id);
- SetPVarInt(id, "Caged", 1);
- SendMSG(id, COLOUR_INFO, "Administrator %s on IRC has caged you. Reason: %s.", user, reason);
- IRC_GroupNoticeEx(gGroupID, user, "You've caged %s (%d). Reason: %s.", pNick(id), id, reason);
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "13"ADMIN_CAGE"", pNick(id), id, reason);
- SendMSGToAll(COLOUR_ADMIN, ADMIN_CAGE, pNick(id), id, reason);
- }
- return 1;
- }
- IRCCMD:cageall(botid, channel[], user[], host[], params[])
- {
- new reason[51], seconds;
- if(!IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "D(0)S(No Reason Specified)[50]", seconds, reason)) return IRC_GroupNotice(gGroupID, user, "4Usage: !cageall (optional: seconds - enter 0 for unlimited) (optional: reason)");
- if(reason[50]) return IRC_GroupNotice(gGroupID, user, "4Invalid length. The length must be between 1 and 50 characters.");
- if(!IRC_IsOp(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need op (+o) or above to use this command.");
- if(seconds < 0) return IRC_GroupNotice(gGroupID, user, "4Invalid time input. The time can not be negative. Enter 0 for unlimited time.");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- CageTime[i][0] = GetTickCount(), CageTime[i][1] = seconds;
- CagePlayer(i);
- SetPVarInt(i, "Caged", 1);
- SendMSG(i, COLOUR_INFO, "Administrator %s on IRC has caged you. Reason: %s.", user, reason);
- count++;
- }
- IRC_GroupNoticeEx(gGroupID, user, "You've caged all non-administrators (%d in total). Reason: %s.", count, reason);
- }
- return 1;
- }
- IRCCMD:uncage(botid, channel[], user[], host[], params[])
- {
- new id;
- if(!IRC_IsOp(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need op (+o) or above to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "u", id)) return IRC_GroupNotice(gGroupID, user, "4Usage: !uncage (nick/id)");
- if(!IsPlayerConnected(id)) return IRC_GroupNotice(gGroupID, user, "4Invalid Player!");
- if(IsPlayerNPC(id) && !IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command on NPCs.");
- else
- {
- CageTime[id][1] = 0;
- UncagePlayer(id);
- SendMSG(id, COLOUR_INFO, "Administrator %s on IRC has uncaged you.", user);
- IRC_GroupNoticeEx(gGroupID, user, "You've uncaged %s (%d).", pNick(id), id);
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "13"ADMIN_UNCAGE"", pNick(id), id);
- SendMSGToAll(COLOUR_ADMIN, ADMIN_UNCAGE, pNick(id), id);
- DeletePVar(id, "Caged");
- }
- return 1;
- }
- IRCCMD:uncageall(botid, channel[], user[], host[], params[])
- {
- new count;
- if(!IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- foreach(Player, i)
- {
- if(IsAdmin(i) || GetPVarInt(i, "Caged") == PLAYER_VARTYPE_NONE) continue;
- CageTime[i][1] = 0;
- UncagePlayer(i);
- SendMSG(i, COLOUR_INFO, "Administrator %s on IRC has uncaged you.", user);
- DeletePVar(i, "Caged");
- count++;
- }
- IRC_GroupNoticeEx(gGroupID, user, "You've uncaged all non-administrators (%d in total).", count);
- return 1;
- }
- IRCCMD:freeze(botid, channel[], user[], host[], params[])
- {
- new id, reason[51], seconds;
- if(!IRC_IsOp(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need op (+o) or above to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "uD(0)S(No Reason Specified)[50]", id, seconds, reason)) return IRC_GroupNotice(gGroupID, user, "4Usage: !freeze (nick/id) (optional: seconds - enter 0 for unlimited) (optional: reason)");
- if(reason[50]) return IRC_GroupNotice(gGroupID, user, "4Invalid length. The length must be between 1 and 50 characters.");
- if(!IsPlayerConnected(id)) return IRC_GroupNotice(gGroupID, user, "4Invalid Player!");
- if(IsPlayerNPC(id) && !IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command on NPCs.");
- if(seconds < 0) return IRC_GroupNotice(gGroupID, user, "4Invalid time input. The time can not be negative. Enter 0 for unlimited time.");
- else
- {
- FreezeTime[id][0] = GetTickCount(), FreezeTime[id][1] = seconds;
- TogglePlayerControllable(id, 0);
- SetPVarInt(id, "Frozen", 1);
- SendMSG(id, COLOUR_INFO, "Administrator %s on IRC has frozen you. Reason: %s.", user, reason);
- IRC_GroupNoticeEx(gGroupID, user, "You've frozen %s (%d). Reason: %s.", pNick(id), id, reason);
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "13"ADMIN_FREEZE"", pNick(id), id, reason);
- SendMSGToAll(COLOUR_ADMIN, ADMIN_FREEZE, pNick(id), id, reason);
- }
- return 1;
- }
- IRCCMD:freezeall(botid, channel[], user[], host[], params[])
- {
- new reason[51], seconds;
- if(!IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "D(0)S(No Reason Specified)[50]", seconds, reason)) return IRC_GroupNotice(gGroupID, user, "4Usage: !freezeall (optional: seconds - enter 0 for unlimited) (optional: reason)");
- if(reason[50]) return IRC_GroupNotice(gGroupID, user, "4Invalid length. The length must be between 1 and 50 characters.");
- if(seconds < 0) return IRC_GroupNotice(gGroupID, user, "4Invalid time input. The time can not be negative. Enter 0 for unlimited time.");
- else
- {
- new count;
- foreach(Player, i)
- {
- FreezeTime[i][0] = GetTickCount(), FreezeTime[i][1] = seconds;
- TogglePlayerControllable(i, 0);
- SetPVarInt(i, "Frozen", 1);
- SendMSG(i, COLOUR_INFO, "Administrator %s on IRC has frozen you. Reason: %s.", user, reason);
- count++;
- }
- IRC_GroupNoticeEx(gGroupID, user, "You've frozen all non-administrators (%d in total). Reason: %s.", count, reason);
- }
- return 1;
- }
- IRCCMD:unfreeze(botid, channel[], user[], host[], params[])
- {
- new id;
- if(!IRC_IsOp(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need op (+o) or above to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "u", id)) return IRC_GroupNotice(gGroupID, user, "4Usage: !unfreeze (nick/id)");
- if(!IsPlayerConnected(id)) return IRC_GroupNotice(gGroupID, user, "4Invalid Player!");
- if(IsPlayerNPC(id) && !IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command on NPCs.");
- else
- {
- FreezeTime[id][1] = 0;
- TogglePlayerControllable(id, 1);
- SendMSG(id, COLOUR_INFO, "Administrator %s on IRC has unfrozen you.", user);
- IRC_GroupNoticeEx(gGroupID, user, "You've unfrozen %s (%d).", pNick(id), id);
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "13"ADMIN_UNFREEZE"", pNick(id), id);
- SendMSGToAll(COLOUR_ADMIN, ADMIN_UNFREEZE, pNick(id), id);
- DeletePVar(id, "Frozen");
- }
- return 1;
- }
- IRCCMD:unfreezeall(botid, channel[], user[], host[], params[])
- {
- new count;
- if(!IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- foreach(Player, i)
- {
- if(IsAdmin(i) || GetPVarInt(i, "Frozen") == PLAYER_VARTYPE_NONE) continue;
- FreezeTime[i][1] = 0;
- TogglePlayerControllable(i, 1);
- SendMSG(i, COLOUR_INFO, "Administrator %s on IRC has unfrozen you.", user);
- DeletePVar(i, "Frozen");
- count++;
- }
- IRC_GroupNoticeEx(gGroupID, user, "You've unfrozen all non-administrators (%d in total).", count);
- return 1;
- }
- IRCCMD:warn(botid, channel[], user[], host[], params[])
- {
- new id, reason[51];
- if(!IRC_IsOp(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need op (+o) or above to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "uS(No Reason Specified)[50]", id, reason)) return IRC_GroupNotice(gGroupID, user, "4Usage: !warn (nick/id) (optional: reason)");
- if(reason[50]) return IRC_GroupSay(gGroupID, user, "4Invalid length. The length must be between 1 and 50 characters.");
- if(!IsPlayerConnected(id)) return IRC_GroupNotice(gGroupID, user, "4Invalid player.");
- if(IsPlayerNPC(id) && !IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command on NPCs.");
- else
- {
- UpdatePVarInt(id, "Warnings", 1);
- SendMSG(id, COLOUR_INFO, "Administrator %s on IRC has given you a warning. Total warnings: %d/"#MAX_WARNINGS". Reason: %s.", user, GetPVarInt(id, "Warnings"), reason);
- IRC_GroupNoticeEx(gGroupID, user, "You've given %s (%d) a warning. Reason: %s.", pNick(id), id, reason);
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "13"ADMIN_WARN"", pNick(id), id, reason);
- SendMSGToAll(COLOUR_ADMIN, ADMIN_WARN, pNick(id), id, reason);
- if(GetPVarInt(id, "Warnings") == MAX_WARNINGS)
- {
- switch(WARN_ACTION)
- {
- case 0: KickEx(id, SERVER, "Max Warnings Reached ("#MAX_WARNINGS"/"#MAX_WARNINGS")");
- case 1: BanEx2(id, SERVER, "Max Warnings Reached ("#MAX_WARNINGS"/"#MAX_WARNINGS")");
- }
- }
- }
- return 1;
- }
- IRCCMD:warnall(botid, channel[], user[], host[], params[])
- {
- if(!IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(isnull(params)) return IRC_GroupNotice(gGroupID, user, "4Usage: !warnall (reason)");
- if(params[50]) return IRC_GroupNotice(gGroupID, user, "4Invalid length. The length must be between 1 and 50 characters.");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- UpdatePVarInt(i, "Warnings", 1);
- SendMSG(i, COLOUR_INFO, "Administrator %s on IRC has given you a warning. Total warnings: %d/"#MAX_WARNINGS". Reason: %s.", user, GetPVarInt(i, "Warnings"), params);
- if(GetPVarInt(i, "Warnings") == MAX_WARNINGS)
- {
- switch(WARN_ACTION)
- {
- case 0: KickEx(i, SERVER, "Max Warnings Reached ("#MAX_WARNINGS"/"#MAX_WARNINGS")");
- case 1: BanEx2(i, SERVER, "Max Warnings Reached ("#MAX_WARNINGS"/"#MAX_WARNINGS")");
- }
- }
- count++;
- }
- IRC_GroupNoticeEx(gGroupID, user, "You've given all non-administrators on the server a warning (%d players). Reason: %s.", count, params);
- }
- return 1;
- }
- IRCCMD:clearallwarnings(botid, channel[], user[], host[], params[])
- {
- new count;
- if(!IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- foreach(Player, i)
- {
- if(GetPVarType(i, "Warnings") == PLAYER_VARTYPE_NONE || IsAdmin(i)) continue;
- DeletePVar(i, "Warnings");
- SendMSG(i, COLOUR_INFO, "Administrator %s on IRC has removed all your warnings.", user);
- count++;
- }
- IRC_GroupNoticeEx(gGroupID, user, "You've removed the warnings for all non-administrators (%d in total).", count);
- return 1;
- }
- IRCCMD:clearwarnings(botid, channel[], user[], host[], params[])
- {
- new id;
- if(!IRC_IsOp(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need op (+o) or above to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "u", id)) return IRC_GroupNotice(gGroupID, user, "4Usage: !clearwarnings (nick/id)");
- if(GetPVarType(id, "Warnings") == PLAYER_VARTYPE_NONE) return IRC_GroupNotice(gGroupID, user, "4This player do not have any warnings to clear.");
- if(!IsPlayerConnected(id)) return IRC_GroupNotice(gGroupID, user, "4Invalid player.");
- if(IsPlayerNPC(id) && !IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command on NPCs.");
- else
- {
- DeletePVar(id, "Warnings");
- SendMSG(id, COLOUR_INFO, "Administrator %s on IRC has removed all your warnings.", user);
- IRC_GroupNoticeEx(gGroupID, user, "You've removed %s's (%d) warnings.", pNick(id), id);
- }
- return 1;
- }
- IRCCMD:mute(botid, channel[], user[], host[], params[])
- {
- new id, reason[51], seconds;
- if(!IRC_IsOp(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need op (+o) or above to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "uD(0)S(No Reason Specified)[50]", id, seconds, reason)) return IRC_GroupNotice(gGroupID, user, "4Usage: !mute (nick/id) (optional: seconds - enter 0 for unlimited) (optional: reason)");
- if(reason[50]) return IRC_GroupSay(gGroupID, user, "4Invalid length. The length must be between 1 and 50 characters.");
- if(seconds < 0) return IRC_GroupSay(gGroupID, user, "4Invalid time input. The time can not be negative. Enter 0 for unlimited time.");
- if(!IsPlayerConnected(id)) return IRC_GroupNotice(gGroupID, user, "4Invalid player.");
- if(IsPlayerNPC(id) && !IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command on NPCs.");
- else
- {
- MuteTime[id][0] = GetTickCount(), MuteTime[id][1] = seconds;
- SetPVarInt(id, "Muted", 1);
- SendMSG(id, COLOUR_INFO, "Administrator %s on IRC has muted you. Reason: %s.", user, reason);
- IRC_GroupNoticeEx(gGroupID, user, "You've muted %s (%d). Reason: %s.", pNick(id), id, reason);
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "13"ADMIN_MUTE"", pNick(id), id, reason);
- SendMSGToAll(COLOUR_ADMIN, ADMIN_MUTE, pNick(id), id, reason);
- }
- return 1;
- }
- IRCCMD:unmute(botid, channel[], user[], host[], params[])
- {
- new id;
- if(!IRC_IsOp(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need op (+o) or above to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "u", id)) return IRC_GroupNotice(gGroupID, user, "4Usage: !unmute (nick/id)");
- if(!IsPlayerConnected(id)) return IRC_GroupNotice(gGroupID, user, "4Invalid player.");
- if(IsPlayerNPC(id) && !IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command on NPCs.");
- else
- {
- MuteTime[id][1] = 0;
- SendMSG(id, COLOUR_INFO, "Administrator %s on IRC has unmuted you.", user);
- IRC_GroupNoticeEx(gGroupID, user, "You've unmuted %s (%d).", pNick(id), id);
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "13"ADMIN_UNMUTE"", pNick(id), id);
- SendMSGToAll(COLOUR_ADMIN, ADMIN_UNMUTE, pNick(id), id);
- DeletePVar(id, "Muted");
- }
- return 1;
- }
- IRCCMD:muteall(botid, channel[], user[], host[], params[])
- {
- new reason[51], seconds;
- if(!IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "D(0)S(No Reason Specified)[50]", seconds, reason)) return IRC_GroupNotice(gGroupID, user, "4Usage: !muteall (optional: seconds - enter 0 for unlimited) (optional: reason)");
- if(reason[50]) return IRC_GroupSay(gGroupID, user, "4Invalid length. The length must be between 1 and 50 characters.");
- if(seconds < 0) return IRC_GroupSay(gGroupID, user, "4Invalid time input. The time can not be negative. Enter 0 for unlimited time.");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- MuteTime[i][0] = GetTickCount(), MuteTime[i][1] = seconds;
- SetPVarInt(i, "Muted", 1);
- SendMSG(i, COLOUR_INFO, "Administrator %s on IRC has muted you. Reason: %s.", user, reason);
- count++;
- }
- IRC_GroupNoticeEx(gGroupID, user, "You've muted all non-administrators (%d in total). Reason: %s.", count, reason);
- }
- return 1;
- }
- IRCCMD:unmuteall(botid, channel[], user[], host[], params[])
- {
- new count;
- if(!IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- foreach(Player, i)
- {
- if(IsAdmin(i) || GetPVarInt(i, "Muted") == PLAYER_VARTYPE_NONE) continue;
- MuteTime[i][1] = 0;
- SetPVarInt(i, "Muted", 1);
- SendMSG(i, COLOUR_INFO, "Administrator %s on IRC has unmuted you.", user);
- }
- IRC_GroupNoticeEx(gGroupID, user, "You've unmuted all non-administrators (%d in total).", count);
- return 1;
- }
- IRCCMD:disarm(botid, channel[], user[], host[], params[])
- {
- new id, reason[51], seconds;
- if(!IRC_IsOp(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need op (+o) or above to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "uD(0)S(No Reason Specified)[50]", id, seconds, reason)) return IRC_GroupNotice(gGroupID, user, "4Usage: !disarm (nick/id) (optional: seconds - enter 0 for unlimited) (optional: reason)");
- if(reason[50]) return IRC_GroupSay(gGroupID, user, "4Invalid length. The length must be between 1 and 50 characters.");
- if(seconds < 0) return IRC_GroupSay(gGroupID, user, "4Invalid time input. The time can not be negative. Enter 0 for unlimited time.");
- if(!IsPlayerConnected(id)) return IRC_GroupNotice(gGroupID, user, "4Invalid player.");
- if(IsPlayerNPC(id) && !IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command on NPCs.");
- else
- {
- DisarmTime[id][0] = GetTickCount(), DisarmTime[id][1] = seconds;
- SendMSG(id, COLOUR_INFO, "Administrator %s on IRC has disarmed you. Reason: %s.", user, reason);
- IRC_GroupNoticeEx(gGroupID, user, "You've disarmed %s (%d). Reason: %s.", pNick(id), id, reason);
- IsDisarmed{id} = 1;
- }
- return 1;
- }
- IRCCMD:disarmall(botid, channel[], user[], host[], params[])
- {
- new reason[51], seconds;
- if(!IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "D(0)S(No Reason Specified)[50]", seconds, reason)) return IRC_GroupNotice(gGroupID, user, "4Usage: !disarmall (optional: seconds - enter 0 for unlimited) (optional: reason)");
- if(reason[50]) return IRC_GroupSay(gGroupID, user, "4Invalid length. The length must be between 1 and 50 characters.");
- if(seconds < 0) return IRC_GroupSay(gGroupID, user, "4Invalid time input. The time can not be negative. Enter 0 for unlimited time.");
- else
- {
- new count;
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- DisarmTime[i][0] = GetTickCount(), DisarmTime[i][1] = seconds;
- SendMSG(i, COLOUR_INFO, "Administrator %s on IRC has disarmed you. Reason: %s.", user, reason);
- IsDisarmed{i} = 1;
- count++;
- }
- IRC_GroupNoticeEx(gGroupID, user, "You've disarmed all non-administrators (%d in total). Reason: %s.", count, reason);
- }
- return 1;
- }
- IRCCMD:dedisarmall(botid, channel[], user[], host[], params[])
- {
- new count;
- if(!IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- foreach(Player, i)
- {
- if(IsAdmin(i) || !IsDisarmed{i}) continue;
- DisarmTime[i][1] = 0;
- SendMSG(i, COLOUR_INFO, "Administrator %s on IRC have de-disarmed you.", user);
- IsDisarmed{i} = 0;
- count++;
- }
- IRC_GroupNoticeEx(gGroupID, user, "You've de-disarmed all non-administrators (%d in total).", count);
- return 1;
- }
- IRCCMD:dedisarm(botid, channel[], user[], host[], params[])
- {
- new id;
- if(!IRC_IsOp(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need op (+o) or above to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "u", id)) return IRC_GroupNotice(gGroupID, user, "4Usage: !dedisarm (nick/id)");
- if(!IsPlayerConnected(id)) return IRC_GroupNotice(gGroupID, user, "4Invalid player.");
- if(IsPlayerNPC(id) && !IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command on NPCs.");
- else
- {
- DisarmTime[id][1] = 0;
- SendMSG(id, COLOUR_INFO, "Administrator %s on IRC have de-disarmed you.", user);
- IRC_GroupNoticeEx(gGroupID, user, "You've de-disarmed %s (%d).", pNick(id), id);
- IsDisarmed{id} = 0;
- }
- return 1;
- }
- IRCCMD:giveweapon(botid, channel[], user[], host[], params[])
- {
- new id, weapon[21], ammo;
- if(!IRC_IsOp(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need op (+o) or above to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "us[20]d", id, weapon, ammo)) return IRC_GroupNotice(gGroupID, user, "4Usage: !giveweapon (nick/id) (weapon name) (ammo)");
- if(!IsPlayerConnected(id)) return IRC_GroupNotice(gGroupID, user, "4Invalid player.");
- if(IsPlayerNPC(id) && !IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command on NPCs.");
- if(GetWeaponIDFromName(weapon) == -1) return IRC_GroupNotice(gGroupID, user, "4Multiple weapon mames found. Please be more specific.");
- if(GetWeaponIDFromName(weapon) == -2 || weapon[20]) return IRC_GroupNotice(gGroupID, user, "4Invalid weapon name.");
- else
- {
- switch(GetWeaponIDFromName(weapon))
- {
- case 1, 10..13, 17..18, 35..39, 42..45:
- {
- switch(IsAdmin(id))
- {
- case 0: return IRC_GroupNotice(gGroupID, user, "4You can not give this weapon to this player.");
- case 1: GivePlayerWeapon(id, GetWeaponIDFromName(weapon), ammo);
- }
- }
- default:
- {
- GivePlayerWeapon(id, GetWeaponIDFromName(weapon), ammo);
- }
- }
- new weapname[32];
- GetWeaponName(GetWeaponIDFromName(weapon), weapname, sizeof(weapname));
- SendMSG(id, COLOUR_INFO, "Administrator %s on IRC has given you a %s (ID: %d) with %d ammo.", user, weapname, GetWeaponIDFromName(weapname), ammo);
- IRC_GroupNoticeEx(gGroupID, user, "You've given %s (%d) a %s (ID: %d) with %d ammo.", pNick(id), id, weapname, GetWeaponIDFromName(weapname), ammo);
- }
- return 1;
- }
- IRCCMD:giveallweapon(botid, channel[], user[], host[], params[])
- {
- new weapon[21], ammo;
- if(!IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "s[20]d", weapon, ammo)) return IRC_GroupNotice(gGroupID, user, "4Usage: !giveweapon (weapon name) (ammo)");
- if(GetWeaponIDFromName(weapon) == -1) return IRC_GroupNotice(gGroupID, user, "4Multiple weapon mames found. Please be more specific.");
- if(GetWeaponIDFromName(weapon) == -2 || weapon[20]) return IRC_GroupNotice(gGroupID, user, "4Invalid weapon name.");
- else
- {
- switch(GetWeaponIDFromName(weapon))
- {
- case 1, 10..13, 17..18, 35..39, 42..45:
- {
- foreach(Player, i)
- {
- switch(IsAdmin(i))
- {
- case 1: GivePlayerWeapon(i, GetWeaponIDFromName(weapon), ammo);
- }
- }
- }
- default:
- {
- foreach(Player, i)
- {
- GivePlayerWeapon(i, GetWeaponIDFromName(weapon), ammo);
- }
- }
- }
- new weapname[32];
- GetWeaponName(GetWeaponIDFromName(weapon), weapname, sizeof(weapname));
- SendMSGToAll(COLOUR_INFO, "Administrator %s on IRC has given everyone on the server a %s (ID: %d) with %d ammo.", user, weapname, GetWeaponIDFromName(weapname), ammo);
- }
- return 1;
- }
- IRCCMD:crash(botid, channel[], user[], host[], params[])
- {
- new id;
- if(!IRC_IsAdmin(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need admin (+a) or above to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "u", id)) return IRC_GroupNotice(gGroupID, user, "4Usage: !crash (nick/id)");
- if(!IsPlayerConnected(id)) return IRC_GroupNotice(gGroupID, user, "4Invalid player.");
- if(IsPlayerNPC(id) && !IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command on NPCs.");
- else
- {
- IRC_GroupNoticeEx(gGroupID, user, "You've crashed %s's (%d) game.", pNick(id), id);
- ApplyAnimation(id, "GANG", "DRUGS_BUY", 10, 0, 0, 0, 0, (5 * 1000));
- }
- return 1;
- }
- IRCCMD:crashall(botid, channel[], user[], host[], params[])
- {
- new count;
- if(!IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- foreach(Player, i)
- {
- if(IsAdmin(i)) continue;
- ApplyAnimation(i, "GANG", "DRUGS_BUY", 10, 0, 0, 0, 0, (5 * 1000));
- count++;
- }
- IRC_GroupNoticeEx(gGroupID, user, "You've crashed the game for all non-administrators (%d in total).", count);
- return 1;
- }
- IRCCMD:botjoin(botid, channel[], user[], host[], params[])
- {
- new chan[51], key[51];
- if(!IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(sscanf(params, "s[50]S()[50]", chan, key)) return IRC_GroupNotice(gGroupID, user, "4Usage: !botjoin (#channel) (optional: channel key)");
- if(strfind(chan, "#", true) == -1 || chan[50]) return IRC_GroupNotice(gGroupID, user, "4Usage: !botjoin (#channel) (optional: channel key)");
- if(key[50]) return IRC_GroupNotice(gGroupID, user, "4Invalid channel key length. The length must be between 0 (no channel key) and 50 characters.");
- switch(strlen(key))
- {
- case 0: IRC_GroupNoticeEx(gGroupID, user, "Attempting to join the channel %s...", chan);
- default: IRC_GroupNoticeEx(gGroupID, user, "Attempting to join the channel %s with the key \"%s\"...", chan, key);
- }
- for(new bot = 1; bot <= IRC_MAX_BOTS; bot++)
- {
- IRC_JoinChannel(bot, chan, key);
- }
- return 1;
- }
- IRCCMD:botleave(botid, channel[], user[], host[], params[])
- {
- if(!IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- if(strfind(params, "#", true) == -1 || isnull(params)) return IRC_GroupNotice(gGroupID, user, "4Usage: !botleave (#channel)");
- IRC_GroupNoticeEx(gGroupID, user, "Leaving channel %s...", params);
- for(new bot = 1; bot <= IRC_MAX_BOTS; bot++)
- {
- IRC_PartChannel(bot, params);
- }
- return 1;
- }
- IRCCMD:botregister(botid, channel[], user[], host[], params[])
- {
- if(!IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- for(new bot = 1; bot <= IRC_MAX_BOTS; bot++)
- {
- switch(bot)
- {
- case 1:
- {
- new string[50];
- format(string, sizeof(string), "ns register %s %s", IRC_BOT_PASSWORD, IRC_BOT_EMAIL);
- IRC_SendRaw(bot, string);
- }
- default: SetTimerEx("IRC_RegisterDelay", (IRC_REGISTER_DELAY * bot), false, "d", bot);
- }
- }
- IRC_GroupNoticeEx(gGroupID, user, "Attempting to register the bots nicknames with password \"%s\" and e-mail \"%s\".", IRC_BOT_PASSWORD, IRC_BOT_EMAIL);
- return 1;
- }
- IRCCMD:botidentify(botid, channel[], user[], host[], params[])
- {
- if(!IRC_IsOwner(botid, channel, user)) return IRC_GroupNotice(gGroupID, user, "4You need owner (+q) to use this command.");
- if(strcmp(channel, IRC_ECHO_CHANNEL, true) && strcmp(channel, IRC_ADMIN_ECHO_CHANNEL, true) && strcmp(channel, IRC_CHANNEL, true)) return IRC_GroupNotice(gGroupID, user, "4This command can only be used on "IRC_ECHO_CHANNEL", "IRC_ADMIN_ECHO_CHANNEL" and "IRC_CHANNEL".");
- new string[50];
- for(new bot = 1; bot <= IRC_MAX_BOTS; bot++)
- {
- format(string, sizeof(string), "ns register %s %s", IRC_BOT_PASSWORD, IRC_BOT_EMAIL);
- IRC_SendRaw(botid, string);
- }
- IRC_GroupNoticeEx(gGroupID, user, "Attempting to identify with nickserv using the password \"%s\".", IRC_BOT_PASSWORD);
- return 1;
- }
- //==============================================================================
- #endif
- //==============================================================================
- // Functions
- //==============================================================================
- stock KickEx(playerid, kick_type, reason[], admin = INVALID_PLAYER_ID, sendmsg = 1)
- {
- #pragma unused admin
- new kick_t[8];
- ClearChat(0, playerid);
- switch(kick_type)
- {
- case 0:
- {
- kick_t = "Server";
- #if defined GA_SAVE_LOGS
- new log[128];
- format(log, 256, "%s (%d) was kicked for %s.", pNick(playerid), playerid, reason);
- SaveLog("/MAdmin/Logs/ServerKicks.txt", log);
- #endif
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "13"SERVER_KICK"", pNick(playerid), playerid, reason);
- #endif
- printf("[server kick] %s (%d) has been kicked. Reason: %s.", pNick(playerid), playerid, reason);
- SendMSGToAll(COLOUR_ADMIN, SERVER_KICK, pNick(playerid), playerid, reason);
- }
- case 1:
- {
- new log[128];
- kick_t = "Admin";
- #if defined GA_SAVE_LOGS
- format(log, 256, "%s (%d) was kicked for %s by %s (%d).", pNick(playerid), playerid, reason, pNick(admin), admin);
- SaveLog("/MAdmin/Logs/AdminKicks.txt", log);
- #endif
- format(log, 128, "%s (%d) was kicked by %s (%d) for \"%s\".", pNick(playerid), playerid, pNick(admin), admin, reason);
- foreach(Player, i)
- {
- if(!IsPlayerAdmin(i) || GetPVarInt(i, "Level") < GetPVarInt(admin, "Level")) continue;
- SendClientMessage(i, COLOUR_ADMIN, log);
- }
- if(sendmsg == 1)
- {
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[kick] 3%s (%d) kicked %s (%d) for %s.", pNick(admin), admin, pNick(playerid), playerid, reason);
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "13"ADMIN_KICK"", pNick(playerid), playerid, reason);
- #endif
- printf("[admin kick] %s (%d) kicked %s (%d). Reason: %s.", pNick(admin), admin, pNick(playerid), playerid, reason);
- SendMSGToAll(COLOUR_ADMIN, ADMIN_KICK, pNick(playerid), playerid, reason);
- SendMSG(admin, COLOUR_INFO, I_KICK_MSG, pNick(playerid), playerid, reason);
- }
- }
- }
- ShowPlayerDialogEx(playerid, GA_INFOMENU, DIALOG_STYLE_MSGBOX, GA_DC_HEADER, "Close", "", I_KICK_INFORMATION, GetPlayerIpEx(playerid), pNick(playerid), kick_t, reason);
- SendMSG(playerid, COLOUR_INFO, KICK_PLAYER_MSG, reason);
- GameTextForPlayer(playerid, KICK_GAMETEXT, (999999 * 999999), 3);
- SetTimerEx("KickPlayer", GA_KICK_DELAY, false, "i", playerid);
- return 1;
- }
- function KickPlayer(playerid) return Kick(playerid);
- stock BanEx2(playerid, ban_type, reason[], admin = INVALID_PLAYER_ID, sendmsg = 1)
- {
- #pragma unused admin
- ClearChat(0, playerid);
- new log[128], ban_t[8], filename[ACCOUNTPATH_LENGTH];
- switch(ban_type)
- {
- case 0:
- {
- ban_t = "Server";
- #if defined GA_SAVE_LOGS
- format(log, 256, "%s (%d) was banned for %s.", pNick(playerid), playerid, reason);
- SaveLog("/MAdmin/Logs/ServerBans.txt", log);
- #endif
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "13"SERVER_BAN"", pNick(playerid), playerid, reason);
- #endif
- printf("[server ban] %s (%d) has been banned. Reason: %s.", pNick(playerid), playerid, reason);
- SendMSGToAll(COLOUR_ADMIN, SERVER_BAN, pNick(playerid), playerid, reason);
- }
- case 1:
- {
- ban_t = "Admin";
- #if defined GA_SAVE_LOGS
- format(log, 128, "%s (%d) was banned by %s (%d) for %s.", pNick(playerid), playerid, pNick(admin), admin, reason);
- SaveLog("/MAdmin/Logs/AdminBans.txt", log);
- #endif
- format(log, 128, "%s (%d) was banned by %s (%d) for \"%s\".", pNick(playerid), playerid, pNick(admin), admin, reason);
- foreach(Player, i)
- {
- if(!IsPlayerAdmin(i) || GetPVarInt(i, "Level") < GetPVarInt(admin, "Level")) continue;
- SendClientMessage(i, COLOUR_ADMIN, log);
- }
- if(sendmsg == 1)
- {
- #if defined GA_USE_IRC
- IRC_GroupSayEx(gGroupID, IRC_ADMIN_ECHO_CHANNEL, "7[ban] 3%s (%d) banned %s (%d) for %s.", pNick(admin), admin, pNick(playerid), playerid, reason);
- IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "13"ADMIN_BAN"", pNick(playerid), playerid, reason);
- #endif
- printf("[admin ban] %s (%d) banned %s (%d). Reason: %s.", pNick(admin), admin, pNick(playerid), playerid, reason);
- SendMSG(admin, COLOUR_INFO, I_BAN_MSG, pNick(playerid), playerid, reason);
- SendMSGToAll(COLOUR_ADMIN, ADMIN_BAN, pNick(playerid), playerid, reason);
- }
- }
- }
- ShowPlayerDialogEx(playerid, GA_INFOMENU, DIALOG_STYLE_MSGBOX, GA_DC_HEADER, "Close", "", I_BAN_INFORMATION, GetPlayerIpEx(playerid), pNick(playerid), ban_t, reason);
- SendMSG(playerid, COLOUR_INFO, BAN_PLAYER_MSG, reason);
- GameTextForPlayer(playerid, BAN_GAMETEXT, (999999 * 999999), 3);
- format(filename, sizeof(filename), ACCOUNTPATH, UserFileName(pNick(playerid)));
- if(fexist(filename))
- {
- new INI:PFile;
- PFile = INI_Open(filename);
- INI_WriteInt(PFile, "Banned", 1);
- INI_Close(PFile);
- }
- #if defined GA_USE_SAMPBAN
- BanEx(playerid, reason);
- #else
- new File:file = fopen(BANFILE, io_append);
- if(!file)
- {
- fcreate(BANFILE);
- }
- log = "";
- new date[3], time[3];
- getdate(date[2], date[1], date[0]), gettime(time[0], time[1], time[2]);
- switch(ban_type)
- {
- case 0: format(log, sizeof(log), "%s|%s|%s|SERVER|SERVER|%02d/%02d/%02d - %02d:%02d:%02d\n\r", GetPlayerIpEx(playerid), pNick(playerid), reason, date[0], date[1], date[2], time[0], time[1], time[2]);
- case 1: format(log, sizeof(log), "%s|%s|%s|ADMIN|%s|%02d/%02d/%02d - %02d:%02d:%02d\n\r", GetPlayerIpEx(playerid), pNick(playerid), reason, pNick(admin), date[0], date[1], date[2], time[0], time[1], time[2]);
- }
- fwrite(file, log);
- fclose(file);
- Kick(playerid);
- #endif
- return 1;
- }
- stock pNick(playerid)
- {
- new GI_nick[MAX_PLAYER_NAME];
- GetPlayerName(playerid, GI_nick, MAX_PLAYER_NAME);
- return GI_nick;
- }
- stock UncagePlayer(playerid)
- {
- if(GetPVarInt(playerid, "CageObject") != -1)
- {
- DestroyDynamicObject(GetPVarInt(playerid, "CageObject"));
- DeletePVar(playerid, "CageObjects");
- }
- return 1;
- }
- stock CagePlayer(playerid)
- {
- if(GetPVarInt(playerid, "CageObject") != -1)
- {
- DestroyDynamicObject(GetPVarInt(playerid, "CageObject"));
- }
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- SetPVarInt(playerid, "CageObject", CreateDynamicObject(19074, X, Y, (Z+8.0), 0, 0, 0, -1, -1, -1, 75));
- Streamer_UpdateEx(playerid, X, Y, Z);
- SetPlayerPos(playerid, X, Y, (Z+9.5));
- return 1;
- }
- function InitLogin(playerid, name[], value[])
- {
- if(!strcmp(name, "LastIP", true))
- {
- SetPVarString(playerid, "GA_TMP_LASTIP", value);
- }
- if(!strcmp(name, "PasswordHash", true))
- {
- format(pwhash[playerid], 130, "%s", value);
- }
- if(!strcmp(name, "Level", true))
- {
- SetPVarInt(playerid, "tmpLevel", strval(value));
- }
- }
- function UnbanPlayer(playerid, name[], value[])
- {
- if(!strcmp(name, "LastIP", true))
- {
- SetPVarString(playerid, "UnbanPlayerIP", value);
- }
- if(!strcmp(name, "Banned", true))
- {
- SetPVarInt(playerid, "UnbanPlayerBanned", strval(value));
- }
- }
- function ConnectTime(playerid, name[], value[])
- {
- if(!strcmp(name, "DaysConnected", true))
- {
- SetPVarInt(playerid, "DaysConnected", strval(value));
- }
- if(!strcmp(name, "HoursConnected", true))
- {
- SetPVarInt(playerid, "HoursConnected", strval(value));
- }
- if(!strcmp(name, "MinutesConnected", true))
- {
- SetPVarInt(playerid, "MinutesConnected", strval(value));
- }
- return 1;
- }
- function LoginPlayer(playerid, name[], value[])
- {
- if(!strcmp(name, "LastIP", true))
- {
- if(strcmp(value, GetPlayerIpEx(playerid), true))
- {
- new INI:file, filename[ACCOUNTPATH_LENGTH];
- format(filename, sizeof(filename), ACCOUNTPATH, UserFileName(pNick(playerid)));
- file = INI_Open(filename);
- INI_WriteString(file, "LastIP", GetPlayerIpEx(playerid));
- INI_Close(file);
- }
- }
- if(!strcmp(name, "Level", true)) { SetPVarInt(playerid, "Level", strval(value)); }
- if(!strcmp(name, "VIP", true)) { SetPVarInt(playerid, "VIP", strval(value)); }
- #if defined GA_SAVE_KILLS
- if(!strcmp(name, "Kills", true)) { SetPVarInt(playerid, "Kills", strval(value)); }
- #endif
- #if defined GA_SAVE_DEATHS
- if(!strcmp(name, "Deaths", true)) { SetPVarInt(playerid, "Deaths", strval(value)); }
- #endif
- #if defined GA_SAVE_SKIN
- if(!strcmp(name, "Skin", true)) { SetPlayerSkin(playerid, strval(value)); }
- #endif
- #if defined GA_SAVE_SCORE
- if(!strcmp(name, "Score", true)) { SetPlayerScore(playerid, strval(value)); }
- #endif
- #if defined GA_SAVE_MONEY
- if(!strcmp(name, "Money", true)) { GivePlayerMoney(playerid, strval(value)); }
- #endif
- #if defined GA_SAVE_WANTEDLEVEL
- if(!strcmp(name, "WantedLevel", true)) { SetPlayerWantedLevel(playerid, strval(value)); }
- #endif
- #if defined GA_SAVE_DRUNKLEVEL
- if(!strcmp(name, "DrunkLevel", true)){ SetPlayerDrunkLevel(playerid, strval(value)); }
- #endif
- #if defined GA_SAVE_FIGHTSTYLE
- if(!strcmp(name, "FightStyle", true)) { SetPlayerFightingStyle(playerid, strval(value)); }
- #endif
- if(!strcmp(name, "DaysConnected", true)) { SetPVarInt(playerid, "DaysConnected", strval(value)); }
- if(!strcmp(name, "HoursConnected", true)) { SetPVarInt(playerid, "HoursConnected", strval(value)); }
- if(!strcmp(name, "MinutesConnected", true)) { SetPVarInt(playerid, "MinutesConnected", strval(value)); }
- if(!strcmp(name, "W1", true)) { SetPVarInt(playerid, "W1", strval(value)); }
- if(!strcmp(name, "W1Ammo", true)) { SetPVarInt(playerid, "W1Ammo", strval(value)); }
- if(!strcmp(name, "W2", true)) { SetPVarInt(playerid, "W2", strval(value)); }
- if(!strcmp(name, "W2Ammo", true)) { SetPVarInt(playerid, "W2Ammo", strval(value)); }
- if(!strcmp(name, "W3", true)) { SetPVarInt(playerid, "W3", strval(value)); }
- if(!strcmp(name, "W3Ammo", true)) { SetPVarInt(playerid, "W3Ammo", strval(value)); }
- if(!strcmp(name, "W4", true)) { SetPVarInt(playerid, "W4", strval(value)); }
- if(!strcmp(name, "W4Ammo", true)) { SetPVarInt(playerid, "W4Ammo", strval(value)); }
- if(!strcmp(name, "W5", true)) { SetPVarInt(playerid, "W5", strval(value)); }
- if(!strcmp(name, "W5Ammo", true)) { SetPVarInt(playerid, "W5Ammo", strval(value)); }
- if(!strcmp(name, "W6", true)) { SetPVarInt(playerid, "W6", strval(value)); }
- if(!strcmp(name, "W6Ammo", true)) { SetPVarInt(playerid, "W6Ammo", strval(value)); }
- if(!strcmp(name, "W7", true)) { SetPVarInt(playerid, "W7", strval(value)); }
- if(!strcmp(name, "W7Ammo", true)) { SetPVarInt(playerid, "W7Ammo", strval(value)); }
- if(!strcmp(name, "W8", true)) { SetPVarInt(playerid, "W8", strval(value)); }
- if(!strcmp(name, "W8Ammo", true)) { SetPVarInt(playerid, "W8Ammo", strval(value)); }
- if(!strcmp(name, "W9", true)) { SetPVarInt(playerid, "W9", strval(value)); }
- if(!strcmp(name, "W9Ammo", true)) { SetPVarInt(playerid, "W9Ammo", strval(value)); }
- if(!strcmp(name, "W10", true)) { SetPVarInt(playerid, "W10", strval(value)); }
- if(!strcmp(name, "W10Ammo", true)) { SetPVarInt(playerid, "W10Ammo", strval(value)); }
- if(!strcmp(name, "W11", true)) { SetPVarInt(playerid, "W11", strval(value)); }
- if(!strcmp(name, "W11Ammo", true)) { SetPVarInt(playerid, "W11Ammo", strval(value)); }
- if(!strcmp(name, "W12", true)) { SetPVarInt(playerid, "W12", strval(value)); }
- if(!strcmp(name, "W12Ammo", true)) { SetPVarInt(playerid, "W12Ammo", strval(value)); }
- if(GetPVarType(playerid, "W12Ammo") >= 1)
- {
- new weapstring[8], tmp;
- for(new weap = 0; weap <= 12; weap++)
- {
- #if !defined GA_SAVE_ADMINWEAPONS
- if(weap == 8 || weap == 7 || weap == 12) continue;
- #endif
- format(weapstring, sizeof(weapstring), "W%d", weap);
- #if !defined GA_SAVE_ADMINWEAPONS
- if((weap == 9 && tmp == 43) || (weap == 11 && tmp != 46)) continue;
- #endif
- tmp = GetPVarInt(playerid, weapstring);
- DeletePVar(playerid, weapstring);
- format(weapstring, sizeof(weapstring), "W%dAmmo", weap);
- GivePlayerWeapon(playerid, tmp, GetPVarInt(playerid, weapstring));
- DeletePVar(playerid, weapstring);
- }
- }
- }
- stock UpdateConnectTime(playerid)
- {
- new INI:file, filename[ACCOUNTPATH_LENGTH], pTime[25], time[3];
- format(filename, sizeof(filename), ACCOUNTPATH, UserFileName(pNick(playerid)));
- if(fexist(filename) && GetPVarInt(playerid, "LoggedIn") == 1)
- {
- INI_ParseFile(filename, "ConnectTime", false, true, playerid, true, false);
- ConvertTime(GetSecondsBetweenAction(GetPVarInt(playerid, "ConnectTime")), time[0], time[1], time[2]);
- time[2] += GetPVarInt(playerid, "DaysConnected"), time[1] += GetPVarInt(playerid, "HoursConnected"), time[0] += GetPVarInt(playerid, "MinutesConnected");
- SetPVarInt(playerid, "DaysConnected", time[2]);
- SetPVarInt(playerid, "HoursConnected", time[1]);
- SetPVarInt(playerid, "MinutesConnected", time[0]);
- format(pTime, sizeof(pTime), "%d:%d:%d", time[2], time[1], time[0]);
- file = INI_Open(filename);
- INI_WriteString(file, "TimeConnected", pTime);
- INI_Close(file);
- }
- return 1;
- }
- stock SavePlayerStats(playerid)
- {
- new INI:file, filename[ACCOUNTPATH_LENGTH];
- format(filename, sizeof(filename), ACCOUNTPATH, UserFileName(pNick(playerid)));
- if(fexist(filename) && GetPVarInt(playerid, "LoggedIn") == 1)
- {
- UpdateConnectTime(playerid);
- file = INI_Open(filename);
- INI_WriteInt(file, "Level", GetPVarInt(playerid, "Level"));
- INI_WriteInt(file, "VIP", GetPVarInt(playerid, "VIP"));
- #if defined GA_SAVE_DEATHS
- INI_WriteInt(file, "Deaths", GetPVarInt(playerid, "Deaths"));
- #endif
- #if defined GA_SAVE_KILLS
- INI_WriteInt(file, "Kills", GetPVarInt(playerid, "Kills"));
- #endif
- #if defined GA_SAVE_SKIN
- INI_WriteInt(file, "Skin", GetPlayerSkin(playerid));
- #endif
- #if defined GA_SAVE_SCORE
- INI_WriteInt(file, "Score", GetPlayerScore(playerid));
- #endif
- #if defined GA_SAVE_MONEY
- INI_WriteInt(file, "Money", GetPlayerMoney(playerid));
- #endif
- #if defined GA_SAVE_WANTEDLEVEL
- INI_WriteInt(file, "WantedLevel", GetPlayerWantedLevel(playerid));
- #endif
- #if defined GA_SAVE_DRUNKLEVEL
- INI_WriteInt(file, "DrunkLevel", GetPlayerDrunkLevel(playerid));
- #endif
- #if defined GA_SAVE_FIGHTSTYLE
- INI_WriteInt(file, "FightStyle", GetPlayerFightingStyle(playerid));
- #endif
- #if defined GA_SAVE_WEAPONS
- new Weapons[14][2], weapstring[8];
- for(new weap = 0; weap <= 12; weap++)
- {
- GetPlayerWeaponData(playerid, weap, Weapons[weap][0], Weapons[weap][1]);
- format(weapstring, sizeof(weapstring), "W%d", weap);
- INI_WriteInt(file, weapstring, Weapons[weap][0]);
- format(weapstring, sizeof(weapstring), "W%dAmmo", weap);
- INI_WriteInt(file, weapstring, Weapons[weap][1]);
- }
- #endif
- INI_Close(file);
- }
- return 1;
- }
- stock SaveLog(filename[], text[], timestamp = 1)
- {
- new File:gFile, year, month, day, hour, minute, second, log[256];
- getdate(year, month, day); gettime(hour, minute, second);
- if(!fexist(filename))
- {
- gFile = fopen(filename, io_write);
- fclose(gFile);
- }
- gFile = fopen(filename, io_append);
- switch(timestamp)
- {
- case 0: format(log, sizeof(log), "%s\n\r", day, month, year, hour, minute, second, text);
- case 1: format(log, sizeof(log), "[%02d/%02d/%02d %02d:%02d:%02d] %s\n\r", day, month, year, hour, minute, second, text);
- }
- fwrite(gFile, log);
- fclose(gFile);
- return 1;
- }
- stock SendAdminCommand(playerid, command[])
- {
- if(IsPlayerConnected(playerid))
- {
- #if defined GA_SAVE_LOGS
- new log[128];
- format(log, sizeof(log), "%s (%d) has used the command /%s. Admin level: %d", pNick(playerid), playerid, command, GetPVarInt(playerid, "Level"));
- SaveLog("/MAdmin/Logs/AdminCommands.txt", log);
- #endif
- foreach(Player, i)
- {
- if(i == playerid || !IsAdmin(i)) continue;
- if(GetPVarInt(i, "Level") >= GetPVarInt(playerid, "Level"))
- {
- SendMSG(i, COLOUR_ADMIN, ADMIN_CMD_MSG, pNick(playerid), playerid, command);
- }
- }
- }
- return 1;
- }
- stock SendAdminMessage(playerid, message[], level_check = 0)
- {
- foreach(Player, i)
- {
- if(i == playerid || || !IsAdmin(i)) continue;
- if(level_check == 0)
- {
- SendClientMessage(i, COLOUR_ADMIN, message);
- }
- if(GetPVarInt(i, "Level") >= GetPVarInt(playerid, "Level") && level_check == 1)
- {
- SendClientMessage(i, COLOUR_ADMIN, message);
- }
- }
- return 1;
- }
- stock fcreate(filename[])
- {
- if(fexist(filename)) return 0;
- new File:file = fopen(filename, io_write);
- fclose(file);
- return 1;
- }
- stock IsRegistered(playerid)
- {
- new filename[ACCOUNTPATH_LENGTH];
- format(filename, 50, ACCOUNTPATH, UserFileName(pNick(playerid)));
- return (fexist(filename)) ? (1) : (0);
- }
- stock IsValidSkin(skinid)
- {
- switch(skinid)
- {
- case 3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208, 273, 289: return 0;
- }
- if(skinid >= 300) return 0;
- return 1;
- }
- stock GetWeaponIDFromName(wname[])
- {
- new rtvalue = strval(wname), attempt, WeapName[20];
- if(rtvalue < 1 || rtvalue > 46)
- {
- for(new i; i < 47; i++)
- {
- GetWeaponName(i, WeapName, 20);
- if(strfind(WeapName, wname, true) != -1)
- {
- attempt++;
- rtvalue = i;
- }
- }
- if(attempt > 1) return -1;
- if(attempt == 0) return -2;
- }
- return rtvalue;
- }
- stock GetPVarStringEx(playerid, varname[])
- {
- new str[130];
- GetPVarString(playerid, varname, str, 130);
- return str;
- }
- stock RangeBan(playerid, ranges = 0)
- {
- new ip[16];
- if(!GetPlayerIp(playerid, ip, 16) || ranges > 3) return 0;
- new i = 16 - 1, last = sizeof(ip);
- while(i >= 0 && last != -1)
- {
- if(ip[--i] == '.' || !i)
- {
- if(!ranges--)
- {
- format(ip, sizeof ip, "banip %s", ip);
- SendRconCommand(ip);
- last = -1;
- }
- else
- {
- ip[i + 1] = '*';
- strdel(ip, i + 2, last);
- last = i;
- }
- }
- }
- return 1;
- }
- stock IsMonth31(month)
- {
- switch(month)
- {
- case 1, 3, 5, 7, 8, 10, 12: return 1;
- }
- return 0;
- }
- stock IsMonth29(year)
- {
- new y = 2000;
- for(new i = 4; i < 3000; i += 4)
- {
- if ((y + i) == year)
- {
- return 1;
- }
- }
- return 0;
- }
- stock fdelete_line(filename[], line[])
- {
- if(fexist(filename)) return 0;
- new line2[128], File:tmpfile, File:existingfile, randfilename[12];
- format(randfilename, sizeof(randfilename), "%d.txt", random(125000));
- fcreate(randfilename);
- existingfile = fopen(filename, io_read);
- tmpfile = fopen(randfilename, io_append);
- while(fread(existingfile, line2, sizeof(line2)))
- {
- if(strfind(line2, line, true) == -1)
- {
- CMDSString = "";
- format(CMDSString, sizeof(CMDSString), "%s\n\r", line2);
- fwrite(tmpfile, CMDSString);
- }
- }
- fclose(existingfile), fclose(tmpfile);
- fremove(filename);
- fcreate(filename);
- existingfile = fopen(filename, io_append);
- tmpfile = fopen(randfilename, io_read);
- while(fread(tmpfile, line2, sizeof(line2)))
- {
- if(strfind(line2, line, true) == -1)
- {
- CMDSString = "";
- format(CMDSString, sizeof(CMDSString), "%s\n\r", line2);
- fwrite(existingfile, CMDSString);
- }
- }
- fclose(existingfile), fclose(tmpfile), fremove(randfilename);
- return 1;
- }
- stock BanCheck(playerid)
- {
- new line[128], year[2], month[2], day[2], ip[16], filename[ACCOUNTPATH_LENGTH], File:file, reason[61], kicker[8], admin[(MAX_PLAYER_NAME + 1)], user[(MAX_PLAYER_NAME + 1)], date[21];
- getdate(year[0], month[0], day[0]);
- file = fopen(TEMPBAN, io_read);
- if(file)
- {
- while(fread(file, line, sizeof(line)))
- {
- sscanf(line, "p<|>ddds[16]s["#MAX_PLAYER_NAME"]s[20]", day[1], month[1], year[1], ip, user, date);
- if(!strcmp(GetPlayerIpEx(playerid), ip, true))
- {
- if(!(year[0] >= year[1] && month[0] >= month[1] && day[0] >= day[1]))
- {
- format(line, sizeof(line), "Temporaly Banned Until %d/%d/%d", day[1], month[1], year[1]);
- KickEx(playerid, SERVER, line);
- return 1;
- }
- else fdelete_line(TEMPBAN, line);
- }
- }
- }
- #if !defined GA_USE_SAMPBAN
- file = fopen(BANFILE, io_read);
- if(file)
- {
- while(fread(file, line, sizeof(line)))
- {
- sscanf(line, "p<|>s[16]s["#MAX_PLAYER_NAME"]s[60]s[7]s["#MAX_PLAYER_NAME"]s[20]", ip, user, reason, kicker, admin, date);
- if(!strcmp(GetPlayerIpEx(playerid), ip, true))
- {
- KickEx(playerid, SERVER, "IP Marked as Banned");
- return 1;
- }
- }
- }
- #endif
- format(filename, sizeof(filename), ACCOUNTPATH, UserFileName(pNick(playerid)));
- if(fexist(filename))
- {
- INI_ParseFile(filename, "UnbanPlayer", false, true, playerid, true, false);
- if(GetPVarInt(playerid, "UnbanPlayerBanned") == 1)
- {
- switch(BANEVADE_ACTION)
- {
- case 0: KickEx(playerid, SERVER, "Account Marked As Banned");
- case 1: BanEx2(playerid, SERVER, "Account Marked As Banned");
- }
- return 1;
- }
- }
- return 0;
- }
- stock GetDeathReason(killerid, reason)
- {
- new ReasonMsg[32];
- if(killerid != INVALID_PLAYER_ID)
- {
- switch(reason)
- {
- case 0: ReasonMsg = "Unarmed";
- case 1: ReasonMsg = "Brass Knuckles";
- case 2: ReasonMsg = "Golf Club";
- case 3: ReasonMsg = "Night Stick";
- case 4: ReasonMsg = "Knife";
- case 5: ReasonMsg = "Baseball Bat";
- case 6: ReasonMsg = "Shovel";
- case 7: ReasonMsg = "Pool Cue";
- case 8: ReasonMsg = "Katana";
- case 9: ReasonMsg = "Chainsaw";
- case 10: ReasonMsg = "Dildo";
- case 11: ReasonMsg = "Dildo";
- case 12: ReasonMsg = "Vibrator";
- case 13: ReasonMsg = "Vibrator";
- case 14: ReasonMsg = "Flowers";
- case 15: ReasonMsg = "Cane";
- case 22: ReasonMsg = "Pistol";
- case 23: ReasonMsg = "Silenced Pistol";
- case 24: ReasonMsg = "Desert Eagle";
- case 25: ReasonMsg = "Shotgun";
- case 26: ReasonMsg = "Sawn-off Shotgun";
- case 27: ReasonMsg = "Combat Shotgun";
- case 28: ReasonMsg = "MAC-10";
- case 29: ReasonMsg = "MP5";
- case 30: ReasonMsg = "AK-47";
- case 31:
- {
- if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
- {
- switch(GetVehicleModel(GetPlayerVehicleID(killerid)))
- {
- case 447: ReasonMsg = "Sea Sparrow Machine Gun";
- default: ReasonMsg = "M4";
- }
- }
- else
- {
- ReasonMsg = "M4";
- }
- }
- case 32: ReasonMsg = "TEC-9";
- case 33: ReasonMsg = "Rifle";
- case 34: ReasonMsg = "Sniper Rifle";
- case 37: ReasonMsg = "Fire";
- case 38:
- {
- if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
- {
- switch(GetVehicleModel(GetPlayerVehicleID(killerid)))
- {
- case 425: ReasonMsg = "Hunter Machine Gun";
- default: ReasonMsg = "Minigun";
- }
- }
- else
- {
- ReasonMsg = "Minigun";
- }
- }
- case 41: ReasonMsg = "Spraycan";
- case 42: ReasonMsg = "Fire Extinguisher";
- case 49: ReasonMsg = "Vehicle Collision";
- case 50:
- {
- if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
- {
- switch(GetVehicleModel(GetPlayerVehicleID(killerid)))
- {
- case 417, 425, 447, 465, 469, 487, 488, 497, 501, 548, 563: ReasonMsg = "Helicopter Blades";
- default: ReasonMsg = "Vehicle Collision";
- }
- }
- else ReasonMsg = "Vehicle Collision";
- }
- case 51:
- {
- if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
- {
- switch(GetVehicleModel(GetPlayerVehicleID(killerid)))
- {
- case 425: ReasonMsg = "Hunter Rockets";
- case 432: ReasonMsg = "Rhino Turret";
- case 520: ReasonMsg = "Hydra Rockets";
- default: ReasonMsg = "Explosion";
- }
- }
- else
- {
- ReasonMsg = "Explosion";
- }
- }
- default: ReasonMsg = "Unknown";
- }
- }
- if(killerid == INVALID_PLAYER_ID)
- {
- switch (reason)
- {
- case 53: ReasonMsg = "Drowned";
- case 54: ReasonMsg = "Collision";
- default: ReasonMsg = "Died";
- }
- }
- return ReasonMsg;
- }
- stock strreplace2(string[], const find[], const replace[], bool:ignorecase=false, count=cellmax, maxlength=sizeof(string))
- {
- if(isnull(find) || isnull(string)) return 0;
- new matches;
- for(new idx, flen = strlen(find), rlen = strlen(replace), pos = strfind(string, find, ignorecase); pos != -1 && idx < maxlength && matches < count; pos = strfind(string, find, ignorecase, idx))
- {
- strdel(string, pos, pos + flen);
- if(rlen) strins(string, replace, pos, maxlength); // Crashy
- idx = pos + rlen;
- matches++;
- }
- return matches;
- }
- stock UserFileName(nickname[])
- {
- new nName[50];
- format(nName, sizeof(nName), "%s", nickname);
- strreplace2(nName, "_", "_00", true);
- strreplace2(nName, ";", "_01", true);
- strreplace2(nName, "!", "_02", true);
- strreplace2(nName, "/", "_03", true);
- strreplace2(nName, "\\", "_04", true);
- strreplace2(nName, "[", "_05", true);
- strreplace2(nName, "]", "_06", true);
- strreplace2(nName, "?", "_07", true);
- strreplace2(nName, ".", "_08", true);
- strreplace2(nName, "*", "_09", true);
- strreplace2(nName, "<", "_10", true);
- strreplace2(nName, ">", "_11", true);
- strreplace2(nName, "{", "_12", true);
- strreplace2(nName, "}", "_13", true);
- strreplace2(nName, " ", "_14", true);
- strreplace2(nName, "\"", "_15", true);
- strreplace2(nName, ":", "_16", true);
- strreplace2(nName, "|", "_17", true);
- strreplace2(nName, "=", "_18", true);
- return nName;
- }
- stock CheckForTextdrawColours(string[])
- {
- CMDSString = "";
- format(CMDSString, sizeof(CMDSString), "%s", string);
- strreplace2(CMDSString, "$cr", "~r~", true);
- strreplace2(CMDSString, "$cb", "~b~", true);
- strreplace2(CMDSString, "$cy", "~y~", true);
- strreplace2(CMDSString, "$cg", "~g~", true);
- strreplace2(CMDSString, "$cp", "~p~", true);
- strreplace2(CMDSString, "$cw", "~w~", true);
- strreplace2(CMDSString, "$cl", "~l~", true);
- strreplace2(CMDSString, "$cn", "~n~", true);
- strreplace2(CMDSString, "$ch", "~h~", true);
- strreplace2(CMDSString, "$<", "~<~", true);
- strreplace2(CMDSString, "$>", "~>~", true);
- strreplace2(CMDSString, "$cu", "~d~", true);
- strreplace2(CMDSString, "$cd", "~u~", true);
- return CMDSString;
- }
- stock DeleteTextdrawColours(string[])
- {
- CMDSString = "";
- format(CMDSString, sizeof(CMDSString), "%s", string);
- strreplace2(CMDSString, "$cr", "", true);
- strreplace2(CMDSString, "$cb", "", true);
- strreplace2(CMDSString, "$cy", "", true);
- strreplace2(CMDSString, "$cg", "", true);
- strreplace2(CMDSString, "$cp", "", true);
- strreplace2(CMDSString, "$cw", "", true);
- strreplace2(CMDSString, "$cl", "", true);
- strreplace2(CMDSString, "$cn", "", true);
- strreplace2(CMDSString, "$ch", "", true);
- strreplace2(CMDSString, "$<", "", true);
- strreplace2(CMDSString, "$>", "", true);
- strreplace2(CMDSString, "$cu", "", true);
- strreplace2(CMDSString, "$cd", "", true);
- return CMDSString;
- }
- stock CreateTextDraw(playerid)
- {
- AnnouncementTextdraw[playerid] = TextDrawCreate(320.000000, 119.000000, "donate to server~n~at~n~~g~sub.site.com");
- TextDrawAlignment(AnnouncementTextdraw[playerid], 2);
- TextDrawBackgroundColor(AnnouncementTextdraw[playerid], 255);
- TextDrawFont(AnnouncementTextdraw[playerid], 3);
- TextDrawLetterSize(AnnouncementTextdraw[playerid], 0.579999, 1.999999);
- TextDrawColor(AnnouncementTextdraw[playerid], -1);
- TextDrawSetOutline(AnnouncementTextdraw[playerid], 1);
- TextDrawSetProportional(AnnouncementTextdraw[playerid], 1);
- return 1;
- }
- stock ShowAnnouncementTDForPlayer(playerid)
- {
- SetPVarInt(playerid, "AnnouncementTextdrawShown", 1);
- TextDrawShowForPlayer(playerid, AnnouncementTextdraw[playerid]);
- return 1;
- }
- new VehicleNames[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-600"},{"Faggio"},{"Freeway"},{"RC Baron"},{"RC Raider"},{"Glendale"},{"Oceanic"}, {"Sanchez"},{"Sparrow"},{"Patriot"},{"Quad"},{"Coastguard"},{"Dinghy"},{"Hermes"},{"Sabre"},
- {"Rustler"},{"ZR-350"},{"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 Car (LVPD)"},{"Police Ranger"},{"Picador"},{"S.W.A.T. Van"},{"Alpha"},{"Phoenix"},{"Glendale"}, {"Sadler"},{"Luggage Trailer A"},{"Luggage Trailer B"},{"Stair Trailer"},{"Boxville"},{"Farm Plow"}, {"Utility Trailer"}
- };
- stock GetVehicleModelIDFromName(vehicle_model[])
- {
- for(new i = 0; i < 211; i++)
- {
- if(strfind(VehicleNames[i], vehicle_model, true) != -1)
- {
- return i + 400;
- }
- }
- return -1;
- }
- stock GetModelIDName(modelid)
- {
- new string[45];
- format(string, sizeof(string), "%s", VehicleNames[modelid-400]);
- return string;
- }
- stock ClearChat(all = 1, playerid = INVALID_PLAYER_ID, amount = 125)
- {
- switch(all)
- {
- case 0:
- {
- for(new i; i < amount; i++)
- {
- SendClientMessage(playerid, COLOUR_INFO, " ");
- }
- }
- case 1:
- {
- for(new i; i < amount; i++)
- {
- SendClientMessageToAll(COLOUR_INFO, " ");
- }
- }
- }
- return 1;
- }
- stock ConvertTime(cts, &ctm=-1,&cth=-1,&ctd=-1,&ctw=-1,&ctmo=-1,&cty=-1)
- {
- #define PLUR(%0,%1,%2) (%0),((%0) == 1)?((#%1)):((#%2))
- #define CTM_cty 31536000
- #define CTM_ctmo 2628000
- #define CTM_ctw 604800
- #define CTM_ctd 86400
- #define CTM_cth 3600
- #define CTM_ctm 60
- #define CT(%0) %0 = cts / CTM_%0; cts %= CTM_%0
- new strii[128];
- if(cty != -1 && (cts/CTM_cty))
- {
- CT(cty); CT(ctmo); CT(ctw); CT(ctd); CT(cth); CT(ctm);
- format(strii, sizeof(strii), "%d %s, %d %s, %d %s, %d %s, %d %s, %d %s, and %d %s",PLUR(cty,"year","years"),PLUR(ctmo,"month","months"),PLUR(ctw,"week","weeks"),PLUR(ctd,"day","days"),PLUR(cth,"hour","hours"),PLUR(ctm,"minute","minutes"),PLUR(cts,"second","seconds"));
- return strii;
- }
- if(ctmo != -1 && (cts/CTM_ctmo))
- {
- cty = 0; CT(ctmo); CT(ctw); CT(ctd); CT(cth); CT(ctm);
- format(strii, sizeof(strii), "%d %s, %d %s, %d %s, %d %s, %d %s, and %d %s",PLUR(ctmo,"month","months"),PLUR(ctw,"week","weeks"),PLUR(ctd,"day","days"),PLUR(cth,"hour","hours"),PLUR(ctm,"minute","minutes"),PLUR(cts,"second","seconds"));
- return strii;
- }
- if(ctw != -1 && (cts/CTM_ctw))
- {
- cty = ctmo = 0; CT(ctw); CT(ctd); CT(cth); CT(ctm);
- format(strii, sizeof(strii), "%d %s, %d %s, %d %s, %d %s, and %d %s",PLUR(ctw,"week","weeks"),PLUR(ctd,"day","days"),PLUR(cth,"hour","hours"),PLUR(ctm,"minute","minutes"),PLUR(cts,"second","seconds"));
- return strii;
- }
- if(ctd != -1 && (cts/CTM_ctd))
- {
- cty = ctmo = ctw = 0; CT(ctd); CT(cth); CT(ctm);
- format(strii, sizeof(strii), "%d %s, %d %s, %d %s, and %d %s",PLUR(ctd,"day","days"),PLUR(cth,"hour","hours"),PLUR(ctm,"minute","minutes"),PLUR(cts,"second","seconds"));
- return strii;
- }
- if(cth != -1 && (cts/CTM_cth))
- {
- cty = ctmo = ctw = ctd = 0; CT(cth); CT(ctm);
- format(strii, sizeof(strii), "%d %s, %d %s, and %d %s",PLUR(cth,"hour","hours"),PLUR(ctm,"minute","minutes"),PLUR(cts,"second","seconds"));
- return strii;
- }
- if(ctm != -1 && (cts/CTM_ctm))
- {
- cty = ctmo = ctw = ctd = cth = 0; CT(ctm);
- format(strii, sizeof(strii), "%d %s, and %d %s",PLUR(ctm,"minute","minutes"),PLUR(cts,"second","seconds"));
- return strii;
- }
- cty = ctmo = ctw = ctd = cth = ctm = 0;
- format(strii, sizeof(strii), "%d %s", PLUR(cts,"second","seconds"));
- return strii;
- }
- stock MAdmin_DeletePVars(playerid)
- {
- DeletePVar(playerid, "AnnouncementTextdrawShown"), DeletePVar(playerid, "Level"), DeletePVar(playerid, "LoggedIn"), DeletePVar(playerid, "Spawned");
- DeletePVar(playerid, "ConnectTime"), DeletePVar(playerid, "Relogin"), DeletePVar(playerid, "TextSpam"), DeletePVar(playerid, "RepeatingTextCount"), DeletePVar(playerid, "LastMessage");
- DeletePVar(playerid, "Muted"), DeletePVar(playerid, "CapsDisabled"), DeletePVar(playerid, "Frozen"), DeletePVar(playerid, "Caged"), DeletePVar(playerid, "LastChat"), DeletePVar(playerid, "VIP");
- DeletePVar(playerid, "SpectatingPlayer"), DeletePVar(playerid, "Spectating"), DeletePVar(playerid, "LastCommand"), DeletePVar(playerid, "CommandSpam"), DeletePVar(playerid, "Warnings"), DeletePVar(playerid, "HoursConnected");
- DeletePVar(playerid, "RconLogins"), DeletePVar(playerid, "PasswordAttempts"), DeletePVar(playerid, "Kills"), DeletePVar(playerid, "Deaths"), DeletePVar(playerid, "MinutesConnected"), DeletePVar(playerid, "DaysConnected");
- DeletePVar(playerid, "OldPosX"), DeletePVar(playerid, "OldPosY"), DeletePVar(playerid, "OldPosZ"), DeletePVar(playerid, "OldAngle"), DeletePVar(playerid, "OldWorld"), DeletePVar(playerid, "OldInterior");
- DeletePVar(playerid, "CageObject"), DeletePVar(playerid, "GA_TMP_LASTIP"), DeletePVar(playerid, "tmpLevel"), DeletePVar(playerid, "UnbanPlayerIP"), DeletePVar(playerid, "UnbanPlayerBanned");
- return 1;
- }
- stock GetPlayerIpEx(playerid) return PlayerIP[playerid];
- stock IsHigherAdminLevel(playerid, id) return ((GetPVarInt(id, "Level") > GetPVarInt(playerid, "Level")) || (IsPlayerAdmin(id) && !IsPlayerAdmin(playerid))) ? (1) : (0);
- stock IsAdmin(playerid) return (GetPVarInt(playerid, "Level") >= 1 || IsPlayerAdmin(playerid)) ? (1) : (0);
- stock IsAdminEx(playerid, lvl) return (GetPVarInt(playerid, "Level") >= lvl || IsPlayerAdmin(playerid)) ? (1) : (0);
- stock GetSecondsBetweenAction(action) return floatround(floatdiv((GetTickCount() - action), 1000), floatround_tozero);
- // © [03]Kakioshe 2011 - Keep The Credits!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement