Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**************************************************************************/
- // Admin & VIP System
- /*************************************************************************/
- /**************************************************************************/
- // Version 1.0 | Build 1
- /*************************************************************************/
- /**
- * Copyright (c) 2015-2016 San Andreas Playground
- *
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
- * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
- /*AUTHOR ********************
- @Yaa - SA-MP Scripter
- ***************************/
- #include <a_samp>
- #include <YSI/y_iterate>
- #include <a_mysql>
- #include <irc>
- #include <streamer>
- #include <zcmd>
- #include <sscanf2>
- #define SERVNAME "San Andreas Server"
- #define SERVWEB "sa-mp.com"
- #define DIALOG_HELP 10
- #define Login 12
- #define Register 13
- #define DIALOG_CONSOLE 14
- #define DIALOG_FEATURES 1000
- #define DIALOG_GMTEXT 1900
- #define DIALOG_FS 2000
- #define DIALOG_HOSTNAME 3000
- #define DIALOG_ANIMALSCARS 3100
- #define EDITOBJ_DIALOG 3200
- #define G "{6EF83C}"
- #define R "{F81414}"
- #define W "{FFFFFF}"
- #define O "{FFAF00}"
- #define YE "{FFFF00}"
- #define GRI "{C0C0C0}"
- #define COLOR_VIOLET 0xEE82EEFF
- #define COLOR_PURPLE 0xC2A2DAAA
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_RED 0xE01B4CFF
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_BLUE 0x2587CEAA
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_ORANGE 0xFF9900AA
- #define COLOR_LIME 0x10F441AA
- #define COLOR_MAGENTA 0xFF00FFFF
- #define COLOR_NAVY 0x000080AA
- #define COLOR_AQUA 0xF0F8FFAA
- #define COLOR_CRIMSON 0xDC143CAA
- #define COLOR_FLBLUE 0x6495EDAA
- #define COLOR_BISQUE 0xFFE4C4AA
- #define COLOR_BLACK 0x000000AA
- #define COLOR_CHARTREUSE 0x7FFF00AA
- #define COLOR_BROWN 0XA52A2AAA
- #define COLOR_CORAL 0xFF7F50AA
- #define COLOR_GOLD 0xB8860BAA
- #define COLOR_GREENYELLOW 0xADFF2FAA
- #define COLOR_INDIGO 0x4B00B0AA
- #define COLOR_IVORY 0xFFFF82AA
- #define COLOR_LAWNGREEN 0x7CFC00AA
- #define COLOR_SEAGREEN 0x20B2AAAA
- #define COLOR_LIMEGREEN 0x32CD32AA
- #define COLOR_MIDNIGHTBLUE 0X191970AA
- #define COLOR_MAROON 0x800000AA
- #define COLOR_OLIVE 0x808000AA
- #define COLOR_ORANGERED 0xFF4500AA
- #define COLOR_PINK 0xFFC0CBAA
- #define COLOR_SPRINGGREEN 0x00FF7FAA
- #define COLOR_TOMATO 0xFF6347AA
- #define COLOR_YELLOWGREEN 0x9ACD32AA
- #define COLOR_MEDIUMAQUA 0x83BFBFAA
- #define COLOR_MEDIUMMAGENTA 0x8B008BAA
- #define getPlayerworld GetPlayerVirtualWorld(playerid)
- native WP_Hash(buffer[], len, const str[]);
- new
- /****** MySQL Configurations ********/
- MySQL_Host[20] = "localhost",
- MySQL_Database[20] = "test",
- MySQL_User[20] = "root",
- MySQL_Password[20] = "",
- MySQL_Port = 3306,
- /****** IRC Configurations ********/
- IRCServer[50] = "pool.irc.tl",
- IRCChannel[20] = "#SAP.echo", // echo channel
- IRCChannel2[20] = "#SAP",
- IRCPort = 6667,
- IRCBot[20] = "StrikerX",
- IRCBot2[20] = "StrikerZ",
- IRCBot3[20] = "EliteX",
- IRCBot4[20] = "EliteZ",
- IRCBot5[20] = "TitanX",
- IRCBot6[20] = "TitanZ"
- ;
- enum PlayerYa
- {
- ID,
- Password[129],
- Kills,
- Deaths,
- Level,
- VIP,
- Skin,
- Hours,
- Minutes,
- DMsg[50],
- Bans,
- Kicks
- }
- static
- myzobject,
- objectid2[3],
- vehicleid2[3],
- groupID,
- Type[MAX_PLAYERS],
- Animal[MAX_PLAYERS],
- IsFlying[MAX_PLAYERS],
- Enabled[MAX_PLAYERS],
- AREnabled[MAX_PLAYERS],
- REnabled[MAX_PLAYERS],
- VehicleBoost[MAX_PLAYERS],
- BlockPm[MAX_PLAYERS],
- botIDs[8],
- IsLoggedIn[MAX_PLAYERS],
- MySQL:yadmin,
- PlayerInfo[MAX_PLAYERS][PlayerYa],
- bool:CRamp[MAX_PLAYERS],
- Ramp[MAX_PLAYERS],
- muted[MAX_PLAYERS],
- IsJailed[MAX_PLAYERS],
- MAPTP[MAX_PLAYERS],
- godmode[MAX_PLAYERS],
- Given[MAX_PLAYERS],
- IsFreezed[MAX_PLAYERS],
- vCar[MAX_PLAYERS],
- Spec[MAX_PLAYERS],
- GodMode[MAX_PLAYERS],
- Mute,
- Jail,
- bool:OnFly[MAX_PLAYERS]
- ;
- forward InitFly(playerid);
- //forward bool:StartFly(playerid);
- forward Fly(playerid);
- forward bool:StopFly(playerid);
- forward static SetPlayerLookAt(playerid,Float:x,Float:y);
- forward onMySQLCheck(playerid);
- forward destroy(playerid);
- forward DelayBans(playerid);
- forward DelayKicks(playerid);
- forward unjail(playerid, reason);
- forward TimeOnServer();
- forward unmuteTimer(playerid);
- forward DelayBan(playerid);
- forward DelayKick(playerid);
- public OnFilterScriptInit()
- {
- new MySQLOpt:options = mysql_init_options();
- mysql_set_option(options, SERVER_PORT, MySQL_Port);
- mysql_log(ALL);
- yadmin = mysql_connect(MySQL_Host, MySQL_User, MySQL_Password, MySQL_Database, options);
- if(mysql_errno() != 0)
- {
- printf("[MySQL Connection]: The connection to Database `%s` has failed.", MySQL_Database);
- printf("[MySQL Notice]: Fail to Create `accounts` & `banlist` tables on database `%s`", MySQL_Database);
- }
- else
- {
- printf("[MySQL Connection]: The connection to Database `%s` was successful.", MySQL_Database);
- mysql_query(yadmin, "CREATE TABLE IF NOT EXISTS `accounts` (`Name` VARCHAR(64),`Password` VARCHAR(129), `IP` VARCHAR(20), `Admin` INT(20), `VIP` INT(20), `Deaths` INT(20), `Kills` INT(20), `Bans` INT(20), `Kicks` INT(20), `DeathMessage` VARCHAR(50))");
- mysql_query(yadmin, "CREATE TABLE IF NOT EXISTS `accounts_2` ( `Name` VARCHAR(64), `Hours` INT(50), `Minutes` INT(50), `SkinID` INT(3))");
- mysql_query(yadmin, "CREATE TABLE IF NOT EXISTS `banlist` ( `name` VARCHAR(50), `ip` VARCHAR(50), `Admin` VARCHAR(64), `Reason` VARCHAR(64))");
- printf("[MySQL Notice]: all Tables are created on database `%s` ! ", MySQL_Database);
- }
- botIDs[0] = IRC_Connect(IRCServer, IRCPort, IRCBot, "SAP", "SAP");
- IRC_SetIntData(botIDs[0], E_IRC_CONNECT_DELAY, 2);
- botIDs[1] = IRC_Connect(IRCServer, IRCPort, IRCBot2, "SAP", "SAP");
- IRC_SetIntData(botIDs[1], E_IRC_CONNECT_DELAY, 2);
- botIDs[2] = IRC_Connect(IRCServer, IRCPort, IRCBot3, "SAP", "SAP");
- IRC_SetIntData(botIDs[2], E_IRC_CONNECT_DELAY, 2);
- botIDs[3] = IRC_Connect(IRCServer, IRCPort, IRCBot4, "SAP", "SAP");
- IRC_SetIntData(botIDs[3], E_IRC_CONNECT_DELAY, 2);
- botIDs[4] = IRC_Connect(IRCServer, IRCPort, IRCBot5, "SAP", "SAP");
- IRC_SetIntData(botIDs[4], E_IRC_CONNECT_DELAY, 2);
- botIDs[5] = IRC_Connect(IRCServer, IRCPort, IRCBot6, "SAP", "SAP");
- IRC_SetIntData(botIDs[5], E_IRC_CONNECT_DELAY, 2);
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- if(IsLoggedIn[playerid] == 1)
- {
- SetSpawnInfo(playerid, 0, PlayerInfo[playerid][Skin], 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
- SpawnPlayer(playerid);
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(PlayerInfo[playerid][DMsg] != 0)
- {
- new querylist[512];
- format(querylist, sizeof(querylist),
- "UPDATE `accounts` SET `Kills` = '%d', `Deaths` = '%d',`Admin` = '%d', `VIP` = '%d', `Kicks` = '%d', `Bans` = '%d', `Deathmessage` = '%s' WHERE `name` = '%s'"
- , PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths], PlayerInfo[playerid][Level], PlayerInfo[playerid][VIP], PlayerInfo[playerid][Kicks], PlayerInfo[playerid][Bans], PlayerInfo[playerid][DMsg], GetName(playerid));
- mysql_query(yadmin, querylist);
- }
- if(PlayerInfo[playerid][DMsg] == 0)
- {
- new querylist[512];
- format(querylist, sizeof(querylist),
- "UPDATE `accounts` SET `Kills` = '%d', `Deaths` = '%d', `Admin` = '%d', `VIP` = '%d', `Kicks` = '%d', `Bans` = '%d', `Deathmessage` = '0' WHERE `name` = '%s'"
- , PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths], PlayerInfo[playerid][Level], PlayerInfo[playerid][VIP], PlayerInfo[playerid][Kicks], PlayerInfo[playerid][Bans], GetName(playerid));
- mysql_query(yadmin, querylist);
- }
- new querylistS[512];
- format(querylistS, sizeof(querylistS),"UPDATE `accounts_2` SET `Hours` = '%d', `Minutes` = '%d', `SkinID` = '%d' WHERE `name` = '%s'", PlayerInfo[playerid][Hours], PlayerInfo[playerid][Minutes], GetPlayerSkin(playerid), GetName(playerid));
- mysql_query(yadmin, querylistS);
- printf("[YAdmin]: Player %s(Id: %d) Account Saved !", GetName(playerid), playerid);
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(muted[playerid] == 1)
- {
- SendClientMessage(playerid, -1, ""R"You are Muted no one can hear you!");
- return 0;
- }
- if(text[0] == '#' && PlayerInfo[playerid][VIP] > 1)
- {
- new str[144];
- if(PlayerInfo[playerid][VIP] == 2)
- {
- format(str, sizeof(str), ""O"*VIP Golden(%s): "W"%s", GetName(playerid), text[1]);
- VSCM(str);
- format(str,sizeof(str),"07*VIP Golden(%s) : %s", GetName(playerid), text[1]);
- IRC_SendMessageToAdmins(1,str);
- return 0;
- }
- if(PlayerInfo[playerid][VIP] == 1)
- {
- format(str, sizeof(str), ""O"*VIP Silver(%s): "W"%s", GetName(playerid), text[1]);
- VSCM(str);
- format(str,sizeof(str),"07*VIP Golden(%s) : %s", GetName(playerid), text[1]);
- IRC_SendMessageToAdmins(1,str);
- return 0;
- }
- }
- if(text[0] == '@')
- {
- new stringX[150];
- if(PlayerInfo[playerid][Level] == 0)
- {
- format(stringX,sizeof(stringX),""YE"*Player(%s) ask for: "W"%s", GetName(playerid), text[1]);
- ASCM(stringX);
- SendClientMessage(playerid, -1, ""G"You Message Has Been Sended to the staff connected !");
- format(stringX,sizeof(stringX),"07*Player(%s) ask for: %s", GetName(playerid), text[1]);
- IRC_SendMessageToAdmins(2,stringX);
- return 0;
- }
- else if(PlayerInfo[playerid][Level] == 1)
- {
- format(stringX,sizeof(stringX),""YE"*Moderator(%s): "W"%s", GetName(playerid), text[1]);
- ASCM(stringX);
- format(stringX,sizeof(stringX),"07*Moderator(%s): %s", GetName(playerid), text[1]);
- IRC_SendMessageToAdmins(2,stringX);
- return 0;
- }
- else if(PlayerInfo[playerid][Level] == 2)
- {
- format(stringX,sizeof(stringX),""YE"*Admin(%s): "W"%s", GetName(playerid), text[1]);
- ASCM(stringX);
- format(stringX,sizeof(stringX),"07*Admin(%s): %s", GetName(playerid), text[1]);
- IRC_SendMessageToAdmins(2,stringX);
- return 0;
- }
- else if(PlayerInfo[playerid][Level] == 3)
- {
- format(stringX,sizeof(stringX),""YE"*Manager(%s): "W"%s", GetName(playerid), text[1]);
- ASCM(stringX);
- format(stringX,sizeof(stringX),"07*Manager(%s): %s", GetName(playerid), text[1]);
- IRC_SendMessageToAdmins(2,stringX);
- return 0;
- }
- else if(PlayerInfo[playerid][Level] == 4)
- {
- format(stringX,sizeof(stringX),""YE"*Mapper(%s): "W"%s", GetName(playerid), text[1]);
- ASCM(stringX);
- format(stringX,sizeof(stringX),"07*Mapper(%s): %s", GetName(playerid), text[1]);
- IRC_SendMessageToAdmins(2,stringX);
- return 0;
- }
- }
- if(GetPlayerVirtualWorld(playerid) != 0)
- {
- new stf[128];
- new stringig[128];
- format(stf, sizeof(stf), ""YE"[Virtual World %d] "W"[%d] %s: %s", GetPlayerVirtualWorld(playerid), playerid, GetName(playerid), text);
- ASCM(stf);
- format(stf, sizeof(stf), "[%d] %s: "W"%s", playerid, GetName(playerid), text);
- SendVirtualMessage(getPlayerworld, GetPlayerColor(playerid), stf);
- format(stringig,sizeof(stringig),"07[Virtual World %d] 02[%d] 07%s: %s",GetPlayerVirtualWorld(playerid), playerid, GetName(playerid),text);
- IRC_SendMessageToAdmins(1,stringig);
- return 0;
- }
- new stringig[128];
- new stf[128];
- format(stf, sizeof(stf), "[%d] %s: "W"%s", playerid, GetName(playerid), text);
- SendClientMessageToAll(GetPlayerColor(playerid), stf);
- format(stringig,sizeof(stringig),"02[%d] 07%s: %s",playerid, GetName(playerid),text);
- IRC_Say(groupID, IRCChannel, stringig);
- return 0;
- }
- public OnPlayerConnect(playerid)
- {
- InitFly(playerid);
- new IPx[16], Adminx[20], reason[50];
- GetPlayerIp(playerid, IPx, sizeof(IPx));
- new querys[128], Cache:results;
- format(querys, 128, "SELECT * FROM `banlist` WHERE `ip` = '%s'", IPx);
- results = mysql_query(yadmin, querys);
- new rowsK;
- cache_get_row_count(rowsK);
- if(rowsK)
- {
- cache_get_value_name(0, "Admin", Adminx);
- cache_get_value_name(0, "Reason", reason);
- new str[150];
- for(new i = 0; i < 50; i++) SendClientMessage(playerid, COLOR_WHITE,"");
- for(new i = 0; i < 50; i++) SendClientMessage(playerid, COLOR_WHITE,"");
- SendClientMessage(playerid, -1,""YE"You are Still Banned From "SERVNAME"");
- format(str, sizeof(str), "You are Banned by Administrator : "R"%s "W"with given a reason : "R"%s", Adminx, reason );
- SendClientMessage(playerid, -1, str);
- SendClientMessage(playerid, -1, "if You Think This Ban was unfair ! Feel Free to create a ban appeal in our forum ");
- SetTimerEx("DelayKick", 1000, false, "i", playerid);
- }
- cache_delete(results);
- new queryS[128];
- mysql_format(yadmin, queryS, sizeof(queryS), "SELECT `Password` FROM `accounts` WHERE `Name` = '%s' LIMIT 1", GetName(playerid));
- mysql_tquery(yadmin, queryS, "onMySQLCheck", "i", playerid);
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case Login:
- {
- static c, hash[129];
- if(!response) Kick(playerid);
- WP_Hash(hash, sizeof (hash), inputtext);
- if(!strcmp(hash, PlayerInfo[playerid][Password], true))
- {
- new query[150], Cache:S;
- mysql_format(yadmin, query, sizeof(query), "SELECT * FROM `accounts` WHERE `Name` = '%s' LIMIT 1", GetName(playerid));
- S = mysql_query(yadmin, query);
- new rows;
- cache_get_row_count(rows);
- if(rows == 1)
- {
- cache_get_value_name_int(0, "Admin", PlayerInfo[playerid][Level]);
- cache_get_value_name_int(0, "VIP", PlayerInfo[playerid][VIP]);
- cache_get_value_name(0, "DeathMessage", PlayerInfo[playerid][DMsg], 50);
- cache_get_value_name_int(0, "Deaths", PlayerInfo[playerid][Deaths]);
- cache_get_value_name_int(0, "Kills", PlayerInfo[playerid][Kills]);
- cache_get_value_name_int(0, "Bans", PlayerInfo[playerid][Bans]);
- cache_get_value_name_int(0, "Kicks", PlayerInfo[playerid][Kicks]);
- cache_get_value_name_int(0, "Hours", PlayerInfo[playerid][Hours]);
- cache_get_value_name_int(0, "Minutes", PlayerInfo[playerid][Minutes]);
- cache_get_value_name_int(0, "SkinID", PlayerInfo[playerid][Skin]);
- }
- cache_delete(S);
- SendClientMessage(playerid, -1, "You have successfully logged in.");
- IsLoggedIn[playerid] = 1;
- cache_delete(S);
- }
- else
- {
- if(c == 3) return Kick(playerid);
- SendClientMessage(playerid, -1, "You have specified an incorrect password!");
- ShowPlayerDialog(playerid, Login, DIALOG_STYLE_INPUT, "Login", "Welcome !\nthis account already registred. Please fill in your password:", "Login", "Quit");
- c++;
- }
- }
- case Register:
- {
- if(!response) return Kick(playerid);
- if(strlen(inputtext) < 5)
- {
- SendClientMessage(playerid, -1, "Your password must at least contain more than 4 characters.");
- return ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Register", "Welcome !\nYour account has not been registered yet. Please fill in your desired password:", "Register", "Quit");
- }
- new
- query[2024],
- playername[MAX_PLAYER_NAME],
- playerip[16];
- GetPlayerName(playerid, playername, sizeof(playername));
- GetPlayerIp(playerid, playerip, sizeof(playerip));
- mysql_format(yadmin, query, sizeof(query), "INSERT INTO `accounts` (`Name`, `Password`, `IP`, `Admin`, `VIP`, `Money`, `Deaths`, `Kills`, `Bans`, `Kicks`, `Deathmessage`, `Car`) VALUES ('%s', '%s', '%s', '0', '0', '0', '0', '0', '0', '0', '0', '0')", playername, inputtext, playerip);
- mysql_query(yadmin, query);
- mysql_format(yadmin, query, sizeof(query), "INSERT INTO `accounts_2` (`Name`, `Hours`, `Minutes`, `SkinID`, `Reaction`) VALUES('%s', '0', '0', '0', '0')", GetName(playerid));
- mysql_query(yadmin, query);
- }
- case DIALOG_FEATURES:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- ShowPlayerDialog(playerid, DIALOG_FEATURES+1, DIALOG_STYLE_LIST, "Boost Feature", "Enable it to all players \nDisable it to all players \nEnable it for one player", "Select", "Cancel");
- }
- case 1:
- {
- ShowPlayerDialog(playerid, DIALOG_FEATURES+500, DIALOG_STYLE_LIST, "Fly Feature", "Enable it to all players \nDisable it to all players \nEnable it for one player", "Select", "Cancel");
- }
- case 2:
- {
- ShowPlayerDialog(playerid, DIALOG_FEATURES+301, DIALOG_STYLE_LIST, "Ramping Feature", "Enable it to all players \nDisable it to all players \nEnable it for one player", "Select", "Cancel");
- }
- case 3:
- {
- ShowPlayerDialog(playerid, DIALOG_FEATURES+302, DIALOG_STYLE_LIST, "Admin Ramp Feature", "Enable it to all players \nDisable it to all players \nEnable it for one player", "Select", "Cancel");
- }
- case 4:
- {
- ShowPlayerDialog(playerid, DIALOG_FEATURES+305, DIALOG_STYLE_LIST, "Animals Cars", "Enable it to all players \nDisable it to all players \nEnable it for one player", "Select", "Cancel");
- }
- }
- return 1;
- }
- }
- case DIALOG_CONSOLE:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- new str[150];
- format(str, sizeof(str), ""YE"*Admin Notice: "W"%s(Id: %d) ShutDown The Server from the console", GetName(playerid), playerid);
- ASCM(str);
- SendClientMessageToAll(COLOR_BLUE, "*Console Applications : Please Save You'r Stats The server will shutdown in 10 sec");
- SetTimer("stopserver", 10000, false);
- }
- case 1:
- {
- new str[150];
- format(str, sizeof(str), ""YE"*Admin Notice: "W"%s(Id: %d) Restarted The Server from the console", GetName(playerid), playerid);
- ASCM(str);
- SendClientMessageToAll(COLOR_BLUE, "*Console Applications : Please Save You'r Stats The server will Restart in 10 sec");
- SetTimer("restartserver", 10000, false);
- }
- case 2:
- {
- ShowPlayerDialog(playerid, DIALOG_HOSTNAME, DIALOG_STYLE_INPUT, "Change The HostName", "Please enter The New Host Name", "Done", "Cancel");
- }
- case 3:
- {
- ShowPlayerDialog(playerid, DIALOG_GMTEXT, DIALOG_STYLE_INPUT, "Change The GameMode Text", "Please enter The New GMText", "Done", "Cancel");
- }
- case 4:
- {
- for(new car = 1; car <= 2000; car++)
- {
- SetVehicleToRespawn(car);
- }
- SendClientMessage(playerid, COLOR_BLUE, "*Console Applications : All cars are respawned !");
- }
- case 5:
- {
- ShowPlayerDialog(playerid, DIALOG_FS, DIALOG_STYLE_LIST, "FilterScripts Settings", "Load FS \nUnLoad FS \nRe-Load FS", "Select", "Cancel");
- }
- }
- return 1;
- }
- }
- case DIALOG_FS:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- ShowPlayerDialog(playerid, DIALOG_FS+10000, DIALOG_STYLE_INPUT, "load FS", "Please enter The FS File Name", "Done", "Cancel");
- }
- case 1:
- {
- ShowPlayerDialog(playerid, DIALOG_FS+290, DIALOG_STYLE_INPUT, "unload FS", "Please enter The FS File Name", "Done", "Cancel");
- }
- case 2:
- {
- ShowPlayerDialog(playerid, DIALOG_FS+1145, DIALOG_STYLE_INPUT, "reload FS", "Please enter The FS File Name", "Done", "Cancel");
- }
- }
- }
- }
- case DIALOG_FEATURES+1:
- {
- switch(listitem)
- {
- case 0:
- {
- SendClientMessageToAll(COLOR_BLUE, "*An Management Connected Has Garanted to all players a `/boost` Exception!");
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Enabled Boost Exception to All Players", GetName(playerid), playerid);
- MSCM(str);
- foreach(new i: Player)
- {
- VehicleBoost[i] = 1;
- }
- }
- case 1:
- {
- SendClientMessageToAll(COLOR_BLUE, "*An Management Connected Has Removed `/boost` Exception From all players !");
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Disabled Boost Exception to All Players", GetName(playerid), playerid);
- MSCM(str);
- foreach(new i: Player)
- {
- VehicleBoost[i] = 0;
- }
- }
- case 2:
- {
- ShowPlayerDialog(playerid, DIALOG_FEATURES+50, DIALOG_STYLE_INPUT, "Boost Exception", "Please enter The PlayerID", "Done", "Cancel");
- }
- }
- }
- case EDITOBJ_DIALOG:
- {
- if(response)
- {
- if(!strlen(inputtext)) return SendClientMessage(playerid, -1, ""R"Error: "W"You must enter the ID");
- myzobject = strval(inputtext);
- if(IsValidObject(myzobject)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid Object");
- ShowPlayerDialog(playerid, EDITOBJ_DIALOG+1, DIALOG_STYLE_INPUT, "Enter Text", "Enter Text\nFor Colour use:\n {FF0000}{ FF0000 } - Red\n{00FF00}{ 00FF00 } - Green\n{FF9933}{ FF9933 } - Orange\n{00FF33}{ 00FF33 } - Lime Green\n{33FFFF}{ 33FFFF } - Cyan\n{FF66CC}{ FF66CC }Pink\n", "Enter", "Cancel");
- }
- }
- case EDITOBJ_DIALOG+1:
- {
- if(response)
- {
- new Float:X, Float:Y, Float:Z, Float:Ang, str[100];
- GetPlayerFacingAngle(playerid, Ang);
- GetPlayerPos(playerid, X, Y, Z);
- if(!strlen(inputtext)) return SendClientMessage(playerid, -1, ""R"Error: "W"You must enter the some text");
- new myrobject = CreateDynamicObject(myzobject, X+3, Y, Z+1, 0.0, 0.0, Ang); //create the object
- SetDynamicObjectMaterialText(myrobject, 0, inputtext, OBJECT_MATERIAL_SIZE_256x128, "Arial", 28, 1, COLOR_RED, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
- format(str, sizeof(str), "The Object is been created with ID %d", myrobject); //-> The number is 42.
- SendClientMessage(playerid, COLOR_RED, str);
- }
- }
- case DIALOG_FEATURES+50:
- {
- if(response)
- {
- new str[150], id;
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Enabled Boost Exception to `(Id: %d)`", GetName(playerid), playerid, GetName(id), id);
- MSCM(str);
- SendClientMessage(id,COLOR_BLUE, "*An Management Connected Has Enabled `/boost` Exception To you!");
- VehicleBoost[id] = 1;
- }
- }
- case DIALOG_FEATURES+500:
- {
- switch(listitem)
- {
- case 0:
- {
- SendClientMessageToAll(COLOR_BLUE, "*An Management Connected Has Garanted to all players a `/fly` Exception!");
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Enabled Fly Exception to All Players", GetName(playerid), playerid);
- MSCM(str);
- foreach(new i: Player)
- {
- Enabled[i] = 1;
- }
- }
- case 1:
- {
- SendClientMessageToAll(COLOR_BLUE, "*An Management Connected Has Removed `/fly` Exception From all players !");
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Disabled Fly Exception to All Players", GetName(playerid), playerid);
- MSCM(str);
- foreach(new i: Player)
- {
- Enabled[i] = 0;
- StopFly(i);
- }
- }
- case 2:
- {
- ShowPlayerDialog(playerid, DIALOG_FEATURES+52, DIALOG_STYLE_INPUT, "Fly Exception", "Please enter The PlayerID", "Done", "Cancel");
- }
- }
- }
- case DIALOG_FEATURES+52:
- {
- if(response)
- {
- new str[150], id;
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Enabled Fly Exception to `(Id: %d)`", GetName(playerid), playerid, GetName(id), id);
- MSCM(str);
- SendClientMessage(id,COLOR_BLUE, "*An Management Connected Has Enabled `/fly` Exception To you!");
- Enabled[id] = 1;
- }
- }
- case DIALOG_FEATURES+301:
- {
- switch(listitem)
- {
- case 0:
- {
- SendClientMessageToAll(COLOR_BLUE, "*An Management Connected Has Garanted to all players a `Ramping (Ctrl)` Exception!");
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Enabled Ramping Exception to All Players", GetName(playerid), playerid);
- MSCM(str);
- foreach(new i: Player)
- {
- REnabled[i] = 1;
- }
- }
- case 1:
- {
- SendClientMessageToAll(COLOR_BLUE, "*An Management Connected Has Removed `Ramping (Ctrl)` Exception From all players !");
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Disabled Ramping Exception to All Players", GetName(playerid), playerid);
- MSCM(str);
- foreach(new i: Player)
- {
- REnabled[i] = 0;
- }
- }
- case 2:
- {
- ShowPlayerDialog(playerid, DIALOG_FEATURES+300+50, DIALOG_STYLE_INPUT, "Ramping Exception", "Please enter The PlayerID", "Done", "Cancel");
- }
- }
- }
- case DIALOG_FEATURES+302:
- {
- switch(listitem)
- {
- case 0:
- {
- SendClientMessageToAll(COLOR_BLUE, "*An Management Connected Has Garanted to all players a `/aramp` Exception!");
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Enabled /aramp Exception to All Players", GetName(playerid), playerid);
- MSCM(str);
- foreach(new i: Player)
- {
- AREnabled[i] = 1;
- }
- }
- case 1:
- {
- SendClientMessageToAll(COLOR_BLUE, "*An Management Connected Has Removed `/aramp` Exception From all players !");
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Disabled /aramp Exception to All Players", GetName(playerid), playerid);
- MSCM(str);
- foreach(new i: Player)
- {
- AREnabled[i] = 0;
- }
- }
- case 2:
- {
- ShowPlayerDialog(playerid, DIALOG_FEATURES+303, DIALOG_STYLE_INPUT, "Admin Ramp Exception", "Please enter The PlayerID", "Done", "Cancel");
- }
- }
- }
- case DIALOG_FEATURES+304:
- {
- if(response)
- {
- new str[150];
- if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Enabled /aramp Exception to `(Id: %d)`", GetName(playerid), playerid, GetName(strval(inputtext)), strval(inputtext));
- MSCM(str);
- SendClientMessage(strval(inputtext),COLOR_BLUE, "*An Management Connected Has Enabled `/aramp` Exception To you!");
- Enabled[strval(inputtext)] = 1;
- }
- }
- case DIALOG_ANIMALSCARS:
- {
- if (!response) return 1;
- switch(listitem)
- {
- case 0:
- {
- new int1 = GetPlayerInterior(playerid);
- new Float: x, Float: y, Float: z, Float: r, deer;
- GetPlayerPos(playerid,x,y,z);
- GetPlayerFacingAngle(playerid,r);
- deer = CreateVehicle(522,x,y,z,r,000,000,0);
- PutPlayerInVehicle(playerid,deer,0);
- LinkVehicleToInterior(GetPlayerVehicleID(playerid),int1+1);
- objectid2[0] = CreateObject(19315,0,0,0,0,0,0);
- vehicleid2[0] = GetPlayerVehicleID(playerid);
- AttachObjectToVehicle(objectid2[0], vehicleid2[0], 0.0, 0.0, 0.0, 0.0, 0.0, 90.0);
- }
- case 1:
- {
- new int2 = GetPlayerInterior(playerid);
- new Float: x, Float: y, Float: z, Float: r, turtle;
- GetPlayerPos(playerid,x,y,z);
- GetPlayerFacingAngle(playerid,r);
- turtle = CreateVehicle(571,x,y,z,r,000,000,0);
- PutPlayerInVehicle(playerid,turtle,0);
- LinkVehicleToInterior(GetPlayerVehicleID(playerid),int2+1);
- objectid2[1] = CreateObject(1609,0,0,0,0,0,0);
- vehicleid2[1] = GetPlayerVehicleID(playerid);
- AttachObjectToVehicle(objectid2[1], vehicleid2[1], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
- }
- case 2:
- {
- new int3 = GetPlayerInterior(playerid);
- new Float: x, Float: y, Float: z, Float: r, cow;
- GetPlayerPos(playerid,x,y,z);
- GetPlayerFacingAngle(playerid,r);
- cow = CreateVehicle(573,x,y,z,r,000,000,0);
- PutPlayerInVehicle(playerid,cow,0);
- LinkVehicleToInterior(GetPlayerVehicleID(playerid),int3+1);
- objectid2[2] = CreateObject(16442,0,0,0,0,0,0);
- vehicleid2[2] = GetPlayerVehicleID(playerid);
- AttachObjectToVehicle(objectid2[2], vehicleid2[2], 0.0, 0.0, 0.5, 0.0, 0.0, 90.0);
- }
- }
- return 1;
- }
- case DIALOG_FEATURES+305:
- {
- switch(listitem)
- {
- case 0:
- {
- SendClientMessageToAll(COLOR_BLUE, "*An Management Connected Has Garanted to all players a `/animalscars` Exception!");
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Enabled /animalscars Exception to All Players", GetName(playerid), playerid);
- MSCM(str);
- foreach(new i: Player)
- {
- Animal[i] = 1;
- }
- }
- case 1:
- {
- SendClientMessageToAll(COLOR_BLUE, "*An Management Connected Has Removed `/animalscars` Exception From all players !");
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Disabled /animalscars Exception to All Players", GetName(playerid), playerid);
- MSCM(str);
- foreach(new i: Player)
- {
- Animal[i] = 0;
- }
- }
- case 2:
- {
- ShowPlayerDialog(playerid, DIALOG_FEATURES+306, DIALOG_STYLE_INPUT, "Animal Cars Exception", "Please enter The PlayerID", "Done", "Cancel");
- }
- }
- }
- case DIALOG_FEATURES+306:
- {
- if(response)
- {
- new str[150];
- if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Enabled /animalscars Exception to `(Id: %d)`", GetName(playerid), playerid, GetName(strval(inputtext)), strval(inputtext));
- MSCM(str);
- SendClientMessage(strval(inputtext),COLOR_BLUE, "*An Management Connected Has Enabled `/animalscars` Exception To you!");
- Animal[strval(inputtext)] = 1;
- }
- }
- case DIALOG_FEATURES+300+50:
- {
- if(response)
- {
- new str[150], id;
- if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Enabled Ramping (Ctrl) Exception to `(Id: %d)`", GetName(playerid), playerid, GetName(strval(inputtext)), strval(inputtext));
- MSCM(str);
- SendClientMessage(strval(inputtext),COLOR_BLUE, "*An Management Connected Has Enabled `Ramping (Ctrl)` Exception To you!");
- Enabled[id] = 1;
- }
- }
- case DIALOG_HOSTNAME:
- {
- if(response)
- {
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Changed HostName To `%s`", GetName(playerid), playerid, inputtext);
- MSCM(str);
- new str2[50];
- format(str2, sizeof(str2), "hostname %s", inputtext);
- SendRconCommand(str2);
- }
- }
- case DIALOG_GMTEXT:
- {
- if(response)
- {
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Changed The Gamemode Text to `%s`", GetName(playerid), playerid, inputtext);
- MSCM(str);
- new str2[50];
- format(str, sizeof(str2), "gamemodetext %s", inputtext);
- SendRconCommand(str2);
- }
- }
- case DIALOG_FS+10000:
- {
- if(response)
- {
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Loaded a Filterscript `%s.amx`", GetName(playerid), playerid, inputtext);
- MSCM(str);
- new str2[50];
- format(str, sizeof(str2), "loadfs %s", inputtext);
- SendRconCommand(str2);
- }
- }
- case DIALOG_FS+290:
- {
- if(response)
- {
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) UnLoaded a Filterscript `%s.amx`", GetName(playerid), playerid, inputtext);
- MSCM(str);
- new str2[50];
- format(str, sizeof(str2), "unloadfs %s", inputtext);
- SendRconCommand(str2);
- }
- }
- case DIALOG_FS+1145:
- {
- if(response)
- {
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) ReLoaded a Filterscript `%s.amx`", GetName(playerid), playerid, inputtext);
- MSCM(str);
- new str2[50];
- format(str2, sizeof(str2), "reloadfs %s", inputtext);
- SendRconCommand(str2);
- }
- }
- }
- return 0;
- }
- static Ztopic = 0;
- public IRC_OnConnect(botid, ip[], port)
- {
- printf("*** IRC_OnConnect: Bot ID %d connected to %s:%d", botid, ip, port);
- // Join the channel
- IRC_JoinChannel(botid, IRCChannel);
- IRC_JoinChannel(botid, IRCChannel2);
- // Add the bot to the group
- IRC_AddToGroup(groupID, botid);
- return 1;
- }
- /*
- This callback is executed whenever a current connection is closed. The
- plugin may automatically attempt to reconnect per user settings. IRC_Quit
- may be called at any time to stop the reconnection process.
- */
- public IRC_OnDisconnect(botid, ip[], port, reason[])
- {
- printf("*** IRC_OnDisconnect: Bot ID %d disconnected from %s:%d (%s)", botid, ip, port, reason);
- // Remove the bot from the group
- IRC_RemoveFromGroup(groupID, botid);
- return 1;
- }
- /*
- This callback is executed whenever a connection attempt begins. IRC_Quit may
- be called at any time to stop the reconnection process.
- */
- public IRC_OnConnectAttempt(botid, ip[], port)
- {
- printf("*** IRC_OnConnectAttempt: Bot ID %d attempting to connect to %s:%d...", botid, ip, port);
- return 1;
- }
- /*
- This callback is executed whenever a connection attempt fails. IRC_Quit may
- be called at any time to stop the reconnection process.
- */
- public IRC_OnConnectAttemptFail(botid, ip[], port, reason[])
- {
- printf("*** IRC_OnConnectAttemptFail: Bot ID %d failed to connect to %s:%d (%s)", botid, ip, port, reason);
- return 1;
- }
- /*
- This callback is executed whenever a bot joins a channel.
- */
- public IRC_OnJoinChannel(botid, channel[])
- {
- printf("*** IRC_OnJoinChannel: Bot ID %d joined channel %s", botid, channel);
- if(Ztopic == 0)
- {
- Ztopic = 1;
- IRC_Say(botIDs[0], channel, "**4Global Gamemode Initialize");
- }
- return 1;
- }
- /*
- This callback is executed whenevever a bot leaves a channel.
- */
- public IRC_OnLeaveChannel(botid, channel[], message[])
- {
- printf("*** IRC_OnLeaveChannel: Bot ID %d left channel %s (%s)", botid, channel, message);
- return 1;
- }
- /*
- This callback is executed whenevever a bot is invited to a channel.
- */
- public IRC_OnInvitedToChannel(botid, channel[], invitinguser[], invitinghost[])
- {
- printf("*** IRC_OnInvitedToChannel: Bot ID %d invited to channel %s by %s (%s)", botid, channel, invitinguser, invitinghost);
- IRC_JoinChannel(botid, channel);
- IRC_Say(botid, channel, "**4Fuck you nigga, Don't try to hack our Bots !");
- IRC_PartChannel(botid, channel, ""SERVNAME" SA-MP IRC Bot !");
- return 1;
- }
- /*
- This callback is executed whenevever a bot is kicked from a channel. If the
- bot cannot immediately rejoin the channel (in the event, for example, that
- the bot is kicked and then banned), you might want to set up a timer here
- for rejoin attempts.
- */
- public IRC_OnKickedFromChannel(botid, channel[], oppeduser[], oppedhost[], message[])
- {
- printf("*** IRC_OnKickedFromChannel: Bot ID %d kicked by %s (%s) from channel %s (%s)", botid, oppeduser, oppedhost, channel, message);
- IRC_JoinChannel(botid, channel);
- return 1;
- }
- public IRC_OnUserDisconnect(botid, user[], host[], message[])
- {
- printf("*** IRC_OnUserDisconnect (Bot ID %d): User %s (%s) disconnected (%s)", botid, user, host, message);
- return 1;
- }
- public IRC_OnUserJoinChannel(botid, channel[], user[], host[])
- {
- printf("*** IRC_OnUserJoinChannel (Bot ID %d): User %s (%s) joined channel %s", botid, user, host, channel);
- return 1;
- }
- public IRC_OnUserLeaveChannel(botid, channel[], user[], host[], message[])
- {
- printf("*** IRC_OnUserLeaveChannel (Bot ID %d): User %s (%s) left channel %s (%s)", botid, user, host, channel, message);
- return 1;
- }
- public IRC_OnUserKickedFromChannel(botid, channel[], kickeduser[], oppeduser[], oppedhost[], message[])
- {
- printf("*** IRC_OnUserKickedFromChannel (Bot ID %d): User %s kicked by %s (%s) from channel %s (%s)", botid, kickeduser, oppeduser, oppedhost, channel, message);
- }
- public IRC_OnUserNickChange(botid, oldnick[], newnick[], host[])
- {
- printf("*** IRC_OnUserNickChange (Bot ID %d): User %s (%s) changed his/her nick to %s", botid, oldnick, host, newnick);
- return 1;
- }
- public IRC_OnUserSetChannelTopic(botid, channel[], user[], host[], topic[])
- {
- printf("*** IRC_OnUserSetChannelTopic (Bot ID %d): User %s (%s) on %s set topic: %s", botid, user, host, channel, topic);
- return 1;
- }
- public IRC_OnUserSay(botid, recipient[], user[], host[], message[])
- {
- printf("*** IRC_OnUserSay (Bot ID %d): User %s (%s) sent message to %s: %s", botid, user, host, recipient, message);
- if (!strcmp(recipient, IRCChannel) || !strcmp(recipient, IRCChannel2))
- {
- if(!strcmp(message, ".credits"))
- {
- IRC_Say(botIDs[0], IRCChannel, "----- Credits -----");
- IRC_Say(botIDs[0], IRCChannel, "Yassine - Scripter");
- IRC_Say(botIDs[0], IRCChannel, "------------------");
- }
- if(!strcmp(message, ".stats"))
- {
- IRC_Say(botIDs[0], IRCChannel, "Server Running on SAMP 0.3.7 R2-1 using Linux Server");
- }
- if(!strcmp(message, ".ping"))
- {
- IRC_Say(botIDs[0], IRCChannel, "pong");
- }
- if(!strcmp(message, ".Yassine"))
- {
- IRC_Say(botIDs[0], IRCChannel, "Yassine is awesome !");
- }
- if(!strcmp(message, ".cmode") && IRC_IsOwner(botid, IRCChannel, user))
- {
- IRC_SetMode(botIDs[0], IRCChannel, "+m");
- }
- if(!strcmp(message, ".cdemode") && IRC_IsOwner(botid, IRCChannel, user))
- {
- IRC_SetMode(botIDs[0], IRCChannel, "-m");
- }
- if(!strcmp(message, ".cmds"))
- {
- IRC_Say(botIDs[0], IRCChannel, ".Yassine ping .hold .cmode .cdemode .stats .owners");
- }
- }
- return 1;
- }
- public IRC_OnUserNotice(botid, recipient[], user[], host[], message[])
- {
- printf("*** IRC_OnUserNotice (Bot ID %d): User %s (%s) sent notice to %s: %s", botid, user, host, recipient, message);
- // Someone sent the bot a notice (probably a network service)
- return 1;
- }
- public IRC_OnUserRequestCTCP(botid, user[], host[], message[])
- {
- printf("*** IRC_OnUserRequestCTCP (Bot ID %d): User %s (%s) sent CTCP request: %s", botid, user, host, message);
- // Someone sent a CTCP VERSION request
- if (!strcmp(message, "VERSION"))
- {
- IRC_ReplyCTCP(botid, user, "VERSION SA-MP IRC Plugin v" #PLUGIN_VERSION "");
- }
- return 1;
- }
- public IRC_OnUserReplyCTCP(botid, user[], host[], message[])
- {
- printf("*** IRC_OnUserReplyCTCP (Bot ID %d): User %s (%s) sent CTCP reply: %s", botid, user, host, message);
- return 1;
- }
- public IRC_OnReceiveRaw(botid, message[])
- {
- new File:file;
- if (!fexist("irc_log.txt"))
- {
- file = fopen("irc_log.txt", io_write);
- }
- else
- {
- file = fopen("irc_log.txt", io_append);
- }
- if (file)
- {
- fwrite(file, message);
- fwrite(file, "\r\n");
- fclose(file);
- }
- return 1;
- }
- CMD:createmapicon(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] == 4)
- {
- new mapiconid;
- if(sscanf(params, "i", mapiconid)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /createmapicon [id]" );
- new Float: X, Float:Y, Float:Z;
- GetPlayerPos( playerid, X, Y, Z );
- SetPlayerMapIcon( playerid, 20, X, Y, Z, mapiconid, 0, MAPICON_LOCAL );
- }
- else return 0;
- return 1;
- }
- CMD:createobj(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] == 4)
- {
- new Float:X, Float:Y, Float:Z;
- new myobject;
- new object;
- GetPlayerPos(playerid, X, Y, Z);
- GetXYInFrontOfPlayer(playerid, Float:X,Float:Y, 2.5);
- if(sscanf(params,"d",object)) return SendClientMessage(playerid,COLOR_RED,"Û USAGE:/createobj [object ID]");
- myobject = CreatePlayerObject(playerid, object, X, Y, Z, 0.0, 0.0, 0.0,0);
- EditObject(playerid, myobject);
- SendClientMessage(playerid,COLOR_PURPLE,"Object Created!");
- }
- else return 0;
- return 1;
- }
- CMD:v(playerid, params[])
- {
- new vehid;
- if(sscanf(params, "i", vehid)) return SendClientMessage(playerid, -1, ""R"USAGE: /v [carid]");
- else if(vehid < 400 || vehid > 611) return SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid car id! [ Car ID's range from 400 - 611 ]");
- new Float:x, Float:y, Float:z, Float:Angle;
- GetPlayerPos(playerid, x, y, z);
- GetPlayerFacingAngle(playerid, Angle);
- vCar[playerid] = CreateVehicle(vehid, x, y, z, Angle, -1, -1, 60);
- PutPlayerInVehicle(playerid, vCar[playerid], 0);
- SendClientMessage(playerid, -1, ""G"Car spawned at your location!");
- new str[150];
- format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) Has Just spawned Car Id: %d at her/his location", GetName(playerid), playerid, vehid);
- ASCM(str);
- return 1;
- }
- CMD:acmds(playerid, params[])
- {
- new DIALOG[3500];
- if(PlayerInfo[playerid][Level] == 0)
- {
- strcat(DIALOG, ""YE"Sorry, You are unable to see administrators commands\n\n");
- }
- if(PlayerInfo[playerid][Level] >= 1)
- {
- strcat(DIALOG, ""YE"Moderators Commands\n\n");
- strcat(DIALOG, ""W"/startevent /toggleevent /destroyevent /stp /fetch /slap /kick /jail /unjail \n");
- strcat(DIALOG, ""W"/freeze /botsay /unfreeze /watch /unwatch /mute /unmute\n");
- strcat(DIALOG, ""W"/announce /showmessage /createtext /deletetext /edittext\n");
- strcat(DIALOG, ""W"/fix /clearchat /rpweapons /asay /v /changename\n");
- strcat(DIALOG, ""O"Set Feature : /set[weather/time/armour/health/skin]\n\n");
- }
- if(PlayerInfo[playerid][Level] >= 2)
- {
- strcat(DIALOG, ""YE"Administrators Commands\n\n");
- strcat(DIALOG, ""W"/startevent /toggleevent /destroyevent /stp /fetch /slap /nuke /ban /unban \n");
- strcat(DIALOG, ""W"/freeze /botsay /unfreeze /watch /unwatch/kick /cage /uncage /jail /unjail /giveweapon /giveallweapon \n");
- strcat(DIALOG, ""W"/givegod /takegod /givemoderator /takemoderator /announce /showmessage /mute /unmute\n");
- strcat(DIALOG, ""W"/fix /clearchat /givecash /rpweapons /asay /v /irckick /changename /createtext /deletetext /edittext\n");
- strcat(DIALOG, ""O"Set Feature : "W"/set[weather/time/armour/health/skin]\n\n");
- }
- if(PlayerInfo[playerid][Level] >= 3)
- {
- strcat(DIALOG, ""G"Management Commands\n\n");
- strcat(DIALOG, ""R"- All Admins Commands\n");
- strcat(DIALOG, ""R"/fakechat /removeacc /ocar \n");
- strcat(DIALOG, ""O"Property Feature: "W"/propertyhelp\n");
- strcat(DIALOG, ""O"Server Feature : /server [Console / Features]\n");
- }
- if(PlayerInfo[playerid][Level] == 4)
- {
- strcat(DIALOG, ""G"Mapper Commands\n\n");
- strcat(DIALOG, ""R"- All Admins Commands\n");
- strcat(DIALOG, ""R"- All Managers Commands (/setlevel not include)\n");
- strcat(DIALOG, ""O"Mapping Features: "W"/creatobj /createmapicon\n");
- strcat(DIALOG, ""O"Set Feature : /set[weather/time/armour/health/skin/gravity/maptp]\n");
- strcat(DIALOG, ""O"Server Feature : /server [Console / Features]\n");
- }
- strcat(DIALOG, ""O"Admin Chat : @ [Text]\n");
- ShowPlayerDialog(playerid, 554989, DIALOG_STYLE_MSGBOX, "Admin Commands", DIALOG, "Close", "");
- return 1;
- }
- CMD:mystats(playerid, params[])
- {
- new level[150];
- if(PlayerInfo[playerid][Level] == 0 && PlayerInfo[playerid][VIP] == 0)
- {
- level = "Regular Player";
- }
- else if(PlayerInfo[playerid][Level] == 1)
- {
- level = ""SERVNAME" Moderator";
- }
- else if(PlayerInfo[playerid][Level] == 2)
- {
- level = ""SERVNAME" Administrator";
- }
- else if(PlayerInfo[playerid][Level] == 3)
- {
- level = ""SERVNAME" Management";
- }
- else if(PlayerInfo[playerid][Level] == 4)
- {
- level = ""SERVNAME" Mapper";
- }
- else if(PlayerInfo[playerid][VIP] >= 1)
- {
- level = "Very Important Player";
- }
- new str[2048];
- format(str, sizeof(str), ""W"Name: "YE"%s\n", GetName(playerid));
- format(str, sizeof(str), "%s"W"Hours in game : "YE"%d hours %d Minutes\n",str, PlayerInfo[playerid][Hours], PlayerInfo[playerid][Minutes]);
- format(str, sizeof(str), "%s"W"Level : "YE"%s\n", str, level);
- format(str, sizeof(str), "%s"W"Kills(Count Of Victims) : "YE"%d\n",str, PlayerInfo[playerid][Kills]);
- format(str, sizeof(str), "%s"W"Deaths: "YE"%d\n",str, PlayerInfo[playerid][Deaths]);
- format(str, sizeof(str), "%s"W"Kicks(Count of Kicks): "YE"%d\n",str, PlayerInfo[playerid][Kicks]);
- format(str, sizeof(str), "%s"W"Bans(Count of Bans): "YE"%d\n",str, PlayerInfo[playerid][Bans]);
- format(str, sizeof(str), "%s"W"DeathMessage: "YE"%d\n",str, PlayerInfo[playerid][DMsg]);
- strcat(str, ""YE"You can see Stats of others players too ! How ? use /getstats or click player on TAB Dialog.\n");
- ShowPlayerDialog(playerid, 554985, DIALOG_STYLE_MSGBOX, "Player Stats", str, "Close", "");
- return 1;
- }
- CMD:stp(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- new id;
- if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1,""R"USAGE: /stp [playerid]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
- if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot teleport to yourslef! ");
- new Float:x, Float:y, Float:z;
- GetPlayerPos(id, x, y, z);
- SetPlayerPos(playerid, x, y+0.3, z);
- SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
- new str[150];
- format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) Has been secretly teleported to %s (Id: %d) in world %d", GetName(playerid), playerid, GetName(id), id, GetPlayerVirtualWorld(id));
- ASCM(str);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:vr(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- RepairVehicle(playerid);
- return 1;
- }
- else
- return 0;
- }
- CMD:irckick(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] < 2) return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Error, This Command can be used just by Admins");
- new user[44], reason[50], str4[300];
- if(sscanf(params, "ss[94]", user, reason)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /irckick [user] [reason]");
- {
- IRC_KickUser(botIDs[0],IRCChannel, user, reason);
- format(str4, sizeof(str4), ""YE"*Admin Notice: "W"User"YE"[IRC]%s "W"has been kicked from echo channel by "YE"%s (Id: %d) for : %s", user, GetName(playerid), playerid, reason);
- ASCM(str4);
- }
- return 1;
- }
- CMD:pm(playerid, params[])
- {
- new str[700], str2[256], str3[700], str4[800], id;
- if(sscanf(params, "us", id, str2)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /pm [playerid] [message]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
- if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot pm yourself!");
- if(BlockPm[id] == 1) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: this player disabled pm's atm !");
- {
- format(str, sizeof(str), ""YE"*PM To %s(ID %d): %s", GetName(id), id, str2);
- SendClientMessage(playerid, 0xFF0000FF, str);
- format(str3, sizeof(str3), ""YE"*PM From %s(ID %d): %s", GetName(playerid), playerid, str2);
- SendClientMessage(id, 0xFF0000FF, str3);
- format(str4, sizeof(str4), ""YE"*Admin Notice: "W"Private Message From "YE"%s (Id: %d) "W"To "YE"%s "W"(Id : %d): "G"%s", GetName(playerid), playerid, GetName(id), id, str2);
- ASCM(str4);
- format(str4,sizeof(str4),"*Admin Notice: Private Message From %s (Id: %d) To %s (Id : %d) : %s", GetName(playerid), playerid, GetName(id), id, str2);
- IRC_SendMessageToAdmins(2, str4);
- }
- return 1;
- }
- CMD:fetch(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- new id;
- if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1,""R"USAGE: /fetch [playerid]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
- if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot fetch yourslef! ");
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- SetPlayerPos(id, x, y+0.3, z);
- SetPlayerVirtualWorld(id, GetPlayerVirtualWorld(playerid));
- new str[150];
- format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) Has been fetched to %s (Id: %d) in world %d", GetName(id), id, GetName(playerid), playerid, GetPlayerVirtualWorld(playerid));
- ASCM(str);
- format(str,sizeof(str),"*Admin Notice: %s (Id: %d) Has been fetched to %s (Id: %d) in world %d", GetName(id), id, GetName(playerid), playerid, GetPlayerVirtualWorld(playerid));
- IRC_SendMessageToAdmins(2,str);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:slap(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- new id;
- if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1,""R"USAGE: /slap [playerid]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
- if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot slap yourslef! ");
- new Float:x, Float:y, Float:z;
- GetPlayerPos(id, x, y, z);
- SetPlayerPos(id, x, y, z+5);
- new str[150];
- format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) Has been Slapped by %s (Id: %d) in world %d", GetName(id), id, GetName(playerid), playerid, GetPlayerVirtualWorld(playerid));
- ASCM(str);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:cage(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=2)
- {
- new id;
- if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1,""R"USAGE: /cage [playerid]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
- SetPlayerWorldBounds(id, 20.0, 0.0, 20.0, 0.0);
- new str[150];
- format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) Has been Caged by %s (Id: %d) in world %d", GetName(id), id, GetName(playerid), playerid, GetPlayerVirtualWorld(playerid));
- ASCM(str);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:fakechat(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >= 3)
- {
- new id, text[50];
- if(sscanf(params,"is[50]",id, text)) return SendClientMessage(playerid, -1,""R"USAGE: /fakechat [playerid] [text]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
- if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot troll yourslef! ");
- SendPlayerMessageToAll(id, text);
- new str[200];
- format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) Has been trolled by %s (Id: %d) in world %d Using /fakechat", GetName(id), id, GetName(playerid), playerid, GetPlayerVirtualWorld(playerid));
- ASCM(str);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Manager!");
- return 1;
- }
- CMD:uncage(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=2)
- {
- new id;
- if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1,""R"USAGE: /cage [playerid]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
- SetPlayerWorldBounds(id, 20000.0000, -20000.0000, 20000.0000, -20000.0000);
- new str[150];
- format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) Has been unCaged by %s (Id: %d) in world %d", GetName(id), id, GetName(playerid), playerid, GetPlayerVirtualWorld(playerid));
- ASCM(str);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:boost(playerid, params[])
- {
- if(VehicleBoost[playerid] == 1 || PlayerInfo[playerid][Level] >= 3)
- {
- new id;
- if(sscanf(params,"i", id)) return SendClientMessage(playerid, -1,""R"USAGE: /boost [playerid]");
- new Float:x, Float:y, Float:z;
- GetVehicleVelocity(GetPlayerVehicleID(id),x,y,z);
- SetVehicleVelocity(GetPlayerVehicleID(id),x+0.9,y+0.9,z);
- new str[150];
- format(str, sizeof(str), ""YE"*Admin Notice: "W"%s(Id: %d) Has been Boosted By %s (Id: %s)", GetName(id), id, GetName(playerid), playerid);
- ASCM(str);
- }
- return 1;
- }
- CMD:aramp(playerid, params[])
- {
- if(AREnabled[playerid] == 0) return SendClientMessage(playerid, -1, "Sorry: This Command enabled just for trusted players!");
- if(Type[playerid] == 16357) return SendClientMessage(playerid, -1, ""R"Error: "W"Admin ramp already enabled for you");
- Type[playerid] = 16357;
- SendClientMessage(playerid, -1, ""G"Success: "W"Admin ramp has been enabled for you");
- return 1;
- }
- CMD:fly(playerid, params[])
- {
- if(Enabled[playerid] == 0) return SendClientMessage(playerid, -1, "Sorry: This Command enabled just for trusted players!");
- if(Enabled[playerid] == 1 && IsFlying[playerid] == 1)
- {
- StopFly(playerid);
- IsFlying[playerid] = 0;
- }
- else if(Enabled[playerid] == 1 && IsFlying[playerid] == 0)
- {
- if(OnFly[playerid]) return 0;
- OnFly[playerid] = true;
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid,x,y,z);
- SetPlayerPos(playerid,x,y,z+5.0);
- ApplyAnimation(playerid,"PARACHUTE","PARA_steerR",6.1,1,1,1,1,0,1);
- Fly(playerid);
- new str[150];
- format(str, sizeof(str), ""YE"*Admin Notice: "W"%s(Id: %d) Start Flying", GetName(playerid), playerid);
- ASCM(str);
- IsFlying[playerid] = 1;
- }
- return 1;
- }
- CMD:server(playerid,params[])
- {
- if(PlayerInfo[playerid][Level] >= 3)
- {
- if(!strcmp(params, "console", true))
- {
- return ShowPlayerDialog(playerid, DIALOG_CONSOLE, DIALOG_STYLE_LIST, "Console", "Stop The Server\nRestart The Server\nChange Host Name\nChange GameMode Text\nRespawn all cars\nFilterscripts Settings", "Select", "Cancel");
- }
- if(!strcmp(params, "features", true))
- {
- return ShowPlayerDialog(playerid, DIALOG_FEATURES, DIALOG_STYLE_LIST, "Features", "Boost Feature \nFly Feature \nRamp Feature \nAdmin Ramp Feature \nAnimal Cars Features", "Select", "Cancel");
- }
- else return SendClientMessage(playerid, -1, ""R"/server [console/features]");
- }
- else return SendClientMessage(playerid, -1, ""R"Error: "W" You are not a manager!");
- }
- CMD:setweather(playerid,params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- new weatherid;
- if(sscanf(params,"i", weatherid)) return SendClientMessage(playerid, -1,""R"USAGE: /setweather [weatherid]");
- new string[150];
- format(string,sizeof(string),""YE"*Admin Notice: "W"%s (Id: %d) Changed Weather to %d ", GetName(playerid), playerid, weatherid);
- ASCM(string);
- SetWeather(weatherid);
- return 1;
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- }
- CMD:setgravity(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] < 3) return SendClientMessage(playerid, -1,""R"Error: You aren't an Manager");
- new Float:gravityid;
- if(sscanf(params,"f", gravityid)) return SendClientMessage(playerid, -1,""R"USAGE: /setgravity [gravity float] (Default: 0.008)");
- new string[150];
- format(string,sizeof(string),""G"*Manager Notice: "W"%s (Id: %d) Changed Gravity to %s ", GetName(playerid), playerid, gravityid);
- MSCM(string);
- SetGravity(gravityid);
- return 1;
- }
- CMD:settime(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- new time;
- if(sscanf(params,"i", time)) return SendClientMessage(playerid, -1,""R"USAGE: /settime [Time]");
- new string[150];
- format(string,sizeof(string),""YE"*Admin Notice: "W"%s (Id: %d) Changed Time to %d ", GetName(playerid), playerid, time);
- ASCM(string);
- SetWorldTime(time);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:setarmour(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- new id, armour;
- if(sscanf(params,"ii", id, armour)) return SendClientMessage(playerid, -1, ""R"/setarmour [playerid] [armour]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
- new string[150];
- format(string,sizeof(string),""YE"*Admin Notice: "W"%s(Id: %d) Changed %s(Id: %d) Armour to %d ", GetName(playerid), playerid, GetName(id), id, armour);
- ASCM(string);
- SetPlayerArmour(id, armour);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:setskin(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- new id, skinid;
- if(sscanf(params,"ii", id, skinid)) return SendClientMessage(playerid, -1, ""R"/setskin [playerid] [skinid]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
- if(skinid < 0 || skinid > 300) return SendClientMessage(playerid, -1, ""R"Error: Skinid Must be (0 < Skinid < 300)");
- new string[150];
- format(string,sizeof(string),""YE"*Admin Notice: "W"%s(Id: %d) Changed %s(Id: %d) Skin to %d ", GetName(playerid), playerid, GetName(id), id, skinid);
- ASCM(string);
- SetPlayerSkin(id, skinid);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:sethealth(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- new id, health;
- if(sscanf(params,"ii", id, health)) return SendClientMessage(playerid, -1, ""R"/sethealth [playerid] [Health]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
- new string[150];
- format(string,sizeof(string),""YE"*Admin Notice: "W"%s(Id: %d) Changed %s(Id: %d) Health to %d ", GetName(playerid), playerid, GetName(id), id, health);
- ASCM(string);
- SetPlayerHealth(id, health);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:setmaptp(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=3)
- {
- new reponse;
- if(sscanf(params,"i", reponse)) return SendClientMessage(playerid, -1, ""R"/setmaptp [1/0] (1 = on | 0 = off)");
- if(reponse == 1)
- {
- new string[150];
- format(string,sizeof(string),""G"*Manager Notice: "W"%s(Id: %d) Enabled Map TP", GetName(playerid), playerid);
- MSCM(string);
- MAPTP[playerid] = 1;
- }
- if(reponse == 0)
- {
- new string[150];
- format(string,sizeof(string),""G"*Manager Notice: "W"%s(Id: %d) Disabled Map TP", GetName(playerid), playerid);
- MSCM(string);
- MAPTP[playerid] = 1;
- }
- }
- else return SendClientMessage(playerid, -1, "Error: You aren't a Manager!");
- return 1;
- }
- CMD:set(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >= 1 && PlayerInfo[playerid][Level] < 3) return SendClientMessage(playerid, -1, ""R"/set[weather/time/armour/health/skin/color]");
- if(PlayerInfo[playerid][Level] >= 3) return SendClientMessage(playerid, -1, ""R"/set[weather/time/armour/health/skin/maptp/gravity/level/vip]");
- return 1;
- }
- CMD:playstream(playerid, params[])
- {
- if(isnull(params)) return SendClientMessage(playerid, -1, "USAGE: /playstream [stream url]");
- PlayAudioStreamForPlayer(playerid, params);
- return 1;
- }
- CMD:lock(playerid, params[])
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new State=GetPlayerState(playerid);
- if(State!=PLAYER_STATE_DRIVER) return SendClientMessage(playerid,0xFF004040,""R"Error: "W"You can only lock the doors as the driver.");
- new i;
- for(i=0;i<MAX_PLAYERS;i++)
- {
- if(i != playerid)
- {
- SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
- }
- }
- SendClientMessage(playerid, 0x33AA33AA, ""G"Success: "W"Vehicle locked!");
- new Float:pX, Float:pY, Float:pZ;
- GetPlayerPos(playerid,pX,pY,pZ);
- PlayerPlaySound(playerid,1056,pX,pY,pZ);
- }
- else
- {
- SendClientMessage(playerid, 0xFF004040, ""R"Error: "W"You're not in a vehicle!");
- }
- return 1;
- }
- CMD:unlock(playerid, params[])
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new State=GetPlayerState(playerid);
- if(State!=PLAYER_STATE_DRIVER) return SendClientMessage(playerid,0xFF004040,""R"Error: "W"You can only unlock the doors as the driver.");
- for(new i=0;i<MAX_PLAYERS;i++)
- {
- SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
- }
- SendClientMessage(playerid, 0x33AA33AA, ""G"Success: "W"Vehicle unlocked!");
- new Float:pX, Float:pY, Float:pZ;
- GetPlayerPos(playerid,pX,pY,pZ);
- PlayerPlaySound(playerid,1057,pX,pY,pZ);
- }
- else
- {
- SendClientMessage(playerid, 0xFF004040, ""R"Error: "W"You're not in a vehicle!");
- }
- return 1;
- }
- CMD:deathmessage(playerid, params[])
- {
- new str[150], string[50];
- if(sscanf(params,"s[50]",string)) return SendClientMessage(playerid, -1,""R"USAGE: /deathmessage [message]");
- if(strlen(string) < 4) return SendClientMessage(playerid, -1, "Your deathmessage must at least contain more than 3 characters.");
- PlayerInfo[playerid][DMsg] = string;
- format(str, sizeof(str), ""O"You have changed your DeathMessage to "R"%s.", PlayerInfo[playerid][DMsg]);
- SendClientMessage(playerid, -1, str);
- return 1;
- }
- CMD:vcmds(playerid, params[])
- {
- new DIALOG[1246+200];
- strcat(DIALOG, ""R"Player Commands:\n\n");
- strcat(DIALOG, ""W" /changepassword /report /stats /getstats /v\n");
- strcat(DIALOG, ""W" /pm /requestskin\n/dm /admins /deathmessage /aastunt /lock /unlock \n");
- strcat(DIALOG, ""W" /requestfeature \n\n");
- strcat(DIALOG, ""R"V.I.P Commands:\n\n");
- strcat(DIALOG, ""O" Silver VIP Commands:\n\n");
- strcat(DIALOG, ""W" /inf /nrg /mycolor /mypm /myskin /vsay /ircpm \n\n");
- strcat(DIALOG, ""O" Golden VIP Commands:\n\n");
- strcat(DIALOG, ""W" /tp /vweather /vjetpack /vgod /getstats\n\n");
- strcat(DIALOG, ""W"V.IP's can use VIPChat using '% [Text]' !");
- strcat(DIALOG, ""W"Admin Commands at /acmds");
- ShowPlayerDialog(playerid, DIALOG_HELP, DIALOG_STYLE_MSGBOX, "Y-Player Commands", DIALOG, "Close", "");
- return 1;
- }
- CMD:ircpm(playerid, params[])
- {
- if(PlayerInfo[playerid][VIP] < 1) return SendClientMessage(playerid, -1, ""R"[YAdmin]: "GRI"Sorry, This Command can be used just by +Silver Donator's");
- new str[700], str2[256], str3[700], str4[800], user[44];
- if(sscanf(params, "ss[300]", user, str2)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /ircpm [user] [message]");
- {
- format(str, sizeof(str), ""YE"*PM To [IRC]%s: %s", user, str2);
- SendClientMessage(playerid, 0xFF0000FF, str);
- format(str3, sizeof(str3), "4*PM From %s(ID %d): %s", GetName(playerid), playerid, str2);
- IRC_Say(botIDs[0], user, str3);
- format(str4, sizeof(str4), ""YE"*Admin Notice: "W"Private Message From "YE"%s (Id: %d) "W"To "YE"[IRC]%s "W": "G"%s", GetName(playerid), playerid, user, str2);
- ASCM(str4);
- }
- return 1;
- }
- CMD:getstats(playerid, params[])
- {
- if(PlayerInfo[playerid][VIP] < 2) return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Sorry, This Command can be used just by +Golden Donator's");
- new id;
- if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1,""R"USAGE: /getstats [playerid]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
- new level[150];
- if(PlayerInfo[id][Level] == 0 && PlayerInfo[id][VIP] == 0)
- {
- level = "Regular Player";
- }
- else if(PlayerInfo[id][Level] == 1)
- {
- level = "San Andreas Playground Moderator";
- }
- else if(PlayerInfo[id][Level] == 2)
- {
- level = "San Andreas Playground Administrator";
- }
- else if(PlayerInfo[id][Level] == 3)
- {
- level = "San Andreas Playground Management";
- }
- else if(PlayerInfo[id][VIP] >= 1)
- {
- level = "Very Important Player";
- }
- new str[2048];
- format(str, sizeof(str), ""W"Name: "YE"%s\n", GetName(id));
- format(str, sizeof(str), "%s"W"Hours in game : "YE"%d hours %d Minutes\n",str, PlayerInfo[id][Hours], PlayerInfo[id][Minutes]);
- format(str, sizeof(str), "%s"W"Level : "YE"%s\n", str, level);
- format(str, sizeof(str), "%s"W"Kills(Count Of Victims) : "YE"%d\n",str, PlayerInfo[id][Kills]);
- format(str, sizeof(str), "%s"W"Deaths: "YE"%d\n",str, PlayerInfo[id][Deaths]);
- format(str, sizeof(str), "%s"W"Kicks(Count of Kicks): "YE"%d\n",str, PlayerInfo[id][Kicks]);
- format(str, sizeof(str), "%s"W"Bans(Count of Bans): "YE"%d\n",str, PlayerInfo[id][Bans]);
- format(str, sizeof(str), "%s"W"DeathMessage: "YE"%d\n",str, PlayerInfo[id][DMsg]);
- strcat(str, ""YE"You can see Stats of others players too ! How ? use /getstats or click player on TAB Dialog.\n");
- ShowPlayerDialog(playerid, 554985, DIALOG_STYLE_MSGBOX, "Player Stats", str, "Close", "");
- return 1;
- }
- CMD:inf(playerid, params[])
- {
- if(PlayerInfo[playerid][VIP] >= 2)
- {
- new Float:x, Float:y, Float:z, Float:Angle;
- GetPlayerPos(playerid, x, y, z);
- GetPlayerFacingAngle(playerid, Angle);
- vCar[playerid] = CreateVehicle(411, x, y, z, Angle, -1, -1, 60);
- PutPlayerInVehicle(playerid, vCar[playerid], 0);
- SendClientMessage(playerid, -1, ""G"Car spawned at your location!");
- }
- else return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Sorry, This Command can be used just by +Silver Donator's");
- return 1;
- }
- CMD:nrg(playerid, params[])
- {
- if(PlayerInfo[playerid][VIP] >= 1)
- {
- new Float:x, Float:y, Float:z, Float:Angle;
- GetPlayerPos(playerid, x, y, z);
- GetPlayerFacingAngle(playerid, Angle);
- vCar[playerid] = CreateVehicle(522, x, y, z, Angle, -1, -1, 60);
- PutPlayerInVehicle(playerid, vCar[playerid], 0);
- SendClientMessage(playerid, -1, ""G"Car spawned at your location!");
- }
- else return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Sorry, This Command can be used just by +Silver Donator's");
- return 1;
- }
- CMD:mypm(playerid, params[])
- {
- if(PlayerInfo[playerid][VIP] >= 1)
- {
- new id;
- if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1,""R"USAGE: /mypm [1/0] (on /off)");
- BlockPm[playerid] = id;
- SendClientMessage(playerid, -1, ""G"Success!");
- }
- else return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Sorry, This Command can be used just by +Silver Donator's");
- return 1;
- }
- CMD:myskin(playerid, params[])
- {
- if(PlayerInfo[playerid][VIP] >= 1)
- {
- new id;
- if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1,""R"USAGE: /mypm [skinID]");
- if(!IsValidSkin(id)) return SendClientMessage(playerid,0xF8F8F8FFF,""R"[SAP]: "GRI"Invalid skinID");
- SetPlayerSkin(playerid, id);
- SendClientMessage(playerid, -1, ""G"Success!");
- }
- else return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Sorry, This Command can be used just by +Silver Donator's");
- return 1;
- }
- CMD:vsay(playerid, params[])
- {
- if(PlayerInfo[playerid][VIP] >= 1)
- {
- if(sscanf(params,"s[50]",params)) return SendClientMessage(playerid, -1,""R"USAGE: /asay [text]");
- new string[200];
- format(string,sizeof(string),""O"**VIP(%s): %s", GetName(playerid), params);
- SendClientMessageToAll(-1, string);
- }
- else return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Sorry, This Command can be used just by +Silver Donator's");
- return 1;
- }
- CMD:mycolor(playerid, params[])
- {
- if(PlayerInfo[playerid][VIP] == 0) return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Sorry, This Command can be used just by +Silver Donator's");
- new color[32];
- if(sscanf(params, "s[32]", color))
- {
- SendClientMessage(playerid, COLOR_RED,"USAGE: /setcolor <0 - 10>");
- }
- else return SendClientMessage(playerid, COLOR_RED, "Invalid Color ID, Valid Color ID "YE"<0 - 10> ");
- if(!strcmp(params, "0", true))
- {
- SetPlayerColor(playerid, COLOR_BLACK);
- SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "W"Black");
- return 1;
- }
- else if(!strcmp(params, "1", true))
- {
- SetPlayerColor(playerid, COLOR_WHITE);
- SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "W"White");
- return 1;
- }
- else if(!strcmp(params, "2", true))
- {
- SetPlayerColor(playerid, COLOR_GREY);
- SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "GRI"Grey");
- return 1;
- }
- else if(!strcmp(params, "3", true))
- {
- SetPlayerColor(playerid, COLOR_ORANGE);
- SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "O"Orange");
- return 1;
- }
- else if(!strcmp(params, "4", true))
- {
- SetPlayerColor(playerid, COLOR_YELLOW);
- SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "YE"Yellow");
- return 1;
- }
- else if(!strcmp(params, "5", true))
- {
- SetPlayerColor(playerid, COLOR_RED);
- SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "R"Red");
- return 1;
- }
- else if(!strcmp(params, "6", true))
- {
- SetPlayerColor(playerid, COLOR_GREEN);
- SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "G"Green");
- return 1;
- }
- else if(!strcmp(params, "7", true))
- {
- SetPlayerColor(playerid, COLOR_BLUE);
- SendClientMessage(playerid, COLOR_GREEN, "You change your color name to Blue");
- return 1;
- }
- else if(!strcmp(params, "8", true))
- {
- SetPlayerColor(playerid, COLOR_PURPLE);
- SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "W"Purple");
- return 1;
- }
- else if(!strcmp(params, "9", true))
- {
- SetPlayerColor(playerid, COLOR_PINK);
- SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "W"Pink");
- return 1;
- }
- else if(!strcmp(params, "10", true))
- {
- SetPlayerColor(playerid, COLOR_VIOLET);
- SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "W"Violet");
- return 1;
- }
- return 1;
- }
- CMD:tp(playerid, params[])
- {
- if(PlayerInfo[playerid][VIP] < 2) return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Sorry, This Command can be used just by +Golden Donator's");
- new id;
- if(sscanf(params,"i", id)) return SendClientMessage(playerid, -1,""R"USAGE: /tp [playerid]");
- new Float:x, Float:y, Float:z, str[100];
- GetPlayerPos(id, x, y, z);
- SetPlayerPos(playerid, x, y, z+1);
- format(str, sizeof(str), "You have teleported to %s(ID:%d)", GetName(id), id);
- SendClientMessage(playerid, 0x00bbbb00 , str);
- return 1;
- }
- CMD:vgod(playerid, params[])
- {
- if(PlayerInfo[playerid][VIP] < 2) return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Sorry, This Command can be used just by +Golden Donator's");
- if(GodMode[playerid] == 1)
- {
- GodMode[playerid] = 0;
- SetPlayerHealth(playerid, 99.0);
- }
- if(GodMode[playerid] == 0)
- {
- GodMode[playerid] = 1;
- SetPlayerHealth(playerid, 99999999999);
- }
- return 1;
- }
- CMD:vjetpack(playerid, params[])
- {
- if(PlayerInfo[playerid][VIP] < 2) return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Sorry, This Command can be used just by +Golden Donator's");
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
- return 1;
- }
- CMD:vweather(playerid, params[])
- {
- if(PlayerInfo[playerid][VIP] < 2) return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Sorry, This Command can be used just by +Golden Donator's");
- new id;
- if(sscanf(params,"i", id)) return SendClientMessage(playerid, -1,""R"USAGE: /vweather [WeatherID]");
- SetPlayerWeather(playerid, strval(params));
- return 1;
- }
- CMD:requestfeature(playerid, params[])
- {
- new str[50], strk[250];
- if(isnull(params))
- {
- SendClientMessage(playerid, -1, ""R"Error: "W"/requestfeatures [featureid]");
- SendClientMessage(playerid, -1, ""R"Features IDs: AnimalsCars(0) AdminRamp(1) Ramping(2) Fly(3) Boost(4)");
- }
- if(strval(params) == 0) str = "AnimalsCars";
- if(strval(params) == 1) str = "AdminRamp";
- if(strval(params) == 2) str = "Ramping";
- if(strval(params) == 3) str = "Fly";
- if(strval(params) == 4) str = "Boost";
- format(strk, sizeof(strk), ""G"*Manager Notice: "W"Player %s (Id: %d) Send a Feeature request `%s`", GetName(playerid), playerid, str);
- MSCM(strk);
- return 1;
- }
- CMD:requestskin(playerid, params[])
- {
- new str[250];
- if(isnull(params)) return SendClientMessage(playerid, -1, ""R"Error: "W"/requestskin [skinid]");
- format(str, sizeof(str), ""YE"*Admin Notice: "W"Player %s (Id: %d) Send a Skin Change request Skin id = `%d`", GetName(playerid), playerid, strval(params));
- ASCM(str);
- return 1;
- }
- CMD:setlevel(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Error: You Need Manager Rights for use this cmd");
- new id, level;
- if(sscanf(params,"ii", id, level)) return SendClientMessage(playerid, -1,""R"USAGE: /setlevel [playerid] [Level]");
- if(PlayerInfo[id][Level] == level) return SendClientMessage(playerid, -1, ""R"Error: This Player Already have this level !");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
- if(level > 4 || level < 0 || level == 1) return SendClientMessage(playerid, -1, ""R"Error: There just 3 perm Levels! (Moderator Not include !)");
- PlayerInfo[id][Level] = level;
- if(PlayerInfo[id][Level] == 4)
- {
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Has been Promoted to an Mapper By %s (Id: %d)", GetName(id), id, GetName(playerid), playerid);
- MSCM(str);
- }
- if(PlayerInfo[id][Level] == 3)
- {
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Has been Promoted to an Manager By %s (Id: %d)", GetName(id), id, GetName(playerid), playerid);
- MSCM(str);
- }
- if(PlayerInfo[id][Level] == 0)
- {
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Has been Demonted to an Player By %s (Id: %d)", GetName(id), id, GetName(playerid), playerid);
- MSCM(str);
- }
- if(PlayerInfo[id][Level] == 2)
- {
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Has been Promoted to an Administrator By %s (Id: %d)", GetName(id), id, GetName(playerid), playerid);
- MSCM(str);
- }
- return 1;
- }
- CMD:setvip(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid) && PlayerInfo[playerid][Level] <= 2) return SendClientMessage(playerid, -1, "Error: You Need Manager Rights for use this cmd");
- new id, level;
- if(sscanf(params,"ii", id, level)) return SendClientMessage(playerid, -1,""R"USAGE: /setvip [playerid] [Level]");
- if(PlayerInfo[id][VIP] == level) return SendClientMessage(playerid, -1, ""R"Error: This Player Already have this level !");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
- if(level > 2 || level < 0) return SendClientMessage(playerid, -1, ""R"Error: There just 2 Levels! <0-2>");
- PlayerInfo[id][VIP] = level;
- if(PlayerInfo[id][VIP] == 1)
- {
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Has been Promoted to an Silver Donator By %s (Id: %d)", GetName(id), id, GetName(playerid), playerid);
- MSCM(str);
- }
- if(PlayerInfo[id][VIP] == 2)
- {
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Has been Promonted to an Golden Donator! By %s (Id: %d)", GetName(id), id, GetName(playerid), playerid);
- MSCM(str);
- }
- if(PlayerInfo[id][VIP] == 0)
- {
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Has been Demonted to an Player By %s (Id: %d)", GetName(id), id, GetName(playerid), playerid);
- MSCM(str);
- }
- return 1;
- }
- CMD:mute(playerid, params[])
- {
- new
- cmdid,
- reason[80],
- minutes,
- time,
- string[128]
- ;
- if(PlayerInfo[playerid][Level] < 1) SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- if(sscanf(params, "uis[80]", cmdid, minutes, reason)) return SendClientMessage(playerid,-1,""YE"USAGE: /mute [id/name] [time] [reason]");
- if(!IsPlayerConnected(cmdid) || cmdid == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"Player not found!");
- if(muted[cmdid] == 1) return SendClientMessage(playerid,COLOR_RED,"Error: This Player Already Muted!");
- if(time == 0)
- {
- new str[150];
- format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) Has been P-Muted By %s (Id: %d) Reason : %s", GetName(cmdid), cmdid, GetName(playerid), playerid, reason);
- ASCM(str);
- SendClientMessage(cmdid, COLOR_RED, "You got muted By an administrator");
- muted[cmdid] = 1;
- }
- else
- {
- new str[150];
- format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) Has been Muted By %s (Id: %d) For: %d Minutes | Reason : %s", GetName(cmdid), cmdid, GetName(playerid), playerid, minutes, reason);
- ASCM(str);
- format(string, sizeof(string), "You got muted By an administrator for %d minutes", minutes);
- muted[cmdid] = 1;
- Mute = SetTimerEx("unmuteTimer", 60*1000*minutes, false, "i", cmdid);
- }
- SendClientMessage(cmdid, -1, string);
- return 1;
- }
- CMD:unmute(playerid, params[])
- {
- new cmdid;
- if(PlayerInfo[playerid][Level] < 1) SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- if(sscanf(params, "u", cmdid)) return SendClientMessage(playerid,-1,""YE"USAGE: /unmute [id/name]");
- if(!IsPlayerConnected(cmdid) || cmdid == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"Player not found!");
- if(muted[cmdid] == 0) return SendClientMessage(playerid,COLOR_RED,"Error: This Player Already UnMuted!");
- new str[150];
- format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) Has been unMuted By %s (Id: %d)", GetName(cmdid), cmdid, GetName(playerid), playerid);
- ASCM(str);
- muted[cmdid] = 0;
- KillTimer(Mute);
- SendClientMessage(cmdid, -1, "You got unmuted By an administrator");
- return 1;
- }
- CMD:givemoderator(playerid, params[])
- {
- new id;
- if(PlayerInfo[playerid][Level] >=2)
- {
- if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1, ""YE"USAGE: /givemoderator [playerid]");
- PlayerInfo[id][Level] = 1;
- SendClientMessage(id, -1, ""YE"An administrator has granted you moderator rights!");
- new str[150];
- format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) has granted moderator rights to %s (Id: %d)", GetName(playerid), playerid, GetName(id), id);
- ASCM(str);
- SetPlayerColor(id, 0xFFFF00AA);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:admincolor(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] == 0) return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- SetPlayerColor(playerid, 0xFFFF00AA);
- return 1;
- }
- CMD:givegod(playerid,params[])
- {
- if(PlayerInfo[playerid][Level] >= 2)
- {
- new target;
- if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"/givegod [ID/Partofname]");
- if(godmode[target] == 0)
- {
- SetPlayerHealth(target,99999);
- SetPlayerArmour(target,99999);
- SendClientMessage(target,-1,""G"Godemode ON.");
- SendClientMessage(target,-1,""G"Player Godmode activated.");
- new str[150];
- format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) has enabled god mode to %s (Id: %d)", GetName(playerid), playerid, GetName(target), target);
- ASCM(str);
- godmode[target] = 1;
- }
- else return SendClientMessage(playerid,-1,"Player's Godmode is already on.");
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:takegod(playerid,params[])
- {
- if(PlayerInfo[playerid][Level] >= 2)
- {
- new target;
- if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"/takegod [ID/Partofname]");
- if(godmode[target] == 1)
- {
- SetPlayerHealth(target, 100);
- SetPlayerArmour(target, 0);
- SendClientMessage(target,-1,""R"Godemode OFF.");
- SendClientMessage(target,-1,""R"Player Godmode Disabled.");
- new str[150];
- format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) has disabled god mode to %s (Id: %d)", GetName(playerid), playerid, GetName(target), target);
- ASCM(str);
- }
- else return SendClientMessage(playerid,-1,"Player Godmode is already off.");
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:takemoderator(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=2)
- {
- new id;
- if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1, ""YE"USAGE: /takemoderator [playerid]");
- if(PlayerInfo[id][Level] == 1)
- {
- new str[150];
- format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) has taked moderator rights from %s (Id: %d)", GetName(playerid), playerid, GetName(id), id);
- ASCM(str);
- PlayerInfo[id][Level] = 0;
- SendClientMessage(id, -1, ""YE"You are no longer an moderator");
- }
- else return SendClientMessage(playerid, -1, "Error: you can just take admin from moderators");
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:ban(playerid,params[])
- {
- if(PlayerInfo[playerid][Level] >=2)
- {
- new IPx[16];
- new id,reason[50],string[300], str[300];
- if(sscanf(params,"us[200]",id, reason)) return SendClientMessage(playerid, -1,""R"USAGE: /ban [playerid] [reason]");
- GetPlayerIp(id, IPx, sizeof(IPx));
- format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) was banned by %s For: %s", GetName(id), id, GetName(playerid), reason);
- ASCM(string);
- for(new i = 0; i < 50; i++) SendClientMessage(id, -1,"");
- TogglePlayerControllable(id, 0);
- SendClientMessage(id, -1,""R"You are Currently Banned From San Andreas Playground");
- format(str, sizeof(str), "You are Banned by Administrator : "R"%s "W"with given a reason : "R"%s",GetName(playerid), reason );
- SendClientMessage(id, -1, str);
- SendClientMessage(id, -1, "if You Think This Ban was unfair ! Feel Free to create a ban appeal in our forum ");
- new querylist[512];
- format(querylist, sizeof(querylist), "INSERT INTO `banlist`(`name`, `ip`, `Admin`, `Reason`) VALUES('%s', '%s', '%s', '%s')", GetName(id), IPx, GetName(playerid), reason);
- mysql_query(yadmin, querylist);
- SetTimerEx("DelayBan", 1000, false, "i", id);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:kick(playerid,params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- new id,reason[50],string[300], str[300];
- if(sscanf(params,"us[178]",id, reason)) return SendClientMessage(playerid, -1,""R"USAGE: /kick [playerid] [reason]");
- format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) was Kicked by %s For: %s", GetName(id), id, GetName(playerid), reason);
- ASCM(string);
- for(new i = 0; i < 50; i++) SendClientMessage(id, -1,"");
- TogglePlayerControllable(id, 0);
- SendClientMessage(id, -1,""R"You have been kicked from San Andreas Playground");
- format(str, sizeof(str), "You were kicked by: "R"%s "W"with given a reason : "R"%s",GetName(playerid), reason);
- SendClientMessage(id, -1, str);
- SendClientMessage(id, -1, "if You Think You are Kick by unfair ! Feel Free to create a report in our forum ");
- SetTimerEx("DelayKick", 1000, false, "i", id);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:report(playerid,params[])
- {
- new id,reason[50],string[300];
- if(sscanf(params,"us[178]",id, reason)) return SendClientMessage(playerid, -1,""R"USAGE: /report [playerid] [reason]");
- format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) reported By %s(Id: %d) For: %s", GetName(id), id, GetName(playerid), playerid, reason);
- ASCM(string);
- format(string,sizeof(string),"*Admin Notice: Player %s (Id: %d) reported By %s(Id: %d) For: %s", GetName(id), id, GetName(playerid), playerid, reason);
- IRC_SendMessageToAdmins(2,string);
- return 1;
- }
- CMD:changename(playerid, params[])
- {
- new nick[50], str[150], string[128];
- if(sscanf(params,"s[50]",nick)) return SendClientMessage(playerid, -1,""R"USAGE: /changename [New nick]");
- format(str, sizeof(str), "UPDATE `accounts` SET `name`= '%s' WHERE `name` = '%s'", nick, GetName(playerid));
- format(str, sizeof(str), "UPDATE `accounts_2` SET `name`= '%s' WHERE `name` = '%s'", nick, GetName(playerid));
- SendClientMessage(playerid, -1,""YE"All Your Stats has been Moved To the new nick :D");
- mysql_query(yadmin, str);
- format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) Changed Her/His Name to %s", GetName(playerid), playerid, nick);
- ASCM(string);
- SetPlayerName(playerid, nick);
- return 1;
- }
- CMD:changepassword(playerid, params[])
- {
- new pass[50], str[150], string[128];
- if(sscanf(params,"s[50]",pass)) return SendClientMessage(playerid, -1,""R"USAGE: /changepassword [New password]");
- format(str, sizeof(str), "UPDATE `accounts` SET `Password`= '%s' WHERE `name` = '%s'",pass, GetName(playerid));
- SendClientMessage(playerid, -1,""YE"Your Password Changed !");
- mysql_query(yadmin, str);
- format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) Changed Her/His Password", GetName(playerid), playerid);
- ASCM(string);
- return 1;
- }
- CMD:clearchat(playerid,params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- new string[128];
- format(string,sizeof(string),""YE"*Admin Notice: "W"%s Clear The chat ", GetName(playerid));
- ASCM(string);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- for(new ik = 0; ik < 50; ik++)
- {
- SendClientMessage(playerid, COLOR_WHITE,"");
- }
- SendClientMessage(i, -1,""YE"Chat Cleared By An Administrator");
- }
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:sannounce(playerid,params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- if(!isnull(params))
- {
- new string[150], str[100];
- format(string,sizeof(string),""YE"*Admin Notice: "W"%s Announced to all players in chat `%s` ", GetName(playerid),params);
- ASCM(string);
- format(str,sizeof(str),""YE"%s", params);
- SendClientMessageToAll(COLOR_RED, "----------------------------------");
- SendClientMessageToAll(-1, str);
- SendClientMessageToAll(COLOR_RED, "----------------------------------");
- }
- else return SendClientMessage(playerid, -1, ""R"/sannounce [Text]");
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:showmessage(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- if(!isnull(params))
- {
- new string[150], str[100];
- format(string,sizeof(string),""YE"*Admin Notice: "W"%s Announced to all players in chat `%s` ", GetName(playerid),params);
- ASCM(string);
- format(str,sizeof(str),"~y~%s", params);
- GameTextForAll(str, 5000, 3);
- return 1;
- }
- else return SendClientMessage(playerid, -1, ""R"/ShowMessage [Text]");
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- }
- CMD:createtext(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] == 0)
- return SendClientMessage(playerid, -1, ""R"Error: "W"You are not authorized to use this command!");
- ShowPlayerDialog(playerid, EDITOBJ_DIALOG, DIALOG_STYLE_INPUT, "Texture", "Enter Object ID\nDon't know Object id?\nUse Following\n19353", "Enter", "Cancel");
- return 1;
- }
- CMD:edittext(playerid, params[])
- {
- new str[100];
- if(PlayerInfo[playerid][Level] == 0)
- return SendClientMessage(playerid, -1, ""R"Error: "W"You are not authorized to use this command!");
- if(isnull(params)) return SendClientMessage(playerid, -1, ""R"Error: "W"Invalid Object");
- new obje = strval(params);
- EditDynamicObject(playerid, obje);
- format(str,sizeof(str), ""G"Success "W": You now edit the object with ID %d", obje); //-> The number is 42.
- SendClientMessage(playerid, COLOR_RED, str);
- return 1;
- }
- CMD:deletetext(playerid, params[])
- {
- new str[100];
- if(PlayerInfo[playerid][Level] == 0)
- return SendClientMessage(playerid, -1, ""R"Error: "W"You are not authorized to use this command!");
- if(isnull(params)) return SendClientMessage(playerid, -1, ""R"Error: "W"You must enter an object id!");
- new obj = strval(params);
- DestroyDynamicObject(obj);
- format(str,sizeof(str), ""R"[SAP]: "GRI"You deleted object the with ID %d", obj); //-> The number is 42.
- SendClientMessage(playerid, COLOR_RED, str);
- return 1;
- }
- CMD:unban(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=2)
- {
- if(!isnull(params))
- {
- new Cache:result,query2[128];
- format(query2, 128, "SELECT * FROM `banlist` WHERE `name` = '%s'", params);
- result = mysql_query(yadmin, query2);
- new rows;
- cache_get_row_count(rows);
- if(!rows) return SendClientMessage(playerid, -1, ""R"Error: this account Not Banned!");
- new querys[128], string[150];
- format(querys, 128, "DELETE FROM `banlist` WHERE name = '%s'", params);
- mysql_query(yadmin, querys);
- format(string,sizeof(string),""YE"*Admin Notice: "W"Player : %s Has Been UnBanned By %s", params, GetName(playerid));
- ASCM(string);
- cache_delete(result);
- }
- else return SendClientMessage(playerid, -1,""R"USAGE: /unban [NickName]");
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:removeacc(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >= 3)
- {
- if(!isnull(params))
- {
- new Cache:result,query2[128];
- format(query2, 128, "SELECT * FROM `accounts` WHERE `name` = '%s'", params);
- result = mysql_query(yadmin, query2);
- new rows;
- cache_get_row_count(rows);
- cache_delete(result);
- if(!rows) return SendClientMessage(playerid, -1, ""R"Error: this account Not exists!");
- new querys[128], string[150];
- format(querys, 128, "DELETE FROM `accounts` WHERE name = '%s'", params);
- format(string,sizeof(string),""G"*Manager Notice: "W"Player : %s Account Has Been Deleted By %s", params, GetName(playerid));
- MSCM(string);
- }
- else return SendClientMessage(playerid, -1,""R"USAGE: /removeacc [NickName]");
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Manager!");
- return 1;
- }
- CMD:jail(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- new id,reason[50],duration,string[128];
- if(sscanf(params,"u[128]i,i",id,duration)) return SendClientMessage(playerid, -1,""R"USAGE: /jail [playerid] [duration in mins] ");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
- if(IsJailed[id] == 1) return SendClientMessage(playerid, -1,""R"Error: This Player already in jail!");
- format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) was Jailed by %s For: %d mins", GetName(id), id, GetName(playerid), duration, reason);
- ASCM(string);
- SendClientMessage(id, -1, ""R"An Administrator Jailed You ! for more informations use @ [Text]");
- SetPlayerVirtualWorld(id, 588);
- SetPlayerPos(id, 8991.62, -9793.03, 1.5);
- SetPlayerFacingAngle(id, 255.0);
- SetPlayerWeather(id, 18);
- SetPlayerInterior(id, 0);
- ResetPlayerWeapons(id);
- IsJailed[id] = 1;
- Jail = SetTimerEx("unjail", duration*60000, false, "i", id);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:unjail(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- new id;
- if(sscanf(params,"i",id)) return SendClientMessage(playerid,-1,"USAGE: /unjail [playerid]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
- new string[100];
- if(IsJailed[id] == 0) return SendClientMessage(playerid, -1,""R"Error: This Player not in jail");
- SpawnPlayer(id);
- IsJailed[id] = 0;
- format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) was UnJailed by %s ", GetName(id), id, GetName(playerid));
- ASCM(string);
- SendClientMessage(id, -1, ""R"You Got unjailed by an administrator!");
- KillTimer(Jail);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:nuke(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- new id;
- if(sscanf(params,"i",id)) return SendClientMessage(playerid,-1,"USAGE: /nuke [playerid]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
- new Float:X, Float:Y, Float:Z, string[120];
- GetPlayerPos(id, X, Y, Z);
- CreateExplosion(X, Y, Z + 3, 1, 10);
- format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) Got Nuked By : %s ", GetName(id), id, GetName(playerid));
- ASCM(string);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:givecash(playerid,params[])
- {
- if(PlayerInfo[playerid][Level] >=2)
- {
- new id, string[128];
- new cash;
- if(sscanf(params,"ui",id, cash)) return SendClientMessage(playerid,-1,"USAGE: /givecash [playerid] [Amount]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"ERROR: That player isn't online!");
- GivePlayerMoney(id, cash);
- format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) Get $ %d From Admin : %s (Id: %d) ", GetName(id), id, cash, GetName(playerid), playerid);
- ASCM(string);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:giveweapon(playerid,params[])
- {
- if(PlayerInfo[playerid][Level] >=2)
- {
- new id, string[128];
- new wid;
- if(sscanf(params,"ui",id, wid)) return SendClientMessage(playerid,-1,"USAGE: /giveweapon [playerid] [weaponid]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"ERROR: That player isn't online!");
- Given[id] = 1;
- GivePlayerWeapon(id, wid, 1500);
- format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) Give Weapon (Id: %d) to %s(Id: %d) ", GetName(playerid), playerid, wid, GetName(id), id);
- ASCM(string);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:giveallweapon(playerid,params[])
- {
- if(PlayerInfo[playerid][Level] >=2)
- {
- new string[128];
- new wid;
- if(sscanf(params,"i", wid)) return SendClientMessage(playerid,-1,"USAGE: /giveallweapon [weaponid]");
- foreach(new i : Player)
- {
- Given[i] = 1;
- GivePlayerWeapon(i, wid, 1500);
- }
- format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) Give Weapon (Id: %d) to All Players ", GetName(playerid), playerid, wid);
- ASCM(string);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:fix(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- new id;
- if(sscanf(params,"i",id)) return SendClientMessage(playerid,-1,"USAGE: /fix [playerid]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
- new Float:X, Float:Y, Float:Z, string[120];
- GetPlayerPos(id, X, Y, Z);
- SpawnPlayer(id);
- format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) Has Been Spawned By : %s ", GetName(id), id, GetName(playerid));
- ASCM(string);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:freeze(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- new id;
- if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1,""R"USAGE: /freeze [playerid]");
- if(IsFreezed[id] == 1) return SendClientMessage(playerid, -1, ""R"Error: This Player Already Freezed !");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
- new string[200];
- TogglePlayerControllable(id, 0);
- format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) Got Freezed By : %s ", GetName(id), id, GetName(playerid));
- ASCM(string);
- IsFreezed[id] = 1;
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:unfreeze(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- new id;
- if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1,""R"USAGE: /unfreeze [playerid]");
- if(IsFreezed[id] == 0) return SendClientMessage(playerid, -1, ""R"Error: This Player Already UnFreezed !");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
- new string[200];
- TogglePlayerControllable(id, 1);
- IsFreezed[id] = 0;
- format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) Got UnFreezed By : %s ", GetName(id), id, GetName(playerid));
- ASCM(string);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:watch(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- new id;
- if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1,""R"USAGE: /watch [playerid]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
- if(Spec[playerid] == 1) return SendClientMessage(playerid, -1, ""R"Error: You already Watching a player :/");
- new string[200];
- format(string,sizeof(string),""YE"*Admin Notice: "W"%s (Id: %d) Currently Watching Player : %s (Id: %d)", GetName(playerid), playerid, GetName(id), id);
- ASCM(string);
- TogglePlayerSpectating(playerid, 1);
- PlayerSpectatePlayer(playerid, id);
- Spec[playerid] = 1;
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:stopwatch(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- if(Spec[playerid] == 0) return SendClientMessage(playerid, -1, ""R"Error: You are Not watching anyone");
- new string[200];
- format(string,sizeof(string),""YE"*Admin Notice: "W"%s (Id: %d) Stop Watching and Back to Duty Mode", GetName(playerid), playerid);
- TogglePlayerSpectating(playerid, 0);
- ASCM(string);
- Spec[playerid] = 0;
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:rpweapons(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- new id;
- if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1,""R"USAGE: /rpweapons [playerid]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
- new string[200];
- ResetPlayerWeapons(id);
- IsFreezed[id] = 0;
- format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) Weapons Has Been Removed By : %s ", GetName(id), id, GetName(playerid));
- ASCM(string);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- CMD:admins(playerid, params[])
- {
- new admins, string[128];
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, ""YE" Online administrators.");
- foreach(new i : Player)
- {
- if(IsPlayerConnected(i))
- {
- if(PlayerInfo[i][Level] == 1)
- {
- admins++;
- format(string, sizeof(string), "%s - "O"Moderator", GetName(i));
- SendClientMessage(playerid, -1, string);
- }
- if(PlayerInfo[i][Level] == 2)
- {
- admins++;
- format(string, sizeof(string), "%s - "YE"Administrator", GetName(i));
- SendClientMessage(playerid, -1, string);
- }
- if(PlayerInfo[i][Level] == 3 )
- {
- admins++;
- format(string, sizeof(string), "%s - "G"Manager", GetName(i));
- SendClientMessage(playerid, -1, string);
- }
- if(PlayerInfo[i][Level] >= 4 )
- {
- admins++;
- format(string, sizeof(string), "%s - "R"Mapper", GetName(i));
- SendClientMessage(playerid, -1, string);
- }
- }
- }
- SendClientMessage(playerid, -1, "");
- if (admins == 0)
- {
- SendClientMessage(playerid, -1, "There No Admins Connected");
- }
- return 1;
- }
- CMD:asay(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >=1)
- {
- if(sscanf(params,"s[50]",params)) return SendClientMessage(playerid, -1,""R"USAGE: /asay [text]");
- new string[200];
- format(string,sizeof(string),"*Admin(%s): %s", GetName(playerid), params);
- SendClientMessageToAll(COLOR_BLUE, string);
- }
- else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
- return 1;
- }
- IRCCMD:say(botid, channel[], user[], host[], params[])
- {
- if (IRC_IsOwner(botid, channel, user))
- {
- // Check if the user entered any text
- if (!isnull(params))
- {
- new msg[128];
- // Echo the formatted message
- format(msg, sizeof(msg), "02Owner(%s) on IRC: %s", user, params);
- IRC_GroupSay(groupID, channel, msg);
- format(msg, sizeof(msg), "**Owner(%s): %s", user, params);
- SendClientMessageToAll(COLOR_BLUE, msg);
- }
- return 1;
- }
- if (IRC_IsAdmin(botid, channel, user))
- {
- // Check if the user entered any text
- if (!isnull(params))
- {
- new msg[128];
- // Echo the formatted message
- format(msg, sizeof(msg), "02Manager(%s) on IRC: %s", user, params);
- IRC_GroupSay(groupID, channel, msg);
- format(msg, sizeof(msg), "**Manager(%s): %s", user, params);
- SendClientMessageToAll(COLOR_BLUE, msg);
- }
- return 1;
- }
- if (IRC_IsOp(botid, channel, user))
- {
- // Check if the user entered any text
- if (!isnull(params))
- {
- new msg[128];
- // Echo the formatted message
- format(msg, sizeof(msg), "02Admin(%s) on IRC: %s", user, params);
- IRC_GroupSay(groupID, channel, msg);
- format(msg, sizeof(msg), "*Admin(%s): %s", user, params);
- SendClientMessageToAll(COLOR_BLUE, msg);
- }
- return 1;
- }
- if (IRC_IsHalfop(botid, channel, user))
- {
- // Check if the user entered any text
- if (!isnull(params))
- {
- new msg[128];
- // Echo the formatted message
- format(msg, sizeof(msg), "02Moderator(%s) on IRC: %s", user, params);
- IRC_GroupSay(groupID, channel, msg);
- format(msg, sizeof(msg), "*Moderator(%s): %s", user, params);
- SendClientMessageToAll(COLOR_BLUE, msg);
- }
- return 1;
- }
- // Check if the user has at least voice in the channel
- if (IRC_IsVoice(botid, channel, user))
- {
- // Check if the user entered any text
- if (!isnull(params))
- {
- new msg[128];
- // Echo the formatted message
- format(msg, sizeof(msg), "02*VIP(%s) on IRC: %s", user, params);
- IRC_GroupSay(groupID, channel, msg);
- format(msg, sizeof(msg), "VIP(%s): %s", user, params);
- SendClientMessageToAll(COLOR_ORANGE, msg);
- }
- return 1;
- }
- else
- {
- if (!isnull(params))
- {
- new msg[128];
- // Echo the formatted message
- format(msg, sizeof(msg), "02[-] 07%s: %s", user, params);
- IRC_GroupSay(groupID, channel, msg);
- format(msg, sizeof(msg), "[-] %s: %s", user, params);
- SendClientMessageToAll(-1, msg);
- }
- return 1;
- }
- }
- IRCCMD:freeze(botid, channel[], user[], host[], params[])
- {
- // Check if the user is at least a halfop in the channel
- if (IRC_IsHalfop(botid, channel, user))
- {
- new playerid, reason[64];
- // Check if the user at least entered a player ID
- if (sscanf(params, "dS(No reason)[64]", playerid, reason))
- {
- return 1;
- }
- // Check if the player is connected
- if (IsPlayerConnected(playerid))
- {
- // Echo the formatted message
- new msg[128], name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- format(msg, sizeof(msg), "02*** %s has been freezed by %s on IRC. (%s)", name, user, reason);
- IRC_GroupSay(groupID, channel, msg);
- format(msg, sizeof(msg), ""YE"*Admin Notice: "W"%s has been freezed by %s on IRC. (%s)", name, user, reason);
- ASCM(msg);
- // freeze the player
- TogglePlayerControllable(playerid, 0);
- }
- }
- return 1;
- }
- IRCCMD:unfreeze(botid, channel[], user[], host[], params[])
- {
- // Check if the user is at least a halfop in the channel
- if (IRC_IsHalfop(botid, channel, user))
- {
- new playerid, reason[64];
- // Check if the user at least entered a player ID
- if (sscanf(params, "dS(No reason)[64]", playerid, reason))
- {
- return 1;
- }
- // Check if the player is connected
- if (IsPlayerConnected(playerid))
- {
- // Echo the formatted message
- new msg[128], name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- format(msg, sizeof(msg), "02*** %s has been unfreezed by %s on IRC. (%s)", name, user, reason);
- IRC_GroupSay(groupID, channel, msg);
- format(msg, sizeof(msg), ""YE"*Admin Notice: "W"%s has been unfreezed by %s on IRC. (%s)", name, user, reason);
- ASCM(msg);
- // freeze the player
- TogglePlayerControllable(playerid, 1);
- }
- }
- return 1;
- }
- IRCCMD:kill(botid, channel[], user[], host[], params[])
- {
- // Check if the user is at least a halfop in the channel
- if (IRC_IsHalfop(botid, channel, user))
- {
- new playerid, reason[64];
- // Check if the user at least entered a player ID
- if (sscanf(params, "dS(No reason)[64]", playerid, reason))
- {
- return 1;
- }
- // Check if the player is connected
- if (IsPlayerConnected(playerid))
- {
- // Echo the formatted message
- new msg[128], name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- format(msg, sizeof(msg), "02*** %s has been killed by %s on IRC. (%s)", name, user, reason);
- IRC_GroupSay(groupID, channel, msg);
- format(msg, sizeof(msg), ""YE"*Admin Notice: "W"%s has been killed by %s on IRC. (%s)", name, user, reason);
- ASCM(msg);
- // Kill the player
- SetPlayerHealth(playerid, 0);
- }
- }
- return 1;
- }
- IRCCMD:kick(botid, channel[], user[], host[], params[])
- {
- // Check if the user is at least a halfop in the channel
- if (IRC_IsHalfop(botid, channel, user))
- {
- new id,reason[50],string[300], str[300];
- if(sscanf(params,"us[178]",id, reason)) return IRC_Say(groupID, channel, "7Usage: 1!kick [ID] [reason]");
- format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) was Kicked by %s For: %s", GetName(id), id, user, reason);
- ASCM(string);
- for(new i = 0; i < 50; i++) SendClientMessage(id, -1,"");
- TogglePlayerControllable(id, 0);
- SendClientMessage(id, -1,""R"You have been kicked from San Andreas Playground");
- format(str, sizeof(str), "You were kicked by: "R"%s "W"with given a reason : "R"%s",user, reason);
- SendClientMessage(id, -1, str);
- SendClientMessage(id, -1, "if You Think You are Kick by unfair ! Feel Free to create a report in our forum ");
- SetTimerEx("DelayKick", 1000, false, "i", id);
- }
- return 1;
- }
- IRCCMD:ban(botid, channel[], user[], host[], params[])
- {
- // Check if the user is at least an op in the channel
- if (IRC_IsOp(botid, channel, user))
- {
- new IPx[16];
- new id,reason[50],string[300], str[300];
- if(sscanf(params,"us[200]",id, reason)) return IRC_Say(groupID, channel, "7Usage: 1!ban [ID] [reason]");
- GetPlayerIp(id, IPx, sizeof(IPx));
- format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) was banned by %s For: %s", GetName(id), id, user, reason);
- ASCM(string);
- for(new i = 0; i < 50; i++) SendClientMessage(id, -1,"");
- TogglePlayerControllable(id, 0);
- SendClientMessage(id, -1,""R"You are Currently Banned From San Andreas Playground");
- format(str, sizeof(str), "You are Banned by Administrator : "R"%s "W"with given a reason : "R"%s", user, reason);
- SendClientMessage(id, -1, str);
- SendClientMessage(id, -1, "if You Think This Ban was unfair ! Feel Free to create a ban appeal in our forum ");
- new querylist[512];
- format(querylist, sizeof(querylist), "INSERT INTO `banlist`(`name`, `ip`, `Admin`, `Reason`) VALUES('%s', '%s', '%s', '%s')", GetName(id), IPx, user, reason);
- mysql_query(yadmin, querylist);
- SetTimerEx("DelayBan", 1000, false, "i", id);
- }
- return 1;
- }
- IRCCMD:rcon(botid, channel[], user[], host[], params[])
- {
- // Check if the user is at least an op in the channel
- if (IRC_IsOwner(botid, channel, user))
- {
- // Check if the user entered any text
- if (!isnull(params))
- {
- // Check if the user did not enter any invalid commands
- if (strcmp(params, "exit", true) != 0 && strfind(params, "loadfs irc", true) == -1)
- {
- // Echo the formatted message
- new msg[128];
- format(msg, sizeof(msg), "RCON command %s has been executed.", params);
- IRC_GroupSay(groupID, channel, msg);
- // Send the command
- SendRconCommand(params);
- }
- }
- }
- return 1;
- }
- IRCCMD:pm(botid, channel[], user[], host[], params[])
- {
- new string[128], str1[128], ppid, pname[MAX_PLAYER_NAME];
- if(sscanf(params, "us[100]", ppid, str1))
- {
- IRC_Say(groupID, channel, "Usage: !pm [ID] [message]");
- return 1;
- }
- if(!IsPlayerConnected(ppid)) return IRC_Say(groupID, channel, "Invalid Player ID.");
- {
- GetPlayerName(ppid, pname, sizeof(pname));
- format(string, sizeof(string), "4PM To: %s(ID %d): %s", pname, ppid, str1);
- IRC_Say(groupID, user, string);
- format(str1, sizeof(str1), "*PM From [IRC]%s : %s", user, str1);
- SendClientMessage(ppid, COLOR_ORANGE, str1);
- }
- return 1;
- }
- IRCCMD:slap(botid, channel[], user[], host[], params[])
- {
- new sid, str[128], str2[128], pname[MAX_PLAYER_NAME], Float:slapx, Float:slapy, Float:slapz;
- if(!IRC_IsHalfop(botid, channel, user)) return IRC_Say(groupID, channel, "Invalid Level");
- {
- if(sscanf(params, "us[128]", sid, str))
- {
- IRC_Say(groupID, channel, "7Usage: 1!slap [ID] [reason]");
- }
- if(!IsPlayerConnected(sid)) return IRC_Say(groupID, channel, "7Error: 1Player Logged off");
- GetPlayerName(sid, pname, sizeof(pname));
- format(str2, sizeof(str2), " 1*%s Has Been Slapped By 3,9IRC Administrator1 %s - 4Reason:1 %s", pname, user, str);
- IRC_Say(groupID, channel, str2);
- GetPlayerPos(sid, slapx, slapy, slapz);
- SetPlayerPos(sid, slapx, slapy, slapz+10);
- }
- return 1;
- }
- IRCCMD:givecash(botid, channel[], user[], host[], params[])
- {
- new gcid, amount, pname[MAX_PLAYER_NAME];
- if(!IRC_IsOp(botid, channel, user)) return IRC_Say(groupID, channel, "Invalid Level");
- if(sscanf(params,"ui", gcid, amount)) return IRC_Say(groupID, channel, "7Usage: 1!givecash [ID] [Amount]");
- if(!IsPlayerConnected(gcid)) return IRC_Say(groupID, channel, "Invalid Player ID.");
- GetPlayerName(gcid, pname, sizeof(pname));
- GivePlayerMoney(gcid, amount);
- return 1;
- }
- IRCCMD:cmds(botid, channel[], user[], host[], params[])
- {
- if(!strcmp(channel, channel, true))
- {
- IRC_Say(botid, user, "04 [IRC Commands] ");
- IRC_Say(groupID, user, "| User: !pm !players !say ");
- {
- if(IRC_IsHalfop(botid, channel, user))
- {
- IRC_Say(groupID, user, "| Moderators: !slap !kick !clearchat !warn !getip");
- }
- if(IRC_IsOp(botid, channel, user))
- {
- IRC_Say(groupID, user, "| Administrators: !explode !ban !givecash !freeze !unfreeze !setwanted !loc !givemoderator");
- }
- if(IRC_IsAdmin(botid, channel, user))
- {
- IRC_Say(groupID, user, "| Managements: !cprotect !crestore ");
- }
- if(IRC_IsOwner(botid, channel, user))
- {
- IRC_Say(groupID, user, "| Owner: !restart !rcon !setlevel ");
- }
- }
- }
- return 1;
- }
- IRCCMD:restart(botid, channel[], user[], host[], params[])
- {
- if(!IRC_IsOwner(botid, channel, user)) return IRC_Say(groupID, channel, "Invalid Level.");
- SendRconCommand("gmx");
- return 1;
- }
- IRCCMD:cprotect(botid, channel[], user[], host[], params[])
- {
- if(!IRC_IsAdmin(botid, channel, user)) return IRC_Say(groupID, channel, "Invalid Level.");
- new pmode[50];
- format(pmode, sizeof(pmode), "mode %s +miRCp", channel);
- IRC_SendRaw(botid, pmode);
- return 1;
- }
- IRCCMD:crestore(botid, channel[], user[], host[], params[])
- {
- if(!IRC_IsAdmin(botid, channel, user)) return IRC_Say(groupID, channel, "Invalid Level.");
- new pmode[50];
- format(pmode, sizeof(pmode), "mode %s -miRCp", channel);
- IRC_SendRaw(botid, pmode);
- return 1;
- }
- IRCCMD:explode(botid, channel[], user[], host[], params[])
- {
- if(!IRC_IsOp(botid, channel, user)) return IRC_Say(groupID, channel, "Invalid Level.");
- new exid, reason[80]; new pname[MAX_PLAYER_NAME];
- if(sscanf(params, "uS(No Reason)[80]", exid, reason))
- {
- IRC_GroupSay(groupID, user, "04USAGE: !explode [ID] [Reason]");
- return 1;
- }
- if(!IsPlayerConnected(exid))
- {
- IRC_GroupSay(groupID, user, "04ERROR: Invalid Player ID");
- return 1;
- }
- new Float:ircx, Float:ircy, Float:ircz, string[100], str2[100];
- GetPlayerPos(exid, ircx, ircy, ircz);
- CreateExplosion(ircx, ircy, ircz, 6, 10);
- CreateExplosion(ircx, ircy, ircz, 6, 10);
- GetPlayerName(exid, pname, sizeof(pname));
- format(string, sizeof(string), ""YE"*Admin Notice: "W"IRC Administrator %s Has Exploded %s(%d) - Reason: %s", user, pname, exid, reason);
- ASCM(string);
- format(str2, sizeof(str2), "4(EXPLOSION):1 IRC Admin %s Exploded %s(%d) - Reason: %s", user, pname, exid, reason);
- IRC_Say(groupID, IRCChannel, str2);
- return 1;
- }
- IRCCMD:getip(botid, channel[], user[], host[], params[])//ReV
- {
- if(!IRC_IsHalfop(botid, channel, user)) return false;
- new giveplayerid, ip[16], str[128];
- new dfgiveplayer[MAX_PLAYER_NAME];
- if(sscanf(params, "i", giveplayerid))
- {
- IRC_GroupSay(groupID, IRCChannel, "Usage: !getip [playerid]");
- return false;
- }
- GetPlayerName(giveplayerid, dfgiveplayer, sizeof(dfgiveplayer));
- GetPlayerIp(giveplayerid, ip, sizeof(ip));
- if(!IsPlayerConnected(giveplayerid))
- {
- IRC_GroupSay(groupID, channel, "4Error:3 Invalid Player ID!");
- return 1;
- }
- format(str, 128, "2Player:1 %s(%i) 4IP:1 Is %s", dfgiveplayer, giveplayerid, ip);
- IRC_GroupSay(groupID, channel, str);
- #pragma unused botid, user
- return true;
- }
- IRCCMD:players(conn, channel[], user[], params[]) //made by Grove, taken from CYS Echo Bot 1.2
- {
- new count, PlayerNames[512], string[256];
- for(new i=0; i<=MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(count == 0)
- {
- new PlayerName1[MAX_PLAYER_NAME];
- GetPlayerName(i, PlayerName1, sizeof(PlayerName1));
- format(PlayerNames, sizeof(PlayerNames),"2%s1", PlayerName1);
- count++;
- }
- else
- {
- new PlayerName1[MAX_PLAYER_NAME];
- GetPlayerName(i, PlayerName1, sizeof(PlayerName1));
- format(PlayerNames, sizeof(PlayerNames),"%s, 2%s1", PlayerNames, PlayerName1);
- count++;
- }
- }
- else { if(count == 0) format(PlayerNames, sizeof(PlayerNames), "1No Players Online!"); }
- }
- new counter = 0;
- for(new i=0; i<=MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i)) counter++;
- }
- format(string, 256, "5Connected Players[%d]:1 %s", counter, PlayerNames);
- IRC_Say(conn, channel, string);
- #pragma unused params,user
- return true;
- }
- IRCCMD:clearchat(conn, channel[], user[], message[])
- {
- if(IRC_IsHalfop(conn, channel, user) == 0) return IRC_Say(conn, channel, "Invalid Level");
- {
- for( new i = 0; i <= 100; i ++ ) SendClientMessageToAll(COLOR_WHITE, "");
- }
- new string[256];
- format(string, sizeof(string), "An IRC Administrator %s has cleared the chat", user);
- SendClientMessageToAll(COLOR_WHITE, string);
- IRC_Say(conn, channel, string);
- #pragma unused message
- return 1;
- }
- IRCCMD:setlevel(botid, channel[], user[], host[], params[])
- {
- if(IRC_IsOwner(botid, channel, user) == 0) return IRC_Say(groupID, channel, "Invalid Level");
- new id, level;
- if(sscanf(params,"ii", id, level)) return IRC_Say(groupID, channel, "7Usage: 1!setlevel [playerid] [Level]");
- if(PlayerInfo[id][Level] == level) return IRC_Say(groupID, channel, "7Error: 1This Player Already have this level !");
- if(!IsPlayerConnected(id)) return IRC_Say(groupID, channel, "4Error: This Player Logged off !");
- if(level > 3 || level < 0 || level == 1) return IRC_Say(groupID, channel, "4Error: There just 2 perm Levels! (Moderator Not include !)");
- PlayerInfo[id][Level] = level;
- if(PlayerInfo[id][Level] == 3)
- {
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Has been Promoted to an Manager By %s on IRC", GetName(id), id, user);
- MSCM(str);
- IRC_Say(groupID, channel, "7Success: 1this player is an manager now!");
- }
- if(PlayerInfo[id][Level] == 0)
- {
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Has been Demonted to an Player By %s on IRC", GetName(id), id, user);
- MSCM(str);
- IRC_Say(groupID, channel, "7Success: 1this staff member is an player now!");
- }
- if(PlayerInfo[id][Level] == 2)
- {
- new str[150];
- format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Has been Promoted to an Administrator By %s (on IRC", GetName(id), id, user);
- MSCM(str);
- IRC_Say(groupID, channel, "7Success: 1this player is an administrator now!");
- }
- return 1;
- }
- IRCCMD:givemoderator(botid, channel[], user[], host[], params[])
- {
- new id;
- if(IRC_IsOp(botid, channel, user))
- {
- if(sscanf(params,"i",id)) return IRC_Say(groupID, channel, "7Usage: 1!givemoderator [playerid]");
- PlayerInfo[id][Level] = 1;
- SendClientMessage(id, -1, ""YE"An administrator has granted you moderator rights!");
- new str[150];
- format(str, sizeof(str), ""YE"*Admin Notice: "W"%s has granted moderator rights to %s (Id: %d)", user, GetName(id), id);
- ASCM(str);
- IRC_Say(groupID, channel, "7Success: 1this player is an moderator now!");
- SetPlayerColor(id, 0xFFFF00AA);
- }
- else return IRC_Say(groupID, channel, "Invalid Level");
- return 1;
- }
- IRCCMD:admin(botid, channel[], user[], host[], params[])
- {
- new msg[100], str[100];
- if(IRC_IsAdmin(botid, channel, user))
- {
- if(sscanf(params,"s[100]",msg)) return IRC_Say(groupID, channel, "7Usage: 1!admin [message]");
- format(str, sizeof(str), ""YE"*Manager(%s)on IRC: %s", user, params);
- ASCM(str);
- return 1;
- }
- if(IRC_IsOp(botid, channel, user))
- {
- if(sscanf(params,"s[100]",msg)) return IRC_Say(groupID, channel, "7Usage: 1!admin [message]");
- format(str, sizeof(str), ""YE"*Admin(%s)on IRC: %s", user, params);
- ASCM(str);
- return 1;
- }
- if(IRC_IsHalfop(botid, channel, user))
- {
- if(sscanf(params,"s[100]",msg)) return IRC_Say(groupID, channel, "7Usage: 1!admin [message]");
- format(str, sizeof(str), ""YE"*Moderator(%s)on IRC: %s", user, params);
- ASCM(str);
- return 1;
- }
- else return IRC_Say(groupID, channel, "Error: Invalid Level");
- }
- public onMySQLCheck(playerid)
- {
- new
- rows, str[200];
- cache_get_row_count(rows);
- if(rows == 1)
- {
- cache_get_value_name(0, "Password", PlayerInfo[playerid][Password], 129);
- ShowPlayerDialog(playerid, Login, DIALOG_STYLE_INPUT, "Login", "Welcome !\nthis account already registred. Please fill in your password:", "Login", "Quit");
- SendClientMessage(playerid, COLOR_BLUE, "-------------------------------------------------------------------------------------------------------------");
- format(str, sizeof(str), "* Welcome back %s, to "SERVNAME" ...", GetName(playerid));
- SendClientMessage(playerid, COLOR_GREEN, str);
- SendClientMessage(playerid, COLOR_GREEN, "* Your account is already registered on the server, type your password into the dialog box displayed below.");
- SendClientMessage(playerid, COLOR_GREEN, "* Visit our website/forums at "SERVWEB"");
- SendClientMessage(playerid, COLOR_GREEN, "* Have Fun !");
- SendClientMessage(playerid, COLOR_BLUE, "-------------------------------------------------------------------------------------------------------------");
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_BLUE, " ---------------------------------------------------------------------------------------------------------------");
- format(str, sizeof(str), "* Welcome %s, to the "SERVNAME".", GetName(playerid));
- SendClientMessage(playerid, COLOR_GREEN, str);
- format(str, sizeof(str), "* Your name (%s) is not registered...", GetName(playerid));
- SendClientMessage(playerid, COLOR_GREEN, str);
- SendClientMessage(playerid, COLOR_GREEN, "* Please register your account with entring a password on the box below");
- SendClientMessage(playerid, COLOR_GREEN, "* If you register then you will get money from your Propertys and access to more features!");
- SendClientMessage(playerid, COLOR_GREEN, "* We have many commands here at "SERVNAME"..type /commands or /cmds to learn more.");
- SendClientMessage(playerid, COLOR_GREEN, "* Use your money wisely and go buy a Propertys and make some more money");
- SendClientMessage(playerid, COLOR_GREEN, "* Stick with the server rules and enjoy gaming here!");
- SendClientMessage(playerid, COLOR_GREEN, "* Visit our website/forums at "SERVWEB"");
- SendClientMessage(playerid, COLOR_GREEN, "* Have Fun !");
- SendClientMessage(playerid, COLOR_BLUE, "-----------------------------------------------------------------------------------------------------------------");
- new RegisterDS[1024];
- format(RegisterDS, sizeof(RegisterDS),""W"Welcome to "SERVNAME""YE"%s\n\n", GetName(playerid));
- strcat(RegisterDS,""W"You are not registered yet on this server,\n");
- strcat(RegisterDS,""W"Enter your password below to register\n");
- strcat(RegisterDS,""W"By registering all your statistics will be saved in server database!\n\n");
- strcat(RegisterDS,""R"Info"W":\n");
- strcat(RegisterDS,""R"- "W"Your password must contain at least 4 characters\n");
- strcat(RegisterDS,""R"- "W"Remember your password, you will need it for your next login\n");
- ShowPlayerDialog(playerid, Register, DIALOG_STYLE_PASSWORD, ""R" "W"SAP Register Account", RegisterDS, "Register","" );
- }
- return 1;
- }
- public TimeOnServer()
- {
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- PlayerInfo[i][Minutes] ++;
- if(PlayerInfo[i][Minutes] == 60)
- {
- PlayerInfo[i][Minutes] =0;
- PlayerInfo[i][Hours] ++;
- GivePlayerMoney(i, 10000);
- SendClientMessage(i, -1, ""R"[SERVER]: "GRI"You earned $ 10000 after staying 1 hour in server whitout leaving !");
- }
- }
- }
- return 1;
- }
- public destroy(playerid)
- {
- if(CRamp[playerid]==true)
- {
- DestroyObject(Ramp[playerid]), CRamp[playerid] = false;
- return 1;
- }
- else
- return 0;
- }
- public DelayBan(playerid)
- {
- PlayerInfo[playerid][Bans]++;
- Kick(playerid);
- return 1;
- }
- public DelayKick(playerid)
- {
- PlayerInfo[playerid][Kicks]++;
- Kick(playerid);
- return 1;
- }
- public unmuteTimer(playerid)
- {
- muted[playerid] = 0;
- return SendClientMessage(playerid,0x00FF0000,"You're no longer muted!");
- }
- public unjail(playerid, reason)
- {
- SpawnPlayer(playerid);
- IsJailed[playerid] = 0;
- return 1;
- }
- stock GetName(playerid)
- {
- new szName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, szName, sizeof(szName));
- return szName;
- }
- stock ASCM(string[])
- {
- foreach(new i : Player)
- {
- if(PlayerInfo[i][Level] >= 1 || IsPlayerAdmin(i))
- {
- SendClientMessage(i, -1, string);
- }
- }
- return 1;
- }
- GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance) // credits to kc
- {
- new Float:a;
- GetPlayerPos(playerid, x, y, a);
- GetPlayerFacingAngle(playerid, a);
- if (GetPlayerVehicleID(playerid))
- {
- GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
- }
- x += (distance * floatsin(-a, degrees));
- y += (distance * floatcos(-a, degrees));
- }
- IRC_SendMessageToAdmins(level,const string[]) // Credits to iLearner
- {
- new levelbeen[5];
- new levelstring[80];
- if (level < 1 || level > 5) printf("*** IRC_SendMessageToAdmins: Invalid level. level: %d Message: %s", level, string);
- switch(level)
- {
- case 1:{levelbeen="+";}
- case 2:{levelbeen="%";}
- case 3:{levelbeen="@";}
- case 4:{levelbeen="&";}
- case 5:{levelbeen="~";}
- }
- format(levelstring,sizeof(levelstring),"%s%s",levelbeen, IRCChannel);
- IRC_GroupSay(groupID,levelstring,string);
- return 1;
- }
- stock SendVirtualMessage(virtualworld, color, string[])
- {
- for(new i =0; i<GetMaxPlayers();i++)
- {
- if(IsPlayerConnected(i))
- {
- // You can do this, if u want:
- //if(IsLoggedIn[i] == 1) or what ever.
- if(GetPlayerVirtualWorld(i) == virtualworld)
- {
- SendClientMessage(i, color, string);
- }
- }
- }
- return 1;
- }
- stock MSCM(string[])
- {
- foreach(new i : Player)
- {
- if(PlayerInfo[i][Level] == 3 || IsPlayerAdmin(i))
- {
- SendClientMessage(i, -1, string);
- }
- }
- return 1;
- }
- stock VSCM(string[])
- {
- foreach(new i : Player)
- {
- if(PlayerInfo[i][VIP] > 0 || PlayerInfo[i][Level] > 0)
- {
- SendClientMessage(i, -1, string);
- }
- }
- return 1;
- }
- /*** Fly Include By Norck ***/
- InitFly(playerid)
- {
- OnFly[playerid] = false;
- return;
- }
- /*
- bool:StartFly(playerid)
- {
- if(OnFly[playerid])
- return false;
- OnFly[playerid] = true;
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid,x,y,z);
- SetPlayerPos(playerid,x,y,z+5.0);
- ApplyAnimation(playerid,"PARACHUTE","PARA_steerR",6.1,1,1,1,1,0,1);
- Fly(playerid);
- GameTextForPlayer(playerid,"~y~Fly mode~n~~r~~k~~PED_FIREWEAPON~ ~w~- increase height~n~~r~RMB ~w~- reduce height~n~\
- ~r~~k~~PED_SPRINT~ ~w~- increase speed~n~\
- ~r~~k~~SNEAK_ABOUT~ ~w~- reduce speed",10000,3);
- return true;
- }
- */
- public Fly(playerid)
- {
- if(!IsPlayerConnected(playerid))
- return 1;
- new k, ud,lr;
- GetPlayerKeys(playerid,k,ud,lr);
- new Float:v_x,Float:v_y,Float:v_z,
- Float:x,Float:y,Float:z;
- if(ud < 0) // forward
- {
- GetPlayerCameraFrontVector(playerid,x,y,z);
- v_x = x+0.1;
- v_y = y+0.1;
- }
- if(k & 128) // down
- v_z = -0.2;
- else if(k & KEY_FIRE) // up
- v_z = 0.2;
- if(k & KEY_WALK) // slow
- {
- v_x /=5.0;
- v_y /=5.0;
- v_z /=5.0;
- }
- if(k & KEY_SPRINT) // fast
- {
- v_x *=4.0;
- v_y *=4.0;
- v_z *=4.0;
- }
- if(v_z == 0.0)
- v_z = 0.025;
- SetPlayerVelocity(playerid,v_x,v_y,v_z);
- if(v_x == 0 && v_y == 0)
- {
- if(GetPlayerAnimationIndex(playerid) == 959)
- ApplyAnimation(playerid,"PARACHUTE","PARA_steerR",6.1,1,1,1,1,0,1);
- }
- else
- {
- GetPlayerCameraFrontVector(playerid,v_x,v_y,v_z);
- GetPlayerCameraPos(playerid,x,y,z);
- SetPlayerLookAt(playerid,v_x*500.0+x,v_y*500.0+y);
- if(GetPlayerAnimationIndex(playerid) != 959)
- ApplyAnimation(playerid,"PARACHUTE","FALL_SkyDive_Accel",6.1,1,1,1,1,0,1);
- }
- if(OnFly[playerid])
- SetTimerEx("Fly",100,false,"i",playerid);
- return 1;
- }
- bool:StopFly(playerid)
- {
- if(!OnFly[playerid])
- return false;
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid,x,y,z);
- SetPlayerPos(playerid,x,y,z);
- OnFly[playerid] = false;
- return true;
- }
- stock IsValidSkin(SkinID)
- {
- if((SkinID >= 0 && SkinID <= 2)||(SkinID == 7)||(SkinID >= 9 && SkinID <= 41)||(SkinID >= 43 && SkinID <= 64)||(SkinID >= 66 && SkinID <= 73)||(SkinID >= 75 && SkinID <= 85)||(SkinID >= 87 && SkinID <= 118)||(SkinID >= 120 && SkinID <= 148)||(SkinID >= 150 && SkinID <= 207)||(SkinID >= 209 && SkinID <= 264)||(SkinID >= 274 && SkinID <= 288)||(SkinID >= 290 && SkinID <= 299)) return true;
- else return false;
- }
- static SetPlayerLookAt(playerid,Float:x,Float:y)
- {
- new Float:Px, Float:Py, Float: Pa;
- GetPlayerPos(playerid, Px, Py, Pa);
- Pa = floatabs(atan((y-Py)/(x-Px)));
- if (x <= Px && y >= Py) Pa = floatsub(180.0, Pa);
- else if (x < Px && y < Py) Pa = floatadd(Pa, 180.0);
- else if (x >= Px && y <= Py) Pa = floatsub(360.0, Pa);
- Pa = floatsub(Pa, 90.0);
- if (Pa >= 360.0)
- Pa = floatsub(Pa, 360.0);
- SetPlayerFacingAngle(playerid, Pa);
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement