//------------------------------------------------------------------------------ // // Los Santos TDM. A Team Deathmtach script for SA-MP 0.1b // //------------------------------------------------------------------------------ #include #include #include #include //Global stuff and defines static gTeam[MAX_PLAYERS]; new gPlayerClass[MAX_PLAYERS]; new gPlayerName[MAX_PLAYERS]; //how many random respawns? new numcars=40; //number of cars new numpickups=15; //number of pickups //Color Defines #define COLOR_RED 0xAA3333AA #define COLOR_GREY 0xAFAFAFAA #define COLOR_GREEN 0x33AA33AA #define COLOR_YELLOW 0xFFFF00AA #define COLOR_PINK 0xFF66FFAA #define COLOR_BLUE 0x0000BBAA #define COLOR_LIGHTBLUE 0x33CCFFAA #define COLOR_CYAN 0x00BFF3AA #define COLOR_BLACK 0x000000AA #define COLOR_WHITE 0xFFFFFFAA //team colors #define COLOR_TEAM_0 0x008000AA #define COLOR_TEAM_1 0x8B008BAA #define COLOR_TEAM_2 0xFFD700AA #define COLOR_TEAM_3 0x00CED3AA #define COLOR_TEAM_4 0x6A5ACDAA //other colors #define COLOR_ERROR 0xed1c24AA #define COLOR_COMMAND 0x8c6239AA //Team Defines #define TEAM_GROVE 0 #define TEAM_BALLAS 1 #define TEAM_VAGOS 2 #define TEAM_AZTECAS 3 #define TEAM_COPS 4 // Round duration new gRoundTime = 3600000; // 60 mins //new gRoundTime = 1800000; // 30 mins //new gRoundTime = 600000; //10 mins //new gRoundTime = 300000; // 5 mins //new gRoundTime = 120000; // 2 mins //new gRoundTime = 60000; // 1 min new startgame = 0; //for stat static points[MAX_PLAYERS]; static frags[MAX_PLAYERS]; static frags2[MAX_PLAYERS]; static frags3[MAX_PLAYERS]; static deaths[MAX_PLAYERS]; static suicides[MAX_PLAYERS]; static teamkills[MAX_PLAYERS]; static lastkill[MAX_PLAYERS]; static tknow[MAX_PLAYERS]; // others variables new firstblood = 0; //------------------------------------------------------------------------------ main() { // new i; print("\n"); printf("\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432"); print("\432 LSDM by #gta@RusNet team loaded. Enjoy the game! \1 \432"); printf("\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432\432"); print("\n"); // new rand; //// for (new i=0;i<100;i++) { // rand=random(10); // if (rand == 10 || rand == 0) print("asdasdasdasdasdasdasdasdasdasdasd"); /// // printf("random=%d",rand); // } // for (i=0;i<100;i++) { // printf("%d = %c | %d = %c | %d = %c | %d = %c | %d = %c",i,i,i+100,i+100,i+200,i+200,i+300,i+300,i+400,i+400); // } } //------------------------------------------------------------------------------ public OnGameModeInit() { SetGameModeText("LS Team DeathMatch"); SetTeamCount(5); ShowNameTags(1); ShowPlayerMarkers(1); SetWorldTime(0); //plaerys AddPlayerClass(107,2512.6606,-1689.3367,13.5515,48.7638,22,68,29,60,27,28); // Grove AddPlayerClass(106,2523.2505,-1659.1217,15.4935,106.4177,22,68,29,60,27,28); // Grove AddPlayerClass(105,2497.8171,-1646.1243,13.5398,180.6784,22,68,29,60,27,28); // Grove AddPlayerClass(102,1872.6663,-1269.6407,13.5506,16.5641,23,58,30,90,26,8); // Ballas 1 AddPlayerClass(103,1899.6895,-1202.5249,19.9033,169.1588,23,58,30,90,26,8); // Ballas 2 AddPlayerClass(104,1836.6270,-1241.1743,15.0258,249.0596,23,58,30,90,26,8); // Ballas 3 AddPlayerClass(110,2682.4373,-1408.3500,30.4882,134.1774,28,90,31,100,4,0); // Vagos AddPlayerClass(109,2662.4937,-1439.7015,30.5021,332.8092,28,90,31,100,4,0); // Vagos AddPlayerClass(108,2686.6614,-1445.6199,30.5312,33.2831,28,90,31,100,4,0); // Vagos AddPlayerClass(114,1798.4735,-1935.1747,13.4589,356.6592,32,60,25,45,9,0); // Aztecas AddPlayerClass(115,1767.8877,-1888.0836,13.5536,187.5536,32,60,25,45,9,0); // Aztecas AddPlayerClass(116,1802.1482,-1883.7207,13.5775,167.5000,32,60,25,45,9,0); // Aztecas AddPlayerClass(280,1551.1449,-1676.3922,15.7248,75.5556,24,21,31,100,25,45); // cops AddPlayerClass(284,1600.1106,-1675.2036,5.8906,105.9259,24,21,31,100,25,45); // cops AddPlayerClass(285,1579.8029,-1634.5599,13.5623,44.2219,24,21,31,100,25,45); // cops //############################ cars ############################ new rand, randid, randpos, randcol1, randcol2; new usedposI=0,fl,i,j; new Float:VehiclePos[116][4] = { {2403.6218,-1647.4016,13.5468,184.2198}, {2235.5219,-1639.1542,15.5608,163.1983}, {2124.5163,-1637.1197,13.4568,348.2605}, {1989.9266,-1610.3903,13.5204,320.9385}, {2019.5689,-1649.3551,13.5546,83.8590}, {1937.7445,-1772.5880,13.3828,3.8780}, {1948.1787,-1882.8950,13.5467,92.3034}, {2065.3571,-1903.1011,13.5468,177.7543}, {1719.2401,-1704.1693,13.5000,355.5477}, {1711.3402,-1615.9056,13.5546,346.9055}, {1695.5527,-1360.9783,17.4435,356.3208}, {1730.5225,-1274.1777,13.5476,126.6447}, {1955.5150,-1165.3322,20.6422,55.9877}, {2409.7265,-1389.3155,24.3022,84.6583}, {2138.2385,-1286.7852,24.4422,175.1966}, {2095.6799,-1315.3432,24.5170,181.4013}, {2329.5063,-1409.7474,23.9925,179.3094}, {2416.7709,-1539.6947,24.0000,3.8815}, {2409.3581,-1539.6464,24.0000,1.7445}, {2398.5324,-1539.5236,24.0000,1.7445}, {2414.3596,-1486.2451,23.8281,88.6709}, {2660.0292,-1634.6035,10.8428,101.3106}, {2658.2836,-1640.8853,10.8550,85.5661}, {2059.6833,-1902.9057,13.5468,180.671768}, {1863.8914,-1602.2917,13.5416,357.791046}, {1925.3468,-1698.3691,13.5468,177.069442}, {2119.3735,-1784.4771,13.3872,3.1367}, {2106.2858,-1784.3941,13.3873,354.6037}, {2121.3293,-1775.3820,13.3917,4.3131}, {2163.9531,-1694.3243,15.0859,351.1560}, {2111.2246,-1558.1876,13.3577,246.9459}, {1865.2639,-1364.5895,13.4991,1.3056}, {1813.4522,-1378.9407,14.4218,92.9392}, {1587.0170,-1647.7772,19.8791,1.5224}, {1588.6503,-1655.5338,19.8791,270.6549}, {1589.5090,-1679.1193,19.8791,270.9682}, {1590.3823,-1699.9207,19.8791,268.4615}, {1813.8669,-1703.1979,13.5468,178.5432}, {1813.8220,-1789.5566,13.5468,184.5082}, {1920.3693,-1925.1796,13.5468,267.7719}, {2511.1865,-1776.3419,13.5468,273.0138}, {2083.7233,-1587.7169,13.4665,267.3307}, {2054.6149,-1694.7956,13.5546,265.7559}, {2066.1772,-1694.8430,13.5468,266.6959}, {2106.5898,-1774.6695,13.3920,355.6584}, {2167.3889,-1921.5549,13.5216,265.8391}, {2230.9101,-1786.0122,13.5613,87.1065}, {2306.6879,-1672.4636,14.2006,354.3420}, {2390.6262,-1503.9531,23.8348,274.6387}, {2397.6350,-1917.8693,13.3828,268.9465}, {2396.9152,-1891.8035,13.3828,261.3193}, {2380.1230,-1891.6842,13.3891,262.2594}, {2304.2685,-1785.5694,13.5591,93.2203}, {2253.0661,-1796.1761,13.5468,267.9696}, {1865.0435,-1858.4916,13.5807,346.8889}, {2286.4494,-1854.7136,-0.1344,267.6148}, {2253.0661,-1796.1761,13.5468,267.9696}, {1900.8970,-1482.5451,10.8207,88.4129}, {2004.3499,-1443.8055,13.5623,137.6643}, {2031.7061,-1418.3122,16.9921,124.5041}, {2167.8776,-1507.9443,23.9210,354.6188}, {2069.5539,-1655.1284,13.5468,275.8742}, {2059.5888,-1553.8944,13.4598,73.9251}, {2290.7553,-1528.4270,26.8750,178.6236}, {2443.6306,-1376.2871,24.0000,179.0048}, {2474.5751,-1279.9097,34.8470,1.3899}, {2408.2458,-1238.9432,23.8125,180.2815}, {2436.4738,-1238.8551,24.6582,90.6674}, {2436.8901,-1303.4694,24.6001,264.8590}, {1484.2366,-1246.0893,14.5625,95.1819}, {1462.2597,-1277.2749,13.5519,177.5893}, {1476.2437,-1419.8007,11.8828,174.7693}, {1525.2764,-1461.8355,9.5000,176.6259}, {1512.7551,-1462.1845,9.5000,181.9526}, {1639.4781,-1459.6680,13.5468,354.8909}, {1672.5500,-1493.9165,18.5468,81.9750}, {1669.6322,-1530.9979,18.5468,179.1092}, {2481.7348,-1748.4934,13.5468,345.2579}, {2496.1210,-1751.8996,13.4668,357.4153}, {2628.7309,-1755.6080,11.1288,265.4027}, {2629.3361,-1644.2540,11.6322,265.6391}, {2768.1511,-1605.1949,10.9218,265.1781}, {2768.8022,-1615.4958,10.9218,279.9049}, {2262.8371,-1249.7912,23.9765,175.1634}, {2208.7321,-1284.5915,24.5304,184.2858}, {2214.8239,-1368.5058,23.9901,181.8923}, {2230.6933,-1358.9364,23.9878,182.2057}, {2186.1079,-1465.7233,25.5390,276.5018}, {2194.1870,-1453.4197,25.5390,178.1142}, {2526.7644,-1357.6702,29.1423,93.1154}, {2578.5327,-1404.3482,26.1704,359.7457}, {1355.0338,-630.4597,108.8411,15.8993}, {2052.7651,-1904.0513,13.2740,180.6526}, {599.0422,-1873.4364,4.6746,168.4479}, {555.8792,-1911.7756,0.3477,183.1009}, {567.0980,-1911.4384,0.2580,173.4404}, {371.4564,-2044.3452,7.6398,88.7252}, {319.4981,-1809.9900,4.1701,358.5054}, {328.1766,-1809.1205,4.1120,0.0799}, {344.2243,-1810.1364,4.2700,0.9710}, {156.3121,-1977.0475,1.6561,177.1444}, {185.8977,-1873.2195,3.0445,354.2627}, {213.2383,-1422.8496,13.0227,225.9205}, {716.8338,-1245.0641,13.9230,274.8734}, {708.4464,-1424.0962,13.2147,0.1223}, {477.4511,-1526.2524,19.7820,352.8512}, {1218.3623,-877.8999,42.8045,94.7515}, {2029.6174,-960.8205,40.5820,206.9758}, {2271.8445,-1041.2769,50.2807,141.7058}, {2761.5588,-1177.2522,69.1200,84.1676}, {2794.1851,-1428.2480,19.9236,188.6449}, {2796.9985,-1434.4459,23.8490,183.6681}, {2908.0706,-1629.3085,10.5677,150.7781}, {2311.5298,-1996.6154,14.1978,0.9217}, {2117.6843,-1919.5791,12.7307,143.8210}, {2117.7429,-1826.3710,13.1545,5.2556} }; new VehicleIDs[41] = { //2 doors (19) 602, 496, 401, 518, 527, 589, 419, 533, 526, 474, 545, 517, 410, 600, 436, 580, 439, 549, 491, //bikes (12) 581, 509, 481, 462, 521, 463, 510, 522, 461, 448, 468, 586, //Light Trucks & Vans (10) 459, 422, 482, 605, 530, 418, 572, 582, 413, 440 }; new UsedPos[200] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; if (numcars > sizeof(VehiclePos)) numcars=sizeof(VehiclePos)-1; for (i=0;i sizeof(PickUPPos)) numpickups=sizeof(PickUPPos); for (i=0;i 0) { format(string, sizeof(string), "*** %s died. (%s)", name, deathreason); } else { format(string, sizeof(string), "*** %s died.", name); } } } */ suicides[playerid]++; frags2[playerid]=0; frags3[playerid]=0; } else { if (GetPlayerState(killerid) == 2 && reason != '1') { SetPlayerHealth(killerid,0); SendClientMessage(killerid,0xAA3333AA, "THAT IS NOT ALLOWED!!!"); // SendDeathMessage(killerid,playerid,reason); return 1; } GetPlayerName(killerid, killer, sizeof(killer)); if (gTeam[playerid] == gTeam[killerid]) { /* if (strlen(deathreason) > 0) { format(string, sizeof(string), "*** %s killed team-mate %s. (%s)", killer, name, deathreason); } else { format(string, sizeof(string), "*** %s killed team-mate %s.", killer, name); } SetPlayerScore(killerid, GetPlayerScore(killerid) - 1); */ GivePlayerMoney(killerid, -1000); if (teamkills[killerid] == 0) { format(warning, sizeof(warning), "Be careful! You have been punished for teamkilling %s.", name); SendClientMessage(killerid, 0xFFFF00AA, warning); } else if (teamkills[killerid] == 1) { SetPlayerInterior(killerid,6); SetPlayerPos(killerid,264.6296,77.1372,1001.0390); ResetPlayerWeapons(killerid); SendClientMessage(killerid, 0xFFFF00AA, "You will be rescued after 2 minutes."); SendClientMessage(killerid, 0xFFFF00AA, "You can type /rescue to rescue at this moment (price: $5.000) or type /kill to die."); SetTimer("RescueTK", 120000, 1); //SetTimer("RescueTK", 15000, 1); tknow[killerid]=1; } else { SendClientMessage(killerid, 0xFFFF00AA, "Kick for you. Teamkill - bad."); Kick(killerid); } teamkills[killerid]++; points[killerid]--; frags2[playerid]=0; frags3[playerid]=0; } else { killyes=1; /* if (strlen(deathreason) > 0) { format(string, sizeof(string), "*** %s killed %s. (%s)", killer, name, deathreason); } else { format(string, sizeof(string), "*** %s killed %s.", killer, name); } SetPlayerScore(killerid, GetPlayerScore(killerid) + 1); */GivePlayerMoney(killerid, 2000); frags[killerid]++; frags2[killerid]++; frags3[killerid]++; points[killerid]++; frags2[playerid]=0; frags3[playerid]=0; if (GetTickCount() - lastkill[killerid] < 15000) { bon1yes=1; } else { frags3[killerid]=1; } } } points[playerid]--; deaths[playerid]++; // SendClientMessageToAll(COLOR_RED, string); //format(string, sizeof(string), "(debug)LAST kill %d, raznica=%d, bonus-%d",lastkill[killerid],(tickcount()-lastkill[killerid])/1000,bon1yes); // SendClientMessageToAll(COLOR_GREY, string); SetPlayerColor(playerid,COLOR_GREY); if (killyes) { if (!firstblood) { firstblood++; format(string, sizeof(string), "First Blood! (+5000) (%s)",killer); SendClientMessageToAll(COLOR_LIGHTBLUE, string); GivePlayerMoney(killerid, 5000); } if (bon1yes==1) { switch (frags3[killerid]) { case 2: { format(string, sizeof(string), "DOUBLE KILL! (+2000) (%s)",killer); SendClientMessageToAll(COLOR_PINK, string); GivePlayerMoney(killerid, 2000); } case 3: { format(string, sizeof(string), "TRIPLE KILL! (+3000) (%s)",killer); SendClientMessageToAll(COLOR_PINK, string); GivePlayerMoney(killerid, 3000); } case 4: { format(string, sizeof(string), "Tquadruple KILL! (+4000) (%s)",killer); SendClientMessageToAll(COLOR_PINK, string); GivePlayerMoney(killerid, 4000); } case 5: { format(string, sizeof(string), "Quintuple KILL! (+5000) (%s)",killer); SendClientMessageToAll(COLOR_PINK, string); GivePlayerMoney(killerid, 5000); } case 6..100: { format(string, sizeof(string), "Inconceivable KILL! (+10000) (%s)",killer); SendClientMessageToAll(COLOR_PINK, string); GivePlayerMoney(killerid, 10000); } } } GetPlayerHealth(killerid, phealth); format(tempstring, sizeof(tempstring), "*** %s have %2.f hp.", killer, phealth); SendClientMessage(playerid,COLOR_GREY, tempstring); switch (frags2[killerid]) { case 3: { format(string, sizeof(string), "KILLING SPREE! (+1000) (%s)",killer); SendClientMessageToAll(COLOR_LIGHTBLUE, string); GivePlayerMoney(killerid, 1000); } case 4: { format(string, sizeof(string), "DOMINATING! (+2000) (%s)",killer); SendClientMessageToAll(COLOR_LIGHTBLUE, string); GivePlayerMoney(killerid, 2000); } case 5: { format(string, sizeof(string), "MEGA KILL! (+3000) (%s)",killer); SendClientMessageToAll(COLOR_LIGHTBLUE, string); GivePlayerMoney(killerid, 2000); } case 6: { format(string, sizeof(string), "UNSTOPPABLE! (+4000) (%s)",killer); SendClientMessageToAll(COLOR_LIGHTBLUE, string); GivePlayerMoney(killerid, 2000); } case 7: { format(string, sizeof(string), "WICKED SICK! (+5000) (%s)",killer); SendClientMessageToAll(COLOR_LIGHTBLUE, string); GivePlayerMoney(killerid, 2000); } case 8: { format(string, sizeof(string), "MOSNTER KILL! (+6000) (%s)",killer); SendClientMessageToAll(COLOR_LIGHTBLUE, string); GivePlayerMoney(killerid, 2000); } case 9..100: { format(string, sizeof(string), "GODLIKE! (+10000) (%s)",killer); SendClientMessageToAll(COLOR_LIGHTBLUE, string); GivePlayerMoney(killerid, 10000); } } lastkill[killerid]=GetTickCount(); } SetPlayerScore(playerid,points[playerid]); // points[playerid]=100; SetPlayerScore(killerid,points[killerid]); return 1; } //------------------------------------------------------------------------------ public SetupPlayerForClassSelection(playerid) { // SetPlayerInterior(playerid,10); SetPlayerPos(playerid,2489.2221,-1656.2525,13.3606); SetPlayerFacingAngle(playerid, 180.0); SetPlayerCameraPos(playerid,2489.3806,-1661.4866,13.3359); SetPlayerCameraLookAt(playerid,2489.2221,-1656.2525,13.3606); } //------------------------------------------------------------------------------ public OnPlayerRequestClass(playerid, classid) { SetPlayerClass(playerid, classid); SetupPlayerForClassSelection(playerid); gPlayerClass[playerid] = classid; switch (classid) { case 0..2: { SetPlayerFacingAngle(playerid, 180.0); SetPlayerPos(playerid,2489.2221,-1656.2525,13.3606); SetPlayerCameraPos(playerid,2489.3806,-1661.4866,13.3359); SetPlayerCameraLookAt(playerid,2489.2221,-1656.2525,13.3606); GameTextForPlayer(playerid, "~g~Grove", 1000, 3); } case 3..5: { SetPlayerFacingAngle(playerid, 180.0); SetPlayerPos(playerid,1881.9139,-1255.8211,13.5468); SetPlayerCameraPos(playerid,1879.5007,-1260.9143,13.3906); SetPlayerCameraLookAt(playerid,1881.9139,-1255.8211,13.5468); GameTextForPlayer(playerid, "~p~Ballas", 1000, 4); } case 6..8: { SetPlayerFacingAngle(playerid, 180.0); SetPlayerPos(playerid,2638.7700,-1414.4694,30.2867); SetPlayerCameraPos(playerid,2638.6892,-1419.2049,30.2878); SetPlayerCameraLookAt(playerid,2638.7700,-1414.4694,30.2867); GameTextForPlayer(playerid, "~y~Vagos", 1000, 5); } case 9..11: { SetPlayerFacingAngle(playerid, 180.0); SetPlayerPos(playerid,1775.1835,-1901.3182,13.3857); SetPlayerCameraPos(playerid,1775.6403,-1907.9654,13.3861); SetPlayerCameraLookAt(playerid,1775.1835,-1901.3182,13.3857); GameTextForPlayer(playerid, "~ñ~Aztecas", 1000, 3); } case 12..14: { SetPlayerFacingAngle(playerid, 90.0); SetPlayerPos(playerid,1523.9155,-1668.9237,13.5468); SetPlayerCameraPos(playerid,1518.6901,-1669.5471,13.5468); SetPlayerCameraLookAt(playerid,1523.9155,-1668.9237,13.5468); GameTextForPlayer(playerid, "~b~Cops", 1000, 6); } } return 1; } //------------------------------------------------------------------------------ public GameModeExitFunc() { GameModeExit(); return 1; } //------------------------------------------------------------------------------ public GameModeShowWinTeam() { new summpoints[5]; new i,j,maxi,fl,Float: phealth; summpoints[0]=summpoints[1]=summpoints[2]=summpoints[3]=summpoints[4]=0; for (i=j = 0; i < MAX_PLAYERS; i++) { if ((IsPlayerConnected(i))) { GetPlayerHealth(i,phealth); if (phealth <= 0.0) continue; ResetPlayerWeapons(i); j++; SetPlayerInterior(i,0); SetPlayerPos(i,2739.4345,-1765.2652,450.5814+j*10.0); switch(gTeam[i]) { case 0: summpoints[0]+=points[i]; case 1: summpoints[1]+=points[i]; case 2: summpoints[2]+=points[i]; case 3: summpoints[3]+=points[i]; case 4: summpoints[4]+=points[i]; } } } // new tempstring[512]; // format(tempstring, sizeof(tempstring), "--- stat0=%d,stat1=%d,stat2=%d,stat3=%d,stat4=%d",summpoints[0],summpoints[1],summpoints[2],summpoints[3],summpoints[4]); // SendClientMessageToAll(COLOR_COMMAND, tempstring); maxi=0,fl=0; for (i=0;i<5;i++) { if (summpoints[i] > summpoints[maxi]) {maxi = i;} } for (i=0;i<5;i++) { if (summpoints[i] == summpoints[maxi] && i != maxi) {fl=1;} } if (fl==1) maxi=-1; switch (maxi) { case -1: { GameTextForAll("~r~No winners",7000,5); SendClientMessageToAll(COLOR_TEAM_0,"No winners"); } case 0: { GameTextForAll("~g~Grove Street 4 life",7000,5); SendClientMessageToAll(COLOR_TEAM_0,"Grove Street 4 life"); } case 1: { GameTextForAll("~p~Ballas da rule",7000,5); SendClientMessageToAll(COLOR_TEAM_1,"Ballas da rule"); } case 2: { GameTextForAll("~c~Vagos win",7000,5); SendClientMessageToAll(COLOR_TEAM_3,"Vagos win"); } case 3: { GameTextForAll("~y~Aztecas in da house",7000,5); SendClientMessageToAll(COLOR_TEAM_2,"Aztecas in da house"); } case 4: { GameTextForAll("~b~Cops win",7000,5); SendClientMessageToAll(COLOR_TEAM_4,"Cops win"); } } return 1; } //------------------------------------------------------------------------------ SetPlayerClass(playerid, classid) { switch (classid) { case 0..2: {gTeam[playerid] = TEAM_GROVE;} case 3..5: {gTeam[playerid] = TEAM_BALLAS;} case 6..8: {gTeam[playerid] = TEAM_VAGOS;} case 9..11: {gTeam[playerid] = TEAM_AZTECAS;} case 12..14: {gTeam[playerid] = TEAM_COPS;} } } //------------------------------------------------------------------------------ StrToInt(text[]) { new number=0; switch (strlen(text)) { case 1: {number=(text[0]-48);} case 2: {number=10*(text[0]-48)+(text[1]-48);} case 3: {number=100*(text[0]-48)+(10*(text[1]-48))+(text[2]-48);} case 4: {number=1000*(text[0]-48)+(100*(text[1]-48))+(10*(text[2]-48))+(text[3]-48);} case 5: {number=10000*(text[0]-48)+1000*(text[1]-48)+100*(text[2]-48)+10*(text[3]-48)+(text[4]-48);} case 6: {number=100000*(text[0]-48)+10000*(text[1]-48)+1000*(text[2]-48)+100*(text[3]-48)+10*(text[4]-48)+(text[5]-48);} case 7..20: {number=1000000;} } return number; } //------------------------------------------------------------------------------ public OnPlayerCommandText(playerid, cmdtext[]) { new tempstring[256]; // new string[256]; // strmid(string,cmdtext,0,strlen(cmdtext)); // format(tempstring, sizeof(tempstring), "--- strcmp(time)=%d,strfind(time)=%d. strcmp(time )=%d,strfind(time )=%d", strcmp(cmdtext, "/time"),strfind(cmdtext,"/time",true,0),strcmp(cmdtext, "/time "),strfind(cmdtext,"/time ",true,0)); // SendClientMessage(playerid, COLOR_GREY, tempstring); // format(tempstring, sizeof(tempstring), "Your admin status=%d", IsPlayerAdmin(playerid)); // SendClientMessage(playerid, COLOR_GREY, tempstring); if (strfind(cmdtext,"/modinfo",true,0) == 0) { SendClientMessage(playerid,COLOR_COMMAND, "LSTDM by TsaR&Warr ver. 0.17 (06.07.2006)."); SendClientMessage(playerid,COLOR_COMMAND, "Scripting, ideas and map content by TsaR. Main ideas, map content and balance by Warr."); SendClientMessage(playerid,COLOR_COMMAND, "All questions and ideas report to #gta@RusNet."); return 1; } else if (strfind(cmdtext,"/modhelp",true,0) == 0) { SendClientMessage(playerid,COLOR_COMMAND, "Help: /modinfo (about mod), /modhelp (shows this message)"); SendClientMessage(playerid,COLOR_COMMAND, "Help: /hp (displays your health), /stat (shows your statictics), /stat ID(or nick) (shows ID(nick) statictics)..."); SendClientMessage(playerid,COLOR_COMMAND, "Help: /time (displays current time on server), /timeleft (time for end the round), /give ID(or nick) summ (gives money for other player)"); return 1; } else if (strfind(cmdtext,"/hp",true,0) == 0) { new Float: phealth; GetPlayerHealth(playerid, phealth); format(tempstring, sizeof(tempstring), "--- You have %2.f hp.", phealth); SendClientMessage(playerid, COLOR_COMMAND, tempstring); return 1; } else if (strfind(cmdtext,"/stat",true,0) == 0 && strfind(cmdtext,"/stat ",true,0) != 0) { format(tempstring, sizeof(tempstring), "--- Your stat: points =%3.d, kills =%3.d, deaths =%3.d, suicides =%3.d, teamkills =%3.d.", points[playerid],frags[playerid],deaths[playerid],suicides[playerid],teamkills[playerid]); SendClientMessage(playerid, COLOR_COMMAND, tempstring); return 1; } else if (strfind(cmdtext,"/stat ",true,0) == 0) { if (strlen(cmdtext) < 7) { SendClientMessage(playerid, COLOR_ERROR, "--- Format command: /stat ID(or nick)"); return 1; } new targetid; new tmp[10]; strmid(tmp,cmdtext,6,strlen(cmdtext),sizeof(tmp)); if (IsNumeric(tmp)) { targetid=StrToInt(tmp); } else { targetid=GetPlayerId(tmp); } // if (targetid < 0 || targetid > 99) { // SendClientMessage(playerid, COLOR_ERROR, "--- Player ID must be between 0 and 99."); // return 1; // } if (!IsPlayerConnected(targetid)) { format(tempstring, sizeof(tempstring), "--- Player #%d not connected.",targetid); SendClientMessage(playerid, COLOR_ERROR, tempstring); return 1; } new target[MAX_PLAYER_NAME]; GetPlayerName(targetid,target,MAX_PLAYER_NAME); format(tempstring, sizeof(tempstring), "--- %s stat: points =%3.d, kills =%3.d, deaths =%3.d, suicides =%3.d, teamkills =%3.d.",target,points[targetid],frags[targetid],deaths[targetid],suicides[targetid],teamkills[targetid]); SendClientMessage(playerid, COLOR_COMMAND, tempstring); return 1; } else if (strfind(cmdtext,"/pos",true,0) == 0) { new Float: x; new Float: y; new Float: z; new Float: z2; GetPlayerPos(playerid,x,y,z); GetPlayerFacingAngle(playerid,z2); format(tempstring, sizeof(tempstring), "--- Your position: %f,%f,%f,%f",x,y,z,z2); SendClientMessage(playerid, COLOR_COMMAND, tempstring); return 1; } else if (strfind(cmdtext,"/time",true,0) == 0 && strfind(cmdtext,"/timeleft",true,0) != 0) { new hour,minute,second; gettime(hour,minute,second); format(tempstring, sizeof(tempstring), "--- The time is now: %d:%d:%d.",hour,minute,second); SendClientMessage(playerid, COLOR_COMMAND, tempstring); return 1; } else if (strfind(cmdtext,"/timeleft",true,0) == 0) { if ((gRoundTime-(GetTickCount()-startgame))/60000 < 0) { SendClientMessage(playerid, COLOR_COMMAND, "--- The game is over."); return 1; } new ttime=(gRoundTime-(GetTickCount()-startgame))/1000; format(tempstring, sizeof(tempstring), "--- Timeleft: %d minutes and %d seconds",ttime/60,ttime%60); SendClientMessage(playerid, COLOR_COMMAND, tempstring); return 1; } else if (strfind(cmdtext,"/give",true,0) == 0 && strfind(cmdtext,"/givemoney",true,0) != 0) { // SendClientMessage(playerid, COLOR_RED, "--- transfer money closed"); // return 1; if (strlen(cmdtext) < 8) { SendClientMessage(playerid, COLOR_ERROR, "--- Format command: /give ID(or nick) MONEY"); return 1; } // if (cmdtext[7] != ' ' && cmdtext[8] != ' ') { // SendClientMessage(playerid, COLOR_ERROR, "--- Player ID must be between 0 and 99."); // return 1; // } new name[MAX_PLAYER_NAME], target[MAX_PLAYER_NAME]; new havemoney=0, transfmoney=0, targetid=0; targetid=0; transfmoney=1; new pos=-1; new tmp[10]; for (new i=0;i 19) { SendClientMessage(playerid, COLOR_ERROR, "--- Hour must be between 0 and 24."); return 1; } new tmp[10]; strmid(tmp,cmdtext,17,strlen(cmdtext),sizeof(tmp)); new hour=StrToInt(tmp); if (hour < 0 || hour > 23) { SendClientMessage(playerid, COLOR_ERROR, "--- Hour must be between 0 and 24."); return 1; } SetWorldTime(hour); format(tempstring, sizeof(tempstring), "The time has been changed!"); SendClientMessage(playerid, COLOR_GREEN, tempstring); return 1; } else if (strfind(cmdtext,"/teleport",true,0) == 0 && IsPlayerAdmin(playerid) == 1) { new Float:ListPos[5][3] = { {2489.3806,-1661.4866,13.3359}, {1879.5007,-1260.9143,13.3906}, {2638.6892,-1419.2049,30.2878}, {1775.6403,-1907.9654,13.3861}, {1518.6901,-1669.5471,13.5468} }; new tmp[10]; strmid(tmp,cmdtext,10,strlen(cmdtext),sizeof(tmp)); new pos=StrToInt(tmp)-1; if (pos < 0 || pos > sizeof(ListPos)) { SendClientMessage(playerid, COLOR_ERROR, "--- You will be teleported in the random place."); pos=random(sizeof(ListPos)); } SetPlayerInterior(playerid,0); SetPlayerPos(playerid,ListPos[pos][0],ListPos[pos][1],ListPos[pos][2]); return 1; // commands for help in map creating } else if (strfind(cmdtext,"/putcar",true,0) == 0 && IsPlayerAdmin(playerid) == 1) { new Float: x; new Float: y; new Float: z; new Float: z2; new comment[100]; strmid(comment,cmdtext,7,strlen(cmdtext),sizeof(comment)); GetPlayerPos(playerid,x,y,z); GetPlayerFacingAngle(playerid,z2); format(tempstring, sizeof(tempstring), "--- Put car to pos: %.4f,%.4f,%.4f,%.4f",x,y,z,z2); SendClientMessage(playerid, COLOR_COMMAND, tempstring); if (IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid, COLOR_RED, "Get out of the car, asshole!"); return 1; } printf("AddStaticVehicle(429,%.4f,%.4f,%.4f,%.4f,58,8);//%s",x,y,z,z2,comment); return 1; } else if (strfind(cmdtext,"/putid",true,0) == 0 && IsPlayerAdmin(playerid) == 1) { new Float: x; new Float: y; new Float: z; new comment[100]; strmid(comment,cmdtext,7,strlen(cmdtext),sizeof(comment)); GetPlayerPos(playerid,x,y,z); format(tempstring, sizeof(tempstring), "--- Put PickUp to pos: %.4f,%.4f,%.4f",x,y,z); SendClientMessage(playerid, COLOR_COMMAND, tempstring); printf("AddStaticPickup(370,15,%.4f,%.4f,%.4f);//%s",x,y,z,comment); return 1; } else if (strfind(cmdtext,"/getcarNOW",false,0) == 0 && IsPlayerAdmin(playerid) == 1) { new Float: x; new Float: y; new Float: z; GetPlayerPos(playerid,x,y,z); SendClientMessage(playerid, COLOR_COMMAND, "getting byke"); AddStaticPickup(370, 15, x,y,z); return 1; } else if (strfind(cmdtext,"/rescue",false,0) == 0) { // format(tempstring, sizeof(tempstring), "--- tknow=: %d, money = %d",tknow[playerid], GetPlayerMoney(playerid)); // SendClientMessageToAll(COLOR_COMMAND, tempstring); if (tknow[playerid] == 0) { SendClientMessage(playerid, COLOR_COMMAND, "You are not in jail."); return 1; } if (GetPlayerMoney(playerid) < 5000) { SendClientMessage(playerid, COLOR_COMMAND, "You haven't enough lack of money."); return 1; } SetPlayerInterior(playerid,0); SetPlayerPos(playerid,1553.0318,-1675.4394,16.1953); GivePlayerMoney(playerid,-5000); tknow[playerid]=0; return 1; } else { return 0; } return 1; } //----------------------------------------------------------------------------- public GetPlayerId(playername[]) { for (new i = 0; i < MAX_PLAYERS; i++) { // printf("zaproc-%s,tekyshee-%s",playername,gPlayerName[i]); if ((IsPlayerConnected(i)) && (strcmp(playername, gPlayerName[i], false) == 0)) return i; } return -1; } //----------------------------------------------------------------------------- public IsNumeric(const string[]) { for (new i = 0, j = strlen(string); i < j; i++) { if (string[i] > '9' || string[i] < '0') return 0; } return 1; } //----------------------------------------------------------------------------- public RescueTK() { for (new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i) && tknow[i]== 1) { SetPlayerInterior(i,0); SetPlayerPos(i,1553.0318,-1675.4394,16.1953); tknow[i]=0; } } } //------------------------------------------------------------------------------