Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Multi Modes
- Made by Jelly23
- */
- /*Includes*/
- #include <a_samp>
- #include <sscanf2>
- #include <foreach>
- #include <TextMenu>
- #include <izcmd>
- #include <a_mysql>
- /*MySQL*/
- #define mysql_host "localhost"
- #define mysql_user "root"
- #define mysql_database "multimode"
- #define mysql_pass ""
- /*Whirlpool*/
- native WP_Hash(buffer[], len, const str[]);
- /*Web*/
- #define YOUR_WEB "www.yourweb.com"
- /*Mode Settings*/
- #define WAR_VERSION "1.0" //War minigame's version
- #define TDM_VERSION "1.0" //TDM minigame's version
- #define MDM_VERSION "1.0" //Minigun dm minigame's version
- /*TextDraws*/
- new Text:Lobby_TD[24],
- Text:Mode_Text[8],
- Text:Mode_Two[2];
- /*Teams - TDM Only*/
- #define SWAT (0)
- #define TERRORIST (1)
- /*Colors*/
- #define COLOR_RED (0xAA333300)
- #define COLOR_BLUE (0x33CCFF00)
- /*Dialogs*/
- #define DIALOG_REGISTER (0)
- #define DIALOG_LOGIN (1)
- #define DIALOG_BANLIST (2)
- #define DIALOG_BANLIST2 (3)
- #define DIALOG_BANLIST3 (4)
- #define DIALOG_BANLIST4 (5)
- #define DIALOG_BANLIST5 (6)
- #define DIALOG_BANLIST6 (7)
- #define DIALOG_BANLIST7 (8)
- #define DIALOG_BANLIST8 (9)
- #define DIALOG_BANLIST9 (10)
- #define DIALOG_BANLIST10 (11)
- #define DIALOG_BANLIST11 (12)
- /*TextDraw Menus*/
- #define MENU_SHOP (0)
- #define MENU_PISTOLS (1)
- #define MENU_SMACHINE (3)
- #define MENU_SHOTGUNS (4)
- #define MENU_ARIFLES (5)
- #define MENU_RIFLES (6)
- #define MENU_CMDS (7)
- /*Enumerators*/
- enum tdm_mapinfo //TDM Enum
- {
- MapName[50],
- time,
- interior,
- Float:SwatSpawnX,
- Float:SwatSpawnY,
- Float:SwatSpawnZ,
- Float:TerrorSpawnX,
- Float:TerrorSpawnY,
- Float:TerrorSpawnZ
- };
- enum mdm_mapinfo //Minigun DM Enum
- {
- MapName[50],
- time,
- interior,
- weather,
- Float:Spawn1X,
- Float:Spawn1Y,
- Float:Spawn1Z,
- Float:Spawn2X,
- Float:Spawn2Y,
- Float:Spawn2Z,
- Float:Spawn3X,
- Float:Spawn3Y,
- Float:Spawn3Z,
- };
- enum playerinfo //Player enum
- {
- ID,
- Pass[129],
- Logged,
- Level,
- Kills,
- Deaths
- };
- /*Arrays*/
- new PlayerInfo[MAX_PLAYERS][playerinfo],
- mode[MAX_PLAYERS],
- TDM_Map[tdm_mapinfo],
- MDM_Map[mdm_mapinfo],
- MapTimer,
- mysql,
- swat,
- terrorist,
- global[128];
- /*Ban List*/
- new banrowid[MAX_PLAYERS];
- new banrowname[MAX_PLAYERS][24];
- new banrowname2[MAX_PLAYERS][24];
- new addbaname[MAX_PLAYERS][24];
- new LBAN2[MAX_PLAYERS][31][24];
- new LBAN[MAX_PLAYERS][31];
- /*Random Colors - Minigun DM*/
- new RandomColors[21] =
- {
- 0xADFF2FFF, 0x90EE90FF, 0xFF4500FF, 0x4169FFFF, 0x9ACD32FF,
- 0xFFFF00FF, 0xDA70D6FF, 0x87CEFAFF, 0xFAFAD2FF, 0xFAEBD7FF,
- 0x6495EDFF, 0x4EEE94FF, 0xC0FF3EFF, 0xFFFF00FF, 0xFFB90FFF,
- 0x7171C6FF, 0x9B30FFFF, 0xA2B5CDFF, 0xC0FF3EFF, 0xFFD700FF
- };
- /*GameMode*/
- main()
- {
- print("\n----------------------------------");
- print(" Multi Modes");
- print("----------------------------------\n");
- }
- /*Callbacks*/
- public OnGameModeInit()
- {
- /*Disable interior markers*/
- DisableInteriorEnterExits();
- /*MySQL connection*/
- mysql_log(LOG_ERROR | LOG_WARNING | LOG_DEBUG);
- mysql = mysql_connect(mysql_host, mysql_user, mysql_database, mysql_pass);
- if(mysql_errno(mysql) != 0)
- {
- print("Wasn't possible to connect to the database!"); SendRconCommand("hostname MYSQL ERROR");
- }
- else
- {
- printf("Connected to database: %s",mysql_database);
- }
- /*Map Time*/
- TDM_Map[time] = 400,
- MDM_Map[time] = 300;
- /*Class & Game Mode Text*/
- SetGameModeText("Multi Modes");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- /*Map timer*/
- MapTimer = SetTimer("MapUpdate",1000,true);
- /*TextDraws*/
- Lobby_TD[0] = TextDrawCreate(105.400001, 127.583389, "box");
- TextDrawLetterSize(Lobby_TD[0], 0.000000, 30.440917);
- TextDrawTextSize(Lobby_TD[0], 234.775024, 0.000000);
- TextDrawAlignment(Lobby_TD[0], 1);
- TextDrawColor(Lobby_TD[0], -1);
- TextDrawUseBox(Lobby_TD[0], 1);
- TextDrawBoxColor(Lobby_TD[0], -1061109610);
- TextDrawSetShadow(Lobby_TD[0], 0);
- TextDrawSetOutline(Lobby_TD[0], 0);
- TextDrawBackgroundColor(Lobby_TD[0], 255);
- TextDrawFont(Lobby_TD[0], 1);
- TextDrawSetProportional(Lobby_TD[0], 1);
- TextDrawSetShadow(Lobby_TD[0], 0);
- Lobby_TD[1] = TextDrawCreate(109.125000, 107.666648, "Server_Lobby");
- TextDrawLetterSize(Lobby_TD[1], 0.400000, 1.600000);
- TextDrawAlignment(Lobby_TD[1], 1);
- TextDrawColor(Lobby_TD[1], -1);
- TextDrawSetShadow(Lobby_TD[1], 0);
- TextDrawSetOutline(Lobby_TD[1], 1);
- TextDrawBackgroundColor(Lobby_TD[1], 255);
- TextDrawFont(Lobby_TD[1], 2);
- TextDrawSetProportional(Lobby_TD[1], 1);
- TextDrawSetShadow(Lobby_TD[1], 0);
- Lobby_TD[2] = TextDrawCreate(239.625000, 127.333282, "box");
- TextDrawLetterSize(Lobby_TD[2], 0.000000, 30.480514);
- TextDrawTextSize(Lobby_TD[2], 237.750000, 0.000000);
- TextDrawAlignment(Lobby_TD[2], 1);
- TextDrawColor(Lobby_TD[2], -1);
- TextDrawUseBox(Lobby_TD[2], 1);
- TextDrawBoxColor(Lobby_TD[2], 90);
- TextDrawSetShadow(Lobby_TD[2], 0);
- TextDrawSetOutline(Lobby_TD[2], 0);
- TextDrawBackgroundColor(Lobby_TD[2], 255);
- TextDrawFont(Lobby_TD[2], 1);
- TextDrawSetProportional(Lobby_TD[2], 1);
- TextDrawSetShadow(Lobby_TD[2], 0);
- Lobby_TD[3] = TextDrawCreate(102.125000, 127.333282, "box");
- TextDrawLetterSize(Lobby_TD[3], 0.000000, 30.480514);
- TextDrawTextSize(Lobby_TD[3], 100.250000, 0.000000);
- TextDrawAlignment(Lobby_TD[3], 1);
- TextDrawColor(Lobby_TD[3], -1);
- TextDrawUseBox(Lobby_TD[3], 1);
- TextDrawBoxColor(Lobby_TD[3], 90);
- TextDrawSetShadow(Lobby_TD[3], 0);
- TextDrawSetOutline(Lobby_TD[3], 0);
- TextDrawBackgroundColor(Lobby_TD[3], 255);
- TextDrawFont(Lobby_TD[3], 1);
- TextDrawSetProportional(Lobby_TD[3], 1);
- TextDrawSetShadow(Lobby_TD[3], 0);
- Lobby_TD[4] = TextDrawCreate(102.500000, 123.916610, "box");
- TextDrawLetterSize(Lobby_TD[4], 0.000000, -0.116500);
- TextDrawTextSize(Lobby_TD[4], 237.640060, 0.000000);
- TextDrawAlignment(Lobby_TD[4], 1);
- TextDrawColor(Lobby_TD[4], -1);
- TextDrawUseBox(Lobby_TD[4], 1);
- TextDrawBoxColor(Lobby_TD[4], 90);
- TextDrawSetShadow(Lobby_TD[4], 0);
- TextDrawSetOutline(Lobby_TD[4], 0);
- TextDrawBackgroundColor(Lobby_TD[4], 255);
- TextDrawFont(Lobby_TD[4], 1);
- TextDrawSetProportional(Lobby_TD[4], 1);
- TextDrawSetShadow(Lobby_TD[4], 0);
- Lobby_TD[5] = TextDrawCreate(102.500000, 406.416625, "box");
- TextDrawLetterSize(Lobby_TD[5], 0.000000, -0.116500);
- TextDrawTextSize(Lobby_TD[5], 237.640060, 0.000000);
- TextDrawAlignment(Lobby_TD[5], 1);
- TextDrawColor(Lobby_TD[5], -1);
- TextDrawUseBox(Lobby_TD[5], 1);
- TextDrawBoxColor(Lobby_TD[5], 90);
- TextDrawSetShadow(Lobby_TD[5], 0);
- TextDrawSetOutline(Lobby_TD[5], 0);
- TextDrawBackgroundColor(Lobby_TD[5], 255);
- TextDrawFont(Lobby_TD[5], 1);
- TextDrawSetProportional(Lobby_TD[5], 1);
- TextDrawSetShadow(Lobby_TD[5], 0);
- Lobby_TD[6] = TextDrawCreate(143.625000, 131.250000, "ADMINs");
- TextDrawLetterSize(Lobby_TD[6], 0.331874, 1.156666);
- TextDrawAlignment(Lobby_TD[6], 1);
- TextDrawColor(Lobby_TD[6], -1);
- TextDrawSetShadow(Lobby_TD[6], 0);
- TextDrawSetOutline(Lobby_TD[6], 1);
- TextDrawBackgroundColor(Lobby_TD[6], 255);
- TextDrawFont(Lobby_TD[6], 2);
- TextDrawSetProportional(Lobby_TD[6], 1);
- TextDrawSetShadow(Lobby_TD[6], 0);
- Lobby_TD[7] = TextDrawCreate(109.125000, 147.250000, " ");
- TextDrawLetterSize(Lobby_TD[7], 0.293749, 0.940833);
- TextDrawAlignment(Lobby_TD[7], 1);
- TextDrawColor(Lobby_TD[7], -1);
- TextDrawSetShadow(Lobby_TD[7], 0);
- TextDrawSetOutline(Lobby_TD[7], 1);
- TextDrawBackgroundColor(Lobby_TD[7], 255);
- TextDrawFont(Lobby_TD[7], 1);
- TextDrawSetProportional(Lobby_TD[7], 1);
- TextDrawSetShadow(Lobby_TD[7], 0);
- Lobby_TD[8] = TextDrawCreate(105.500000, 207.416625, "box");
- TextDrawLetterSize(Lobby_TD[8], 0.000000, -0.116500);
- TextDrawTextSize(Lobby_TD[8], 234.960006, 0.000000);
- TextDrawAlignment(Lobby_TD[8], 1);
- TextDrawColor(Lobby_TD[8], -1);
- TextDrawUseBox(Lobby_TD[8], 1);
- TextDrawBoxColor(Lobby_TD[8], 150);
- TextDrawSetShadow(Lobby_TD[8], 0);
- TextDrawSetOutline(Lobby_TD[8], 0);
- TextDrawBackgroundColor(Lobby_TD[8], 255);
- TextDrawFont(Lobby_TD[8], 1);
- TextDrawSetProportional(Lobby_TD[8], 1);
- TextDrawSetShadow(Lobby_TD[8], 0);
- Lobby_TD[9] = TextDrawCreate(133.125000, 215.250000, "TOP_KILLS");
- TextDrawLetterSize(Lobby_TD[9], 0.331874, 1.156666);
- TextDrawAlignment(Lobby_TD[9], 1);
- TextDrawColor(Lobby_TD[9], -1);
- TextDrawSetShadow(Lobby_TD[9], 0);
- TextDrawSetOutline(Lobby_TD[9], 1);
- TextDrawBackgroundColor(Lobby_TD[9], 255);
- TextDrawFont(Lobby_TD[9], 2);
- TextDrawSetProportional(Lobby_TD[9], 1);
- TextDrawSetShadow(Lobby_TD[9], 0);
- Lobby_TD[10] = TextDrawCreate(109.125000, 232.750000, "1_-_Jelly23_-_1000~n~2_-_Test_-_900~n~3_-_Test2_-_700~n~4_-_Test3_-_500~n~5_-_Test4_-_100~n~6_-_Test5_-_90~n~7_-_Test6_-_60~n~8_-_Test7_-_50~n~9_-_Test8_-_40~n~10_-_Test9_-_30");
- TextDrawLetterSize(Lobby_TD[10], 0.293749, 0.940833);
- TextDrawAlignment(Lobby_TD[10], 1);
- TextDrawColor(Lobby_TD[10], -1);
- TextDrawSetShadow(Lobby_TD[10], 0);
- TextDrawSetOutline(Lobby_TD[10], 1);
- TextDrawBackgroundColor(Lobby_TD[10], 255);
- TextDrawFont(Lobby_TD[10], 1);
- TextDrawSetProportional(Lobby_TD[10], 1);
- TextDrawSetShadow(Lobby_TD[10], 0);
- Lobby_TD[11] = TextDrawCreate(105.500000, 326.916625, "box");
- TextDrawLetterSize(Lobby_TD[11], 0.000000, -0.116500);
- TextDrawTextSize(Lobby_TD[11], 234.960006, 0.000000);
- TextDrawAlignment(Lobby_TD[11], 1);
- TextDrawColor(Lobby_TD[11], -1);
- TextDrawUseBox(Lobby_TD[11], 1);
- TextDrawBoxColor(Lobby_TD[11], 150);
- TextDrawSetShadow(Lobby_TD[11], 0);
- TextDrawSetOutline(Lobby_TD[11], 0);
- TextDrawBackgroundColor(Lobby_TD[11], 255);
- TextDrawFont(Lobby_TD[11], 1);
- TextDrawSetProportional(Lobby_TD[11], 1);
- TextDrawSetShadow(Lobby_TD[11], 0);
- Lobby_TD[12] = TextDrawCreate(122.625000, 336.750000, "Server_INfo");
- TextDrawLetterSize(Lobby_TD[12], 0.331874, 1.156666);
- TextDrawAlignment(Lobby_TD[12], 1);
- TextDrawColor(Lobby_TD[12], -1);
- TextDrawSetShadow(Lobby_TD[12], 0);
- TextDrawSetOutline(Lobby_TD[12], 1);
- TextDrawBackgroundColor(Lobby_TD[12], 255);
- TextDrawFont(Lobby_TD[12], 2);
- TextDrawSetProportional(Lobby_TD[12], 1);
- TextDrawSetShadow(Lobby_TD[12], 0);
- Lobby_TD[13] = TextDrawCreate(109.125000, 355.250000, "__www.yourweb.com~n~~n~-Players:_0/100~n~-Admins:_0~n~-Modes:_3");
- TextDrawLetterSize(Lobby_TD[13], 0.293749, 0.940833);
- TextDrawAlignment(Lobby_TD[13], 1);
- TextDrawColor(Lobby_TD[13], -1);
- TextDrawSetShadow(Lobby_TD[13], 0);
- TextDrawSetOutline(Lobby_TD[13], 1);
- TextDrawBackgroundColor(Lobby_TD[13], 255);
- TextDrawFont(Lobby_TD[13], 1);
- TextDrawSetProportional(Lobby_TD[13], 1);
- TextDrawSetShadow(Lobby_TD[13], 0);
- Lobby_TD[14] = TextDrawCreate(286.875000, 124.166641, "box");
- TextDrawLetterSize(Lobby_TD[14], 0.000000, 9.289999);
- TextDrawTextSize(Lobby_TD[14], 519.403625, 0.000000);
- TextDrawAlignment(Lobby_TD[14], 1);
- TextDrawColor(Lobby_TD[14], -1);
- TextDrawUseBox(Lobby_TD[14], 1);
- TextDrawBoxColor(Lobby_TD[14], 120);
- TextDrawSetShadow(Lobby_TD[14], 0);
- TextDrawSetOutline(Lobby_TD[14], 0);
- TextDrawBackgroundColor(Lobby_TD[14], 120);
- TextDrawFont(Lobby_TD[14], 1);
- TextDrawSetProportional(Lobby_TD[14], 1);
- TextDrawSetShadow(Lobby_TD[14], 0);
- Lobby_TD[15] = TextDrawCreate(326.325775, 107.566642, "MODE_SELECTION");
- TextDrawLetterSize(Lobby_TD[15], 0.400000, 1.600000);
- TextDrawAlignment(Lobby_TD[15], 1);
- TextDrawColor(Lobby_TD[15], -1);
- TextDrawSetShadow(Lobby_TD[15], 0);
- TextDrawSetOutline(Lobby_TD[15], 1);
- TextDrawBackgroundColor(Lobby_TD[15], 255);
- TextDrawFont(Lobby_TD[15], 2);
- TextDrawSetProportional(Lobby_TD[15], 1);
- TextDrawSetShadow(Lobby_TD[15], 0);
- Lobby_TD[16] = TextDrawCreate(286.875000, 216.566238, "box");
- TextDrawLetterSize(Lobby_TD[16], 0.000000, 9.289999);
- TextDrawTextSize(Lobby_TD[16], 519.403625, 0.000000);
- TextDrawAlignment(Lobby_TD[16], 1);
- TextDrawColor(Lobby_TD[16], 120);
- TextDrawUseBox(Lobby_TD[16], 1);
- TextDrawBoxColor(Lobby_TD[16], 120);
- TextDrawSetShadow(Lobby_TD[16], 0);
- TextDrawSetOutline(Lobby_TD[16], 0);
- TextDrawBackgroundColor(Lobby_TD[16], 120);
- TextDrawFont(Lobby_TD[16], 1);
- TextDrawSetProportional(Lobby_TD[16], 1);
- TextDrawSetShadow(Lobby_TD[16], 0);
- Lobby_TD[17] = TextDrawCreate(286.875000, 309.666992, "box");
- TextDrawLetterSize(Lobby_TD[17], 0.000000, 9.289999);
- TextDrawTextSize(Lobby_TD[17], 519.403625, 0.000000);
- TextDrawAlignment(Lobby_TD[17], 1);
- TextDrawColor(Lobby_TD[17], -1);
- TextDrawUseBox(Lobby_TD[17], 1);
- TextDrawBoxColor(Lobby_TD[17], 120);
- TextDrawSetShadow(Lobby_TD[17], 0);
- TextDrawSetOutline(Lobby_TD[17], 0);
- TextDrawBackgroundColor(Lobby_TD[17], 255);
- TextDrawFont(Lobby_TD[17], 1);
- TextDrawSetProportional(Lobby_TD[17], 1);
- TextDrawSetShadow(Lobby_TD[17], 0);
- Lobby_TD[18] = TextDrawCreate(291.250000, 125.833366, "WAR_GAME~n~~n~Players:_10~n~map:_area_51~n~VERSION:_1.0");
- TextDrawLetterSize(Lobby_TD[18], 0.400000, 1.600000);
- TextDrawAlignment(Lobby_TD[18], 1);
- TextDrawColor(Lobby_TD[18], -5963521);
- TextDrawSetShadow(Lobby_TD[18], 0);
- TextDrawSetOutline(Lobby_TD[18], 1);
- TextDrawBackgroundColor(Lobby_TD[18], 255);
- TextDrawFont(Lobby_TD[18], 2);
- TextDrawSetProportional(Lobby_TD[18], 1);
- TextDrawSetShadow(Lobby_TD[18], 0);
- Lobby_TD[19] = TextDrawCreate(479.725158, 132.833328, "PLAY");
- TextDrawLetterSize(Lobby_TD[19], 0.400000, 1.600000);
- TextDrawTextSize(Lobby_TD[19], 15.000000, 66.705001);
- TextDrawAlignment(Lobby_TD[19], 2);
- TextDrawColor(Lobby_TD[19], -1);
- TextDrawUseBox(Lobby_TD[19], 1);
- TextDrawBoxColor(Lobby_TD[19], 255);
- TextDrawSetShadow(Lobby_TD[19], 0);
- TextDrawSetOutline(Lobby_TD[19], 1);
- TextDrawBackgroundColor(Lobby_TD[19], 255);
- TextDrawFont(Lobby_TD[19], 2);
- TextDrawSetProportional(Lobby_TD[19], 1);
- TextDrawSetShadow(Lobby_TD[19], 0);
- TextDrawSetSelectable(Lobby_TD[19], 1);
- Lobby_TD[20] = TextDrawCreate(291.250000, 219.632965, "tdm_game~n~~n~players:_5~n~map:_lvpd~n~version:_1.0");
- TextDrawLetterSize(Lobby_TD[20], 0.400000, 1.600000);
- TextDrawAlignment(Lobby_TD[20], 1);
- TextDrawColor(Lobby_TD[20], -5963521);
- TextDrawSetShadow(Lobby_TD[20], 0);
- TextDrawSetOutline(Lobby_TD[20], 1);
- TextDrawBackgroundColor(Lobby_TD[20], 255);
- TextDrawFont(Lobby_TD[20], 2);
- TextDrawSetProportional(Lobby_TD[20], 1);
- TextDrawSetShadow(Lobby_TD[20], 0);
- Lobby_TD[21] = TextDrawCreate(479.725158, 225.232925, "PLAY");
- TextDrawLetterSize(Lobby_TD[21], 0.400000, 1.600000);
- TextDrawTextSize(Lobby_TD[21], 15.000000, 66.705001);
- TextDrawAlignment(Lobby_TD[21], 2);
- TextDrawColor(Lobby_TD[21], -1);
- TextDrawUseBox(Lobby_TD[21], 1);
- TextDrawBoxColor(Lobby_TD[21], 255);
- TextDrawSetShadow(Lobby_TD[21], 0);
- TextDrawSetOutline(Lobby_TD[21], 1);
- TextDrawBackgroundColor(Lobby_TD[21], 255);
- TextDrawFont(Lobby_TD[21], 2);
- TextDrawSetProportional(Lobby_TD[21], 1);
- TextDrawSetShadow(Lobby_TD[21], 0);
- TextDrawSetSelectable(Lobby_TD[21], 1);
- Lobby_TD[22] = TextDrawCreate(291.250000, 312.733795, "minigun_dm~n~~n~players:_2~n~map:_stadium~n~version:_1.0");
- TextDrawLetterSize(Lobby_TD[22], 0.400000, 1.600000);
- TextDrawAlignment(Lobby_TD[22], 1);
- TextDrawColor(Lobby_TD[22], -5963521);
- TextDrawSetShadow(Lobby_TD[22], 0);
- TextDrawSetOutline(Lobby_TD[22], 1);
- TextDrawBackgroundColor(Lobby_TD[22], 255);
- TextDrawFont(Lobby_TD[22], 2);
- TextDrawSetProportional(Lobby_TD[22], 1);
- TextDrawSetShadow(Lobby_TD[22], 0);
- Lobby_TD[23] = TextDrawCreate(479.725158, 318.333892, "PLAY");
- TextDrawLetterSize(Lobby_TD[23], 0.400000, 1.600000);
- TextDrawTextSize(Lobby_TD[23], 15.000000, 66.705001);
- TextDrawAlignment(Lobby_TD[23], 2);
- TextDrawColor(Lobby_TD[23], -1);
- TextDrawUseBox(Lobby_TD[23], 1);
- TextDrawBoxColor(Lobby_TD[23], 255);
- TextDrawSetShadow(Lobby_TD[23], 0);
- TextDrawSetOutline(Lobby_TD[23], 1);
- TextDrawBackgroundColor(Lobby_TD[23], 255);
- TextDrawFont(Lobby_TD[23], 2);
- TextDrawSetProportional(Lobby_TD[23], 1);
- TextDrawSetShadow(Lobby_TD[23], 0);
- TextDrawSetSelectable(Lobby_TD[23], 1);
- Mode_Text[0] = TextDrawCreate(31.599992, 271.386749, "box");
- TextDrawLetterSize(Mode_Text[0], 0.000000, 6.800001);
- TextDrawTextSize(Mode_Text[0], 134.799911, 0.000000);
- TextDrawAlignment(Mode_Text[0], 1);
- TextDrawColor(Mode_Text[0], -1);
- TextDrawUseBox(Mode_Text[0], 1);
- TextDrawBoxColor(Mode_Text[0], 100);
- TextDrawSetShadow(Mode_Text[0], 0);
- TextDrawSetOutline(Mode_Text[0], 0);
- TextDrawBackgroundColor(Mode_Text[0], 255);
- TextDrawFont(Mode_Text[0], 1);
- TextDrawSetProportional(Mode_Text[0], 1);
- TextDrawSetShadow(Mode_Text[0], 0);
- Mode_Text[1] = TextDrawCreate(31.600025, 271.586730, "box");
- TextDrawLetterSize(Mode_Text[1], 0.000000, 0.320000);
- TextDrawTextSize(Mode_Text[1], 134.800003, 0.000000);
- TextDrawAlignment(Mode_Text[1], 1);
- TextDrawColor(Mode_Text[1], -1);
- TextDrawUseBox(Mode_Text[1], 1);
- TextDrawBoxColor(Mode_Text[1], 150);
- TextDrawSetShadow(Mode_Text[1], 0);
- TextDrawSetOutline(Mode_Text[1], 0);
- TextDrawBackgroundColor(Mode_Text[1], 255);
- TextDrawFont(Mode_Text[1], 1);
- TextDrawSetProportional(Mode_Text[1], 1);
- TextDrawSetShadow(Mode_Text[1], 0);
- Mode_Text[2] = TextDrawCreate(52.500057, 267.153320, "MAP_INFO");
- TextDrawLetterSize(Mode_Text[2], 0.302399, 1.107199);
- TextDrawAlignment(Mode_Text[2], 1);
- TextDrawColor(Mode_Text[2], -1);
- TextDrawSetShadow(Mode_Text[2], 0);
- TextDrawSetOutline(Mode_Text[2], 1);
- TextDrawBackgroundColor(Mode_Text[2], 255);
- TextDrawFont(Mode_Text[2], 2);
- TextDrawSetProportional(Mode_Text[2], 1);
- TextDrawSetShadow(Mode_Text[2], 0);
- Mode_Text[3] = TextDrawCreate(33.199974, 282.586730, "MAP:_Jefferson");
- TextDrawLetterSize(Mode_Text[3], 0.280799, 1.308799);
- TextDrawAlignment(Mode_Text[3], 1);
- TextDrawColor(Mode_Text[3], -1);
- TextDrawSetShadow(Mode_Text[3], 0);
- TextDrawSetOutline(Mode_Text[3], 1);
- TextDrawBackgroundColor(Mode_Text[3], 255);
- TextDrawFont(Mode_Text[3], 2);
- TextDrawSetProportional(Mode_Text[3], 1);
- TextDrawSetShadow(Mode_Text[3], 0);
- Mode_Text[4] = TextDrawCreate(33.199974, 293.387390, "TIME_LEFT:_400");
- TextDrawLetterSize(Mode_Text[4], 0.280799, 1.308799);
- TextDrawAlignment(Mode_Text[4], 1);
- TextDrawColor(Mode_Text[4], -1);
- TextDrawSetShadow(Mode_Text[4], 0);
- TextDrawSetOutline(Mode_Text[4], 1);
- TextDrawBackgroundColor(Mode_Text[4], 255);
- TextDrawFont(Mode_Text[4], 2);
- TextDrawSetProportional(Mode_Text[4], 1);
- TextDrawSetShadow(Mode_Text[4], 0);
- Mode_Text[5] = TextDrawCreate(33.199974, 303.388000, "---------------------------");
- TextDrawLetterSize(Mode_Text[5], 0.280799, 1.308799);
- TextDrawAlignment(Mode_Text[5], 1);
- TextDrawColor(Mode_Text[5], -1);
- TextDrawSetShadow(Mode_Text[5], 0);
- TextDrawSetOutline(Mode_Text[5], 1);
- TextDrawBackgroundColor(Mode_Text[5], 255);
- TextDrawFont(Mode_Text[5], 2);
- TextDrawSetProportional(Mode_Text[5], 1);
- TextDrawSetShadow(Mode_Text[5], 0);
- Mode_Text[6] = TextDrawCreate(33.199974, 312.888580, "SWAT_TEAM:_0");
- TextDrawLetterSize(Mode_Text[6], 0.280799, 1.308799);
- TextDrawAlignment(Mode_Text[6], 1);
- TextDrawColor(Mode_Text[6], -1);
- TextDrawSetShadow(Mode_Text[6], 0);
- TextDrawSetOutline(Mode_Text[6], 1);
- TextDrawBackgroundColor(Mode_Text[6], 255);
- TextDrawFont(Mode_Text[6], 2);
- TextDrawSetProportional(Mode_Text[6], 1);
- TextDrawSetShadow(Mode_Text[6], 0);
- Mode_Text[7] = TextDrawCreate(33.199974, 323.589233, "TERRORISTS:__0");
- TextDrawLetterSize(Mode_Text[7], 0.280799, 1.308799);
- TextDrawAlignment(Mode_Text[7], 1);
- TextDrawColor(Mode_Text[7], -1);
- TextDrawSetShadow(Mode_Text[7], 0);
- TextDrawSetOutline(Mode_Text[7], 1);
- TextDrawBackgroundColor(Mode_Text[7], 255);
- TextDrawFont(Mode_Text[7], 2);
- TextDrawSetProportional(Mode_Text[7], 1);
- TextDrawSetShadow(Mode_Text[7], 0);
- Mode_Two[0] = TextDrawCreate(33.199974, 282.586730, "MAP:_Jefferson");
- TextDrawLetterSize(Mode_Two[0], 0.280799, 1.308799);
- TextDrawAlignment(Mode_Two[0], 1);
- TextDrawColor(Mode_Two[0], -1);
- TextDrawSetShadow(Mode_Two[0], 0);
- TextDrawSetOutline(Mode_Two[0], 1);
- TextDrawBackgroundColor(Mode_Two[0], 255);
- TextDrawFont(Mode_Two[0], 2);
- TextDrawSetProportional(Mode_Two[0], 1);
- TextDrawSetShadow(Mode_Two[0], 0);
- Mode_Two[1] = TextDrawCreate(33.199974, 293.387390, "TIME_LEFT:_400");
- TextDrawLetterSize(Mode_Two[1], 0.280799, 1.308799);
- TextDrawAlignment(Mode_Two[1], 1);
- TextDrawColor(Mode_Two[1], -1);
- TextDrawSetShadow(Mode_Two[1], 0);
- TextDrawSetOutline(Mode_Two[1], 1);
- TextDrawBackgroundColor(Mode_Two[1], 255);
- TextDrawFont(Mode_Two[1], 2);
- TextDrawSetProportional(Mode_Two[1], 1);
- TextDrawSetShadow(Mode_Two[1], 0);
- /*War mode vehicles*/
- new Warveh0 = CreateVehicle(432,293.3999900,1907.0999800,17.7000000,314.0000000,95,10,15); //Rhino
- new Warveh1 = CreateVehicle(432,293.7999900,1896.5000000,17.7000000,313.9950000,95,10,15); //Rhino
- new Warveh2 = CreateVehicle(432,294.7999900,1886.4000200,17.7000000,313.9950000,95,10,15); //Rhino
- new Warveh3 = CreateVehicle(432,294.8999900,1873.4000200,17.7000000,313.9950000,95,10,15); //Rhino
- new Warveh4 = CreateVehicle(432,294.5000000,1859.5000000,17.7000000,313.9950000,95,10,15); //Rhino
- new Warveh5 = CreateVehicle(432,295.0000000,1850.8000500,17.7000000,313.9950000,95,10,15); //Rhino
- new Warveh6 = CreateVehicle(432,281.8999900,1934.3000500,17.7000000,269.9950000,95,10,15); //Rhino
- new Warveh7 = CreateVehicle(432,278.8999900,1960.0999800,17.7000000,269.9950000,95,10,15); //Rhino
- new Warveh8 = CreateVehicle(432,359.0000000,1969.4000200,17.7000000,117.9950000,95,10,15); //Rhino
- new Warveh9 = CreateVehicle(432,359.6992200,1985.2998000,17.7000000,117.9880000,95,10,15); //Rhino
- new Warveh10 = CreateVehicle(432,371.7999900,1964.5999800,17.7000000,117.9930000,95,10,15); //Rhino
- new Warveh11 = CreateVehicle(520,280.6000100,2029.5999800,18.2000000,270.0000000,-1,-1,15); //Hydra
- new Warveh12 = CreateVehicle(520,280.7000100,2019.4000200,18.2000000,270.0000000,-1,-1,15); //Hydra
- new Warveh13 = CreateVehicle(520,279.2999900,1993.5999800,18.2000000,270.0000000,-1,-1,15); //Hydra
- new Warveh14 = CreateVehicle(520,280.0000000,1984.0000000,18.2000000,296.0000000,-1,-1,15); //Hydra
- new Warveh15 = CreateVehicle(520,302.1000100,2044.5999800,18.2000000,180.0000000,-1,-1,15); //Hydra
- new Warveh16 = CreateVehicle(520,317.6000100,2044.0999800,18.2000000,180.0000000,-1,-1,15); //Hydra
- new Warveh17 = CreateVehicle(520,315.5000000,1817.0000000,18.2000000,0.0000000,-1,-1,15); //Hydra
- new Warveh18 = CreateVehicle(520,303.8999900,1817.3000500,18.2000000,0.0000000,-1,-1,15); //Hydra
- new Warveh19 = CreateVehicle(425,348.7999900,1923.0000000,18.4000000,90.0000000,95,10,15); //Hunter
- new Warveh20 = CreateVehicle(425,348.8999900,1938.5999800,18.4000000,90.0000000,95,10,15); //Hunter
- new Warveh21 = CreateVehicle(425,337.6000100,1957.3000500,18.4000000,90.0000000,95,10,15); //Hunter
- new Warveh22 = CreateVehicle(425,329.3999900,1928.3000500,18.4000000,90.0000000,95,10,15); //Hunter
- new Warveh23 = CreateVehicle(425,335.0000000,1909.0000000,18.4000000,90.0000000,95,10,15); //Hunter
- new Warveh24 = CreateVehicle(425,294.0000000,1921.1999500,18.4000000,280.0000000,95,10,15); //Hunter
- new Warveh25 = CreateVehicle(476,209.2000000,1955.3000500,18.7000000,0.0000000,170,157,15); //Rustler
- new Warveh26 = CreateVehicle(476,222.3999900,1955.4000200,18.7000000,0.0000000,170,157,15); //Rustler
- new Warveh27 = CreateVehicle(476,238.1000100,1955.5999800,18.7000000,0.0000000,170,157,15); //Rustler
- new Warveh28 = CreateVehicle(476,251.8000000,1962.4000200,18.7000000,32.0000000,170,157,15); //Rustler
- SetVehicleVirtualWorld(Warveh0,0);SetVehicleVirtualWorld(Warveh1,0);SetVehicleVirtualWorld(Warveh2,0);SetVehicleVirtualWorld(Warveh3,0);
- SetVehicleVirtualWorld(Warveh4,0);SetVehicleVirtualWorld(Warveh5,0);SetVehicleVirtualWorld(Warveh6,0);SetVehicleVirtualWorld(Warveh7,0);SetVehicleVirtualWorld(Warveh8,0);
- SetVehicleVirtualWorld(Warveh9,0);SetVehicleVirtualWorld(Warveh10,0);SetVehicleVirtualWorld(Warveh11,0);SetVehicleVirtualWorld(Warveh12,0);SetVehicleVirtualWorld(Warveh13,0);
- SetVehicleVirtualWorld(Warveh14,0);SetVehicleVirtualWorld(Warveh15,0);SetVehicleVirtualWorld(Warveh16,0);SetVehicleVirtualWorld(Warveh17,0);SetVehicleVirtualWorld(Warveh28,0);
- SetVehicleVirtualWorld(Warveh18,0);SetVehicleVirtualWorld(Warveh19,0);SetVehicleVirtualWorld(Warveh20,0);SetVehicleVirtualWorld(Warveh21,0);SetVehicleVirtualWorld(Warveh22,0);
- SetVehicleVirtualWorld(Warveh23,0);SetVehicleVirtualWorld(Warveh24,0);SetVehicleVirtualWorld(Warveh25,0);SetVehicleVirtualWorld(Warveh26,0);SetVehicleVirtualWorld(Warveh27,0);
- /*Top 10 Kills - Lobby*/
- new query[115];
- mysql_tquery(mysql,"SELECT `name`, `kills` FROM `players` ORDER BY `kills` DESC LIMIT 10", "TopTen", "", "" );
- /*TDM Map*/
- mysql_tquery(mysql, "SELECT * FROM `tdm_maps` ORDER BY RAND() LIMIT 1", "LoadMaps", "i", 2);
- /*MDM Map*/
- mysql_tquery(mysql, "SELECT * FROM `mdm_maps` ORDER BY RAND() LIMIT 1", "LoadMaps", "i", 3);
- /*Update Draws Info*/
- ResetDraws();
- return 1;
- }
- forward TopTen();
- public TopTen()
- {
- new top[MAX_PLAYER_NAME],str[260];
- for(new i =0; i < cache_num_rows(); i++)
- {
- cache_get_field_content(i,"name",top,mysql,MAX_PLAYER_NAME);
- format(str,sizeof(str),"%s%i - %s - %d~n~",str,i+1,top,cache_get_field_content_int(i,"kills"));
- }
- TextDrawSetString(Lobby_TD[10], str);
- }
- forward MapUpdate();
- public MapUpdate()
- {
- /*TDM Map time*/
- new str[4];
- if(TDM_Map[time] != 0)
- {
- TDM_Map[time]--;
- format(str,sizeof(str),"%i",TDM_Map[time]);
- TextDrawSetString(Mode_Text[4],str);
- TextDrawShowForMode(2,Mode_Text[4]);
- }
- else
- {
- new cstr[115];
- mysql_format(mysql, cstr, sizeof(cstr), "SELECT * FROM `tdm_maps` ORDER BY RAND() LIMIT 1");
- mysql_tquery(mysql, cstr, "LoadMaps", "i", 2);
- TDM_Map[time] = 400;
- }
- /*MDM Map time*/
- if(MDM_Map[time] != 0)
- {
- MDM_Map[time]--;
- format(str,sizeof(str),"%i",MDM_Map[time]);
- TextDrawSetString(Mode_Two[1],str);
- TextDrawShowForMode(3,Mode_Two[1]);
- }
- else
- {
- new cstr[115];
- mysql_format(mysql, cstr, sizeof(cstr), "SELECT * FROM `mdm_maps` ORDER BY RAND() LIMIT 1");
- mysql_tquery(mysql, cstr, "LoadMaps", "i", 3);
- MDM_Map[time] = 300;
- }
- }
- public OnGameModeExit()
- {
- foreach(new i: Player)
- {
- SavePlayer(i);
- }
- KillTimer(MapTimer);
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetSpawnInfo(playerid, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0);
- TogglePlayerSpectating(playerid, true);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new query[103];
- mysql_format(mysql, query, sizeof(query),"SELECT * FROM `bans` WHERE `b_name` = '%e' or `b_ip` ='%s' LIMIT 1", GetName(playerid),GetIp(playerid));
- mysql_tquery(mysql, query, "OnBanCheck", "i", playerid);
- mode[playerid] = 0,PlayerInfo[playerid][Logged] = 0;
- SelectTextDraw(playerid, 0xFF4040AA),UpdateOnlinePlayers();
- ShowLobby(playerid);
- SetSpawnInfo(playerid, NO_TEAM, 255, 1280.0, -1024.0, 20.0, 180.0, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new reasons[14],cstr[50];
- switch(reason)
- {
- case 0: reasons = "Timeout/Crash";
- case 1: reasons = "Quit";
- case 2: reasons = "Kick/Ban";
- }
- format(cstr, sizeof cstr, "%s has left the server (%s).", GetName(playerid), reasons);
- SendClientMessageToAll(0xC4C4C4FF, cstr);
- SavePlayer(playerid),UpdateOnlinePlayers(),ResetDraws();
- PlayerInfo[playerid][Kills] = PlayerInfo[playerid][Logged] = PlayerInfo[playerid][Deaths] = PlayerInfo[playerid][Level] = 0;
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- PlayerInfo[playerid][Deaths]++;
- if(killerid != INVALID_PLAYER_ID)
- {
- GivePlayerMoney(killerid,random(4000)),SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
- PlayerInfo[killerid][Kills]++;
- SendClientMessage(playerid,-1,"{FF0000}[KILL]: You killed somebody. You received 1+ score and some cash.");
- if(mode[killerid] == 1)
- {
- new str[16];
- if(GetPlayerTeam(killerid) == SWAT)
- {
- swat++;
- format(str,sizeof(str),"SWAT Team: %d",swat);
- TextDrawSetString(Mode_Text[6],str);
- TextDrawShowForMode(2,Mode_Text[6]);
- }
- else
- {
- terrorist++;
- format(str,sizeof(str),"Terrorists: %d",terrorist);
- TextDrawSetString(Mode_Text[7],str);
- TextDrawShowForMode(2,Mode_Text[7]);
- }
- }
- }
- }
- forward DelayedKick(playerid);
- public DelayedKick(playerid)
- {
- Kick(playerid);
- return 1;
- }
- forward LoadMaps(modeid); //Loads the maps
- public LoadMaps(modeid)
- {
- new str[50];
- if(modeid == 2)
- {
- for(new i = 0; i < cache_get_row_count(); i++)
- {
- cache_get_field_content(i, "MapName", TDM_Map[MapName], mysql, 50);
- TDM_Map[interior] = cache_get_field_content_int(i, "interior");
- TDM_Map[SwatSpawnX] = cache_get_field_content_float(i, "SwatSpawnX");
- TDM_Map[SwatSpawnY] = cache_get_field_content_float(i, "SwatSpawnY");
- TDM_Map[SwatSpawnZ] = cache_get_field_content_float(i, "SwatSpawnZ");
- TDM_Map[TerrorSpawnX] = cache_get_field_content_float(i, "TerrorSpawnX");
- TDM_Map[TerrorSpawnY] = cache_get_field_content_float(i, "TerrorSpawnY");
- TDM_Map[TerrorSpawnZ] = cache_get_field_content_float(i, "TerrorSpawnZ");
- }
- format(str,sizeof(str),"%s",TDM_Map[MapName]);
- TextDrawSetString(Mode_Text[3],str);
- TextDrawShowForMode(2,Mode_Text[3]);
- foreach(new i: Player)
- {
- if(mode[i] == 2)
- {
- SpawnPlayer(i);
- }
- if(GetPlayerTeam(i) == SWAT && swat > terrorist)
- {
- SetPlayerScore(i,GetPlayerScore(i)+10);
- SendClientMessage(i,-1,"{FFFF00}[!] SWAT Team win! You got +10 scores.");
- GameTextForPlayer(i, "~b~SWAT WIN", 2000, 3);
- }
- else if(GetPlayerTeam(i) == TERRORIST && swat < terrorist)
- {
- SetPlayerScore(i,GetPlayerScore(i)+10);
- SendClientMessage(i,-1,"{FFFF00}[!] Terrorist Team win! You got +10 scores.");
- GameTextForPlayer(i, "~r~TERRORIST WIN", 2000, 3);
- }
- }
- }
- else
- {
- for(new i = 0; i < cache_get_row_count(); i++)
- {
- cache_get_field_content(i, "MapName", MDM_Map[MapName], mysql, 50);
- MDM_Map[interior] = cache_get_field_content_int(i, "interior");
- MDM_Map[Spawn1X] = cache_get_field_content_float(i, "Spawn1X");
- MDM_Map[Spawn1Y] = cache_get_field_content_float(i, "Spawn1Y");
- MDM_Map[Spawn1Z] = cache_get_field_content_float(i, "Spawn1Z");
- MDM_Map[Spawn2X] = cache_get_field_content_float(i, "Spawn2X");
- MDM_Map[Spawn2Y] = cache_get_field_content_float(i, "Spawn2Y");
- MDM_Map[Spawn2Z] = cache_get_field_content_float(i, "Spawn2Z");
- MDM_Map[Spawn3X] = cache_get_field_content_float(i, "Spawn3X");
- MDM_Map[Spawn3Y] = cache_get_field_content_float(i, "Spawn3Y");
- MDM_Map[Spawn3Z] = cache_get_field_content_float(i, "Spawn3Z");
- }
- format(str,sizeof(str),"%s",MDM_Map[MapName]);
- TextDrawSetString(Mode_Two[0],str);
- TextDrawShowForMode(3,Mode_Two[0]);
- foreach(new i: Player)
- {
- if(mode[i] == 3)
- {
- SpawnPlayer(i);
- }
- }
- }
- ResetDraws();
- }
- forward OnBanCheck(playerid);
- public OnBanCheck(playerid)
- {
- new rows,fields;
- cache_get_data(rows, fields, mysql);
- if(rows)
- {
- new adm[24],res[50],btime[50],origin[24],str[128];
- cache_get_field_content(0, "b_admin", adm, mysql, 24);
- cache_get_field_content(0, "b_reason", res, mysql,50);
- cache_get_field_content(0, "b_time", btime, mysql, 50);
- cache_get_field_content(0, "b_name", origin, mysql, 24);
- TogglePlayerSpectating(playerid,true);
- SendClientMessage(playerid,0xFF0080FF,"----------------------------------------------------------------------------------------------------------");
- SendClientMessage(playerid,0xFF0080FF,"* You are banned from this server.");
- format(str,sizeof(str),"* Account: %s",origin);
- SendClientMessage(playerid,0xFF0080FF,str);
- format(str,sizeof(str),"* Admin: %s",adm);
- SendClientMessage(playerid,0xFF0080FF,str);
- format(str,sizeof(str),"* Time: %s",btime);
- SendClientMessage(playerid,0xFF0080FF,str);
- format(str,sizeof(str),"* Reason: %s",res);
- SendClientMessage(playerid,0xFF0080FF,str);
- SendClientMessage(playerid,0xFF0080FF,"----------------------------------------------------------------------------------------------------------");
- KickEx(playerid);
- }
- else
- {
- new query[71];
- format(query,sizeof query,"%s has joined the server.",GetName(playerid));
- SendClientMessageToAll(0xFFFFFFAA,query);
- mysql_format(mysql, query, sizeof(query),"SELECT `pass` FROM `players` WHERE `name` = '%e'", GetName(playerid));
- mysql_tquery(mysql, query, "OnAccountCheck", "i", playerid);
- }
- }
- forward OnAccountCheck(playerid);
- public OnAccountCheck(playerid)
- {
- new rows, fields,string[138];
- cache_get_data(rows, fields, mysql);
- if(rows)
- {
- format(string, sizeof(string),"{FFFF00}Welcome {0080FF}%s, {FFFF00}you are already registered\nPlease enter your password to log into your account", GetName(playerid));
- cache_get_field_content(0, "pass", PlayerInfo[playerid][Pass], mysql, 129);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login",string,"Login","");
- }
- else
- {
- format(string, sizeof(string),"{FFFF00}Welcome {0080FF}%s, {FFFF00}you are not registered\nPlease enter a password to register your account", GetName(playerid));
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register",string,"Register","");
- }
- }
- public OnPlayerClickTextDraw(playerid, Text:clickedid)
- {
- if(_:clickedid != INVALID_TEXT_DRAW)
- {
- if(PlayerInfo[playerid][Logged] == 0) return SendClientMessage(playerid,-1,"You must be logged in to select a mode!");
- if(clickedid == Lobby_TD[19])
- {
- new string[80];
- mode[playerid] = 1;
- TogglePlayerSpectating(playerid,0);
- format(string,sizeof(string),"WAR_GAME~n~~n~Players:_%i~n~map:_area_51~n~VERSION:_%s",GetModeCount(1),WAR_VERSION);
- TextDrawSetString(Lobby_TD[18],string);
- CancelSelectTextDraw(playerid);
- HideLobby(playerid);
- }
- if(clickedid == Lobby_TD[21])
- {
- new string[80];
- mode[playerid] = 2;
- TogglePlayerSpectating(playerid,0);
- format(string,sizeof(string),"tdm_game~n~~n~players:_%i~n~map:_lvpd~n~version:_%s",GetModeCount(2),TDM_VERSION);
- TextDrawSetString(Lobby_TD[20],string);
- CancelSelectTextDraw(playerid);
- HideLobby(playerid);
- ShowModeTextForPlayer(playerid,2);
- switch(random(2))
- {
- case 0: SetPlayerTeam(playerid,SWAT);
- case 1: SetPlayerTeam(playerid,TERRORIST);
- }
- }
- if(clickedid == Lobby_TD[23])
- {
- new string[84];
- mode[playerid] = 3;
- TogglePlayerSpectating(playerid,0);
- format(string,sizeof(string),"minigun_dm~n~~n~players:_%i~n~map:_stadium~n~version:_%s",GetModeCount(3),MDM_VERSION);
- TextDrawSetString(Lobby_TD[22],string);
- CancelSelectTextDraw(playerid);
- HideLobby(playerid);
- SetPlayerTeam(playerid,NO_TEAM);
- ShowModeTextForPlayer(playerid,3);
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_REGISTER)
- {
- new string[176];
- if(!response)
- {
- format(string, sizeof(string),"{FFFF00}Welcome {0080FF}%s, {FFFF00}you are not registered\nPlease enter a password to register your account\n{FF0000}Please Register", GetName(playerid));
- return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register",string,"Register","");
- }
- if (strlen(inputtext) < 4 || strlen(inputtext) > 20)
- {
- format(string, sizeof(string),"{FFFF00}Welcome {0080FF}%s, {FFFF00}you are not registered\nPlease enter a password to register your account\n{FF0000}Password too short or either long", GetName(playerid));
- return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register",string,"Register","");
- }
- new query[600];
- WP_Hash(PlayerInfo[playerid][Pass], 129, inputtext);
- mysql_format(mysql, query, sizeof(query), "INSERT INTO `players` (`name`,`Level`, `pass`, `kills`, `deaths`, `cash`, `IP`) VALUES ('%e','0','%e', 0, 0, 0, '%e')", GetName(playerid),PlayerInfo[playerid][Pass],GetIp(playerid));
- mysql_tquery(mysql, query, "OnAccountRegister", "d", playerid);
- PlayerInfo[playerid][Logged] = 1;
- SendClientMessage(playerid, -1, "{FFFF00}[ACCOUNT]: {FFFFFF}Account succesfuly registered.");
- PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
- }
- if(dialogid == DIALOG_LOGIN)
- {
- if(response)
- {
- new hpass[129],query[126];
- WP_Hash(hpass, 129, inputtext);
- if(!strcmp(hpass, PlayerInfo[playerid][Pass]))
- {
- mysql_format(mysql, query, sizeof(query), "SELECT * FROM `players` WHERE `name` = '%e' LIMIT 1", GetName(playerid));
- mysql_tquery(mysql, query, "OnAccountLoad", "i", playerid);
- }
- else
- {
- format(query, sizeof(query),"{FFFF00}Welcome {0080FF}%s, {FFFF00}you are already registered\nPlease enter your password to log into your account", GetName(playerid));
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login",query,"Login","");
- }
- }
- else
- {
- KickEx(playerid);
- }
- }
- if(dialogid == DIALOG_BANLIST11)
- {
- if(response)
- {
- mysql_format(mysql,global,sizeof(global),"UPDATE `bans` SET `b_name`= '%e' WHERE `bid`= '%d'",inputtext,banrowid[playerid]);
- mysql_tquery(mysql, global,"","");
- format(banrowname[playerid],24,"%s",inputtext);
- SendClientMessage(playerid,-1,"{FFFF00}[BANLIST]: {FFFFFF}Name successfuly changed.");
- }
- }
- if(dialogid == DIALOG_BANLIST10)
- {
- if(response)
- {
- mysql_format(mysql,global,sizeof(global),"UPDATE `bans` SET `b_admin`= '%e' WHERE `bid`= '%d'",inputtext,banrowid[playerid]);
- mysql_tquery(mysql, global,"","");
- SendClientMessage(playerid,-1,"{FFFF00}[BANLIST]: {FFFFFF}Admin's name successfuly changed.");
- }
- }
- if(dialogid == DIALOG_BANLIST9)
- {
- if(response)
- {
- mysql_format(mysql,global,sizeof(global),"UPDATE `bans` SET `b_reason`= '%e' WHERE `bid`= '%d'",inputtext,banrowid[playerid]);
- mysql_tquery(mysql, global,"","");
- SendClientMessage(playerid,-1,"{FFFF00}[BANLIST]: {FFFFFF}Reason successfuly changed.");
- }
- }
- if(dialogid == DIALOG_BANLIST8)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0: ShowPlayerDialog(playerid,DIALOG_BANLIST11, DIALOG_STYLE_INPUT, "Player's Name", "Enter a new name", "Change", "Cancel");
- case 1:
- {
- if(PlayerInfo[playerid][Level] < 3) return ERROR(playerid,"Only level 3 admins can use that feature");
- ShowPlayerDialog(playerid,DIALOG_BANLIST10, DIALOG_STYLE_INPUT, "Admin's Name", "Enter a new admin name", "Change", "Cancel");
- }
- case 2: ShowPlayerDialog(playerid,DIALOG_BANLIST9, DIALOG_STYLE_INPUT, "Reason", "Enter a new reason", "Change", "Cancel");
- }
- }
- }
- if(dialogid == DIALOG_BANLIST5)
- {
- if(response)
- {
- mysql_format(mysql,global, sizeof(global), "SELECT * FROM `bans` WHERE `b_name` = '%e' LIMIT 1",inputtext);
- mysql_tquery(mysql,global, "EditBans", "ds",playerid,inputtext);
- format(banrowname[playerid],24,"%s",inputtext);
- }
- }
- if(dialogid == DIALOG_BANLIST7)
- {
- if(response)
- {
- format(global,sizeof(global),"%s %s",addbaname[playerid], inputtext);
- cmd_offban(playerid,global);
- }
- }
- if(dialogid == DIALOG_BANLIST6)
- {
- if(response)
- {
- format(addbaname[playerid],24,"%s",inputtext);
- ShowPlayerDialog(playerid,DIALOG_BANLIST7, DIALOG_STYLE_INPUT, "Add Ban", "Enter a reason", "Confirm", "Cancel");
- }
- }
- if(dialogid == DIALOG_BANLIST4)
- {
- if(response)
- {
- mysql_format(mysql,global, sizeof(global), "SELECT * FROM `bans` WHERE `b_name` LIKE '%%%s%%' OR `b_ip` LIKE '%%%s%%' ORDER BY `bid` DESC LIMIT 10",inputtext,inputtext);
- mysql_tquery(mysql,global, "GetLastBans", "d",playerid);
- }
- }
- if(dialogid == DIALOG_BANLIST3)
- {
- if(response)
- {
- if(PlayerInfo[playerid][Level] >= 2)
- {
- banrowid[playerid] = LBAN[playerid][listitem];
- format(banrowname2[playerid],24,"%s",LBAN2[playerid][listitem]);
- ShowPlayerDialog(playerid, DIALOG_BANLIST2, DIALOG_STYLE_MSGBOX, "Ban Info", "Would you like to unban that player?", "Unban", "Cancel");
- }
- }
- }
- if(dialogid == DIALOG_BANLIST2)
- {
- if(response)
- {
- mysql_format(mysql, global, sizeof(global),"DELETE FROM `bans` WHERE `bid` = '%d' LIMIT 1",banrowid[playerid]);
- mysql_tquery(mysql, global,"","");
- mysql_format(mysql, global, sizeof(global), "UPDATE `players` SET `Banned`= %d WHERE `b_name`='%e'",0,banrowname2[playerid]);
- mysql_tquery(mysql, global, "QueryComplete", "");
- format(global, sizeof(global),"{FF0000}[BANLIST]: {FFFFFF}You have successfully removed ban id %d",banrowid[playerid]);
- SendClientMessage(playerid,-1,global);
- }
- }
- if(dialogid == DIALOG_BANLIST)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- mysql_format(mysql,global,sizeof(global),"SELECT * FROM `bans` ORDER BY `bid` DESC LIMIT 30");
- mysql_tquery(mysql,global, "GetLastBans", "d",playerid);
- }
- case 1:
- {
- ShowPlayerDialog(playerid,DIALOG_BANLIST4, DIALOG_STYLE_INPUT, "Search Bans", "Enter a name and results will show up", "Search", "Cancel");
- }
- case 2:
- {
- if(PlayerInfo[playerid][Level] < 3) return ERROR(playerid,"You must be a level 3!");
- ShowPlayerDialog(playerid,DIALOG_BANLIST5, DIALOG_STYLE_INPUT, "Edit Bans", "Enter a ban name to edit it", "Confirm", "Cancel");
- }
- case 3:
- {
- if(PlayerInfo[playerid][Level] < 3) return ERROR(playerid,"You must be a level 3!");
- ShowPlayerDialog(playerid,DIALOG_BANLIST6, DIALOG_STYLE_INPUT, "Add Ban", "Enter a Player's name", "Confirm", "Cancel");
- }
- }
- }
- }
- return 1;
- }
- forward OnAccountLoad(playerid);
- public OnAccountLoad(playerid)
- {
- PlayerInfo[playerid][ID] = cache_get_field_content_int(0, "id");
- PlayerInfo[playerid][Level] = cache_get_field_content_int(0, "Level");
- PlayerInfo[playerid][Kills] = cache_get_field_content_int(0, "kills");
- PlayerInfo[playerid][Deaths] = cache_get_field_content_int(0, "deaths");
- PlayerInfo[playerid][Logged] = 1;
- if(PlayerInfo[playerid][Level] >= 1)
- {
- UpdateAdminList(),UpdateOnlinePlayers();
- TextDrawShowForPlayer(playerid,Lobby_TD[7]),TextDrawShowForPlayer(playerid,Lobby_TD[13]);
- }
- ResetPlayerMoney(playerid);
- SetPlayerScore(playerid,PlayerInfo[playerid][Kills]);
- GivePlayerMoney(playerid,cache_get_field_content_int(0, "cash"));
- SendClientMessage(playerid, -1, "{FF0000}[ACCOUNT]: {FFFFFF}Successfully logged in.");
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(mode[playerid] == 1)
- {
- SetPlayerPos(playerid, 270.9977,1942.9789,17.6406);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerInterior(playerid, 0);
- SetPlayerFacingAngle(playerid,356.5239);
- SetPlayerTeam(playerid,NO_TEAM);
- switch(random(5))
- {
- case 0: SetPlayerSkin(playerid,287);
- case 1: SetPlayerSkin(playerid,285);
- case 2: SetPlayerSkin(playerid,90);
- case 3: SetPlayerSkin(playerid,165);
- case 4: SetPlayerSkin(playerid,166);
- }
- ClearAnimations(playerid);
- }
- else if(mode[playerid] == 2)
- {
- if(GetPlayerTeam(playerid) == SWAT)
- {
- GivePlayerWeapon(playerid,4,1);
- GivePlayerWeapon(playerid,24,20);
- GivePlayerWeapon(playerid,29,300);
- GivePlayerWeapon(playerid,25,100);
- SetPlayerColor(playerid,COLOR_BLUE);
- SendClientMessage(playerid,COLOR_BLUE,"You can buy weapons using /shop");
- switch(random(3))
- {
- case 0: { SetPlayerSkin(playerid,285); }
- case 1: { SetPlayerSkin(playerid,280); }
- case 2: { SetPlayerSkin(playerid,287); }
- }
- SetPlayerPos(playerid,TDM_Map[SwatSpawnX],TDM_Map[SwatSpawnY],TDM_Map[SwatSpawnZ]);
- SetPlayerInterior(playerid,TDM_Map[interior]);
- SetPlayerVirtualWorld(playerid, 1);
- }
- else if(GetPlayerTeam(playerid) == TERRORIST)
- {
- GivePlayerWeapon(playerid,4,1);
- GivePlayerWeapon(playerid,24,60);
- GivePlayerWeapon(playerid,30,250);
- GivePlayerWeapon(playerid,25,110);
- SetPlayerColor(playerid,COLOR_RED);
- SendClientMessage(playerid,COLOR_RED,"You can buy weapons using /shop");
- switch(random(3))
- {
- case 0: { SetPlayerSkin(playerid,126); }
- case 1: { SetPlayerSkin(playerid,125); }
- case 2: { SetPlayerSkin(playerid,108); }
- }
- SetPlayerPos(playerid,TDM_Map[TerrorSpawnX],TDM_Map[TerrorSpawnY],TDM_Map[TerrorSpawnZ]);
- SetPlayerInterior(playerid,TDM_Map[interior]);
- SetPlayerVirtualWorld(playerid, 1);
- }
- }
- else if(mode[playerid] == 3)
- {
- SetPlayerSkin(playerid,287);
- GivePlayerWeapon(playerid,38,99999);
- SetPlayerColor(playerid,RandomColors[random(sizeof(RandomColors))]);
- SetPlayerInterior(playerid,MDM_Map[interior]);
- SetPlayerVirtualWorld(playerid, 2);
- switch(random(3))
- {
- case 0: SetPlayerPos(playerid,MDM_Map[Spawn1X],MDM_Map[Spawn1Y],MDM_Map[Spawn1Z]);
- case 1: SetPlayerPos(playerid,MDM_Map[Spawn2X],MDM_Map[Spawn2Y],MDM_Map[Spawn2Z]);
- case 2: SetPlayerPos(playerid,MDM_Map[Spawn3X],MDM_Map[Spawn3Y],MDM_Map[Spawn3Z]);
- }
- }
- return 1;
- }
- public OnTextMenuResponse(playerid,menuid,listitem)
- {
- if(menuid == MENU_SHOP)
- {
- switch(listitem)
- {
- case 1:
- {
- static Pistols[350],bool:form = true;
- if(form)
- {
- strcat(Pistols," ~r~1-~w~ Desert Eagle (~g~$1500~w~)~n~");
- strcat(Pistols," ~r~2-~w~ Silenced Pistol (~g~$800~w~)~n~");
- strcat(Pistols," ~r~3-~w~ Colt-45 (~g~$500~w~)");
- form = false;
- }
- TextMenuShowForPlayer(playerid,MENU_PISTOLS,"Pistols",Pistols,3);
- }
- case 2:
- {
- static sMachines[350],bool:form = true;
- if(form)
- {
- strcat(sMachines," ~r~1-~w~ MP5 (~g~$3000~w~)~n~");
- strcat(sMachines," ~r~2-~w~ Tec-9 (~g~$1500~w~)~n~");
- strcat(sMachines," ~r~3-~w~ UZI (~g~$1500~w~)");
- form = false;
- }
- TextMenuShowForPlayer(playerid,MENU_SMACHINE,"Sub-Machine Guns",sMachines,3);
- }
- case 3:
- {
- static Shotguns[350],bool:form = true;
- if(form)
- {
- strcat(Shotguns," ~r~1-~w~ Combat Shotgun (~g~$5000~w~)~n~");
- strcat(Shotguns," ~r~2-~w~ Sawn-Off (~g~$3500~w~)~n~");
- strcat(Shotguns," ~r~3-~w~ Shotgun (~g~$2500~w~)");
- form = false;
- }
- TextMenuShowForPlayer(playerid,MENU_SHOTGUNS,"Shotguns",Shotguns,3);
- }
- case 4:
- {
- static AssaultRifles[220],bool:form = true;
- if(form)
- {
- strcat(AssaultRifles," ~r~1-~w~ M4 (~g~$4000~w~)~n~");
- strcat(AssaultRifles," ~r~2-~w~ AK-47 (~g~$3500~w~)~n~");
- form = false;
- }
- TextMenuShowForPlayer(playerid,MENU_ARIFLES,"Assault Rifles",AssaultRifles,2);
- }
- case 5:
- {
- static Rifles[220],bool:rif = true;
- if(rif)
- {
- strcat(Rifles," ~r~1-~w~ Sniper Rifle (~g~$4500~w~)~n~");
- strcat(Rifles," ~r~2-~w~ Country Rifle (~g~$2000~w~)~n~");
- rif = false;
- }
- TextMenuShowForPlayer(playerid,MENU_RIFLES,"Rifles",Rifles,2);
- }
- }
- }
- if(menuid == MENU_PISTOLS)
- {
- switch(listitem)
- {
- case 1:
- {
- if(GetPlayerMoney(playerid) < 1500) return ERROR(playerid,"You need $1500 in order to buy this weapon.");
- GivePlayerMoney(playerid,-1500);
- GivePlayerWeapon(playerid,24,100);
- }
- case 2:
- {
- if(GetPlayerMoney(playerid) < 800) return ERROR(playerid,"You need $800 in order to buy this weapon.");
- GivePlayerMoney(playerid,-800);
- GivePlayerWeapon(playerid,23,100);
- }
- case 3:
- {
- if(GetPlayerMoney(playerid) < 500) return ERROR(playerid,"You need $500 in order to buy this weapon.");
- GivePlayerMoney(playerid,-500);
- GivePlayerWeapon(playerid,22,100);
- }
- }
- }
- if(menuid == MENU_SMACHINE)
- {
- switch(listitem)
- {
- case 1:
- {
- if(GetPlayerMoney(playerid) < 3000) return ERROR(playerid,"You need $3000 in order to buy this weapon.");
- GivePlayerMoney(playerid,-3000);
- GivePlayerWeapon(playerid,29,150);
- }
- case 2:
- {
- if(GetPlayerMoney(playerid) < 1500) return ERROR(playerid,"You need $1500 in order to buy this weapon.");
- GivePlayerMoney(playerid,-1500);
- GivePlayerWeapon(playerid,32,200);
- }
- case 3:
- {
- if(GetPlayerMoney(playerid) < 1500) return ERROR(playerid,"You need $1500 in order to buy this weapon.");
- GivePlayerMoney(playerid,-1500);
- GivePlayerWeapon(playerid,28,200);
- }
- }
- }
- if(menuid == MENU_SHOTGUNS)
- {
- switch(listitem)
- {
- case 1:
- {
- if(GetPlayerMoney(playerid) < 5000) return ERROR(playerid,"You need $5000 in order to buy this weapon.");
- GivePlayerMoney(playerid,-5000);
- GivePlayerWeapon(playerid,27,150);
- }
- case 2:
- {
- if(GetPlayerMoney(playerid) < 3500) return ERROR(playerid,"You need $3500 in order to buy this weapon.");
- GivePlayerMoney(playerid,-3500);
- GivePlayerWeapon(playerid,26,200);
- }
- case 3:
- {
- if(GetPlayerMoney(playerid) < 2500) return ERROR(playerid,"You need $2500 in order to buy this weapon.");
- GivePlayerMoney(playerid,-2500);
- GivePlayerWeapon(playerid,25,200);
- }
- }
- }
- if(menuid == MENU_ARIFLES)
- {
- switch(listitem)
- {
- case 1:
- {
- if(GetPlayerMoney(playerid) < 4000) return ERROR(playerid,"You need $4000 in order to buy this weapon.");
- GivePlayerMoney(playerid,-4000);
- GivePlayerWeapon(playerid,31,250);
- }
- case 2:
- {
- if(GetPlayerMoney(playerid) < 3500) return ERROR(playerid,"You need $3500 in order to buy this weapon.");
- GivePlayerMoney(playerid,-3500);
- GivePlayerWeapon(playerid,30,200);
- }
- }
- }
- if(menuid == MENU_RIFLES)
- {
- switch(listitem)
- {
- case 1:
- {
- if(GetPlayerMoney(playerid) < 4500) return ERROR(playerid,"You need $4500 in order to buy this weapon.");
- GivePlayerMoney(playerid,-4500);
- GivePlayerWeapon(playerid,34,90);
- }
- case 2:
- {
- if(GetPlayerMoney(playerid) < 2000) return ERROR(playerid,"You need $2000 in order to buy this weapon.");
- GivePlayerMoney(playerid,-2000);
- GivePlayerWeapon(playerid,33,70);
- }
- }
- }
- if(menuid == MENU_CMDS)
- {
- switch(listitem)
- {
- case 1:
- {
- static CS[350],bool:form = true;
- if(form)
- {
- strcat(CS," /report~n~");
- strcat(CS," /savestats~n~");
- strcat(CS," /changemode~n~");
- strcat(CS," /rules~n~");
- strcat(CS," /admins~n~");
- strcat(CS," /credits~n~");
- strcat(CS," /stats~n~");
- form = false;
- }
- TextMenuShowForPlayer(playerid,MENU_CMDS,"General Commands",CS);
- }
- case 2:
- {
- TextMenuShowForPlayer(playerid,MENU_CMDS,"War Mode"," /shop~n~ /kill");
- }
- case 3:
- {
- TextMenuShowForPlayer(playerid,MENU_CMDS,"TDM Mode"," /shop~n~ /kill");
- }
- case 4:
- {
- TextMenuShowForPlayer(playerid,MENU_CMDS,"Minigun DM Mode"," /kill");
- }
- }
- }
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- switch(mode[playerid])
- {
- case 1:
- {
- format(global,sizeof(global),"{00FF00}[WAR]{%06x}%s{FFFFFF}(%d): %s",GetPlayerColor(playerid) >>> 8,GetName(playerid),playerid, text);
- SendClientMessageToAll(GetPlayerColor(playerid),global);
- }
- case 2:
- {
- format(global,sizeof(global),"{FFFF00}[TDM]{%06x}%s{FFFFFF}(%d): %s",GetPlayerColor(playerid) >>> 8,GetName(playerid),playerid, text);
- SendClientMessageToAll(GetPlayerColor(playerid),global);
- }
- case 3:
- {
- format(global,sizeof(global),"{E5E4E2}[MDM]{%06x}%s{FFFFFF}(%d): %s",GetPlayerColor(playerid) >>> 8,GetName(playerid),playerid, text);
- SendClientMessageToAll(GetPlayerColor(playerid),global);
- }
- default:
- {
- format(global,sizeof(global),"{FFFFFF}[LOBBY]{%06x}%s{FFFFFF}(%d): %s",GetPlayerColor(playerid) >>> 8,GetName(playerid),playerid, text);
- SendClientMessageToAll(GetPlayerColor(playerid),global);
- }
- }
- return 0;
- }
- forward OnAccountUnban(playerid,tar[]);
- public OnAccountUnban(playerid,tar[])
- {
- new rows, fields;
- cache_get_data(rows, fields, mysql);
- if(rows)
- {
- new Query[200];
- mysql_format(mysql, Query, sizeof(Query),"DELETE FROM `bans` WHERE `b_name` = '%e' or `b_ip` ='%e' LIMIT 1",tar,tar);
- mysql_tquery(mysql, Query,"","");
- format(global, sizeof(global),"{00FF00}[UNBAN]: {FFFFFF}You have successfully unbanned account/ip %s",tar);
- SendClientMessage(playerid,-1,global);
- }
- else
- {
- ERROR(playerid,"No such ban found.");
- }
- return 1;
- }
- forward OnAccountBan(playerid,target[],offreason[]);
- public OnAccountBan(playerid,target[],offreason[])
- {
- new zcount=0,raw = cache_get_row_count(),ggwzd[20],Query[200];
- for(new i=0; i < raw; i ++ )
- {
- zcount++;
- cache_get_field_content(i,"IP",ggwzd,mysql,20);
- }
- if(zcount == 0) return ERROR(playerid,"No such account found.");
- new tima[80];
- new Year, Month, Day;
- getdate(Year, Month, Day);
- new Hour, Minute, Second;
- gettime(Hour, Minute, Second);
- format(tima,sizeof(tima),"%d/%d/%d | %d:%d",Day,Month,Year,Hour,Minute);
- mysql_format(mysql, Query, sizeof(Query), "INSERT INTO `bans` (`b_name`,`b_ip`,`b_admin`,`b_reason`,`b_time`) VALUES ('%s','%s','%s','%s','%s')",target,ggwzd,GetName(playerid),offreason,tima);
- mysql_tquery(mysql, Query,"","");
- format(global,sizeof(global),"{FFFF00}[OFF-BAN]: {FFFFFF}You have offline-banned %s [Reason: %s]", target, offreason );
- SendClientMessage(playerid,-1,global);
- return 1;
- }
- forward GetLastBans(playerid);
- public GetLastBans(playerid)
- {
- new count,raw = cache_get_row_count(),lastbans[1000],Gn[MAX_PLAYER_NAME],AdminB[MAX_PLAYER_NAME],bTime[30],bReason[50];
- format(lastbans, sizeof(lastbans),"{FFFFFF}Name\t{FFFFFF}Admin\t{FFFFFF}Date\t{FFFFFF}Reason\n");
- for(new i=0; i < raw; i ++ )
- {
- LBAN[playerid][count] = cache_get_field_content_int(i,"bid");
- cache_get_field_content(i,"b_name",Gn,mysql,MAX_PLAYER_NAME);
- format(LBAN2[playerid][count],24,"%s",Gn);
- cache_get_field_content(i,"b_admin",AdminB,mysql,MAX_PLAYER_NAME);
- cache_get_field_content(i,"b_time",bTime,mysql,30);
- cache_get_field_content(i,"b_reason",bReason,mysql,50);
- format(lastbans, sizeof(lastbans), "%s\n%s\t%s\t%s\t%s", lastbans, Gn, AdminB, bTime, bReason);
- count++;
- }
- ShowPlayerDialog(playerid, DIALOG_BANLIST3, DIALOG_STYLE_TABLIST_HEADERS, "Ban List", lastbans, "Select", "Cancel");
- }
- forward EditBans(playerid,editname);
- public EditBans(playerid,editname)
- {
- new zcount = 0,raw = cache_get_row_count(),LittleString[90],Gn[24];
- format(LittleString,sizeof(LittleString),"You are editing %s's ban",editname);
- for(new i=0; i < raw; i ++ )
- {
- zcount++;
- cache_get_field_content(i,"b_admin",Gn,mysql,MAX_PLAYER_NAME);
- banrowid[playerid] = cache_get_field_content_int(i,"bid");
- format(banrowname2[playerid],24,"%s",Gn);
- }
- if(zcount == 0) return SendClientMessage(playerid,-1,"Error: there is no such ban!");
- ShowPlayerDialog(playerid, DIALOG_BANLIST8, DIALOG_STYLE_LIST, LittleString,"Player's Name\nAdmin's Name\nReason", "Continue","Close");
- return 1;
- }
- /*Functions*/
- UpdateOnlinePlayers()
- {
- new count,acount,str[77];
- foreach(new i: Player)
- {
- ++count;
- if(PlayerInfo[i][Level] >= 1)
- {
- ++acount;
- }
- }
- format(str,sizeof(str),"__%s~n~~n~-Players:_%i/%i~n~-Admins:_%i~n~-Modes:_3",YOUR_WEB,count,GetMaxPlayers(),acount);
- TextDrawSetString(Lobby_TD[13],str);
- }
- SavePlayer(playerid)
- {
- if(PlayerInfo[playerid][Logged] == 1)
- {
- new query[256];
- mysql_format(mysql, query, sizeof(query),"UPDATE `players` SET `kills`='%d', `deaths`='%d', `cash`='%d', `Level`='%d' WHERE `name` = '%e'",PlayerInfo[playerid][Kills],PlayerInfo[playerid][Deaths],GetPlayerMoney(playerid),PlayerInfo[playerid][Level],GetName(playerid));
- mysql_tquery(mysql, query, "", "");
- }
- }
- GetIp(playerid)
- {
- new ip[16];
- GetPlayerIp(playerid, ip, 16);
- return ip;
- }
- ERROR(playerid,msg[])
- {
- new somestring[128];
- format(somestring,128,"{FF0000}[ERROR]:{FFFFFF} %s",msg);
- return SendClientMessage(playerid,-1,somestring);
- }
- GetName(playerid)
- {
- new return_[MAX_PLAYER_NAME];
- GetPlayerName(playerid,return_,sizeof(return_));
- return return_;
- }
- UpdateAdminList()
- {
- new string[145];
- foreach(new i: Player)
- {
- if(PlayerInfo[i][Level] >= 1)
- {
- format(string,sizeof(string),"%s-%s~n~",string,GetName(i));
- }
- }
- TextDrawSetString(Lobby_TD[7],string);
- }
- ShowLobby(playerid)
- {
- for(new i = 0; i < sizeof(Lobby_TD); i++)
- {
- TextDrawShowForPlayer(playerid,Lobby_TD[i]);
- }
- }
- ShowModeTextForPlayer(playerid,modeid)
- {
- switch(modeid)
- {
- case 2:
- {
- TextDrawShowForPlayer(playerid,Mode_Text[7]);
- TextDrawShowForPlayer(playerid,Mode_Text[6]);
- TextDrawShowForPlayer(playerid,Mode_Text[5]);
- TextDrawShowForPlayer(playerid,Mode_Text[4]);
- TextDrawShowForPlayer(playerid,Mode_Text[3]);
- TextDrawShowForPlayer(playerid,Mode_Text[2]);
- TextDrawShowForPlayer(playerid,Mode_Text[1]);
- TextDrawShowForPlayer(playerid,Mode_Text[0]);
- }
- case 3:
- {
- TextDrawShowForPlayer(playerid,Mode_Two[1]);
- TextDrawShowForPlayer(playerid,Mode_Two[0]);
- TextDrawShowForPlayer(playerid,Mode_Text[5]);
- TextDrawShowForPlayer(playerid,Mode_Text[2]);
- TextDrawShowForPlayer(playerid,Mode_Text[1]);
- TextDrawShowForPlayer(playerid,Mode_Text[0]);
- }
- }
- }
- HideModeTextForPlayer(playerid,modeid)
- {
- switch(modeid)
- {
- case 2:
- {
- TextDrawHideForPlayer(playerid,Mode_Text[7]);
- TextDrawHideForPlayer(playerid,Mode_Text[6]);
- TextDrawHideForPlayer(playerid,Mode_Text[5]);
- TextDrawHideForPlayer(playerid,Mode_Text[4]);
- TextDrawHideForPlayer(playerid,Mode_Text[3]);
- TextDrawHideForPlayer(playerid,Mode_Text[2]);
- TextDrawHideForPlayer(playerid,Mode_Text[1]);
- TextDrawHideForPlayer(playerid,Mode_Text[0]);
- }
- case 3:
- {
- TextDrawHideForPlayer(playerid,Mode_Two[1]);
- TextDrawHideForPlayer(playerid,Mode_Two[0]);
- TextDrawHideForPlayer(playerid,Mode_Text[5]);
- TextDrawHideForPlayer(playerid,Mode_Text[2]);
- TextDrawHideForPlayer(playerid,Mode_Text[1]);
- TextDrawHideForPlayer(playerid,Mode_Text[0]);
- }
- }
- }
- HideLobby(playerid)
- {
- for(new i = 0; i < sizeof(Lobby_TD); i++)
- {
- TextDrawHideForPlayer(playerid,Lobby_TD[i]);
- }
- }
- TextDrawShowForMode(modeid,Text:drawid)
- {
- foreach(new i: Player)
- {
- if(mode[i] == modeid)
- {
- TextDrawShowForPlayer(i,drawid);
- }
- }
- }
- ResetDraws()
- {
- new string[83];
- format(string,sizeof(string),"WAR_GAME~n~~n~Players:_%i~n~map:_AREA_51~n~VERSION:_%s",GetModeCount(1),WAR_VERSION);
- TextDrawSetString(Lobby_TD[18],string);
- format(string,sizeof(string),"tdm_game~n~~n~players:_%i~n~map:_%s~n~version:_%s",GetModeCount(2),TDM_Map[MapName],TDM_VERSION);
- TextDrawSetString(Lobby_TD[20],string);
- format(string,sizeof(string),"minigun_dm~n~~n~players:_%i~n~map:_%s~n~version:_%s",GetModeCount(3),MDM_Map[MapName],MDM_VERSION);
- TextDrawSetString(Lobby_TD[22],string);
- }
- KickEx(playerid)
- {
- SetTimerEx("DelayedKick", 1000, false, "i", playerid);
- }
- GetModeCount(modeid)
- {
- new count;
- foreach(new j: Player)
- {
- if(mode[j] == modeid)
- {
- ++count;
- }
- }
- return count;
- }
- BanPlayer(admin[],id,resa[])
- {
- SetPlayerPos(id,197.6661,173.8179,1003.0234);
- SetPlayerInterior(id,3);
- SetCameraBehindPlayer(id);
- new Year, Month, Day,tima[80],Query[600],Hour, Minute, Second;
- getdate(Year, Month, Day);
- gettime(Hour, Minute, Second);
- format(tima,sizeof(tima),"%d/%d/%d | %02d:%02d",Day,Month,Year,Hour,Minute);
- mysql_format(mysql, Query, sizeof(Query), "INSERT INTO `bans` (`b_name`,`b_ip`,`b_admin`,`b_reason`,`b_time`) VALUES ('%s','%s','%s','%s','%s')",GetName(id),GetIp(id),admin,resa,tima);
- mysql_tquery(mysql, Query,"","");
- KickEx(id);
- return 1;
- }
- GetPlayerAdmin(playerid)
- {
- new rankname[17];
- switch(PlayerInfo[playerid][Level])
- {
- case 1: rankname = "~b~Moderator";
- case 2: rankname = "~g~Administrator";
- case 3: rankname = "~p~Manager";
- case 4: rankname = "~r~Owner";
- }
- return rankname;
- }
- /*Commands*/
- CMD:changemode(playerid)
- {
- TogglePlayerSpectating(playerid,1);
- SelectTextDraw(playerid, 0xFF4040AA);
- HideModeTextForPlayer(playerid,mode[playerid]);
- mode[playerid] = 0;
- SetPlayerInterior(playerid,0);
- ShowLobby(playerid);
- return 1;
- }
- CMD:shop(playerid)
- {
- if(mode[playerid] == 3) return ERROR(playerid,"You can't use this command in the mode you are playing at.");
- static Shop[350],bool:form = true;
- if(form)
- {
- strcat(Shop," ~r~1-~w~ Pistols~n~");
- strcat(Shop," ~r~2-~w~ Sub-Machine Guns~n~");
- strcat(Shop," ~r~3-~w~ Shotguns~n~");
- strcat(Shop," ~r~4-~w~ Assault Rifles~n~");
- strcat(Shop," ~r~5-~w~ Rifles~n~");
- form = false;
- }
- TextMenuShowForPlayer(playerid,MENU_SHOP,"Shop",Shop,5);
- return 1;
- }
- CMD:commands(playerid)
- {
- static CS[132],bool:form = true;
- if(form)
- {
- strcat(CS," ~y~1-~w~ General Commands~n~");
- strcat(CS," ~y~2-~w~ War Mode~n~");
- strcat(CS," ~y~3-~w~ TDM Mode~n~");
- strcat(CS," ~y~4-~w~ Minigun DM Mode~n~");
- form = false;
- }
- TextMenuShowForPlayer(playerid,MENU_CMDS,"Commands",CS,4);
- return 1;
- }
- CMD:cmds(playerid) return cmd_commands(playerid);
- CMD:credits(playerid)
- {
- TextMenuShowForPlayer(playerid,MENU_CMDS,"Credits","~y~ Developer: ~w~Jelly23");
- return 1;
- }
- CMD:stats(playerid)
- {
- new Stats[210];
- format(Stats,sizeof(Stats)," ~y~Name: ~w~%s~n~ ~y~Admin Level: ~w~%i~n~ ~y~Cash: ~g~$%i~n~ ~y~Kills: ~w~%i~n~ ~y~Deaths: ~w~%i~n~",
- GetName(playerid),PlayerInfo[playerid][Level],GetPlayerMoney(playerid),PlayerInfo[playerid][Kills],PlayerInfo[playerid][Deaths]);
- TextMenuShowForPlayer(playerid,MENU_CMDS,"Statistics",Stats);
- return 1;
- }
- CMD:rules(playerid)
- {
- static Rules[350],bool:form = true;
- if(form)
- {
- strcat(Rules," ~y~1-~w~ Respect admins/players~n~");
- strcat(Rules," ~y~2-~w~ Cheating/Hacking will lead to a ban~n~");
- strcat(Rules," ~y~3-~w~ You may not ask for score/cash/level~n~");
- strcat(Rules," ~y~4-~w~ You may not abuse bugs, report them~n~");
- strcat(Rules," ~y~5-~w~ C-Bug isn't allowed here~n~");
- strcat(Rules," ~y~6-~w~ You may not disturb admins~n~");
- strcat(Rules," ~y~7-~w~ Banned? Do not evade, appeal at forums~n~");
- strcat(Rules," ~y~8-~w~ Racism isn't tolerated in here");
- form = false;
- }
- TextMenuShowForPlayer(playerid,MENU_CMDS,"Rules",Rules);
- return 1;
- }
- CMD:savestats(playerid)
- {
- SavePlayer(playerid);
- SendClientMessage(playerid,-1,"{FFFF00}[STATS]: {FFFFFF}Stats saved!");
- return 1;
- }
- CMD:kill(playerid)
- {
- SetPlayerHealth(playerid,0);
- SendClientMessage(playerid,-1,"{FF0000}[SUICIDE]: {FFFFFF}You killed yourself");
- return 1;
- }
- CMD:admins(playerid)
- {
- new admins[1500],count;
- foreach(new i: Player)
- {
- if(PlayerInfo[i][Level] >= 1)
- {
- count++;
- format(admins,sizeof(admins)," ~y~%s-_%s(%d)_-_%s~n~",admins,GetName(i),i,GetPlayerAdmin(i));
- }
- }
- if(count == 0)
- {
- admins = " No ~r~admins ~w~online right now";
- }
- TextMenuShowForPlayer(playerid,MENU_CMDS,"Admins",admins);
- return 1;
- }
- CMD:acmds(playerid)
- {
- if(PlayerInfo[playerid][Level] < 1) return ERROR(playerid,"You must be a moderator to use this command.");
- static ACMDS[350],bool:form = true;
- if(form)
- {
- strcat(ACMDS," ~b~Level 1:~w~ /warn /kick /spec /specoff /spawn /slap~n~");
- strcat(ACMDS," ~g~Level 2:~w~ /banlist /ban /unban /weaps /disarm /giveallcash~n~");
- strcat(ACMDS," ~p~Level 3:~w~ /offban /setlevel /setkills /setdeaths /resetcash~n~");
- strcat(ACMDS," ~r~Level 4:~w~ /setweather /settime /gmx /setcash~n~");
- form = false;
- }
- TextMenuShowForPlayer(playerid,MENU_CMDS,"Admin Commands",ACMDS);
- return 1;
- }
- CMD:warn(playerid, params[])
- {
- new id, reason[24];
- if(PlayerInfo[playerid][Level] < 1) return ERROR(playerid,"You must be a moderator to use this command.");
- if(sscanf(params, "us[24]", id, reason)) return SendClientMessage(playerid, -1, "USAGE: /warn [playerid] [reason]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- format(global, sizeof(global), "{FF0000}[WARN]: %s has been warned by %s [Reason: %s]", GetName(id), GetName(playerid), reason);
- SendClientMessageToAll(-1, global);
- return 1;
- }
- CMD:kick(playerid, params[])
- {
- new id, reason[24];
- if(PlayerInfo[playerid][Level] < 1) return ERROR(playerid,"You must be a moderator to use this command.");
- if(sscanf(params, "us[24]", id, reason)) return SendClientMessage(playerid, -1, "USAGE: /kick [playerid] [reason]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- format(global, sizeof(global), "{FF0000}[KICK]: %s has been kicked by %s [Reason: %s]", GetName(id), GetName(playerid), reason);
- SendClientMessageToAll(-1, global);
- KickEx(id);
- return 1;
- }
- CMD:spec(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] < 1) return ERROR(playerid,"You must be a moderator to use this command.");
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USAGE: /spec [playerid]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- if(IsPlayerInAnyVehicle(id))
- {
- SetPlayerInterior(playerid, GetPlayerInterior(id));
- TogglePlayerSpectating(playerid, 1);
- PlayerSpectateVehicle(playerid, GetPlayerVehicleID(id));
- }
- else
- {
- SetPlayerInterior(playerid, GetPlayerInterior(id));
- TogglePlayerSpectating(playerid, 1);
- PlayerSpectatePlayer(playerid, id);
- }
- return 1;
- }
- CMD:specoff(playerid)
- {
- if(PlayerInfo[playerid][Level] == 0) return 0;
- TogglePlayerSpectating(playerid, 0);
- SpawnPlayer(playerid);
- return 1;
- }
- CMD:spawn(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] < 1) return ERROR(playerid,"You must be a moderator to use this command.");
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USAGE: /spawn [playerid]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- SpawnPlayer(id);
- format(global,sizeof(global),"{FFFF00}[SPAWN]: {FFFFFF}You have spawned '%s'",GetName(id));
- SendClientMessage(playerid,-1,global);
- format(global,sizeof(global),"{FFFF00}[SPAWN]: {FFFFFF}You have been spawned by '%s'",GetName(playerid));
- SendClientMessage(id,-1,global);
- return 1;
- }
- CMD:slap(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] < 1) return ERROR(playerid,"You must be a moderator to use this command.");
- new Float:xPos[3],id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USAGE: /slap [playerid]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- GetPlayerPos(id,xPos[0],xPos[1],xPos[2]);
- SetPlayerPos(id,xPos[0],xPos[1],xPos[2]+7);
- format(global,sizeof(global),"{FFFF00}[SLAP]: {FFFFFF}You have slapped '%s'",GetName(id));
- SendClientMessage(playerid,-1,global);
- format(global,sizeof(global),"{FFFF00}[SLAP]: {FFFFFF}You have been slapped by '%s'",GetName(playerid));
- SendClientMessage(id,-1,global);
- return 1;
- }
- CMD:ban(playerid,params[])
- {
- if(PlayerInfo[playerid][Level] < 2) return ERROR(playerid,"You must be an administrator to use this command.");
- new id, reason[50];
- if(sscanf(params, "us[50]", id, reason)) return SendClientMessage(playerid,-1,"USAGE: /ban [playerid] [reason]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- if(PlayerInfo[playerid][Level] <= PlayerInfo[id][Level]) return ERROR(playerid,"You can't ban that player.");
- format(global, sizeof(global), "{FF0000}[BAN]: {FFFFFF}%s has been banned by %s [Reason: %s]", GetName(id), GetName(playerid), reason);
- SendClientMessageToAll(-1, global);
- BanPlayer(GetName(playerid),id,reason);
- return 1;
- }
- CMD:unban(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] < 2) return ERROR(playerid,"You must be an administrator to use this command.");
- new target[50];
- if(sscanf(params,"s[50]", target)) return SendClientMessage(playerid,-1,"USAGE: /unban [name]");
- mysql_format(mysql, global, sizeof(global),"SELECT * FROM `bans` WHERE `b_name` ='%e' OR `b_ip` ='%e' LIMIT 1",target,target);
- mysql_tquery(mysql, global,"OnAccountUnban","ds",playerid,target);
- return 1;
- }
- CMD:weaps(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >= 2)
- {
- new count = 0;
- new ammo, weaponid, weapon[30], string26[150], id;
- if(!sscanf(params, "u", id))
- {
- for (new c = 0; c < 13; c++)
- {
- GetPlayerWeaponData(id, c, weaponid, ammo);
- if (weaponid != 0 && ammo != 0)
- {
- count++;
- }
- }
- SendClientMessage(playerid, -1, "||{FF8000}============={FFFF00} Weapons And Ammo {FF8000}===========||");
- if(count > 0)
- {
- for (new c = 0; c < 13; c++)
- {
- GetPlayerWeaponData(id, c, weaponid, ammo);
- if (weaponid != 0 && ammo != 0)
- {
- GetWeaponName(weaponid, weapon, 24);
- format(string26, sizeof(string26), "{00FF00}Weapons: {A8FFA8}%s {FF0000}.:. {00FF00}Ammo: {A8FFA8}%d", weapon, ammo);
- SendClientMessage(playerid, -1, string26);
- }
- }
- }
- else
- {
- ERROR(playerid,"This player has no weapons.");
- }
- return 1;
- }
- else return SendClientMessage(playerid, -1, "USAGE: /weaps [id]");
- }
- else return ERROR(playerid,"You must be an administrator to use this command.");
- }
- CMD:disarm(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] < 2) return ERROR(playerid,"You must be an administrator to use this command.");
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USAGE: /disarm [playerid]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- ResetPlayerWeapons(id);
- format(global,sizeof(global),"{FFFF00}[DISARM]: {FFFFFF}You have disarmed '%s'",GetName(id));
- SendClientMessage(playerid,-1,global);
- format(global,sizeof(global),"{FFFF00}[DISARM]: {FFFFFF}You have been disarmed by '%s'",GetName(playerid));
- SendClientMessage(id,-1,global);
- return 1;
- }
- CMD:giveallcash(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] < 2) return ERROR(playerid,"You must be an administrator to use this command.");
- if(isnull(params)) return SendClientMessage(playerid,-1,"USAGE: /giveallcash [cash]");
- new strt[200];
- foreach(new i: Player)
- {
- GivePlayerMoney(i,strval(params));
- }
- format(strt,127," %s ~w~%s has given everyone ~g~$%i",GetPlayerAdmin(playerid),GetName(playerid),strval(params));
- TextMenuShowForPlayer(playerid,MENU_CMDS,"Cash",strt);
- return 1;
- }
- CMD:offban(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] < 3) return ERROR(playerid,"You must be a manager to use this command.");
- new target[24],reason[50];
- if(sscanf(params, "s[24]s[50]", target, reason)) return SendClientMessage(playerid,-1,"USAGE: /offban [account] [reason]");
- mysql_format(mysql,global,sizeof(global),"SELECT * FROM `players` WHERE `name` = '%e' LIMIT 1",target);
- mysql_tquery(mysql,global,"OnAccountBan","dss",playerid,target,reason);
- return 1;
- }
- CMD:setlevel(playerid, params[])
- {
- new id,level;
- if(PlayerInfo[playerid][Level] < 3) return ERROR(playerid,"You must be a manager to use this command.");
- if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, -1, "USAGE: /setlevel [playerid] [level]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- if(level < 0) return ERROR(playerid,"Levels are between 0-4 only");
- if(level > 4) return ERROR(playerid,"Levels are between 0-4 only");
- format(global, sizeof(global), "{00FF00}[LEVEL]: {FFFFFF}Your level was set to '%i' by %s.", level,GetName(playerid));
- SendClientMessage(id,-1, global);
- format(global, sizeof(global), "{00FF00}[LEVEL]: {FFFFFF}You have given level '%i' to %s.", level,GetName(id));
- SendClientMessage(playerid,-1, global);
- PlayerInfo[id][Level] = level;
- return 1;
- }
- CMD:setkills(playerid, params[])
- {
- new id,kill;
- if(PlayerInfo[playerid][Level] < 3) return ERROR(playerid,"You must be a manager to use this command.");
- if(sscanf(params, "ud", id, kill)) return SendClientMessage(playerid, -1, "USAGE: /setkills [playerid] [kills]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- format(global, sizeof(global), "{00FF00}[KILLS]: {FFFFFF}Your kills were set to '%i' by %s.", kill,GetName(playerid));
- SendClientMessage(id,-1, global);
- format(global, sizeof(global), "{00FF00}[KILLS]: {FFFFFF}You have set %s's kills to %i.",GetName(id),kill);
- SendClientMessage(playerid,-1, global);
- PlayerInfo[id][Kills] = kill;
- return 1;
- }
- CMD:setdeaths(playerid, params[])
- {
- new id,kill;
- if(PlayerInfo[playerid][Level] < 3) return ERROR(playerid,"You must be a manager to use this command.");
- if(sscanf(params, "ud", id, kill)) return SendClientMessage(playerid, -1, "USAGE: /setdeaths [playerid] [deaths]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- format(global, sizeof(global), "{00FF00}[DEATHS]: {FFFFFF}Your deaths were set to '%i' by %s.", kill,GetName(playerid));
- SendClientMessage(id,-1, global);
- format(global, sizeof(global), "{00FF00}[DEATHS]: {FFFFFF}You have set %s's deaths to %i.",GetName(id),kill);
- SendClientMessage(playerid,-1, global);
- PlayerInfo[id][Deaths] = kill;
- return 1;
- }
- CMD:resetcash(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] < 3) return ERROR(playerid,"You must be a manager to use this command.");
- new id;
- if(sscanf(params, "ud", id)) return SendClientMessage(playerid, -1, "USAGE: /resetcash [playerid]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- ResetPlayerMoney(id);
- format(global,sizeof(global),"{FFFF00}[RESET]: {FFFFFF}You have reset %s's cash",GetName(id));
- SendClientMessage(playerid,-1,global);
- format(global,sizeof(global),"{FFFF00}[RESET]: {FFFFFF}Your cash was reset by '%s'",GetName(playerid));
- SendClientMessage(id,-1,global);
- return 1;
- }
- CMD:settime(playerid,params[])
- {
- if(PlayerInfo[playerid][Level] < 4) return ERROR(playerid,"You must be an owner to use this command.");
- if(isnull(params)) return SendClientMessage(playerid,-1,"USAGE: /settime [time]");
- SetWorldTime(strval(params));
- return 1;
- }
- CMD:setweather(playerid,params[])
- {
- if(PlayerInfo[playerid][Level] < 4) return ERROR(playerid,"You must be an owner to use this command.");
- if(isnull(params)) return SendClientMessage(playerid,-1,"USAGE: /setweather [time]");
- SetWeather(strval(params));
- return 1;
- }
- CMD:setcash(playerid, params[])
- {
- new id,kill;
- if(PlayerInfo[playerid][Level] < 4) return ERROR(playerid,"You must be an owner to use this command.");
- if(sscanf(params, "ud", id, kill)) return SendClientMessage(playerid, -1, "USAGE: /setcash [playerid] [cash]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- format(global, sizeof(global), "{00FF00}[DEATHS]: {FFFFFF}Your cash was set to $%i by %s.", kill,GetName(playerid));
- SendClientMessage(id,-1, global);
- format(global, sizeof(global), "{00FF00}[DEATHS]: {FFFFFF}You have set %s's cash to $%i.",GetName(id),kill);
- SendClientMessage(playerid,-1, global);
- ResetPlayerMoney(id);
- GivePlayerMoney(id,kill);
- return 1;
- }
- CMD:report(playerid, params[])
- {
- new id,reason[50];
- if(sscanf(params, "us[50]", id, reason)) return SendClientMessage(playerid, -1, "USAGE: /report [playerid] [reason]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- format(global, sizeof(global), "{FF0000}[REPORT]: {FFFFFF}%s has reported %s(%i). [Reason: %s]", GetName(playerid),GetName(id),id,reason);
- foreach(new I: Player)
- {
- if(PlayerInfo[I][Level] >= 1) SendClientMessage(I,-1, global);
- }
- SendClientMessage(playerid,-1,"{FFFF00}[REPORT]: {FFFFFF}Your report was sent to the staff, wait for a response!");
- return 1;
- }
- CMD:banlist(playerid)
- {
- if(PlayerInfo[playerid][Level] < 2) return ERROR(playerid,"You must be a moderator to use this command.");
- ShowPlayerDialog(playerid, DIALOG_BANLIST, DIALOG_STYLE_LIST, "{FFFF00}Ban List","Last Bans\nFind Bans\nEdit Bans\nAdd Ban", "Close","");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment