Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- #include <YSI\y_ini>
- #include <streamer>
- #include <mGates>
- #include <sscanf2>
- //Colors
- #define COLOR_WHITE 0xFFFFFFFF
- #define COLOR_BLACK 0x000000FF
- #define COLOR_RED 0xFF0000FF
- #define COLOR_BROWN 0x800000FF
- #define COLOR_LIME 0x00FF00FF
- #define COLOR_GREEN 0x008000FF
- #define COLOR_CYAN 0x00FFFFFF
- #define COLOR_YELLOW 0xFFFF00FF
- #define COLOR_BLUE 0x0000FFFF
- #define COLOR_ORANGE 0xFF8000FF
- #define COLOR_PINK 0xFF00FFFF
- #define COLOR_PURPLE 0x8000FFFF
- //Gay shit
- #define PATH "/Users/%s.ini"
- //Dialogs
- #define DIALOG_REGISTER 800
- #define DIALOG_LOGIN 801
- #define DIALOG_SUCCESS_1 802
- #define DIALOG_SUCCESS_2 803
- #define DIALOG_TEAM_SELECTION 804
- #define DIALOG_SELECT_WEAPONS_CATEGORY 805
- #define DIALOG_ADM_WEAPONS_MELEE 806
- #define DIALOG_ADM_WEAPONS_THROWN 807
- #define DIALOG_ADM_WEAPONS_PISTOLS 808
- #define DIALOG_ADM_WEAPONS_SHOTGUNS 809
- #define DIALOG_ADM_WEAPONS_SMGS 810
- #define DIALOG_ADM_WEAPONS_ASSAULT_RIFLES 811
- #define DIALOG_ADM_WEAPONS_RIFLES 812
- #define DIALOG_ADM_WEAPONS_HEAVY 813
- //Teams
- #define TEAM_USA 5000
- #define TEAM_CANADA 5001
- #define TEAM_BRITAIN 5002
- #define TEAM_AUSTRALIA 5003
- #define TEAM_RUSSIA 5004
- #define TEAM_GERMANY 5005
- #define TEAM_ITALY 5006
- #define TEAM_FRANCE 5007
- #define TEAM_CHINA 5008
- #define TEAM_INDIA 5009
- #define COLOR_USA 0x0000FFFF
- #define COLOR_CANADA 0x008000FF
- #define COLOR_BRITAIN 0xFF0000FF
- #define COLOR_AUSTRALIA 0x0080FFFF
- #define COLOR_RUSSIA 0x800000FF
- #define COLOR_GERMANY 0xFFFF00FF
- #define COLOR_ITALY 0x408080FF
- #define COLOR_FRANCE 0x80FF80FF
- #define COLOR_CHINA 0xFF8000FF
- #define COLOR_INDIA 0x0080C0FF
- #define COLOR_USA_EMBED "{0000FF}"
- #define COLOR_CANADA_EMBED "{008000}"
- #define COLOR_BRITAIN_EMBED "{FF0000}"
- #define COLOR_AUSTRALIA_EMBED "{0080FF}"
- #define COLOR_RUSSIA_EMBED "{800000}"
- #define COLOR_GERMANY_EMBED "{408080}"
- #define COLOR_ITALY_EMBED "{80FF80}"
- #define COLOR_FRANCE_EMBED "{0080C0}"
- #define COLOR_CHINA_EMBED "{FFFF00}"
- #define COLOR_INDIA_EMBED "{FF8000}"
- //Player data
- enum pInfo
- {
- pPass,
- pCash,
- pAdmin,
- pKills,
- pDeaths,
- pVIP,
- pXP,
- pLevel,
- pLevelName[64],
- pTeam
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- //Gates
- new GATE_ADMIN_HOUSE1;
- new GATE_ADMIN_HOUSE2;
- new GATE_INDIA1;
- new GATE_INDIA2;
- new GATE_INDIA3;
- //Zones
- new CP[30];
- new Zone[30];
- new tCheck[30];
- new zDefine[MAX_PLAYERS];
- new UnderAttack[30];
- new timer[MAX_PLAYERS][30];
- #define ZONE_BLUEBERRY_FACTORY 0
- main()
- {
- print("\n----------------------------------");
- print(" Maude Team Deathmatch");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- SetGameModeText("Maude TDM - Alpha 1.0");
- DisableInteriorEnterExits();
- //Zomes
- CP[ZONE_BLUEBERRY_FACTORY] = CreateDynamicCP(-241.4616,-236.2352,2.4297, 10, -1, -1, -1, 100.0);
- Zone[ZONE_BLUEBERRY_FACTORY] = GangZoneCreate(-250.0, -397.0, 25.0, -207.0); //blueberry brewery
- //Gates
- GATE_ADMIN_HOUSE1 = CreateAutomaticGate(980, 1491.3000000,-699.9000200,96.5000000, 0.0000000,0.0000000,180.0000000, 1480.8000488281,-699.9000200,96.5000000, 0.000000, 0.0000000, 180.000000, 1497.3116,-701.8853,94.7500, 5.0, 3, true);
- GATE_ADMIN_HOUSE2 = CreateAutomaticGate(980, 1502.8000000,-699.9000200,96.5000000, 0.000000, 0.0000000, 0.0000000, 1514.3000488281,-699.9000200,96.5000000, 0.000000, 0.000000, 0.000000, 1497.3116,-701.8853,94.7500, 5.0, 3, true);
- //Admin House
- AddStaticVehicleEx(520,1465.0996000,-688.0996100,95.7000000,270.0000000,-1,-1,15); //Hydra
- AddStaticVehicleEx(425,1523.3000000,-672.7000100,95.6000000,180.0000000,95,10,15); //Hunter
- AddStaticVehicleEx(520,1465.0000000,-675.7999900,95.7000000,270.0000000,-1,-1,15); //Hydra
- AddStaticVehicleEx(520,1465.1000000,-663.4000200,95.7000000,270.0000000,-1,-1,15); //Hydra
- AddStaticVehicleEx(445,1517.1000000,-697.0000000,94.7000000,90.0000000,100,100,15); //Admiral
- AddStaticVehicleEx(445,1517.1000000,-694.2000100,94.7000000,90.0000000,100,100,15); //Admiral
- AddStaticVehicleEx(445,1517.1000000,-691.2999900,94.7000000,90.0000000,100,100,15); //Admiral
- AddStaticVehicleEx(468,1502.7000000,-687.9000200,94.5000000,180.0000000,132,4,15); //Sanchez
- AddStaticVehicleEx(468,1504.0000000,-687.9000200,94.5000000,180.0000000,132,4,15); //Sanchez
- AddStaticVehicleEx(468,1505.4000000,-687.9000200,94.5000000,180.0000000,132,4,15); //Sanchez
- AddStaticVehicleEx(468,1506.9000000,-687.9000200,94.5000000,180.0000000,132,4,15); //Sanchez
- AddStaticVehicleEx(521,1491.7000000,-687.7999900,94.4000000,180.0000000,96,26,15); //FCR-900
- AddStaticVehicleEx(521,1490.5000000,-687.9000200,94.4000000,180.0000000,96,26,15); //FCR-900
- AddStaticVehicleEx(521,1489.0000000,-687.9000200,94.4000000,180.0000000,96,26,15); //FCR-900
- AddStaticVehicleEx(521,1487.6000000,-688.0000000,94.4000000,180.0000000,96,26,15); //FCR-900
- CreateObject(987,1469.5000000,-694.2000100,93.7000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (1)
- CreateObject(987,1457.6000000,-694.2000100,93.7000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (2)
- CreateObject(987,1456.7000000,-694.2000100,93.7000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (3)
- CreateObject(987,1456.6000000,-682.4000200,93.7000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (4)
- CreateObject(987,1456.6000000,-670.4000200,93.7000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (5)
- CreateObject(987,1456.6000000,-658.4000200,93.7000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (6)
- CreateObject(987,1456.6000000,-657.0000000,93.7000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (7)
- CreateObject(987,1468.3000000,-657.2000100,93.7000000,0.0000000,0.0000000,180.0000000); //object(elecfence_bar) (10)
- CreateObject(987,1480.3000000,-657.2000100,93.7000000,0.0000000,0.0000000,179.9950000); //object(elecfence_bar) (11)
- CreateObject(987,1492.3000000,-657.2000100,93.7000000,0.0000000,0.0000000,179.9950000); //object(elecfence_bar) (12)
- CreateObject(987,1504.2000000,-657.2000100,93.7000000,0.0000000,0.0000000,179.9950000); //object(elecfence_bar) (13)
- CreateObject(987,1516.1000000,-657.2000100,93.7000000,0.0000000,0.0000000,179.9950000); //object(elecfence_bar) (14)
- CreateObject(987,1528.0000000,-657.2000100,93.7000000,0.0000000,0.0000000,179.9950000); //object(elecfence_bar) (15)
- CreateObject(987,1531.0000000,-657.2000100,93.7000000,0.0000000,0.0000000,179.9950000); //object(elecfence_bar) (16)
- CreateObject(987,1530.9000000,-669.0999800,93.7000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (18)
- CreateObject(987,1530.9000000,-681.0000000,93.7000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (19)
- CreateObject(987,1530.9000000,-692.9000200,93.7000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (20)
- CreateObject(987,1530.9000000,-699.7999900,93.7000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (21)
- CreateObject(987,1519.0000000,-699.7999900,93.7000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (22)
- CreateObject(987,1508.6000000,-699.7999900,93.7000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (23)
- CreateObject(987,1476.3000000,-694.2999900,93.7000000,0.0000000,0.0000000,330.0000000); //object(elecfence_bar) (25)
- //India base
- AddStaticVehicleEx(432,2795.2998000,-2417.7998000,13.7000000,90.0000000,95,10,15); //Rhino
- AddStaticVehicleEx(433,2777.2998000,-2403.0000000,14.2000000,88.9950000,95,10,15); //Barracks
- AddStaticVehicleEx(433,2777.2998000,-2470.5996000,14.2000000,88.9950000,95,10,15); //Barracks
- AddStaticVehicleEx(470,2757.0000000,-2380.8994000,13.7000000,180.0000000,95,10,15); //Patriot
- AddStaticVehicleEx(520,2796.1001000,-2340.8000000,14.6000000,180.0000000,-1,-1,15); //Hydra
- AddStaticVehicleEx(520,2785.8999000,-2340.8000000,14.6000000,180.0000000,-1,-1,15); //Hydra
- AddStaticVehicleEx(520,2775.7000000,-2340.8000000,14.6000000,180.0000000,-1,-1,15); //Hydra
- AddStaticVehicleEx(520,2765.5000000,-2340.8000000,14.6000000,180.0000000,-1,-1,15); //Hydra
- AddStaticVehicleEx(425,2765.8000000,-2355.2000000,14.5000000,0.0000000,95,10,15); //Hunter
- AddStaticVehicleEx(425,2777.3000000,-2355.2000000,14.5000000,0.0000000,95,10,15); //Hunter
- AddStaticVehicleEx(425,2788.8000000,-2355.2000000,14.5000000,0.0000000,95,10,15); //Hunter
- AddStaticVehicleEx(433,2777.3000000,-2398.5000000,14.2000000,88.9950000,95,10,15); //Barracks
- AddStaticVehicleEx(470,2760.3000000,-2380.8999000,13.7000000,180.0000000,95,10,15); //Patriot
- AddStaticVehicleEx(432,2795.3000000,-2455.8000000,13.7000000,90.0000000,95,10,15); //Rhino
- AddStaticVehicleEx(432,2795.3000000,-2494.5000000,13.7000000,90.0000000,95,10,15); //Rhino
- AddStaticVehicleEx(430,2718.5000000,-2572.0996000,0.0000000,180.0000000,157,152,15); //Predator
- AddStaticVehicleEx(430,2728.3999000,-2583.8000000,0.0000000,90.0000000,157,152,15); //Predator
- AddStaticVehicleEx(473,2736.5000000,-2583.3000000,0.0000000,90.0000000,158,164,15); //Dinghy
- AddStaticVehicleEx(473,2742.0000000,-2583.3000000,0.0000000,90.0000000,158,164,15); //Dinghy
- AddStaticVehicleEx(473,2747.8000000,-2583.3000000,0.0000000,90.0000000,158,164,15); //Dinghy
- AddStaticVehicleEx(473,2753.3000000,-2583.3000000,0.0000000,90.0000000,158,164,15); //Dinghy
- AddStaticVehicleEx(493,2760.5000000,-2583.8000500,0.0000000,270.0000000,37,37,15); //Jetmax
- AddStaticVehicleEx(447,2777.8000000,-2578.0000000,0.6000000,178.0000000,32,32,15); //Seasparrow
- AddStaticVehicleEx(425,2794.8999000,-2553.2000000,14.5000000,0.0000000,95,10,15); //Hunter
- AddStaticVehicleEx(425,2782.3999000,-2553.2000000,14.5000000,0.0000000,95,10,15); //Hunter
- AddStaticVehicleEx(425,2789.2000000,-2534.2000000,14.5000000,0.0000000,95,10,15); //Hunter
- AddStaticVehicleEx(433,2777.3000000,-2479.3999000,14.2000000,89.2450000,95,10,15); //Barracks
- AddStaticVehicleEx(433,2777.3000000,-2508.8999000,14.2000000,89.2420000,95,10,15); //Barracks
- CreateObject(987,2719.7000000,-2379.6001000,12.6000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (8)
- CreateObject(987,2719.5000000,-2389.3000000,12.6000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (9)
- CreateObject(987,2719.5000000,-2409.8999000,12.6000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (24)
- CreateObject(987,2719.5000000,-2487.2000000,12.6000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (26)
- CreateObject(987,2719.5000000,-2487.8999000,12.6000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (27)
- CreateObject(987,2719.5000000,-2508.3000000,12.6000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (28)
- CreateObject(987,2719.5000000,-2510.7000000,16.2000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (29)
- CreateObject(987,2719.5000000,-2341.7000000,12.6000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (30)
- CreateObject(987,2719.5000000,-2330.2000000,12.6000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (31)
- CreateObject(987,2719.5000000,-2544.7000000,12.6000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (32)
- CreateObject(987,2719.5000000,-2556.7000000,12.6000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (33)
- CreateObject(987,2719.8000000,-2565.8000000,12.6000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (34)
- CreateObject(987,2731.8000000,-2565.8000000,12.6000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (35)
- CreateObject(987,2742.2000000,-2565.8000000,12.6000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (36)
- CreateObject(987,2762.8999000,-2565.8000000,12.6000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (37)
- CreateObject(987,2774.8000000,-2565.8000000,12.6000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (38)
- CreateObject(987,2786.7000000,-2565.8000000,12.6000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (39)
- CreateObject(987,2798.7000000,-2565.8000000,12.6000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (40)
- CreateObject(11095,2820.8999000,-2435.8999000,11.6000000,0.0000000,0.0000000,271.5000000); //object(stadbridge_sfs) (2)
- CreateObject(987,2810.7000000,-2565.8999000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (41)
- CreateObject(987,2810.7000000,-2553.8999000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (42)
- CreateObject(987,2810.7000000,-2541.8999000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (43)
- CreateObject(987,2810.7000000,-2529.8999000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (44)
- CreateObject(987,2810.7000000,-2518.1001000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (45)
- CreateObject(987,2810.7000000,-2506.1001000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (46)
- CreateObject(987,2810.7000000,-2494.2000000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (47)
- CreateObject(987,2810.7000000,-2482.3000000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (48)
- CreateObject(987,2810.7000000,-2470.3999000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (49)
- CreateObject(987,2810.7000000,-2458.5000000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (50)
- CreateObject(987,2810.7000000,-2451.1001000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (51)
- CreateObject(987,2810.7000000,-2432.7000000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (52)
- CreateObject(987,2810.7000000,-2420.7000000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (53)
- CreateObject(987,2810.7000000,-2408.8000000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (54)
- CreateObject(987,2810.7000000,-2396.8999000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (55)
- CreateObject(987,2810.7000000,-2385.0000000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (56)
- CreateObject(987,2810.7000000,-2373.1001000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (57)
- CreateObject(987,2810.7000000,-2361.2000000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (58)
- CreateObject(987,2810.7000000,-2349.3000000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (59)
- CreateObject(987,2810.7000000,-2341.7000000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (61)
- CreateObject(987,2810.8999000,-2330.0000000,12.6000000,0.0000000,0.0000000,180.5000000); //object(elecfence_bar) (68)
- CreateObject(987,2798.8999000,-2330.1001000,12.6000000,0.0000000,0.0000000,180.5000000); //object(elecfence_bar) (69)
- CreateObject(987,2786.8999000,-2330.2000000,12.6000000,0.0000000,0.0000000,180.5000000); //object(elecfence_bar) (70)
- CreateObject(987,2775.0000000,-2330.3000000,12.6000000,0.0000000,0.0000000,180.5000000); //object(elecfence_bar) (71)
- CreateObject(987,2763.0000000,-2330.3999000,12.6000000,0.0000000,0.0000000,180.5000000); //object(elecfence_bar) (72)
- CreateObject(987,2751.0000000,-2330.5000000,12.6000000,0.0000000,0.0000000,180.5000000); //object(elecfence_bar) (73)
- CreateObject(987,2739.0000000,-2330.6001000,12.6000000,0.0000000,0.0000000,180.5000000); //object(elecfence_bar) (74)
- CreateObject(987,2731.3000000,-2330.7000000,12.6000000,0.0000000,0.0000000,180.5000000); //object(elecfence_bar) (75)
- GATE_INDIA1 = CreateAutomaticGate(971, 2720.1001000,-2405.3999000,16.1000000,0.0000000,0.0000000,270.0000000, 2720.1001000,-2413.8999023438,16.1000000, 0.000000, 0.0000000, 270.000000, 2719.5498,-2405.3574,13.4668, 20.0, 3, true);
- GATE_INDIA2 = CreateAutomaticGate(971, 2720.1001000,-2503.8999000,16.1000000,0.0000000,0.0000000,270.0000000, 2720.1001000,-2512.6000976563,16.1000000, 0.000000, 0.000000, 270.000000, 2720.6343,-2503.9419,13.4869, 20.0, 3, true);
- GATE_INDIA3 = CreateAutomaticGate(971, 2758.3999000,-2565.8000000,15.9000000,0.0000000,0.0000000,0.0000000, 2767.1999511719,-2565.8000000,15.9000000, 0.000000, 0.0000000, 0.000000, 2758.7979,-2565.1077,13.6328, 20.0, 3, true);
- /*
- Objects converted: 50
- Vehicles converted: 28
- Vehicle models found: 9
- ----------------------
- In the time this conversion took to finish light could have travelled around the world 0.07 times!
- */
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- TogglePlayerSpectating(playerid, 1);
- SpawnPlayerAtTeam(playerid);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new name[MAX_PLAYER_NAME], string[23 + MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "-| %s has connected to the server |-", name);
- SendClientMessageToAll(COLOR_LIME, string);
- TogglePlayerSpectating(playerid, true);
- if(fexist(UserPath(playerid)))
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","Type your password below to login.","Login","Quit");
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Registering...","Type your password below to register a new account.","Register","Quit");
- }
- //ZONES
- GangZoneShowForAll(ZONE_BLUEBERRY_FACTORY,0x00800080);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new name[MAX_PLAYER_NAME], string[23 + MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- new DisconnectReason[3][] =
- {
- "Timeout/Crash",
- "Quit",
- "Kick/Ban"
- };
- format(string, sizeof(string), "-| %s has left the server (%s) |-", name, DisconnectReason[reason]);
- SendClientMessageToAll(COLOR_YELLOW, string);
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
- INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
- INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
- INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
- INI_WriteInt(File,"VIP",PlayerInfo[playerid][pVIP]);
- INI_WriteInt(File,"XP",PlayerInfo[playerid][pXP]);
- INI_WriteInt(File,"Score",PlayerInfo[playerid][pLevel]);
- INI_WriteInt(File,"Team",PlayerInfo[playerid][pTeam]);
- INI_WriteInt(File,"Level",PlayerInfo[playerid][pLevel]);
- INI_Close(File);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- TogglePlayerSpectating(playerid, false);
- SpawnPlayerAtTeam(playerid);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- SendDeathMessage(killerid, playerid, reason);
- PlayerInfo[playerid][pDeaths]++;
- if(killerid != INVALID_PLAYER_ID)
- {
- new string1[128];
- new string2[128];
- new name[24];
- new name2[24];
- GetPlayerName(playerid, name, sizeof(name));
- GetPlayerName(killerid, name, sizeof(name2));
- format(string1, sizeof(string1), "You have been killed by %u!", name2);
- format(string2, sizeof(string2), "You have killed %u, and received $1000!", name);
- SendClientMessage(playerid, COLOR_RED, string1);
- SendClientMessage(killerid, COLOR_LIME, string2);
- PlayerInfo[killerid][pKills]++;
- GivePlayerXP(killerid, 100);
- GivePlayerMoney(killerid, 1000);
- }
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/mycommand", cmdtext, true, 10) == 0)
- {
- // Do something here
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerEnterDynamicCP(playerid, checkpointid)
- {
- if(checkpointid == CP[ZONE_BLUEBERRY_FACTORY])
- {
- if(tCheck[ZONE_BLUEBERRY_FACTORY] == PlayerInfo[playerid][pTeam]) return SendClientMessage(playerid, COLOR_RED,"This zone is already captured by your team");
- if(UnderAttack[ZONE_BLUEBERRY_FACTORY] == 1) return SendClientMessage(playerid, COLOR_RED,"This zone is already being taken over!");
- if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED,"ERROR: You cannot capture while in vehicle!");
- UnderAttack[ZONE_BLUEBERRY_FACTORY] = 1;
- timer[playerid][ZONE_BLUEBERRY_FACTORY] = SetTimerEx("SetZone",25000,false,"i", playerid);
- GangZoneFlashForAll(Zone[ZONE_BLUEBERRY_FACTORY],COLOR_RED);
- SendClientMessageToAll(COLOR_GREEN, "The Blueberry Brewery is being taken over!");
- zDefine[playerid] = ZONE_BLUEBERRY_FACTORY;
- }
- return 1;
- }
- public OnPlayerLeaveDynamicCP(playerid, checkpointid)
- {
- if(checkpointid == CP[ZONE_BLUEBERRY_FACTORY])
- {
- UnderAttack[ZONE_BLUEBERRY_FACTORY] = 0;
- GangZoneStopFlashForAll(Zone[ZONE_BLUEBERRY_FACTORY]);
- KillTimer(timer[playerid][ZONE_BLUEBERRY_FACTORY]);
- }
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch( dialogid )
- {
- case DIALOG_REGISTER:
- {
- if (!response) return Kick(playerid);
- if(response)
- {
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registering...","You have entered an invalid password.\nType your password below to register a new account.","Register","Quit");
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Password",udb_hash(inputtext));
- INI_WriteInt(File,"Cash",0);
- INI_WriteInt(File,"Admin",0);
- INI_WriteInt(File,"Kills",0);
- INI_WriteInt(File,"Deaths",0);
- INI_WriteInt(File,"VIP",0);
- INI_WriteInt(File,"XP",0);
- INI_WriteInt(File,"Level",0);
- INI_Close(File);
- SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- ShowPlayerDialog(playerid, DIALOG_TEAM_SELECTION,DIALOG_STYLE_LIST,"You have registered, please select your team.",""COLOR_USA_EMBED"United States\n"COLOR_CANADA_EMBED"Canada\n"COLOR_BRITAIN_EMBED"Britain\n"COLOR_AUSTRALIA_EMBED"Australia\n"COLOR_RUSSIA_EMBED"Russia\n"COLOR_CHINA_EMBED"China\n"COLOR_GERMANY_EMBED"Germany\n"COLOR_ITALY_EMBED"Italy\n"COLOR_INDIA_EMBED"India\n"COLOR_FRANCE_EMBED"France","Select","");
- }
- }
- case DIALOG_LOGIN:
- {
- if ( !response ) return Kick ( playerid );
- if( response )
- {
- if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
- SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
- ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,"Success!","You have successfully logged in!","Ok","");
- SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
- TogglePlayerSpectating(playerid, 0);
- SpawnPlayer(playerid);
- SpawnPlayerAtTeam(playerid);
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
- }
- return 1;
- }
- }
- }
- if(dialogid == DIALOG_TEAM_SELECTION)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0: TogglePlayerSpectating(playerid, 0), AltSetPlayerTeam(playerid, TEAM_USA);
- case 1: TogglePlayerSpectating(playerid, 0), AltSetPlayerTeam(playerid, TEAM_CANADA);
- case 2: TogglePlayerSpectating(playerid, 0), AltSetPlayerTeam(playerid, TEAM_BRITAIN);
- case 3: TogglePlayerSpectating(playerid, 0), AltSetPlayerTeam(playerid, TEAM_AUSTRALIA);
- case 4: TogglePlayerSpectating(playerid, 0), AltSetPlayerTeam(playerid, TEAM_RUSSIA);
- case 5: TogglePlayerSpectating(playerid, 0), AltSetPlayerTeam(playerid, TEAM_GERMANY);
- case 6: TogglePlayerSpectating(playerid, 0), AltSetPlayerTeam(playerid, TEAM_ITALY);
- case 7: TogglePlayerSpectating(playerid, 0), AltSetPlayerTeam(playerid, TEAM_FRANCE);
- case 8: TogglePlayerSpectating(playerid, 0), AltSetPlayerTeam(playerid, TEAM_CHINA);
- case 9: TogglePlayerSpectating(playerid, 0), AltSetPlayerTeam(playerid, TEAM_INDIA);
- }
- }
- return 1;
- }
- if(dialogid == DIALOG_SELECT_WEAPONS_CATEGORY)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0: ShowPlayerDialog(playerid,DIALOG_ADM_WEAPONS_MELEE,DIALOG_STYLE_LIST,"Select Melee Weapon","Brass Knuckles\nGolf Club\nNightstick\nKnife\nBat\nShovel\nPoolstick\nKatana\nChainsaw\nDildo\nDildo 2\nVibrator\nVibrator 2\nFlowers\nCane\nSpray Can\nFire Extinguisher\nGo Back","Select","Cancel");
- case 1: ShowPlayerDialog(playerid,DIALOG_ADM_WEAPONS_THROWN,DIALOG_STYLE_LIST,"Select Thrown Weapon","Grenade\nTear Gas\nMolotov Cocktail\nGo Back","Select","Cancel");
- case 2: ShowPlayerDialog(playerid,DIALOG_ADM_WEAPONS_PISTOLS,DIALOG_STYLE_LIST,"Select Pistol","9mm\nSilenced 9mm\nDesert Eagle\nGo Back","Select","Cancel");
- case 3: ShowPlayerDialog(playerid,DIALOG_ADM_WEAPONS_SHOTGUNS,DIALOG_STYLE_LIST,"Select Shotgun","Shotgun\nSawnoff Shotgun\nCombat Shotgun\nGo Back","Select","Cancel");
- case 4: ShowPlayerDialog(playerid,DIALOG_ADM_WEAPONS_SMGS,DIALOG_STYLE_LIST,"Select SMG","Micro SMG/Uzi\nMP5\nTec-9\nGo Back","Select","Cancel");
- case 5: ShowPlayerDialog(playerid,DIALOG_ADM_WEAPONS_ASSAULT_RIFLES,DIALOG_STYLE_LIST,"Select Assault Rifle","AK-47\nM4\nGo Back","Select","Cancel");
- case 6: ShowPlayerDialog(playerid,DIALOG_ADM_WEAPONS_RIFLES,DIALOG_STYLE_LIST,"Select Rifle","Country Rifle\nSniper Rifle\nGo Back","Select","Cancel");
- case 7: ShowPlayerDialog(playerid,DIALOG_ADM_WEAPONS_HEAVY,DIALOG_STYLE_LIST,"Select Heavy","RPG\nHS Rocket\nFlamethrower\nMinigun\nGo Back","Select","Cancel");
- }
- }
- return 1;
- }
- if(dialogid == DIALOG_ADM_WEAPONS_MELEE)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0: GivePlayerWeapon(playerid,1,9999999);
- case 1: GivePlayerWeapon(playerid,2,9999999);
- case 2: GivePlayerWeapon(playerid,3,9999999);
- case 3: GivePlayerWeapon(playerid,4,9999999);
- case 4: GivePlayerWeapon(playerid,5,9999999);
- case 5: GivePlayerWeapon(playerid,6,9999999);
- case 6: GivePlayerWeapon(playerid,7,9999999);
- case 7: GivePlayerWeapon(playerid,8,9999999);
- case 8: GivePlayerWeapon(playerid,8,9999999);
- case 9: GivePlayerWeapon(playerid,9,9999999);
- case 10: GivePlayerWeapon(playerid,10,9999999);
- case 11: GivePlayerWeapon(playerid,11,9999999);
- case 12: GivePlayerWeapon(playerid,12,9999999);
- case 13: GivePlayerWeapon(playerid,13,9999999);
- case 14: GivePlayerWeapon(playerid,14,9999999);
- case 15: GivePlayerWeapon(playerid,15,9999999);
- case 16: GivePlayerWeapon(playerid,41,9999999);
- case 17: GivePlayerWeapon(playerid,42,9999999);
- case 18: ShowPlayerDialog(playerid,DIALOG_SELECT_WEAPONS_CATEGORY,DIALOG_STYLE_LIST,"Select Weapon Category","Melee\nThrown\nPistols\nShotguns\nSMGs\nAssault Rifles\nRifles\nHeavy","Select","Cancel");
- }
- }
- return 1;
- }
- if(dialogid == DIALOG_ADM_WEAPONS_THROWN)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0: GivePlayerWeapon(playerid,16,9999999);
- case 1: GivePlayerWeapon(playerid,17,9999999);
- case 2: GivePlayerWeapon(playerid,18,9999999);
- case 3: ShowPlayerDialog(playerid,DIALOG_SELECT_WEAPONS_CATEGORY,DIALOG_STYLE_LIST,"Select Weapon Category","Melee\nThrown\nPistols\nShotguns\nSMGs\nAssault Rifles\nRifles\nHeavy","Select","Cancel");
- }
- }
- return 1;
- }
- if(dialogid == DIALOG_ADM_WEAPONS_PISTOLS)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0: GivePlayerWeapon(playerid,22,9999999);
- case 1: GivePlayerWeapon(playerid,23,9999999);
- case 2: GivePlayerWeapon(playerid,24,9999999);
- case 3: ShowPlayerDialog(playerid,DIALOG_SELECT_WEAPONS_CATEGORY,DIALOG_STYLE_LIST,"Select Weapon Category","Melee\nThrown\nPistols\nShotguns\nSMGs\nAssault Rifles\nRifles\nHeavy","Select","Cancel");
- }
- }
- return 1;
- }
- if(dialogid == DIALOG_ADM_WEAPONS_SHOTGUNS)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0: GivePlayerWeapon(playerid,25,9999999);
- case 1: GivePlayerWeapon(playerid,26,9999999);
- case 2: GivePlayerWeapon(playerid,27,9999999);
- case 3: ShowPlayerDialog(playerid,DIALOG_SELECT_WEAPONS_CATEGORY,DIALOG_STYLE_LIST,"Select Weapon Category","Melee\nThrown\nPistols\nShotguns\nSMGs\nAssault Rifles\nRifles\nHeavy","Select","Cancel");
- }
- }
- return 1;
- }
- if(dialogid == DIALOG_ADM_WEAPONS_SMGS)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0: GivePlayerWeapon(playerid,28,9999999);
- case 1: GivePlayerWeapon(playerid,29,9999999);
- case 2: GivePlayerWeapon(playerid,32,9999999);
- case 3: ShowPlayerDialog(playerid,DIALOG_SELECT_WEAPONS_CATEGORY,DIALOG_STYLE_LIST,"Select Weapon Category","Melee\nThrown\nPistols\nShotguns\nSMGs\nAssault Rifles\nRifles\nHeavy","Select","Cancel");
- }
- }
- return 1;
- }
- if(dialogid == DIALOG_ADM_WEAPONS_ASSAULT_RIFLES)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0: GivePlayerWeapon(playerid,30,9999999);
- case 1: GivePlayerWeapon(playerid,31,9999999);
- case 2: ShowPlayerDialog(playerid,DIALOG_SELECT_WEAPONS_CATEGORY,DIALOG_STYLE_LIST,"Select Weapon Category","Melee\nThrown\nPistols\nShotguns\nSMGs\nAssault Rifles\nRifles\nHeavy","Select","Cancel");
- }
- }
- return 1;
- }
- if(dialogid == DIALOG_ADM_WEAPONS_RIFLES)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0: GivePlayerWeapon(playerid,33,9999999);
- case 1: GivePlayerWeapon(playerid,34,9999999);
- case 2: ShowPlayerDialog(playerid,DIALOG_SELECT_WEAPONS_CATEGORY,DIALOG_STYLE_LIST,"Select Weapon Category","Melee\nThrown\nPistols\nShotguns\nSMGs\nAssault Rifles\nRifles\nHeavy","Select","Cancel");
- }
- }
- return 1;
- }
- if(dialogid == DIALOG_ADM_WEAPONS_HEAVY)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0: GivePlayerWeapon(playerid,35,9999999);
- case 1: GivePlayerWeapon(playerid,36,9999999);
- case 2: GivePlayerWeapon(playerid,37,9999999);
- case 3: GivePlayerWeapon(playerid,38,9999999);
- case 4: ShowPlayerDialog(playerid,DIALOG_SELECT_WEAPONS_CATEGORY,DIALOG_STYLE_LIST,"Select Weapon Category","Melee\nThrown\nPistols\nShotguns\nSMGs\nAssault Rifles\nRifles\nHeavy","Select","Cancel");
- }
- }
- return 1;
- }
- return 0;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- public OnPlayerRequestGate(playerid, gateid)
- {
- //return 0 means cannot pass, return 1 means can
- if((gateid == GATE_ADMIN_HOUSE1) && (PlayerInfo[playerid][pAdmin] < 1)) return 0;
- if((gateid == GATE_ADMIN_HOUSE2) && (PlayerInfo[playerid][pAdmin] < 1)) return 0;
- if((gateid == GATE_INDIA1) && (PlayerInfo[playerid][pTeam] != TEAM_INDIA)) return 0;
- if((gateid == GATE_INDIA2) && (PlayerInfo[playerid][pTeam] != TEAM_INDIA)) return 0;
- if((gateid == GATE_INDIA3) && (PlayerInfo[playerid][pTeam] != TEAM_INDIA)) return 0;
- return 1;
- }
- public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
- {
- SetPlayerPosFindZ(playerid, fX, fY, fZ);
- return 1;
- }
- /*////////////////////////////////////
- COMMANDS
- *//////////////////////////////////////
- CMD:changeteam(playerid, params[])
- {
- ShowPlayerDialog(playerid, DIALOG_TEAM_SELECTION,DIALOG_STYLE_LIST,"Please select your team.",""COLOR_USA_EMBED"United States\n"COLOR_CANADA_EMBED"Canada\n"COLOR_BRITAIN_EMBED"Britain\n"COLOR_AUSTRALIA_EMBED"Australia\n"COLOR_RUSSIA_EMBED"Russia\n"COLOR_CHINA_EMBED"China\n"COLOR_GERMANY_EMBED"Germany\n"COLOR_ITALY_EMBED"Italy\n"COLOR_INDIA_EMBED"India\n"COLOR_FRANCE_EMBED"France","Select","");
- return 1;
- }
- CMD:setadmin(playerid, params[])
- {
- if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 4)
- {
- new log[128];
- new id;
- new asetlevel;
- new name[24];
- GetPlayerName(playerid, name, sizeof(name));
- if(sscanf(params, "ud", id, asetlevel)) SendClientMessage(playerid, COLOR_RED, "USAGE: /setadmin [playerid] [level]");
- else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "ERROR: Player not found.");
- else if((PlayerInfo[id][pAdmin] >= PlayerInfo[playerid][pAdmin]) && !IsPlayerAdmin(playerid)) SendClientMessage(playerid, COLOR_RED, "ERROR: You cannot use this command on admins that are of equal or higher rank than you.");
- else if((playerid == id) && !IsPlayerAdmin(playerid)) SendClientMessage(playerid, COLOR_RED, "ERROR: You cannot use this command on yourself.");
- else
- {
- new name2[24];
- new string1[128];
- new string2[128];
- GetPlayerName(id, name2, sizeof(name2));
- PlayerInfo[id][pAdmin] = asetlevel;
- format(string1, sizeof(string1), "-| You have set %s's admin level to %d |-", name2, asetlevel);
- format(string2, sizeof(string2), "-| Your admin level has been set to %d by %s |-", asetlevel, name);
- SendClientMessage(playerid, COLOR_GREEN, string1);
- SendClientMessage(id, COLOR_GREEN, string2);
- format(log, sizeof(log), "[ADMIN LOG] %s(%i) used /setadmin on %s(%i), setting their admin level to %i", name, playerid, name2, id, asetlevel);
- SendAdminMessage(COLOR_GREEN, log);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "ERROR: You must have admin level 4 or higher to use this command.");
- }
- return 1;
- }
- CMD:adminhouse(playerid, params[])
- {
- new log[128];
- new name[24];
- GetPlayerName(playerid, name, sizeof(name));
- if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
- {
- SetPlayerPos(playerid, 1498.8534,-703.7729,94.7439);
- SetPlayerFacingAngle(playerid, 7.6887);
- SetCameraBehindPlayer(playerid);
- format(log, sizeof(log), "[ADMIN LOG] %s(%i) teleported to the admin house", name, playerid);
- SendAdminMessage(COLOR_GREEN, log);
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "ERROR: You must be an admin to use this command.");
- }
- return 1;
- }
- CMD:closeadmingate(playerid, params[])
- {
- if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
- {
- CloseGate(GATE_ADMIN_HOUSE1);
- CloseGate(GATE_ADMIN_HOUSE2);
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "ERROR: You must be an admin to use this command.");
- }
- return 1;
- }
- CMD:openadmingate(playerid, params[])
- {
- if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
- {
- OpenGate(GATE_ADMIN_HOUSE1);
- OpenGate(GATE_ADMIN_HOUSE2);
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "ERROR: You must be an admin to use this command.");
- }
- return 1;
- }
- CMD:stats(playerid, params[])
- {
- new name[24], string1[128], string2[128], string3[128], year, month, day;
- GetPlayerName(playerid, name, sizeof(name));
- getdate(year,month,day);
- new team[24];
- team = GetPlayerTeamName(playerid);
- SendClientMessage(playerid, COLOR_YELLOW, "-| Stats |-");
- format(string1, sizeof(string1), "Name: %s | Team: %s", name, team);
- format(string2, sizeof(string2), "Level: %d (%s) | XP: %d | Cash: $%i | Kills: %d | Deaths: %d", PlayerInfo[playerid][pLevel], GetPlayerLevelName(playerid), PlayerInfo[playerid][pXP], GetPlayerMoney(playerid), PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths]);
- format(string3, sizeof(string3), "VIP Level: %d | Admin Level: %d", PlayerInfo[playerid][pVIP], PlayerInfo[playerid][pAdmin]);
- SendClientMessage(playerid, COLOR_YELLOW, string1);
- SendClientMessage(playerid, COLOR_YELLOW, string2);
- SendClientMessage(playerid, COLOR_YELLOW, string3);
- return 1;
- }
- CMD:kill(playerid, params[])
- {
- SetPlayerHealth(playerid, 0);
- SendClientMessage(playerid, COLOR_RED, "You have killed yourself!");
- return 1;
- }
- CMD:setcash(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 2)
- {
- new id;
- new cash;
- new name[24];
- GetPlayerName(playerid, name, sizeof(name));
- if(sscanf(params, "ud", id, cash)) SendClientMessage(playerid, COLOR_RED, "USAGE: /setcash [playerid] [amount]");
- else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "ERROR: Player not found.");
- else
- {
- new name2[24];
- new string1[128];
- new string2[128];
- new log[128];
- GetPlayerName(id, name2, sizeof(name2));
- ResetPlayerMoney(id);
- GivePlayerMoney(id, cash);
- format(string1, sizeof(string1), "-| You have set %s's cash to $%d |-", name2, cash);
- format(string2, sizeof(string2), "-| Your cash has been set to $%d by %s |-", cash, name);
- SendClientMessage(playerid, COLOR_GREEN, string1);
- SendClientMessage(id, COLOR_YELLOW, string2);
- format(log, sizeof(log), "[ADMIN LOG] %s(%i) used /setcash on %s(%i), setting their cash to $%i", name, playerid, name2, id, cash);
- SendAdminMessage(COLOR_GREEN, log);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "ERROR: You must have admin level 2 or higher to use this command.");
- }
- return 1;
- }
- CMD:givecash(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 2)
- {
- new id;
- new cash;
- new name[24];
- GetPlayerName(playerid, name, sizeof(name));
- if(sscanf(params, "ud", id, cash)) SendClientMessage(playerid, COLOR_RED, "USAGE: /givecash [playerid] [amount]");
- else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "ERROR: Player not found.");
- else
- {
- new name2[24];
- new string1[128];
- new string2[128];
- new log[64];
- GetPlayerName(id, name2, sizeof(name2));
- GivePlayerMoney(id, cash);
- format(string1, sizeof(string1), "-| You have given %s $%d |-", name2, cash);
- format(string2, sizeof(string2), "-| You have been given $%d by %s |-", cash, name);
- SendClientMessage(playerid, COLOR_GREEN, string1);
- SendClientMessage(id, COLOR_GREEN, string2);
- format(log, sizeof(log), "[ADMIN LOG] %s(%i) used /givecash on %s(%i), giving them $%i", name, playerid, name2, id, cash);
- SendAdminMessage(COLOR_GREEN, log);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "ERROR: You must be admin level 2 or higher to use this command.");
- }
- return 1;
- }
- CMD:pm(playerid, params[])
- {
- new id;
- new message[256];
- new name[24];
- GetPlayerName(playerid, name, sizeof(name));
- if(sscanf(params, "us", id, message)) SendClientMessage(playerid, COLOR_RED, "USAGE: /pm [playerid] [message]");
- else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "ERROR: Player not found.");
- else
- {
- new name2[24];
- new string1[128];
- new string2[128];
- GetPlayerName(id, name2, sizeof(name2));
- format(string1, sizeof(string1), "PM from %s: %s", name, message);
- format(string2, sizeof(string2), "PM to %s: %s", name2, message);
- SendClientMessage(playerid, COLOR_GREEN, string1);
- SendClientMessage(id, COLOR_YELLOW, string2);
- }
- return 1;
- }
- CMD:a(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- new message[256];
- new name[24];
- GetPlayerName(playerid, name, sizeof(name));
- if(sscanf(params, "s[256]", message)) SendClientMessage(playerid, COLOR_RED, "USAGE: /a [message]");
- else
- {
- format(message, sizeof(message), "[ADMIN CHAT] %s(%i): %s", name, playerid, message);
- SendAdminMessage(COLOR_GREEN, message);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "ERROR: You must be admin level 2 or higher to use this command.");
- }
- return 1;
- }
- CMD:t(playerid, params[])
- {
- new message[256];
- new name[24];
- new team;
- GetPlayerName(playerid, name, sizeof(name));
- team = GetPlayerTeam(playerid);
- if(sscanf(params, "s[256]", message)) SendClientMessage(playerid, COLOR_RED, "USAGE: /t [message]");
- else
- {
- format(message, sizeof(message), "[TEAM CHAT] %s(%i): %s", name, playerid, message);
- SendTeamMessage(team, message);
- }
- return 1;
- }
- CMD:teleport(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- new id;
- new name[24];
- if(sscanf(params, "u", id)) SendClientMessage(playerid, COLOR_RED, "USAGE: /teleport [playerid]");
- else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "ERROR: Player not found.");
- else
- {
- new interior;
- new Float:x, Float:y, Float:z, Float:angle;
- GetPlayerName(playerid, name, sizeof(name));
- GetPlayerPos(id, x, y, z);
- GetPlayerFacingAngle(id, angle);
- interior = GetPlayerInterior(id);
- SetPlayerInterior(playerid, interior);
- SetPlayerPos(playerid, x, y, z);
- SetPlayerFacingAngle(playerid, angle);
- SetCameraBehindPlayer(playerid);
- new name2[24];
- new string1[128];
- new log[64];
- GetPlayerName(id, name2, sizeof(name2));
- format(string1, sizeof(string1), "-| You have teleported to %s |-", name2);
- SendClientMessage(playerid, COLOR_GREEN, string1);
- format(log, sizeof(log), "[ADMIN LOG] %s(%i) used /tp and teleported to %s(%i)", name, playerid, name2, id);
- SendAdminMessage(COLOR_GREEN, log);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "ERROR: You must be admin to use this command.");
- }
- return 1;
- }
- CMD:tp(playerid, params[])
- {
- return cmd_teleport(playerid, params);
- }
- CMD:admingetweapon(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- new logname[24];
- new string[128];
- GetPlayerName(playerid, logname, sizeof(logname));
- ShowPlayerDialog(playerid,DIALOG_SELECT_WEAPONS_CATEGORY,DIALOG_STYLE_LIST,"Select Weapon Category","Melee\nThrown\nPistols\nShotguns\nSMGs\nAssault Rifles\nRifles\nHeavy","Select","Cancel");
- format(string, sizeof(string), "[ADMIN LOGS] %s(%i) used /admingetweapon", logname, playerid);
- SendAdminMessage(COLOR_GREEN, string);
- }
- else SendClientMessage(playerid, COLOR_RED, "ERROR: You must be an admin to use this command.");
- return 1;
- }
- /*////////////////////////////////////////////////////
- YEET DAB
- *////////////////////////////////////////////////////
- forward LoadUser_data(playerid,name[],value[]);
- public LoadUser_data(playerid,name[],value[])
- {
- INI_Int("Password",PlayerInfo[playerid][pPass]);
- INI_Int("Cash",PlayerInfo[playerid][pCash]);
- INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
- INI_Int("Kills",PlayerInfo[playerid][pKills]);
- INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
- INI_Int("VIP",PlayerInfo[playerid][pVIP]);
- INI_Int("XP",PlayerInfo[playerid][pXP]);
- INI_Int("Level",PlayerInfo[playerid][pLevel]);
- INI_String("Level Name", PlayerInfo[playerid][pLevelName], 64);
- INI_Int("Team",PlayerInfo[playerid][pTeam]);
- return 1;
- }
- stock UserPath(playerid)
- {
- new string[128],playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playername,sizeof(playername));
- format(string,sizeof(string),PATH,playername);
- return string;
- }
- /*Credits to Dracoblue*/
- stock udb_hash(buf[]) {
- new length=strlen(buf);
- new s1 = 1;
- new s2 = 0;
- new n;
- for (n=0; n<length; n++)
- {
- s1 = (s1 + buf[n]) % 65521;
- s2 = (s2 + s1) % 65521;
- }
- return (s2 << 16) + s1;
- }
- stock PlayerLevelUp(playerid)
- {
- PlayerInfo[playerid][pLevel]++;
- }
- stock GivePlayerXP(playerid, xpamount)
- {
- PlayerInfo[playerid][pXP] += xpamount;
- LevelUpCheck(playerid);
- }
- /*//////////////////////////////////////////////////
- LEVELS
- *//////////////////////////////////////////////////
- stock GetPlayerLevel(playerid)
- {
- if(PlayerInfo[playerid][pLevel] == 1) return 1;
- if(PlayerInfo[playerid][pLevel] == 2) return 2;
- if(PlayerInfo[playerid][pLevel] == 3) return 3;
- if(PlayerInfo[playerid][pLevel] == 4) return 4;
- if(PlayerInfo[playerid][pLevel] == 5) return 5;
- if(PlayerInfo[playerid][pLevel] == 6) return 6;
- if(PlayerInfo[playerid][pLevel] == 7) return 7;
- if(PlayerInfo[playerid][pLevel] == 8) return 8;
- if(PlayerInfo[playerid][pLevel] == 9) return 9;
- if(PlayerInfo[playerid][pLevel] == 10) return 10;
- if(PlayerInfo[playerid][pLevel] == 11) return 11;
- if(PlayerInfo[playerid][pLevel] == 12) return 12;
- if(PlayerInfo[playerid][pLevel] == 13) return 13;
- if(PlayerInfo[playerid][pLevel] == 14) return 14;
- if(PlayerInfo[playerid][pLevel] == 15) return 15;
- if(PlayerInfo[playerid][pLevel] == 16) return 16;
- if(PlayerInfo[playerid][pLevel] == 17) return 17;
- if(PlayerInfo[playerid][pLevel] == 18) return 18;
- if(PlayerInfo[playerid][pLevel] == 19) return 19;
- if(PlayerInfo[playerid][pLevel] == 20) return 20;
- if(PlayerInfo[playerid][pLevel] == 21) return 21;
- if(PlayerInfo[playerid][pLevel] == 22) return 22;
- if(PlayerInfo[playerid][pLevel] == 23) return 23;
- if(PlayerInfo[playerid][pLevel] == 24) return 24;
- if(PlayerInfo[playerid][pLevel] == 25) return 25;
- if(PlayerInfo[playerid][pLevel] == 26) return 26;
- if(PlayerInfo[playerid][pLevel] == 27) return 27;
- if(PlayerInfo[playerid][pLevel] == 28) return 28;
- if(PlayerInfo[playerid][pLevel] == 29) return 29;
- if(PlayerInfo[playerid][pLevel] == 30) return 30;
- }
- stock LevelUpCheck(playerid)
- {
- if(PlayerInfo[playerid][pXP] == 100) PlayerLevelUp(playerid); //To level 2
- if(PlayerInfo[playerid][pXP] == 250) PlayerLevelUp(playerid); //To level 3
- if(PlayerInfo[playerid][pXP] == 500) PlayerLevelUp(playerid); //To level 4
- if(PlayerInfo[playerid][pXP] == 750) PlayerLevelUp(playerid); //To level 5
- if(PlayerInfo[playerid][pXP] == 1000) PlayerLevelUp(playerid); //To level 6
- if(PlayerInfo[playerid][pXP] == 1250) PlayerLevelUp(playerid); //To level 7
- if(PlayerInfo[playerid][pXP] == 1500) PlayerLevelUp(playerid); //To level 8
- if(PlayerInfo[playerid][pXP] == 1750) PlayerLevelUp(playerid); //To level 9
- if(PlayerInfo[playerid][pXP] == 2000) PlayerLevelUp(playerid); //To level 10
- if(PlayerInfo[playerid][pXP] == 2500) PlayerLevelUp(playerid); //To level 11
- if(PlayerInfo[playerid][pXP] == 3000) PlayerLevelUp(playerid); //To level 12
- if(PlayerInfo[playerid][pXP] == 3500) PlayerLevelUp(playerid); //To level 13
- if(PlayerInfo[playerid][pXP] == 4000) PlayerLevelUp(playerid); //To level 14
- if(PlayerInfo[playerid][pXP] == 4500) PlayerLevelUp(playerid); //To level 15
- if(PlayerInfo[playerid][pXP] == 5000) PlayerLevelUp(playerid); //To level 16
- if(PlayerInfo[playerid][pXP] == 5500) PlayerLevelUp(playerid); //To level 17
- if(PlayerInfo[playerid][pXP] == 6000) PlayerLevelUp(playerid); //To Level 18
- if(PlayerInfo[playerid][pXP] == 6500) PlayerLevelUp(playerid); //To level 19
- if(PlayerInfo[playerid][pXP] == 7000) PlayerLevelUp(playerid); //To Level 20
- if(PlayerInfo[playerid][pXP] == 7500) PlayerLevelUp(playerid); //To Level 21
- if(PlayerInfo[playerid][pXP] == 8000) PlayerLevelUp(playerid); //To Level 22
- if(PlayerInfo[playerid][pXP] == 8500) PlayerLevelUp(playerid); //To Level 23
- if(PlayerInfo[playerid][pXP] == 9000) PlayerLevelUp(playerid); //To level 24
- if(PlayerInfo[playerid][pXP] == 10000) PlayerLevelUp(playerid); //To level 25
- if(PlayerInfo[playerid][pXP] == 11000) PlayerLevelUp(playerid); //To level 26
- if(PlayerInfo[playerid][pXP] == 12000) PlayerLevelUp(playerid); //To level 27
- if(PlayerInfo[playerid][pXP] == 13000) PlayerLevelUp(playerid); //To level 28
- if(PlayerInfo[playerid][pXP] == 14000) PlayerLevelUp(playerid); //To level 29
- if(PlayerInfo[playerid][pXP] == 15000) PlayerLevelUp(playerid); //To level 30
- }
- SetPlayerLevelName(playerid)
- {
- strdel(PlayerInfo[playerid][pLevelName],0,128);
- switch(PlayerInfo[playerid][pLevel])
- {
- case 1: strins(PlayerInfo[playerid][pLevelName],"Private I",0,128);
- case 2: strins(PlayerInfo[playerid][pLevelName],"Private II",0,128);
- case 3: strins(PlayerInfo[playerid][pLevelName],"Private III",0,128);
- case 4: strins(PlayerInfo[playerid][pLevelName],"Private First Class",0,128);
- case 5: strins(PlayerInfo[playerid][pLevelName],"Specialist",0,128);
- case 6: strins(PlayerInfo[playerid][pLevelName],"Corporal",0,128);
- case 7: strins(PlayerInfo[playerid][pLevelName],"Sergeant",0,128);
- case 8: strins(PlayerInfo[playerid][pLevelName],"Staff Sergeant",0,128);
- case 9: strins(PlayerInfo[playerid][pLevelName],"Sergeant First Class",0,128);
- case 10: strins(PlayerInfo[playerid][pLevelName],"Master Sergeant",0,128);
- case 11: strins(PlayerInfo[playerid][pLevelName],"First Sergeant",0,128);
- case 12: strins(PlayerInfo[playerid][pLevelName],"Sergeant Major",0,128);
- case 13: strins(PlayerInfo[playerid][pLevelName],"Command Sergeant Major",0,128);
- case 14: strins(PlayerInfo[playerid][pLevelName],"Sergeant Major of the Army",0,128);
- case 15: strins(PlayerInfo[playerid][pLevelName],"Warrant Officer",0,128);
- case 16: strins(PlayerInfo[playerid][pLevelName],"Chief Warrant Officer II",0,128);
- case 17: strins(PlayerInfo[playerid][pLevelName],"Chief Warrant Officer III",0,128);
- case 18: strins(PlayerInfo[playerid][pLevelName],"Chief Warrant Officer IV",0,128);
- case 19: strins(PlayerInfo[playerid][pLevelName],"Chief Warrant Officer V",0,128);
- case 20: strins(PlayerInfo[playerid][pLevelName],"Second Lieutenant",0,128);
- case 21: strins(PlayerInfo[playerid][pLevelName],"First Lieutenant",0,128);
- case 22: strins(PlayerInfo[playerid][pLevelName],"Captain",0,128);
- case 23: strins(PlayerInfo[playerid][pLevelName],"Major",0,128);
- case 24: strins(PlayerInfo[playerid][pLevelName],"Lieutenant Colonel",0,128);
- case 25: strins(PlayerInfo[playerid][pLevelName],"Colonel",0,128);
- case 26: strins(PlayerInfo[playerid][pLevelName],"Brigadier General",0,128);
- case 27: strins(PlayerInfo[playerid][pLevelName],"Major General",0,128);
- case 28: strins(PlayerInfo[playerid][pLevelName],"Lieutenant General",0,128);
- case 29: strins(PlayerInfo[playerid][pLevelName],"General",0,128);
- case 30: strins(PlayerInfo[playerid][pLevelName],"General of the Army",0,128);
- }
- return 1;
- }
- stock GetPlayerLevelName(playerid)
- {
- SetPlayerLevelName(playerid);
- return PlayerInfo[playerid][pLevelName];
- }
- /*/////////////////////////////////////////
- TEAMS
- *///////////////////////////////////////////
- AltSetPlayerTeam(playerid, team)
- {
- SetPlayerTeam(playerid, team);
- printf("Former Team ID is %d", PlayerInfo[playerid][pTeam]);
- PlayerInfo[playerid][pTeam] = team;
- printf("New team ID is %d", GetPlayerTeam(playerid));
- SpawnPlayerAtTeam(playerid);
- if(team == TEAM_USA) SetPlayerColor(playerid, COLOR_USA);
- if(team == TEAM_CANADA) SetPlayerColor(playerid, COLOR_CANADA);
- if(team == TEAM_BRITAIN) SetPlayerColor(playerid, COLOR_BRITAIN);
- if(team == TEAM_AUSTRALIA) SetPlayerColor(playerid, COLOR_AUSTRALIA);
- if(team == TEAM_RUSSIA) SetPlayerColor(playerid, COLOR_RUSSIA);
- if(team == TEAM_GERMANY) SetPlayerColor(playerid, COLOR_GERMANY);
- if(team == TEAM_ITALY) SetPlayerColor(playerid, COLOR_ITALY);
- if(team == TEAM_FRANCE) SetPlayerColor(playerid, COLOR_FRANCE);
- if(team == TEAM_CHINA) SetPlayerColor(playerid, COLOR_CHINA);
- if(team == TEAM_INDIA) SetPlayerColor(playerid, COLOR_INDIA);
- }
- SpawnPlayerAtTeam(playerid)
- {
- new Float:USASpawns[3][4] =
- {
- {154.0558,1912.6029,18.8228,4.6064},
- {213.6994,1874.9786,17.6406,3.0163},
- {153.7363,1847.5313,17.6406,356.7496}
- };
- new Float:CanadaSpawns[3][4] =
- {
- {-472.4701,-194.1285,78.0881,20.1248},
- {-541.7864,-151.8316,77.0442,359.2529},
- {-536.2971,-98.5008,63.2969,273.6887}
- };
- new Float:BritainSpawns[3][4] =
- {
- {-1521.9277,481.4308,7.1875,180.5736},
- {-1348.7789,500.1924,18.2344,348.6155},
- {-1563.8306,316.6201,7.1875,131.1303}
- };
- new Float:AustraliaSpawns[3][4] =
- {
- {-688.0345,944.7898,13.6328,0.0469},
- {-686.2051,979.6094,12.1262,87.5167},
- {-687.8675,929.7429,13.6293,181.1319}
- };
- new Float:RussiaSpawns[3][4] =
- {
- {-2520.4351,-624.5309,132.7848,0.8743},
- {-2487.4331,-621.0484,132.5872,87.1375},
- {-2374.1062,-583.5718,132.1172,118.5435}
- };
- new Float:GermanySpawns[3][4] =
- {
- {1106.4036,-299.6010,74.5391,99.9817},
- {1073.4133,-345.0207,73.9922,356.5807},
- {1023.7352,-316.0926,73.9889,175.7202}
- };
- new Float:ItalySpawns[3][4] =
- {
- {-1070.8738,-1170.6907,129.6406,234.3037},
- {-1060.0549,-1205.3832,129.2188,267.3490},
- {-1067.8376,-1299.5409,129.2188,276.0990}
- };
- new Float:FranceSpawns[3][4] =
- {
- {-2237.7219,2353.6807,4.9803,132.8337},
- {-2241.0059,2333.7966,4.9918,99.6200},
- {-2281.6807,2288.4836,4.9704,271.9083}
- };
- new Float:ChinaSpawns[3][4] =
- {
- {2735.4065,-2452.2302,17.5938,359.3937},
- {2721.3025,-2386.2537,17.3403,266.3329},
- {2752.5508,-2513.4436,13.6402,19.0380}
- };
- new Float:IndiaSpawns[3][4] =
- {
- {2841.2942,1285.7273,11.3906,88.5804},
- {2794.3298,1256.1736,11.0299,4.2696},
- {2837.1394,1337.4557,11.0877,82.9403}
- };
- new rnd;
- TogglePlayerSpectating(playerid, 0);
- if(PlayerInfo[playerid][pTeam] == TEAM_USA) rnd = random(sizeof(USASpawns)), SetPlayerPos(playerid,USASpawns[rnd][0],USASpawns[rnd][1],USASpawns[rnd][2]), SetPlayerFacingAngle(playerid, USASpawns[rnd][3]), SetPlayerColor(playerid, COLOR_USA);
- if(PlayerInfo[playerid][pTeam] == TEAM_CANADA) rnd = random(sizeof(CanadaSpawns)), SetPlayerPos(playerid,CanadaSpawns[rnd][0],CanadaSpawns[rnd][1],CanadaSpawns[rnd][2]), SetPlayerFacingAngle(playerid, CanadaSpawns[rnd][3]), SetPlayerColor(playerid, COLOR_CANADA);
- if(PlayerInfo[playerid][pTeam] == TEAM_BRITAIN) rnd = random(sizeof(BritainSpawns)), SetPlayerPos(playerid,BritainSpawns[rnd][0],BritainSpawns[rnd][1],BritainSpawns[rnd][2]), SetPlayerFacingAngle(playerid, BritainSpawns[rnd][3]), SetPlayerColor(playerid, COLOR_BRITAIN);
- if(PlayerInfo[playerid][pTeam] == TEAM_AUSTRALIA) rnd = random(sizeof(AustraliaSpawns)), SetPlayerPos(playerid,AustraliaSpawns[rnd][0],AustraliaSpawns[rnd][1],AustraliaSpawns[rnd][2]), SetPlayerFacingAngle(playerid, AustraliaSpawns[rnd][3]), SetPlayerColor(playerid, COLOR_AUSTRALIA);
- if(PlayerInfo[playerid][pTeam] == TEAM_RUSSIA) rnd = random(sizeof(RussiaSpawns)), SetPlayerPos(playerid,RussiaSpawns[rnd][0],RussiaSpawns[rnd][1],RussiaSpawns[rnd][2]), SetPlayerFacingAngle(playerid,RussiaSpawns[rnd][3]), SetPlayerColor(playerid, COLOR_RUSSIA);
- if(PlayerInfo[playerid][pTeam] == TEAM_GERMANY) rnd = random(sizeof(GermanySpawns)), SetPlayerPos(playerid,GermanySpawns[rnd][0],GermanySpawns[rnd][1],GermanySpawns[rnd][2]), SetPlayerFacingAngle(playerid, GermanySpawns[rnd][3]), SetPlayerColor(playerid, COLOR_GERMANY);
- if(PlayerInfo[playerid][pTeam] == TEAM_ITALY) rnd = random(sizeof(ItalySpawns)), SetPlayerPos(playerid,ItalySpawns[rnd][0],ItalySpawns[rnd][1],ItalySpawns[rnd][2]), SetPlayerFacingAngle(playerid, ItalySpawns[rnd][3]), SetPlayerColor(playerid, COLOR_ITALY);
- if(PlayerInfo[playerid][pTeam] == TEAM_FRANCE) rnd = random(sizeof(FranceSpawns)), SetPlayerPos(playerid,FranceSpawns[rnd][0],FranceSpawns[rnd][1],FranceSpawns[rnd][2]), SetPlayerFacingAngle(playerid, FranceSpawns[rnd][3]), SetPlayerColor(playerid, COLOR_FRANCE);
- if(PlayerInfo[playerid][pTeam] == TEAM_CHINA) rnd = random(sizeof(ChinaSpawns)), SetPlayerPos(playerid,ChinaSpawns[rnd][0],ChinaSpawns[rnd][1],ChinaSpawns[rnd][2]), SetPlayerFacingAngle(playerid, ChinaSpawns[rnd][3]), SetPlayerColor(playerid, COLOR_CHINA);
- if(PlayerInfo[playerid][pTeam] == TEAM_INDIA) rnd = random(sizeof(IndiaSpawns)), SetPlayerPos(playerid,IndiaSpawns[rnd][0],IndiaSpawns[rnd][1],IndiaSpawns[rnd][2]), SetPlayerFacingAngle(playerid, IndiaSpawns[rnd][3]), SetPlayerColor(playerid, COLOR_INDIA);
- SetCameraBehindPlayer(playerid);
- SetPlayerSkin(playerid, 287);
- }
- GetPlayerTeamName(playerid)
- {
- new szString[24];
- new team;
- team = GetPlayerTeam(playerid);
- switch(team)
- {
- case TEAM_USA: szString = "United States";
- case TEAM_CANADA: szString = "Canada";
- case TEAM_BRITAIN: szString = "Britain";
- case TEAM_AUSTRALIA: szString = "Australia";
- case TEAM_RUSSIA: szString = "Russia";
- case TEAM_GERMANY: szString = "Germany";
- case TEAM_ITALY: szString = "Italy";
- case TEAM_FRANCE: szString = "France";
- case TEAM_CHINA: szString = "China";
- case TEAM_INDIA: szString = "India";
- default: valstr(szString, team);
- }
- printf("Team name is %s", szString);
- return szString;
- }
- ////////////////////////////////////////
- ////////////////////////////////////////
- /////////////////////////////////////
- stock SendAdminMessage(color,string[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) == 1 && PlayerInfo[i][pAdmin] >= 1)
- {
- SendClientMessage(i, color, string);
- }
- }
- return 1;
- }
- stock SendTeamMessage(team,string[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) == 1 && PlayerInfo[i][pTeam] == team)
- {
- switch(GetPlayerTeam(i))
- {
- case TEAM_USA: SendClientMessage(i, COLOR_USA, string);
- case TEAM_CANADA: SendClientMessage(i, COLOR_CANADA, string);
- case TEAM_BRITAIN: SendClientMessage(i, COLOR_BRITAIN, string);
- case TEAM_AUSTRALIA: SendClientMessage(i, COLOR_AUSTRALIA, string);
- case TEAM_RUSSIA: SendClientMessage(i, COLOR_RUSSIA, string);
- case TEAM_GERMANY: SendClientMessage(i, COLOR_GERMANY, string);
- case TEAM_ITALY: SendClientMessage(i, COLOR_ITALY, string);
- case TEAM_FRANCE: SendClientMessage(i, COLOR_FRANCE, string);
- case TEAM_CHINA: SendClientMessage(i, COLOR_CHINA, string);
- case TEAM_INDIA: SendClientMessage(i, COLOR_INDIA, string);
- }
- }
- }
- return 1;
- }
- forward SetZone(playerid);
- public SetZone(playerid)
- {
- GivePlayerXP(playerid, 250);
- GivePlayerMoney(playerid, 3000);
- SendClientMessage(playerid,COLOR_GREEN,"Congratulation! You have been given 250 XP & $3000");
- UnderAttack[ZONE_BLUEBERRY_FACTORY] = 0;
- KillTimer(timer[playerid][ZONE_BLUEBERRY_FACTORY]);
- SetGangZone(playerid);
- return 1;
- }
- forward SetGangZone(playerid);
- public SetGangZone(playerid)
- {
- if(zDefine[playerid] == ZONE_BLUEBERRY_FACTORY)
- {
- GangZoneShowForAll(Zone[ZONE_BLUEBERRY_FACTORY],GetPlayerColor(playerid));
- new string[126], pName5[MAX_PLAYER_NAME];
- GetPlayerName(playerid,pName5,sizeof(pName5));
- format(string,sizeof string,"%s has captured the Blueberry Brewery for %s", pName5, GetPlayerTeamName(playerid));
- GangZoneStopFlashForAll(Zone[ZONE_BLUEBERRY_FACTORY]);
- SendClientMessageToAll(COLOR_GREEN, string);
- tCheck[ZONE_BLUEBERRY_FACTORY] = PlayerInfo[playerid][pTeam];
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment