Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // .:--------------------------------------------------------------:.
- // .:==============================================================:.
- // { M - TDM V0.1 FOR 0.3C BY Soumi }
- // Credits : *Me for doing this :D
- // *cloudysky for mapping
- // *SA-MP team of course
- // "and for everyone who helped me to make this script"
- // .:==============================================================:.
- // .:--------------------------------------------------------------:.
- #include <a_samp>
- //Teams Define
- #define TEAM_POLICE 1
- #define TEAM_HOBOS 2
- #define TEAM_GROVE 3
- #define TEAM_MAFIA 4
- //Colours Define
- #define TEAM_POLICE_COLOUR 0x2641FEAA
- #define TEAM_HOBOS_COLOUR 0x800000AA
- #define TEAM_GROVE_COLOUR 0x33AA33AA
- #define TEAM_MAFIA_COLOUR 0xF5DEB3AA
- #define COLOR_WHITE 0xFFFFFFFF
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_RED 0xA10000AA
- #define COLOR_YELLOW 0xFFFF00AA
- new gTeam[MAX_PLAYERS];
- new Menu:ammunationmenu;
- new Text:txt1;
- new ammunationenter;
- new ammunationexit;
- new drugpickup;
- new Float:pArmour;
- new pMoney;
- new Float:pHealth;
- new pScore;
- new wLevel;
- forward HourTimer(playerid);
- #if defined FILTERSCRIPT
- #else
- main()
- {
- print("\n--------------------------------------");
- print(" M-TDM V0.1 ");
- print(" By {Soumi} ");
- print("--------------------------------------\n");
- }
- #endif
- public OnGameModeInit()
- {
- //-----------------------------------------
- AllowAdminTeleport(1);
- AllowInteriorWeapons(1);
- DisableInteriorEnterExits();
- ShowPlayerMarkers(0);
- SetTeamCount(4);
- //-----------------------------------------
- //Game mode
- SetGameModeText("M-TDM V0.1");
- //-----------------------------------------
- //Teams spawn :
- //Police :
- AddPlayerClass(280,1305.4125,-786.8438,1084.0078,37.1204,3,0,22,60,30,300);
- AddPlayerClass(281,1305.4125,-786.8438,1084.0078,37.1204,3,0,22,60,30,300);
- AddPlayerClass(282,1305.4125,-786.8438,1084.0078,37.1204,3,0,22,60,30,300);
- AddPlayerClass(283,1305.4125,-786.8438,1084.0078,37.1204,3,0,22,60,30,300);
- AddPlayerClass(285,1305.4125,-786.8438,1084.0078,37.1204,3,0,22,60,30,300);
- AddPlayerClass(288,1305.4125,-786.8438,1084.0078,37.1204,3,0,22,60,30,300);
- AddPlayerClass(286,1305.4125,-786.8438,1084.0078,37.1204,3,0,22,60,30,300);
- AddPlayerClass(192,1305.4125,-786.8438,1084.0078,37.1204,3,0,22,60,30,300);
- //Hobos :
- AddPlayerClass(134,1265.8604,-777.2852,1084.0078,359.8568,6,0,23,60,31,300);
- AddPlayerClass(135,1265.8604,-777.2852,1084.0078,359.8568,6,0,23,60,31,300);
- AddPlayerClass(137,1265.8604,-777.2852,1084.0078,359.8568,6,0,23,60,31,300);
- AddPlayerClass(212,1265.8604,-777.2852,1084.0078,359.8568,6,0,23,60,31,300);
- AddPlayerClass(230,1265.8604,-777.2852,1084.0078,359.8568,6,0,23,60,31,300);
- AddPlayerClass(239,1265.8604,-777.2852,1084.0078,359.8568,6,0,23,60,31,300);
- AddPlayerClass(77,1265.8604,-777.2852,1084.0078,359.8568,6,0,23,60,31,300);
- //Grove :
- AddPlayerClass(105,1267.8646,-810.1602,1084.0078,52.8108,5,0,26,70,30,300);
- AddPlayerClass(106,1267.8646,-810.1602,1084.0078,52.8108,5,0,26,70,30,300);
- AddPlayerClass(107,1267.8646,-810.1602,1084.0078,52.8108,5,0,26,70,30,300);
- AddPlayerClass(269,1267.8646,-810.1602,1084.0078,52.8108,5,0,26,70,30,300);
- AddPlayerClass(270,1267.8646,-810.1602,1084.0078,52.8108,5,0,26,70,30,300);
- AddPlayerClass(271,1267.8646,-810.1602,1084.0078,52.8108,5,0,26,70,30,300);
- AddPlayerClass(298,1267.8646,-810.1602,1084.0078,52.8108,5,0,26,70,30,300);
- //Mafia :
- AddPlayerClass(111,1282.1912,-824.7309,1085.6328,132.7349,1,0,29,250,25,70);
- AddPlayerClass(113,1282.1912,-824.7309,1085.6328,132.7349,1,0,29,250,25,70);
- AddPlayerClass(124,1282.1912,-824.7309,1085.6328,132.7349,1,0,29,250,25,70);
- AddPlayerClass(125,1282.1912,-824.7309,1085.6328,132.7349,1,0,29,250,25,70);
- AddPlayerClass(126,1282.1912,-824.7309,1085.6328,132.7349,1,0,29,250,25,70);
- AddPlayerClass(127,1282.1912,-824.7309,1085.6328,132.7349,1,0,29,250,25,70);
- AddPlayerClass(194,1282.1912,-824.7309,1085.6328,132.7349,1,0,29,250,25,70);
- //-----------------------------------------
- //Pickups
- //Team Spawn Pickups
- //With a 3D text in each spawn pickup
- CreatePickup(1314,1,1305.4125,-786.8438,1084.0078);
- Create3DTextLabel("Police Spawn",0xFF00FFFF,1305.4125,-786.8438,1084.0078,6.0,0);
- CreatePickup(1314,1,1265.8604,-777.2852,1084.0078);
- Create3DTextLabel("Hobos Spawn",0xFF00FFFF,1265.8604,-777.2852,1084.0078,6.0,0);
- CreatePickup(1314,1,1267.8646,-810.1602,1084.0078);
- Create3DTextLabel("Grove Spawn",0xFF00FFFF,1267.8646,-810.1602,1084.0078,6.0,0);
- CreatePickup(1314,1,1282.1912,-824.7309,1085.6328);
- Create3DTextLabel("Mafia Spawn",0xFF00FFFF,1282.1912,-824.7309,1085.6328,6.0,0);
- //Drugs/Ammunation Pickups
- //with 3D text in each pickup too , it helps the player to
- //know what is that pickup for
- drugpickup = CreatePickup(1279,1,1248.7208,-806.1448,1084.0078);
- Create3DTextLabel("Drug Point",0x33AA33AA,1248.7208,-806.1448,1084.0078,6.0,0);
- ammunationenter = CreatePickup(1318,1,1271.4468,-822.4473,1089.9375);
- Create3DTextLabel("Ammu-Nation",0xFFFF00AA,1271.4468,-822.4473,1089.9375,6.0,0);
- ammunationexit = CreatePickup(1318,1,286.0389,-29.8492,1001.5156);
- //-----------------------------------------
- //Menus
- //The ammunation menu , you can type /buygun at the ammuation to
- //see this menu that allows you to select the weapon you want to buy
- ammunationmenu = CreateMenu("AmmuNation :", 2, 200.0, 100.0, 150.0, 150.0);
- AddMenuItem(ammunationmenu, 0, "AK47 $8000");
- AddMenuItem(ammunationmenu, 0, "M4 $9000");
- AddMenuItem(ammunationmenu, 0, "MP5 $4000");
- AddMenuItem(ammunationmenu, 0, "UZI $4000");
- AddMenuItem(ammunationmenu, 0, "SPAS12 $7500");
- AddMenuItem(ammunationmenu, 0, "Deagle $5000");
- AddMenuItem(ammunationmenu, 0, "Sniper $10.000");
- AddMenuItem(ammunationmenu, 0, "Rocket launcher $50.000");
- //-----------------------------------------
- //Timers
- //Note : 3600000 = 1Hour
- SetTimer("HourTimer",3600000,true);
- //Objects By cloudysky
- //Maddog Mansion Objects :
- CreateObject(3015, 1283.4685058594, -783.25317382813, 1088.9375, 0, 0, 0);
- CreateObject(18257, 1268.6064453125, -777.88317871094, 1090.90625, 0, 0, 0);
- CreateObject(1685, 1280.4525146484, -782.69390869141, 1089.6875, 0, 0, 0);
- CreateObject(1685, 1283.951171875, -787.72045898438, 1089.6875, 0, 0, 0);
- CreateObject(1685, 1280.6843261719, -794.84375, 1089.6875, 0, 0, 0);
- CreateObject(1685, 1283.6586914063, -802.11389160156, 1089.6875, 0, 0, 0);
- CreateObject(1685, 1280.6539306641, -810.66033935547, 1089.6875, 0, 0, 0);
- CreateObject(1685, 1283.9046630859, -816.2861328125, 1089.6875, 0, 0, 0);
- CreateObject(944, 1282.9704589844, -832.66619873047, 1089.822265625, 0, 0, 0);
- CreateObject(3013, 1282.4670410156, -833.52166748047, 1089.0847167969, 0, 0, 0);
- CreateObject(18257, 1279.267578125, -836.28381347656, 1084.6328125, 0, 0, 270);
- CreateObject(964, 1270.8817138672, -830.07318115234, 1084.6328125, 0, 0, 0);
- CreateObject(964, 1270.9008789063, -830.06182861328, 1085.5985107422, 0, 0, 0);
- CreateObject(964, 1270.8041992188, -828.09484863281, 1084.6328125, 0, 0, 0);
- CreateObject(964, 1270.8045654297, -828.09490966797, 1085.5985107422, 0, 0, 0);
- CreateObject(964, 1270.9875488281, -830.00482177734, 1086.5642089844, 0, 0, 0);
- CreateObject(964, 1270.9973144531, -828.74108886719, 1086.5642089844, 0, 0, 0);
- CreateObject(964, 1270.9912109375, -827.59020996094, 1086.5642089844, 0, 0, 0);
- CreateObject(2974, 1288.6882324219, -832.89422607422, 1084.6328125, 0, 0, 0);
- CreateObject(2912, 1262.5721435547, -831.54174804688, 1083.0148925781, 0, 0, 0);
- CreateObject(2912, 1262.5548095703, -831.54541015625, 1083.71484375, 0, 0, 0);
- CreateObject(930, 1262.7761230469, -832.22424316406, 1083.4907226563, 0, 0, 0);
- CreateObject(1685, 1263.0493164063, -835.00860595703, 1083.7648925781, 0, 0, 0);
- CreateObject(1685, 1263.0401611328, -838.27423095703, 1083.7578125, 0, 0, 0);
- CreateObject(1685, 1281.0793457031, -822.1123046875, 1089.6875, 0, 0, 0);
- CreateObject(2991, 1254.3442382813, -828.16259765625, 1083.6354980469, 0, 0, 0);
- CreateObject(2991, 1235.5437011719, -833.06286621094, 1083.6354980469, 0, 0, 90);
- CreateObject(2975, 1239.3370361328, -826.60205078125, 1082.15625, 0, 0, 0);
- CreateObject(2975, 1249.0526123047, -831.75555419922, 1083.0148925781, 0, 0, 0);
- CreateObject(2975, 1251.1234130859, -835.57684326172, 1083.0078125, 0, 0, 0);
- CreateObject(2975, 1248.3004150391, -838.54870605469, 1083.0078125, 0, 0, 0);
- CreateObject(925, 1229.7275390625, -836.10113525391, 1084.0697021484, 0, 0, 0);
- CreateObject(925, 1235.4520263672, -838.2861328125, 1084.0697021484, 0, 0, 0);
- CreateObject(1431, 1227.451171875, -830.45275878906, 1083.5554199219, 0, 0, 0);
- CreateObject(1431, 1227.4953613281, -826.00225830078, 1083.5554199219, 0, 0, 0);
- CreateObject(1685, 1229.1007080078, -815.25439453125, 1083.7578125, 0, 0, 0);
- CreateObject(1685, 1229.1105957031, -817.37756347656, 1083.7578125, 0, 0, 0);
- CreateObject(930, 1240.0802001953, -811.35986328125, 1083.4836425781, 0, 0, 90);
- CreateObject(930, 1240.2679443359, -813.39324951172, 1083.4836425781, 0, 0, 0);
- CreateObject(1431, 1232.015625, -812.86987304688, 1083.5554199219, 0, 0, 90);
- CreateObject(1431, 1228.6192626953, -808.72845458984, 1083.5554199219, 0, 0, 0);
- CreateObject(2567, 1249.3779296875, -811.3125, 1084.9354248047, 0, 0, 0);
- CreateObject(942, 1271.5297851563, -798.40734863281, 1085.4510498047, 0, 0, 0);
- CreateObject(935, 1260.9449462891, -802.34149169922, 1083.5710449219, 0, 0, 0);
- CreateObject(935, 1261.9300537109, -802.35845947266, 1083.5710449219, 0, 0, 0);
- CreateObject(935, 1262.9259033203, -802.33630371094, 1083.5710449219, 0, 0, 0);
- CreateObject(935, 1263.9537353516, -802.25360107422, 1083.5710449219, 0, 0, 0);
- CreateObject(1431, 1258.5804443359, -804.14392089844, 1083.5554199219, 0, 0, 90);
- CreateObject(1431, 1281.3435058594, -800.90148925781, 1083.5554199219, 0, 0, 0);
- CreateObject(1431, 1283.4188232422, -800.81677246094, 1083.5554199219, 0, 0, 0);
- CreateObject(1685, 1284.7239990234, -798.10766601563, 1083.7578125, 0, 0, 0);
- CreateObject(1685, 1283.6350097656, -792.51336669922, 1083.7578125, 0, 0, 0);
- CreateObject(1685, 1267.0187988281, -793.64581298828, 1083.7578125, 0, 0, 0);
- CreateObject(925, 1274.7543945313, -786.8017578125, 1084.0767822266, 0, 0, 0);
- CreateObject(944, 1270.1082763672, -789.45581054688, 1083.892578125, 0, 0, 90);
- CreateObject(935, 1275.0075683594, -790.5966796875, 1083.5710449219, 0, 0, 0);
- CreateObject(935, 1274.9952392578, -789.80413818359, 1083.5710449219, 0, 0, 0);
- CreateObject(935, 1253.4654541016, -791.03802490234, 1083.5710449219, 0, 0, 0);
- CreateObject(935, 1254.0161132813, -790.20257568359, 1083.5710449219, 0, 0, 0);
- CreateObject(1337, 1254.1267089844, -789.33032226563, 1083.6569824219, 0, 0, 0);
- CreateObject(1299, 1250.0831298828, -787.16754150391, 1083.4636230469, 0, 0, 0);
- CreateObject(1299, 1242.6888427734, -780.49841308594, 1083.470703125, 0, 0, 0);
- CreateObject(1299, 1240.1783447266, -763.10949707031, 1083.4650878906, 0, 0, 0);
- CreateObject(12957, 1235.8734130859, -763.90338134766, 1083.8853759766, 0, 0, 245);
- CreateObject(1227, 1250.9050292969, -772.07415771484, 1083.8594970703, 0, 0, 0);
- CreateObject(1224, 1248.5551757813, -767.53466796875, 1083.6291503906, 0, 0, 0);
- CreateObject(1224, 1261.8525390625, -779.00042724609, 1083.6226806641, 0, 0, 0);
- CreateObject(1224, 1266.3231201172, -778.13940429688, 1083.6226806641, 0, 0, 0);
- CreateObject(3594, 1289.2827148438, -773.94354248047, 1083.6390380859, 0, 0, 0);
- CreateObject(1440, 1283.6583251953, -783.63342285156, 1083.5269775391, 0, 0, 0);
- CreateObject(2744, 1284.6867675781, -782.10870361328, 1085.0920410156, 0, 0, 270);
- CreateObject(932, 1299.5815429688, -782.56298828125, 1083.0078125, 0, 0, 0);
- CreateObject(932, 1298.8043212891, -782.55981445313, 1083.0078125, 0, 0, 0);
- CreateObject(910, 1299.0833740234, -780.38854980469, 1084.2769775391, 0, 0, 90);
- return 1;
- }
- public OnGameModeExit()
- {
- //it is showen when you exit the Gamemode
- print("GTA-TDM By .:'{Soumi}':.");
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- //----------------------------------
- //a sound will be playing while the player is choosing a class
- PlayerPlaySound(playerid, 1062, 0.0, 0.0, 2.0);
- ApplyAnimation(playerid,"PED","WALK_gang1",4.1,1,1,1,1,1);
- SetPlayerTeamFromClass(playerid,classid); // This sets the palyer team from class
- //----------------------------------
- //This is what the player Position when he's selecting a class
- SetPlayerPos(playerid,1286.1554,-774.1998,1091.9063);
- SetPlayerFacingAngle(playerid,0.0);
- SetPlayerCameraPos(playerid,1282.0900,-772.8223,1091.9063);
- SetPlayerCameraLookAt(playerid,1286.1554,-774.1998,1091.9063);
- SetPlayerInterior(playerid,5);
- //-----------------------------------
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- //-----------------------------------------
- GameTextForPlayer(playerid,"~w~Modern Team Dm !",3000,4);
- SendClientMessage(playerid,0xA10000AA,"Welcome to {88AA88}Modern{FFFFFF}-TDM");
- //-----------------------------------------
- //This sends a message to all the palyers when someone join the server
- new str[128], pName[24];
- GetPlayerName(playerid, pName, 24);
- format(str, 128, "(Connecting) %s has Joined Modern TDM Server.", pName);
- SendClientMessageToAll(0xA10000AA,str);
- //----------------------------------------
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- //----------------------------------
- //also this sends a message to all the players when someone exit the server
- new str[128], pName[24];
- GetPlayerName(playerid, pName, 24);
- format(str, 128, "(Leaving) %s has left Modern TDM Server.", pName);
- SendClientMessageToAll(0xA10000AA,str);
- //-----------------------------------
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- //-----------------------------------
- //when the player spawn , he'll see this text at the bottom of the screen
- //near the mini-map
- txt1 = TextDrawCreate(10.0, 415.0,"~r~Modern Team Deathmatch");
- TextDrawBoxColor(txt1,0x222222BB);
- TextDrawLetterSize(txt1,0.3,1.0);
- TextDrawTextSize(txt1,400.0,40.0);
- TextDrawFont(txt1, 2);
- TextDrawShowForPlayer(playerid,txt1);
- //-----------------------------------
- //This stops the sound that was playing when player is selecting a class
- PlayerPlaySound(playerid,1063, 0.0, 0.0, 2.0);
- SetPlayerToTeamColour(playerid); //This sets the player color from his team
- SetPlayerInterior(playerid,5);
- SetPlayerHealth(playerid,100);
- SetPlayerArmour(playerid,100);
- //------------------------------------
- //Player will have the Maximum of all the weapons that are used in the gamemode
- SetPlayerSkillLevel(playerid,22,9999);
- SetPlayerSkillLevel(playerid,23,9999);
- SetPlayerSkillLevel(playerid,24,9999);
- SetPlayerSkillLevel(playerid,25,9999);
- SetPlayerSkillLevel(playerid,26,9999);
- SetPlayerSkillLevel(playerid,27,9999);
- SetPlayerSkillLevel(playerid,28,9999);
- SetPlayerSkillLevel(playerid,29,9999);
- SetPlayerSkillLevel(playerid,30,9999);
- SetPlayerSkillLevel(playerid,31,9999);
- SetPlayerSkillLevel(playerid,32,9999);
- SetPlayerSkillLevel(playerid,34,9999);
- //------------------------------------
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- //------------------------------------
- //When player dies , He'll loose $500 and he'll respawn of course
- //but the one who killed him will get $1000 and + wanted level
- //also he'll get +1 score and death message will be send to the otehr players
- wLevel = GetPlayerWantedLevel(playerid);
- pMoney = GetPlayerMoney(playerid),
- GivePlayerMoney(killerid, 1000);
- SetPlayerWantedLevel(killerid, wLevel + 1);
- ResetPlayerMoney(playerid);
- GivePlayerMoney(playerid, pMoney -500),
- //------------------------------------
- SendDeathMessage(killerid, playerid, reason);
- SendClientMessage(playerid, 0xFF6347AA ," You Died and Lost $500 !");
- //------------------------------------
- if(IsPlayerConnected(killerid))
- {
- SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
- }
- //------------------------------------
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- //I Only used text commands here
- if (strcmp("/help", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid,0xFFFF00AA, "***---Modern TDM Help :---***");
- SendClientMessage(playerid,0xFFFFFFFF, "Forums : http://www.m-tdm.com/ is our current forums");
- SendClientMessage(playerid,0xFFFFFFFF, "Commands : Type /cmds For a list of the Server Commands");
- SendClientMessage(playerid,0xFFFFFFFF, "Rules : Type /rules for a list of M-TDM server rules");
- SendClientMessage(playerid,0xFFFFFFFF, "Money : When you kill a player you will earn $1000 , but when you die you'll loose $500 ");
- SendClientMessage(playerid,0xFFFFFFFF, "Other : /weaponhelp *** /drughelp ");
- SendClientMessage(playerid,0xFFFFFFFF, "That's all , Have fun !!");
- return 1;
- }
- if (strcmp("/rules", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid,0xFFFF00AA, "***---Modern TDM Rules---***");
- SendClientMessage(playerid,0xFFFFFFFF, "Hacks : Cheating is not allowed in this server , if you use any kind of hacks (Weapons, Health...) You'll be banned");
- SendClientMessage(playerid,0xFFFFFFFF, "Flaming : Flaming is not allowed here , You'll be punished if you start insulting someone because he just killed you in game");
- SendClientMessage(playerid,0xFFFFFFFF, "Spawn Killing : You are not allowed to kill other players when they spawn");
- SendClientMessage(playerid,0xFFFFFFFF, "Bug Abuse : You Don't have the right abuse any bug ");
- SendClientMessage(playerid,0xFFFFFFFF, "Adversing : You can not advertise other servers , sending any IP will get you banned");
- SendClientMessage(playerid,0xFFFFFFFF, "Team Work : Work as a Team and Never fight with Players that are in your Team." );
- SendClientMessage(playerid,0xFFFFFFFF, "Other : /weaponhelp *** /drughelp ");
- SendClientMessage(playerid,0xFFFFFFFF, "That's all , Have fun !!");
- return 1;
- }
- if (strcmp("/cmds", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid,0xFFFF00AA, "***---Modern TDM Commands---***");
- SendClientMessage(playerid,0xFFFFFFFF, "/stats --- /report [Reason] --- /kill --- /enter --- /exit --- @Text (Team Chat)");
- SendClientMessage(playerid,0xFFFFFFFF, "Other : /weaponhelp *** /drughelp *** /help *** /rules ");
- SendClientMessage(playerid,0xFFFFFFFF, "That's all , Have fun !!");
- return 1;
- }
- ///enter and /exit allows you to TP from a place to another (from DM area to ammunation)
- if (strcmp("/enter", cmdtext, true, 10) == 0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 3, 1271.4468,-822.4473,1089.9375) )
- {
- SetPlayerInterior(playerid, 1);
- SetPlayerPos(playerid, 286.0595,-32.6137,1001.5156);
- GameTextForPlayer(playerid, "~w~The Ammu-Nation", 5000, 1);
- }
- else
- {
- }
- return 1;
- }
- if (strcmp("/exit", cmdtext, true, 10) == 0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 3, 286.0389,-29.8492,1001.5156) )
- {
- SetPlayerInterior(playerid, 5);
- SetPlayerPos(playerid, 1273.1444,-822.4879,1089.9375);
- }
- else
- {
- }
- return 1;
- }
- //This cmd will kill the player by setting his health to 0 and he'll be fined +$500
- if (strcmp("/kill", cmdtext, true, 10) == 0)
- {
- SetPlayerHealth(playerid, 0);
- SendClientMessage(playerid, 0xA10000AA, "You have been fined +$500 because You committed a suicide!");
- GivePlayerMoney(playerid, -500);
- return 1;
- }
- //the stats command only shows some information about the player
- if (strcmp("/stats", cmdtext, true, 10) == 0)
- {
- new str[128], pName[24];
- GetPlayerName(playerid, pName, 24);
- pMoney = GetPlayerMoney(playerid),
- GetPlayerHealth(playerid,pHealth);
- GetPlayerArmour(playerid,pArmour);
- pScore =GetPlayerScore(playerid),
- format(str, 128, "%s Stats :", pName);
- SendClientMessage(playerid,0xFFFFFFFF,str);
- format(str,128, "Money : $%i --- Health : %0.f ",pMoney,pHealth);
- SendClientMessage(playerid,0xFFFFFFFF,str);
- format(str,128, "Armour : %0.f --- Score : %i",pArmour,pScore);
- SendClientMessage(playerid,0xFFFFFFFF,str);
- return 1;
- }
- if (strcmp("/weaponhelp", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid,0xFFFF00AA, "***---Modern TDM Weapon Help---***");
- SendClientMessage(playerid,0xFFFFFFFF, "You always get weapons when you spawn. But you can buy more weapons with more bullets");
- SendClientMessage(playerid,0xFFFFFFFF, "You can buy weapons from AmmuNations :");
- SendClientMessage(playerid,0xFFFFFFFF, "Type /buygun to purchase a weapon");
- SendClientMessage(playerid,0xFFFFFFFF, "Other : /cmds *** /racehelp *** /drughelp *** /rules *** /help ");
- SendClientMessage(playerid,0xFFFFFFFF, "That's all , Have fun !!");
- return 1;
- }
- //This command can be used in ammunation only , it shows the ammunation menu that allows
- //the player to select a weapon and buy it
- if (strcmp("/buygun", cmdtext, true, 10) == 0)
- {
- if(GetPlayerInterior(playerid) == 1)
- {
- TogglePlayerControllable(playerid, 0);
- ShowMenuForPlayer(ammunationmenu,playerid);
- }
- else
- {
- SendClientMessage(playerid, 0xFFFF00AA,"You are not at the Ammu Nation ! ");
- }
- return 1;
- }
- if (strcmp("/drughelp", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid,0xFFFF00AA, "***---Modern TDM Drug Help---***");
- SendClientMessage(playerid,0xFFFFFFFF, "You can buy drugs to get more armor ");
- SendClientMessage(playerid,0xFFFFFFFF, "Type /buydrug to get 2g of drugs that will give you +20 Armour/Health ");
- SendClientMessage(playerid,0xFFFFFFFF, "Meth will give you +20 Health and Armour and it costs $500 ");
- SendClientMessage(playerid,0xFFFFFFFF, "Crack will give you +20 Armour and it costs $350 ");
- SendClientMessage(playerid,0xFFFFFFFF, "Pot will give you +20 Health and it costs $200 ");
- SendClientMessage(playerid,0xFFFFFFFF, "Other : /weaponhelp *** /cmds *** /rules *** /help ");
- SendClientMessage(playerid,0xFFFFFFFF, "That's all , Have fun !!");
- return 1;
- }
- //also this command can be used only near the drug point , it shows the
- //dialog where can the player select a tye of drugs and buy it
- if (strcmp("/buydrug", cmdtext, true, 10) == 0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 3, 1248.7208,-806.1448,1084.0078) )
- {
- TogglePlayerControllable(playerid, 0);
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Choose a Drug type :", "Pot\nCrack\nMeth", "Buy", "Cancel");
- }
- else
- {
- SendClientMessage(playerid,0x33AA33AA,"You are not at the Drug point right now !");
- }
- return 1;
- }
- //only RCON admins can use these cmds
- if (strcmp("/ah", cmdtext, true, 10) == 0)
- {
- if(IsPlayerAdmin(playerid))
- {
- SendClientMessage(playerid,0xFFFF00AA, "***---Modern TDM Admin Help---***");
- SendClientMessage(playerid,0xFFFFFFFF, "/adminduty --- /kick --- /ban --- /jail --- /spec --- /goto");
- SendClientMessage(playerid,0xFFFFFFFF, "Do not abuse these Commands !");
- }
- else
- {
- SendClientMessage(playerid,0xFFFFFFFF,"You are not an admin !");
- }
- return 1;
- //admins commands aren't set yet !
- }
- return 0;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- if(GetPlayerMenu(playerid) == ammunationmenu)
- {
- switch(row)
- {
- //this menu will be showing only if player type /buygun inside the ammunation
- //when player select a weapon , first it checks his money (< or > of the gun price)
- //if it is < player money , player won't get the weapon and if it is > player money
- //He'll get the weapon
- case 0: //AK47
- {
- TogglePlayerControllable(playerid, 1);
- if(GetPlayerMoney(playerid) < 8000)
- {
- SendClientMessage(playerid,0xFFFF00AA,"You Can not afford this");
- }
- else
- {
- GivePlayerWeapon(playerid,30,750);
- SendClientMessage(playerid, 0xFFFF00AA, "You Bought an AK47 from the Ammu Nation!");
- GivePlayerMoney(playerid, -8000);
- }
- }
- case 1: //M4
- {
- TogglePlayerControllable(playerid, 1);
- if(GetPlayerMoney(playerid) < 9000)
- {
- SendClientMessage(playerid,0xFFFF00AA,"You Can not afford this");
- }
- else
- {
- GivePlayerWeapon(playerid,31,750);
- SendClientMessage(playerid, 0xFFFF00AA, "You Bought an M4 from the Ammu Nation!");
- GivePlayerMoney(playerid, -9000);
- }
- }
- case 2: //MP5
- {
- TogglePlayerControllable(playerid, 1);
- if(GetPlayerMoney(playerid) < 4000)
- {
- SendClientMessage(playerid,0xFFFF00AA,"You Can not afford this");
- }
- else
- {
- GivePlayerWeapon(playerid,29,2400);
- SendClientMessage(playerid, 0xFFFF00AA, "You Bought an MP5 from the Ammu Nation!");
- GivePlayerMoney(playerid, -4000);
- }
- }
- case 3: //UZI
- {
- TogglePlayerControllable(playerid, 1);
- if(GetPlayerMoney(playerid) < 4000)
- {
- SendClientMessage(playerid,0xFFFF00AA,"You Can not afford this");
- }
- else
- {
- GivePlayerWeapon(playerid,28,2400);
- SendClientMessage(playerid, 0xFFFF00AA, "You Bought a UZI from the Ammu Nation!");
- GivePlayerMoney(playerid, -4000);
- }
- }
- case 4: //SPAS12
- {
- TogglePlayerControllable(playerid, 1);
- if(GetPlayerMoney(playerid) < 7500)
- {
- SendClientMessage(playerid,0xFFFF00AA,"You Can not afford this");
- }
- else
- {
- GivePlayerWeapon(playerid,27,500);
- SendClientMessage(playerid, 0xFFFF00AA, "You Bought a SPAS12 from the Ammu Nation!");
- GivePlayerMoney(playerid, -7500);
- }
- }
- case 5: //Deagle
- {
- TogglePlayerControllable(playerid, 1);
- if(GetPlayerMoney(playerid) < 5000)
- {
- SendClientMessage(playerid,0xFFFF00AA,"You Can not afford this");
- }
- else
- {
- GivePlayerWeapon(playerid,24,450);
- SendClientMessage(playerid, 0xFFFF00AA, "You Bought a Deagle from the Ammu Nation!");
- GivePlayerMoney(playerid, -5000);
- }
- }
- case 6: //Sniper
- {
- TogglePlayerControllable(playerid, 1);
- if(GetPlayerMoney(playerid) < 10000)
- {
- SendClientMessage(playerid,0xFFFF00AA,"You Can not afford this");
- }
- else
- {
- GivePlayerWeapon(playerid,34,25);
- SendClientMessage(playerid, 0xFFFF00AA, "You Bought a Sniper Rifle from the Ammu Nation!");
- GivePlayerMoney(playerid, -10000);
- }
- }
- case 7: //Rocket launcher
- {
- TogglePlayerControllable(playerid, 1);
- if(GetPlayerMoney(playerid) < 50000)
- {
- SendClientMessage(playerid,0xFFFF00AA,"You Can not afford this");
- }
- else
- {
- GivePlayerWeapon(playerid,35,5);
- SendClientMessage(playerid, 0xFFFF00AA, "You Bought a Rocket Launcher from the Ammu Nation!");
- GivePlayerMoney(playerid, -50000);
- }
- //Ammunation only sells the best weapons and with a lot of ammo !
- }
- }
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- //This sends a message when player is in a pickup (to inform him about the cmd to use)
- if(pickupid == ammunationenter)
- {
- GameTextForPlayer(playerid,"~w~Type ~r~ /ENTER ~w~ to enter the Ammunation",3000,4);
- }
- if(pickupid == ammunationexit)
- {
- GameTextForPlayer(playerid,"~w~Type ~r~ /EXIT ~w~ to exit the Ammunation",3000,4);
- }else if(pickupid == drugpickup)
- {
- GameTextForPlayer(playerid,"~w~Type ~r~ /BUYDRUG ~w~ to buy Drugs",3000,4);
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- //This is the dialog when player types /buydrug to purchase drugs
- if (dialogid == 1)
- {
- if (response == 1)
- {
- TogglePlayerControllable(playerid, 1);
- switch (listitem)
- {
- case 0://Pot : + 20 health
- {
- if(GetPlayerMoney(playerid) < 200)
- {
- SendClientMessage(playerid,0x33AA33AA,"You Can not afford this");
- }
- else
- {
- GetPlayerHealth(playerid,pHealth);
- GivePlayerMoney(playerid,-200);
- SetPlayerHealth(playerid,pHealth + 20);
- }
- }
- case 1://Crack : + 20 armour
- {
- if(GetPlayerMoney(playerid) < 350)
- {
- SendClientMessage(playerid,0x33AA33AA,"You Can not afford this");
- }
- else
- {
- GetPlayerArmour(playerid,pArmour);
- GivePlayerMoney(playerid,-350);
- SetPlayerArmour(playerid,pArmour + 20);
- }
- }
- case 2://Meth : + 20 health and armour
- {
- if(GetPlayerMoney(playerid) < 500)
- {
- SendClientMessage(playerid,0x33AA33AA,"You Can not afford this");
- }
- else
- {
- GetPlayerHealth(playerid,pHealth);
- GetPlayerArmour(playerid,pArmour);
- GivePlayerMoney(playerid,-500);
- SetPlayerHealth(playerid,pHealth + 20);
- SetPlayerArmour(playerid,pArmour + 20);
- }
- }
- }
- }
- else
- {
- TogglePlayerControllable(playerid, 1);
- }
- return 1;
- }
- return 0;
- }
- public HourTimer(playerid)
- {
- //The Player will get money , score and rocket for playing 1Hour..
- GivePlayerMoney(playerid,20000);
- SetPlayerScore(playerid,GetPlayerScore(playerid)+20);
- GivePlayerWeapon(playerid,35,5);
- GameTextForPlayer(playerid,"~g~You Have Passed 1Hour playing in the Server",3000,4);
- SendClientMessage(playerid,0x33AA33AA,"You won $20.000 , + 20 Score and a Rocket Launcher !! Enjoy !!");
- SetTimer("HourTimer",3600000,true); //This will set the timer again and he'll
- return 1;
- }
- //We use @Text as team chat , it is a Channel where the team members can chat
- //Privatly to plan for attacking other teams etc..
- public OnPlayerText(playerid, text[])
- {
- if( (text[0] == '@') && strlen(text) > 1)
- {
- new str[128];
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
- format(str, 128, "*Team Chat* %s Says : %s", pName, text[1]);
- for(new iPlayerID; iPlayerID < MAX_PLAYERS; iPlayerID++){
- if(!IsPlayerConnected(iPlayerID)) continue;
- if(GetPlayerTeam(playerid) == GetPlayerTeam(iPlayerID)) SendClientMessage(iPlayerID, 0xA10000AA, str);
- }
- return 0;
- }
- return 1;
- }
- //This is the callback that sets player team from class
- SetPlayerTeamFromClass(playerid, classid)
- {
- if(classid == 0 || classid == 1 || classid == 2 || classid == 3 || classid == 4 || classid == 5 || classid == 6 || classid == 7 )
- {
- gTeam[playerid] = TEAM_POLICE;
- GameTextForPlayer(playerid,"~b~Police",3000,4);
- }
- if(classid == 8 || classid == 9 || classid == 10 || classid == 11 || classid == 12 || classid == 13 || classid == 14)
- {
- gTeam[playerid] = TEAM_HOBOS;
- GameTextForPlayer(playerid,"~W~Hobos",3000,4);
- }
- if(classid == 15 || classid == 16 || classid == 17 || classid == 18 || classid == 19 || classid == 20 || classid == 21)
- {
- gTeam[playerid] = TEAM_GROVE;
- GameTextForPlayer(playerid,"~g~Grove Street",3000,4);
- }
- else if(classid == 22 || classid == 23 || classid == 24 || classid == 25 || classid == 26 || classid == 27 || classid == 28)
- {
- gTeam[playerid] = TEAM_MAFIA;
- GameTextForPlayer(playerid,"~y~The Mafia",3000,4);
- }
- }
- //This is the callback that sets player colour according to team when he spawns
- SetPlayerToTeamColour(playerid)
- {
- if(gTeam[playerid] == TEAM_POLICE)
- {
- SetPlayerColor(playerid,TEAM_POLICE_COLOUR);
- }
- if(gTeam[playerid] == TEAM_HOBOS)
- {
- SetPlayerColor(playerid,TEAM_HOBOS_COLOUR);
- }
- if(gTeam[playerid] == TEAM_GROVE)
- {
- SetPlayerColor(playerid,TEAM_GROVE_COLOUR);
- }
- else if(gTeam[playerid] == TEAM_MAFIA)
- {
- SetPlayerColor(playerid,TEAM_MAFIA_COLOUR);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement