#include #include #include #include #define COLOR_WHITE 0xFFFFFFFF #define COLOR_NORMAL_PLAYER 0xFFBB7777 #define COLOR_GREEN 0x33AA33AA #define COLOR_RED 0xAA3333AA #define COLOR_LIGHTRED 0xFF6347AA #define COLOR_GREY 0xAFAFAFAA #define COLOR_GRAD1 0xB4B5B7FF #define COLOR_LIGHTRED 0xFF6347AA #define COLOR_YELLOW 0xFFFF00AA #define MAX_DROP_AMOUNT -1 #define Speed(%0,%1,%2,%3,%4) floatround(floatsqroot(%4?(%0*%0+%1*%1+%2*%2):(%0*%0+%1*%1))*%3*1.6) #define MAX_DROP_LIFETIME 30 #define WEAPON_SLOTS 13 #define INVALID_PICKUP -1 #define PICKUP_TYPE 19 #undef MAX_PICKUPS #define MAX_PICKUPS 90 #undef MAX_PLAYERS #define MAX_PLAYERS 50 //////////////////////////////ИЗМЕНИТЬ НА СВОЁ КОЛ-ВО СЛОТОВ new Text:txtLosSantos; new Text:txtSanFierro; new Text:txtLasVenturas; new Text:txtTimeDisp; new hour, minute; new timestr[32]; enum pStats { Pass[60], Money, Admin, Score, Name }; new PInfo[MAX_PLAYERS][pStats]; enum pickup { creation_time, weapon, ammo, timer } #define CITY_LOS_SANTOS 0 #define CITY_SAN_FIERRO 1 #define CITY_LAS_VENTURAS 2 #define AccauntBD "Players/%s.ini" new pickups [ MAX_PICKUPS ][ pickup ]; new Float:gRandomSpawns_LosSantos[][4] = { {1751.1097,-2106.4529,13.5469,183.1979}, // El-Corona - Outside random house {2652.6418,-1989.9175,13.9988,182.7107}, // Random house in willowfield - near playa de seville and stadium {2489.5225,-1957.9258,13.5881,2.3440}, // Hotel in willowfield - near cluckin bell {2689.5203,-1695.9354,10.0517,39.5312}, // Outside stadium - lots of cars {2770.5393,-1628.3069,12.1775,4.9637}, // South in east beach - north of stadium - carparks nearby {2807.9282,-1176.8883,25.3805,173.6018}, // North in east beach - near apartments {2552.5417,-958.0850,82.6345,280.2542}, // Random house north of Las Colinas {2232.1309,-1159.5679,25.8906,103.2939}, // Jefferson motel {2388.1003,-1279.8933,25.1291,94.3321}, // House south of pig pen {2481.1885,-1536.7186,24.1467,273.4944}, // East LS - near clucking bell and car wash {2495.0720,-1687.5278,13.5150,359.6696}, // Outside CJ's house - lots of cars nearby {2306.8252,-1675.4340,13.9221,2.6271}, // House in ganton - lots of cars nearby {2191.8403,-1455.8251,25.5391,267.9925}, // House in south jefferson - lots of cars nearby {1830.1359,-1092.1849,23.8656,94.0113}, // Mulholland intersection carpark {2015.3630,-1717.2535,13.5547,93.3655}, // Idlewood house {1654.7091,-1656.8516,22.5156,177.9729}, // Right next to PD {1219.0851,-1812.8058,16.5938,190.0045}, // Conference Center {1508.6849,-1059.0846,25.0625,1.8058}, // Across the street of BANK - lots of cars in intersection carpark {1421.0819,-885.3383,50.6531,3.6516}, // Outside house in vinewood {1133.8237,-1272.1558,13.5469,192.4113}, // Near hospital {1235.2196,-1608.6111,13.5469,181.2655}, // Backalley west of mainstreet {590.4648,-1252.2269,18.2116,25.0473}, // Outside "BAnk of San Andreas" {842.5260,-1007.7679,28.4185,213.9953}, // North of Graveyard {911.9332,-1232.6490,16.9766,5.2999}, // LS Film Studio {477.6021,-1496.6207,20.4345,266.9252}, // Rodeo Place {255.4621,-1366.3256,53.1094,312.0852}, // Outside propery in richman {281.5446,-1261.4562,73.9319,305.0017}, // Another richman property {790.1918,-839.8533,60.6328,191.9514}, // Mulholland house {1299.1859,-801.4249,84.1406,269.5274}, // Maddoggs {1240.3170,-2036.6886,59.9575,276.4659}, // Verdant Bluffs {2215.5181,-2627.8174,13.5469,273.7786}, // Ocean docks 1 {2509.4346,-2637.6543,13.6453,358.3565} // Ocean Docks spawn 2 }; new Float:gRandomSpawns_LasVenturas[][4] = { {1435.8024,2662.3647,11.3926,1.1650}, // Northern train station {1457.4762,2773.4868,10.8203,272.2754}, // Northern golf club {1739.6390,2803.0569,14.2735,285.3929}, // Northern housing estate 1 {1870.3096,2785.2471,14.2734,42.3102}, // Northern housing estate 2 {1959.7142,2754.6863,10.8203,181.4731}, // Northern house 1 {2314.2556,2759.4504,10.8203,93.2711}, // Northern industrial estate 1 {2216.5674,2715.0334,10.8130,267.6540}, // Northern industrial estate 2 {2101.4192,2678.7874,10.8130,92.0607}, // Northern near railway line {1951.1090,2660.3877,10.8203,180.8461}, // Northern house 2 {1666.6949,2604.9861,10.8203,179.8495}, // Northern house 3 {2808.3367,2421.5107,11.0625,136.2060}, // Northern shopping centre {2633.3203,2349.7061,10.6719,178.7175}, // V-Rock {2606.6348,2161.7490,10.8203,88.7508}, // South V-Rock {2616.5286,2100.6226,10.8158,177.7834}, // North Ammunation 1 {2491.8816,2397.9370,10.8203,266.6003}, // North carpark 1 {2531.7891,2530.3223,21.8750,91.6686}, // North carpark 2 {2340.6677,2530.4324,10.8203,177.8630}, // North Pizza Stack {2097.6855,2491.3313,14.8390,181.8117}, // Emerald Isle {1893.1000,2423.2412,11.1782,269.4385}, // Souvenir shop {1698.9330,2241.8320,10.8203,357.8584}, // Northern casino {1479.4559,2249.0769,11.0234,306.3790}, // Baseball stadium 1 {1298.1548,2083.4016,10.8127,256.7034}, // Baseball stadium 2 {1117.8785,2304.1514,10.8203,81.5490}, // North carparks {1108.9878,1705.8639,10.8203,0.6785}, // Dirtring racing 1 {1423.9780,1034.4188,10.8203,90.9590}, // Sumo {1537.4377,752.0641,11.0234,271.6893}, // Church {1917.9590,702.6984,11.1328,359.2682}, // Southern housing estate {2089.4785,658.0414,11.2707,357.3572}, // Southern house 1 {2489.8286,928.3251,10.8280,67.2245}, // Wedding chapel {2697.4717,856.4916,9.8360,267.0983}, // Southern construction site {2845.6104,1288.1444,11.3906,3.6506}, // Southern train station {2437.9370,1293.1442,10.8203,86.3830}, // Wedding chapel (near Pyramid) {2299.5430,1451.4177,10.8203,269.1287}, // Carpark (near Pyramid) {2214.3008,2041.9165,10.8203,268.7626}, // Central parking lot {2005.9174,2152.0835,10.8203,270.1372}, // Central motel {2222.1042,1837.4220,10.8203,88.6461}, // Clowns Pocket {2025.6753,1916.4363,12.3382,272.5852}, // The Visage {2087.9902,1516.5336,10.8203,48.9300}, // Royal Casino {2172.1624,1398.7496,11.0625,91.3783}, // Auto Bahn {2139.1841,987.7975,10.8203,0.2315}, // Come-a-lot {1860.9672,1030.2910,10.8203,271.6988}, // Behind 4 Dragons {1673.2345,1316.1067,10.8203,177.7294}, // Airport carpark {1412.6187,2000.0596,14.7396,271.3568} // South baseball stadium houses }; new Float:gRandomSpawns_SanFierro[][4] = { {-2723.4639,-314.8138,7.1839,43.5562}, // golf course spawn {-2694.5344,64.5550,4.3359,95.0190}, // in front of a house {-2458.2000,134.5419,35.1719,303.9446}, // hotel {-2796.6589,219.5733,7.1875,88.8288}, // house {-2706.5261,397.7129,4.3672,179.8611}, // park {-2866.7683,691.9363,23.4989,286.3060}, // house {-2764.9543,785.6434,52.7813,357.6817}, // donut shop {-2660.9402,883.2115,79.7738,357.4440}, // house {-2861.0796,1047.7109,33.6068,188.2750}, // parking lot {-2629.2009,1383.1367,7.1833,179.7006}, // parking lot at the bridge {-2079.6802,1430.0189,7.1016,177.6486}, // pier {-1660.2294,1382.6698,9.8047,136.2952}, // pier 69 {-1674.1964,430.3246,7.1797,226.1357}, // gas station] {-1954.9982,141.8080,27.1747,277.7342}, // train station {-1956.1447,287.1091,35.4688,90.4465}, // car shop {-1888.1117,615.7245,35.1719,128.4498}, // random {-1922.5566,886.8939,35.3359,272.1293}, // random {-1983.3458,1117.0645,53.1243,271.2390}, // church {-2417.6458,970.1491,45.2969,269.3676}, // gas station {-2108.0171,902.8030,76.5792,5.7139}, // house {-2097.5664,658.0771,52.3672,270.4487}, // random {-2263.6650,393.7423,34.7708,136.4152}, // random {-2287.5027,149.1875,35.3125,266.3989}, // baseball parking lot {-2039.3571,-97.7205,35.1641,7.4744}, // driving school {-1867.5022,-141.9203,11.8984,22.4499}, // factory {-1537.8992,116.0441,17.3226,120.8537}, // docks ship {-1708.4763,7.0187,3.5489,319.3260}, // docks hangar {-1427.0858,-288.9430,14.1484,137.0812}, // airport {-2173.0654,-392.7444,35.3359,237.0159}, // stadium {-2320.5286,-180.3870,35.3135,179.6980}, // burger shot {-2930.0049,487.2518,4.9141,3.8258} // harbor }; static armedbody_pTick[MAX_PLAYERS]; // Set any of those to -1 to disable dropping of that weapon new weapons[] = { -1, // no fists 331, // - Brass Knuckles 333, // Golf Club 334, // Night Stick 335, // Knife 336, // baseball bat 337, // shovel 338, // pool cue 339, // katama 341, // chainsaw 321, // regular dildo 322, // white dildo 323, // Medium, white vibrator 324, // smaill, silver vibrator 325, // flowers 326, // cane 342, // grendade 343, // tear gas 344, // molotov -1, // RPG rocket - we can't pick up those, do we oO -1, // Heat-Seeking Rocket -1, // Hydra rocket 346, // colt 45 347, // colt 45 + silencer 348, // deagle 349, // shotgun 350, // sawn-off 351, // spaz 352, // micro-uzi 353, // mp5 355, // ak47 356, // m4 372, // tec9 357, // country rifle 358, // sniper rifle 359, // rocket launcher 360, // heat-seeking rocket launcher 361, // flamethrower 362, // minigun 363, // sachtel charges -1, // detonator 365, // spray can 366, // fire extinguisher 367, // camera -1, // night-vision goggles -1, // heat-vision goggles 371 // parachute }; new total_vehicles_from_files=0; new gPlayerCitySelection[MAX_PLAYERS]; new gPlayerHasCitySelected[MAX_PLAYERS]; new gPlayerLastCitySelectionTick[MAX_PLAYERS]; new Text:RUGAMING; new givem; new moneypickup; forward DropPlayerMoney(playerid); forward DeletePickup(pickupid); forward GetWeaponModel(weaponid); forward ShowPlayerRegisterDialog(playerid); forward ShowPlayerLoginDialog(playerid); forward KickTimer(playerid); forward UpdateTimeAndWeather(); forward DestroyPickupEx( p ); #define COLORS "{FF0000}Красный\ \n{BEBEBE}Серый\ \n{006400}Зеленый\ \n{EEA2AD}Розовый\ \n{00FF00}Лайм\ \n{0000FF}Синий\ \n{FFFF00}Желтый\ \n{00FFFF}Голубой\ \n{FFA500}Оранжевый\ \n{FF00FF}Магента\ \n{FF6347}Томатный\ \n{551A8B}Индиго\ \n{B8860B}Золотой\ \n{698B22}Оливковый\ \n{9ACD32}Желто-Зеленый\ \n{8B4513}Коричневый\ \n{EE6A50}Коралловый\ \n{FF4500}Красно-оранжевый" new fine_weather_ids[] = {1,2,3,4,5,6,7,12,13,14,15,17,18,24,25,26,27,28,29,30,40}; new foggy_weather_ids[] = {9,19,20,31,32}; new wet_weather_ids[] = {8}; main(){} public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == 2) SetPVarInt(playerid,"AC_MCS",GetTickCount()); else if(oldstate == 2) if((GetTickCount() - GetPVarInt(playerid,"AC_MCS")) <= 250) return RKick(playerid); if((newstate == 2 && oldstate == 3) || (newstate == 3 && oldstate == 2)) return RKick(playerid); return 1; } public OnPlayerConnect(playerid) { GetPlayerName(playerid, PInfo[playerid][Name], MAX_PLAYER_NAME); new string[128]; format(string,sizeof(string),AccauntBD,PInfo[playerid][Name]); if(fexist(string)) { ShowPlayerLoginDialog(playerid); } else { ShowPlayerRegisterDialog(playerid); } SendClientMessage(playerid,COLOR_WHITE,"{40BF99}Добро пожаловать на сервер RuGaming Death Match!"); SendClientMessage(playerid,COLOR_WHITE,"{40BF99}После регистрации/авторизации нажимай стрелки {40BF99}ВЛЕВО{FFFFFF} или {40BF99}ВПРАВО{FFFFFF} для смены города. Нажми {40BF99}ЛКМ{FFFFFF} чтобы выбрать."); gettime(hour, minute); SetPlayerTime(playerid,hour,minute); gPlayerCitySelection[playerid] = -1; gPlayerHasCitySelected[playerid] = 0; gPlayerLastCitySelectionTick[playerid] = GetTickCount(); TextDrawShowForPlayer(playerid, RUGAMING); return 1; } ClassSel_InitTextDraws() { txtLosSantos = TextDrawCreate(350.000000, 415.000000, "Los Santos"); TextDrawSetProportional(txtLosSantos, 1); ClassSel_InitCityNameText(txtLosSantos); txtSanFierro = TextDrawCreate(350.000000, 415.000000, "San Fierro"); TextDrawSetProportional(txtSanFierro, 1); ClassSel_InitCityNameText(txtSanFierro); txtLasVenturas = TextDrawCreate(350.000000, 415.000000, "Las Venturas"); TextDrawSetProportional(txtLasVenturas, 1); ClassSel_InitCityNameText(txtLasVenturas); } public OnPlayerCommandText(playerid, cmdtext[]) return 1; public OnPlayerSpawn(playerid) { if(IsPlayerNPC(playerid)) return 1; new randSpawn = 0; SetPlayerInterior(playerid,0); TogglePlayerClock(playerid,0); TextDrawShowForPlayer(playerid,txtTimeDisp); gettime(hour, minute); SetPlayerTime(playerid,hour,minute); if(CITY_LOS_SANTOS == gPlayerCitySelection[playerid]) { randSpawn = random(sizeof(gRandomSpawns_LosSantos)); SetPlayerPos(playerid, gRandomSpawns_LosSantos[randSpawn][0], gRandomSpawns_LosSantos[randSpawn][1], gRandomSpawns_LosSantos[randSpawn][2]); SetPlayerFacingAngle(playerid,gRandomSpawns_LosSantos[randSpawn][3]); } else if(CITY_SAN_FIERRO == gPlayerCitySelection[playerid]) { randSpawn = random(sizeof(gRandomSpawns_SanFierro)); SetPlayerPos(playerid, gRandomSpawns_SanFierro[randSpawn][0], gRandomSpawns_SanFierro[randSpawn][1], gRandomSpawns_SanFierro[randSpawn][2]); SetPlayerFacingAngle(playerid,gRandomSpawns_SanFierro[randSpawn][3]); } else if(CITY_LAS_VENTURAS == gPlayerCitySelection[playerid]) { randSpawn = random(sizeof(gRandomSpawns_LasVenturas)); SetPlayerPos(playerid, gRandomSpawns_LasVenturas[randSpawn][0], gRandomSpawns_LasVenturas[randSpawn][1], gRandomSpawns_LasVenturas[randSpawn][2]); SetPlayerFacingAngle(playerid,gRandomSpawns_LasVenturas[randSpawn][3]); } SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL,200); SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL_SILENCED,200); SetPlayerSkillLevel(playerid,WEAPONSKILL_DESERT_EAGLE,200); SetPlayerSkillLevel(playerid,WEAPONSKILL_SHOTGUN,200); SetPlayerSkillLevel(playerid,WEAPONSKILL_SAWNOFF_SHOTGUN,200); SetPlayerSkillLevel(playerid,WEAPONSKILL_SPAS12_SHOTGUN,200); SetPlayerSkillLevel(playerid,WEAPONSKILL_MICRO_UZI,200); SetPlayerSkillLevel(playerid,WEAPONSKILL_MP5,200); SetPlayerSkillLevel(playerid,WEAPONSKILL_AK47,200); SetPlayerSkillLevel(playerid,WEAPONSKILL_M4,200); SetPlayerSkillLevel(playerid,WEAPONSKILL_SNIPERRIFLE,200); GivePlayerWeapon(playerid,WEAPON_COLT45,100); GivePlayerWeapon(playerid,5,1); GivePlayerWeapon(playerid,28,200); TogglePlayerClock(playerid, 0); return 1; } public OnPlayerDeath(playerid, killerid, reason) { givem = GetPlayerMoney(playerid)/3; GivePlayerMoney(playerid, -GetPlayerMoney(playerid)/3); DropPlayerMoney(playerid); DropWeapons(playerid); gPlayerHasCitySelected[playerid] = 0; PInfo[playerid][Score] ++; SetPlayerScore(killerid,GetPlayerScore(killerid)+1); TextDrawHideForPlayer(playerid,txtTimeDisp); return 1; } public OnPlayerDisconnect(playerid, reason) { OnPlayerSave(playerid); if(GetPVarInt(playerid, "Kick") != 0) KillTimer(GetPVarInt(playerid, "Kick")); return 1; } ClassSel_SetupCharSelection(playerid) { if(gPlayerCitySelection[playerid] == CITY_LOS_SANTOS) { SetPlayerInterior(playerid,11); SetPlayerPos(playerid,508.7362,-87.4335,998.9609); SetPlayerFacingAngle(playerid,0.0); SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609); SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609); } else if(gPlayerCitySelection[playerid] == CITY_SAN_FIERRO) { SetPlayerInterior(playerid,3); SetPlayerPos(playerid,-2673.8381,1399.7424,918.3516); SetPlayerFacingAngle(playerid,181.0); SetPlayerCameraPos(playerid,-2673.2776,1394.3859,918.3516); SetPlayerCameraLookAt(playerid,-2673.8381,1399.7424,918.3516); } else if(gPlayerCitySelection[playerid] == CITY_LAS_VENTURAS) { SetPlayerInterior(playerid,3); SetPlayerPos(playerid,349.0453,193.2271,1014.1797); SetPlayerFacingAngle(playerid,286.25); SetPlayerCameraPos(playerid,352.9164,194.5702,1014.1875); SetPlayerCameraLookAt(playerid,349.0453,193.2271,1014.1797); } } ClassSel_SetupSelectedCity(playerid) { if(gPlayerCitySelection[playerid] == -1) { gPlayerCitySelection[playerid] = CITY_LOS_SANTOS; } if(gPlayerCitySelection[playerid] == CITY_LOS_SANTOS) { SetPlayerInterior(playerid,0); SetPlayerCameraPos(playerid, 2538.4661, -1706.6311, 34.5701); SetPlayerCameraLookAt(playerid, 2537.6658, -1706.0270, 34.3751); TextDrawShowForPlayer(playerid,txtLosSantos); TextDrawHideForPlayer(playerid,txtSanFierro); TextDrawHideForPlayer(playerid,txtLasVenturas); } else if(gPlayerCitySelection[playerid] == CITY_SAN_FIERRO) { SetPlayerInterior(playerid,0); SetPlayerCameraPos(playerid, -1637.7233, 597.6656, 77.6386); SetPlayerCameraLookAt(playerid, -1638.7274, 597.6577, 77.4484); TextDrawHideForPlayer(playerid,txtLosSantos); TextDrawShowForPlayer(playerid,txtSanFierro); TextDrawHideForPlayer(playerid,txtLasVenturas); } else if(gPlayerCitySelection[playerid] == CITY_LAS_VENTURAS) { SetPlayerInterior(playerid,0); SetPlayerCameraPos(playerid, 2179.3489, 1909.3308, 83.1317); SetPlayerCameraLookAt(playerid, 2178.3438, 1909.3477, 82.9415); TextDrawHideForPlayer(playerid,txtLosSantos); TextDrawHideForPlayer(playerid,txtSanFierro); TextDrawShowForPlayer(playerid,txtLasVenturas); } } ClassSel_SwitchToNextCity(playerid) { gPlayerCitySelection[playerid]++; if(gPlayerCitySelection[playerid] > CITY_LAS_VENTURAS) { gPlayerCitySelection[playerid] = CITY_LOS_SANTOS; } PlayerPlaySound(playerid,1052,0.0,0.0,0.0); gPlayerLastCitySelectionTick[playerid] = GetTickCount(); ClassSel_SetupSelectedCity(playerid); } ClassSel_SwitchToPreviousCity(playerid) { gPlayerCitySelection[playerid]--; if(gPlayerCitySelection[playerid] < CITY_LOS_SANTOS) { gPlayerCitySelection[playerid] = CITY_LAS_VENTURAS; } PlayerPlaySound(playerid,1053,0.0,0.0,0.0); gPlayerLastCitySelectionTick[playerid] = GetTickCount(); ClassSel_SetupSelectedCity(playerid); } ClassSel_HandleCitySelection(playerid) { new Keys,ud,lr; GetPlayerKeys(playerid,Keys,ud,lr); if(gPlayerCitySelection[playerid] == -1) { ClassSel_SwitchToNextCity(playerid); return; } if( (GetTickCount() - gPlayerLastCitySelectionTick[playerid]) < 500 ) return; if(Keys & KEY_FIRE) { gPlayerHasCitySelected[playerid] = 1; TextDrawHideForPlayer(playerid,txtLosSantos); TextDrawHideForPlayer(playerid,txtSanFierro); TextDrawHideForPlayer(playerid,txtLasVenturas); TogglePlayerSpectating(playerid,0); return; } if(lr > 0) { ClassSel_SwitchToNextCity(playerid); } else if(lr < 0) { ClassSel_SwitchToPreviousCity(playerid); } } public OnPlayerRequestClass(playerid, classid) { if(IsPlayerNPC(playerid)) return 1; if(gPlayerHasCitySelected[playerid]) { ClassSel_SetupCharSelection(playerid); return 1; } else { if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING) { TogglePlayerSpectating(playerid,1); gPlayerCitySelection[playerid] = -1; } } return 0; } ClassSel_InitCityNameText(Text:txtInit) { TextDrawUseBox(txtInit, 0); TextDrawLetterSize(txtInit,1.25,3.0); TextDrawFont(txtInit, 0); TextDrawSetShadow(txtInit,0); TextDrawSetOutline(txtInit,1); TextDrawColor(txtInit,0xEEEEEEFF); } public OnPlayerPickUpPickup(playerid, pickupid) { DestroyPickup(pickupid); if (pickupid == moneypickup) { GivePlayerMoney(playerid, givem); } if( pickups[ pickupid ][ creation_time ] != 0 ) { GivePlayerWeapon( playerid, pickups[ pickupid ][ weapon ], pickups[ pickupid ][ ammo ] ); } return 1; } public OnGameModeInit() { txtTimeDisp = TextDrawCreate(605.0,25.0,"00:00"); TextDrawUseBox(txtTimeDisp, 0); TextDrawFont(txtTimeDisp, 3); TextDrawSetShadow(txtTimeDisp,0); // no shadow TextDrawSetOutline(txtTimeDisp,2); // thickness 1 TextDrawBackgroundColor(txtTimeDisp,0x000000FF); TextDrawColor(txtTimeDisp,0xFFFFFFFF); TextDrawAlignment(txtTimeDisp,3); TextDrawLetterSize(txtTimeDisp,0.5,1.5); UpdateTimeAndWeather(); SetTimer("UpdateTimeAndWeather",1000 * 60,1); SetGameModeText("RuGaming Death Match"); ShowNameTags(1); SetNameTagDrawDistance(30.0); EnableStuntBonusForAll(1); SetWeather(2); SetWorldTime(11); ClassSel_InitTextDraws(); DisableInteriorEnterExits(); RUGAMING = TextDrawCreate(500.000000, 5.000000, "RUGAMING"); TextDrawBackgroundColor(RUGAMING, 255); TextDrawFont(RUGAMING, 2); TextDrawLetterSize(RUGAMING, 0.529999, 1.700000); TextDrawColor(RUGAMING, -65281); TextDrawSetOutline(RUGAMING, 0); TextDrawSetProportional(RUGAMING, 1); TextDrawSetShadow(RUGAMING, 2); SetTimer("Others", 1000, 1); for(new i = 1; i < 300; i++) { if(i == 74) continue; AddPlayerClass(i,-1,-1,3000,-1,-1,-1,-1,-1,-1,-1); } total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/trains.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/pilots.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_law.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_airport.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_gen.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_law.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_airport.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_gen.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_law.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_airport.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_inner.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_outer.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/whetstone.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/bone.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/flint.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/tierra.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/red_county.txt"); printf("Total vehicles from files: %d",total_vehicles_from_files); return 1; } public OnGameModeExit() { SaveAccounts(); TextDrawHideForAll(RUGAMING); TextDrawDestroy(RUGAMING); return 1; } stock SaveAccounts() { for(new f; f < GetMaxPlayers(); f++) { if(!IsPlayerConnected(f))continue; OnPlayerSave(f); } } public OnPlayerUpdate(playerid) { if(!IsPlayerConnected(playerid)) return 0; if(IsPlayerNPC(playerid)) return 1; if( !gPlayerHasCitySelected[playerid] && GetPlayerState(playerid) == PLAYER_STATE_SPECTATING ) { ClassSel_HandleCitySelection(playerid); return 1; } if(GetPVarInt(playerid, "Kick") != 0) RKick(playerid); return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch(dialogid) { case 767: { if(!response) return true; { switch(listitem) { case 0: return SetPlayerColor(playerid,0xAA3333AA); case 1: return SetPlayerColor(playerid,0xAFAFAFAA); case 2: return SetPlayerColor(playerid,0x008000AA); case 3: return SetPlayerColor(playerid,0xFF80FFAA); case 4: return SetPlayerColor(playerid,0x00FF40AA); case 5: return SetPlayerColor(playerid,0x0000FFAA); case 6: return SetPlayerColor(playerid,0xFFFF00AA); case 7: return SetPlayerColor(playerid,0x00FFFFAA); case 8: return SetPlayerColor(playerid,0xFF8000AA); case 9: return SetPlayerColor(playerid,0xFF00FFAA); case 10: return SetPlayerColor(playerid,0xF96C77AA); case 11: return SetPlayerColor(playerid,0x400080AA); case 12: return SetPlayerColor(playerid,0x808000AA); case 13: return SetPlayerColor(playerid,0x808040AA); case 14: return SetPlayerColor(playerid,0x809E21AA); case 15: return SetPlayerColor(playerid,0x804040AA); case 16: return SetPlayerColor(playerid,0xAD163DAA); case 17: return SetPlayerColor(playerid,0xFF4500AA); } } } case 7000: { if(!response) return ShowPlayerDialog(playerid,-1,-1,"","","",""); if(response) switch(listitem) { case 0: { if(GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid, -1, "{40BF99}У вас не хватает денег"); else { GivePlayerMoney(playerid, -2000); GivePlayerWeapon(playerid, 24, 100); SendClientMessage(playerid, -1, "{40BF99}Спасибо за покупку [{FFFFFF}Desert Eagle{40BF99}]"); } } case 1: { if(GetPlayerMoney(playerid) <3500) return SendClientMessage(playerid, -1, "{40BF99}У вас не хватает денег"); else { GivePlayerMoney(playerid, -3500); GivePlayerWeapon(playerid, 25, 100); SendClientMessage(playerid, -1, "{40BF99}Спасибо за покупку [{FFFFFF}Shotgun{40BF99}]"); } } case 2: { if(GetPlayerMoney(playerid) <3500) return SendClientMessage(playerid, -1, "{40BF99}У вас не хватает денег"); else { GivePlayerMoney(playerid, -3500); GivePlayerWeapon(playerid, 27, 100); SendClientMessage(playerid, -1, "{40BF99}Спасибо за покупку [{FFFFFF}Combat Shotgun{40BF99}]"); } } case 3: { if(GetPlayerMoney(playerid) <3000) return SendClientMessage(playerid, -1, "{40BF99}У вас не хватает денег"); else { GivePlayerMoney(playerid, -3000); GivePlayerWeapon(playerid, 28, 250); SendClientMessage(playerid, -1, "{40BF99}Спасибо за покупку [{FFFFFF}SMG/Uzi{40BF99}]"); } } case 4: { if(GetPlayerMoney(playerid) <3000) return SendClientMessage(playerid, -1, "{40BF99}У вас не хватает денег"); else { GivePlayerMoney(playerid, -3000); GivePlayerWeapon(playerid, 29, 250); SendClientMessage(playerid, -1, "{40BF99}Спасибо за покупку [{FFFFFF}MP5{40BF99}]"); } } case 5: { if(GetPlayerMoney(playerid) <4000) return SendClientMessage(playerid, -1, "{40BF99}У вас не хватает денег"); else { GivePlayerMoney(playerid, -400); GivePlayerWeapon(playerid, 30, 250); SendClientMessage(playerid, -1, "{40BF99}Спасибо за покупку [{FFFFFF}AK47{40BF99}]"); } } case 6: { if(GetPlayerMoney(playerid) <4000) return SendClientMessage(playerid, -1, "{40BF99}У вас не хватает денег"); else { GivePlayerMoney(playerid, -4000); GivePlayerWeapon(playerid, 31, 250); SendClientMessage(playerid, -1, "{40BF99}Спасибо за покупку [{FFFFFF}M4{40BF99}]"); } } case 7: { if(GetPlayerMoney(playerid) <3000) return SendClientMessage(playerid, -1, "{40BF99}У вас не хватает денег"); else { GivePlayerMoney(playerid, -3000); GivePlayerWeapon(playerid, 32, 250); SendClientMessage(playerid, -1, "{40BF99}Спасибо за покупку [{FFFFFF}Tec9{40BF99}]"); } } case 8: { if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, -1, "{40BF99}У вас не хватает денег"); else { GivePlayerMoney(playerid, -5000); GivePlayerWeapon(playerid, 33, 100); SendClientMessage(playerid, -1, "{40BF99}Cпасибо за покупку [{FFFFFF}Country Rifle{40BF99}]"); } } case 9: { if(GetPlayerMoney(playerid) <100) return SendClientMessage(playerid, -1, "{40BF99}У вас не хватает денег"); else { GivePlayerMoney(playerid, -5000); GivePlayerWeapon(playerid, 34, 100); SendClientMessage(playerid, -1, "{40BF99}Спасибо за покупку [{FFFFFF}Sniper Rifle{40BF99}]"); } } } } case 350: { if(!response) Kick(playerid); if(strlen(inputtext) == 0) return ShowPlayerLoginDialog(playerid); OnPlayerLogged(playerid, inputtext); return 1; } case 351: { if(!response) Kick(playerid); if(strlen(inputtext) == 0) return ShowPlayerRegisterDialog(playerid); OnPlayerRegistered(playerid, inputtext); return 1; } } return true; } public DropPlayerMoney(playerid) { if(GetPlayerMoney(playerid) > 0) { new Float:xf,Float:yf,Float:zf; GetPlayerPos(playerid, xf, yf, zf); moneypickup = CreatePickup(1212, 3, xf+1, yf+1, zf); return 1; } return 1; } public DeletePickup(pickupid) { DestroyPickup(pickupid); return 1; } stock OnPlayerLogged(playerid, password[]) { new string[128]; format(string,sizeof(string),AccauntBD,PInfo[playerid][Name]); new iniFile = ini_openFile(string); ini_getString(iniFile, "Password",string); if(strcmp(string,password, true, 10) == 0) { ini_getInteger(iniFile,"Money",PInfo[playerid][Money]); ini_getInteger(iniFile,"Score",PInfo[playerid][Score]); ini_getInteger(iniFile,"Admin",PInfo[playerid][Admin]); ini_closeFile(iniFile); GivePlayerMoney(playerid, PInfo[playerid][Money]); SetPlayerScore(playerid, PInfo[playerid][Score]); } else { Kick(playerid); SendClientMessage(playerid,COLOR_RED,"Неверный пароль."); ini_closeFile(iniFile); } return 1; } stock OnPlayerRegistered(playerid, password[]) { new string[128]; new year,month,day; getdate(year, month, day); format(string,sizeof(string),AccauntBD,PInfo[playerid][Name]); new iniFile = ini_createFile(string); if(iniFile < 0) iniFile = ini_openFile(string); ini_setString(iniFile, "Password",password); ini_setInteger(iniFile,"Money",10000); ini_setInteger(iniFile,"Score",0); ini_setInteger(iniFile,"Admin",0); ini_closeFile(iniFile); OnPlayerLogged(playerid,password); format(string,sizeof(string), "Вы зарегистрировались и автоматически залогинились. Ваш пароль: {FF8000}%s",password); SendClientMessage(playerid,COLOR_GREEN,string); return 1; } stock OnPlayerSave(playerid) { new string[128]; format(string,sizeof(string),AccauntBD,PInfo[playerid][Name]); new iniFile = ini_openFile (string); ini_setInteger(iniFile,"Money",GetPlayerMoney(playerid)); ini_setInteger(iniFile,"Score",GetPlayerScore(playerid)); ini_setInteger(iniFile,"Admin",PInfo[playerid][Admin]); ini_closeFile(iniFile); return 1; } //============================================================================== public GetWeaponModel(weaponid) { new model; switch(weaponid) { case 1: model=331; case 2: model=333; case 3: model=334; case 4: model=335; case 5: model=336; case 6: model=337; case 7: model=338; case 8: model=339; case 9: model=341; case 10: model=321; case 11: model=322; case 12: model=323; case 13: model=324; case 14: model=325; case 15: model=326; case 16: model=342; case 17: model=343; case 18: model=344; case 22: model=346; case 23: model=347; case 24: model=348; case 25: model=349; case 26: model=350; case 27: model=351; case 28: model=352; case 29: model=353; case 30: model=355; case 31: model=356; case 32: model=372; case 33: model=357; case 34: model=358; case 35: model=359; case 36: model=360; case 37: model=361; case 38: model=362; case 39: model=363; case 41: model=365; case 42: model=366; case 46: model=371; } if(model<300) return -1; return model; } public ShowPlayerRegisterDialog(playerid) { ShowPlayerDialog(playerid, 351, DIALOG_STYLE_INPUT, "[Регистрация]", "{FF8000}Добро пожаловать на сервер\nПожалуйста зарегистрируйтесь", "Ок", "Выход"); return 1; } public ShowPlayerLoginDialog(playerid) { new string[128]; format(string,sizeof(string), "{FF8000}Здраствуйте {01DF01}%s {FF8000}вы здесь уже зарегистрированы\n{FF8000}Пожалуйтса введите свой пароль",PInfo[playerid][Name]); ShowPlayerDialog(playerid, 350, DIALOG_STYLE_INPUT, "[Авторизация]", string, "Ок", "Выход"); return 1; } public DestroyPickupEx( p ) { DestroyPickup( p ); pickups[ p ][ creation_time ] = 0; pickups[ p ][ weapon ] = 0; pickups[ p ][ ammo ] = 0; } mktime(hourw,minutew,secondw,day,month,year) { new timestamp; timestamp = secondw; timestamp += minutew * 60; timestamp += hourw * 3600; new days_of_month[12]; if(((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) { days_of_month = {31,29,31,30,31,30,31,31,30,31,30,31}; // Schaltjahr } else { days_of_month = {31,28,31,30,31,30,31,31,30,31,30,31}; // keins } new days_this_year = 0; days_this_year = day; if(month > 1) { // No January Calculation, because its always the 0 past months for(new i=0; i 0 && weapon_slots[ i ][ 0 ] < sizeof( weapons ) && weapons[ weapon_slots[ i ][ 0 ] ] != -1 ) { used_weapon_slots ++; } else { weapon_slots[ i ][ 0 ] = 0; weapon_slots[ i ][ 1 ] = 0; } } // Create the pickups new used_weapon_slots2 = used_weapon_slots; for( new i = 0; i < WEAPON_SLOTS; i ++ ) { if( weapon_slots[ i ][ 1 ] > 0 ) { new Float:angle = 360.0 - float(used_weapon_slots--) * ( 360.0 / float(used_weapon_slots2) ); // see... if there's a pickup we create by any chance new p = CreatePickup( weapons[ weapon_slots[ i ][ 0 ] ], PICKUP_TYPE, px + floatsin(angle,degrees) * (used_weapon_slots2/2 + 1.0), py + floatcos(angle,degrees) * (used_weapon_slots2/2 + 1.0), pz ); if( p == INVALID_PICKUP ) { new lowest_time; new _id; for( new j = 0; j < MAX_PICKUPS; j ++ ) { if( pickups[ j ][ creation_time ] < lowest_time ) { lowest_time = pickups[ j ][ creation_time ]; _id = j; } } DestroyPickupEx( _id ); KillTimer( pickups[ _id ][ timer ] ); p = CreatePickup( weapons[ weapon_slots[ i ][ 0 ] ], PICKUP_TYPE, px + floatsin(angle,degrees) * (used_weapon_slots2/2 + 1.0), py + floatcos(angle,degrees) * (used_weapon_slots2/2 + 1.0), pz ); } pickups[ p ][ creation_time ] = mktime(hourw,minutew,secondw,day,month,year); pickups[ p ][ weapon ] = weapon_slots[ i ][ 0 ]; pickups[ p ][ ammo ] = weapon_slots[ i ][ 1 ]; #if MAX_DROP_AMOUNT != -1 if( pickups[ p ][ ammo ] > MAX_DROP_AMOUNT ) { pickups[ p ][ ammo ] = MAX_DROP_AMOUNT; } #endif pickups[ p ][ timer ] = SetTimerEx("DestroyPickupEx", MAX_DROP_LIFETIME * 1000, 0, "i", p); } } } public OnPlayerText(playerid, text[]) { if(GetPVarInt(playerid,"CountFlood") > gettime()) { SendClientMessage(playerid,COLOR_GREY,"[Anti-Flood]Писать в чат можно раз в 2 секунды!"); return false; } SetPVarInt(playerid,"CountFlood",gettime() + 2); if(AntiCaps(text)) { SendClientMessage(playerid, COLOR_GREY, "[Anti-Caps]Отключи Caps Lock"); return false; } if ( strfind(text,".ru",true) >= 0 || strfind(text,".ру",true) >= 0 || strfind(text,".py",true) >= 0 || strfind(text,".рy",true) >= 0 || strfind(text,".pу",true) >= 0 || strfind(text,".com",true) >= 0 || strfind(text,".сом",true) >= 0 || strfind(text,".kz",true) >= 0 || strfind(text,".кз",true) >= 0 || strfind(text,".ucoz",true) >= 0 || strfind(text,".ua",true) >= 0 || strfind(text,"http",true) >= 0 || strfind(text,"www.",true) >= 0 || strfind(text,".tk",true) >= 0 || strfind(text,".hdd1",true) >= 0 || strfind(text,".su",true) >= 0) { static name[24], str[400]; GetPlayerName(playerid,name,24); format(str,400,"{40BF99}%s [ID: %d] был замечен с рекламой сайтов",PInfo[playerid][Name],playerid); SendClientMessageToAll(COLOR_GREY,str); return false; } return true; } stock AntiCaps(const string[]) { new len = strlen(string), c = len - 1, upperChars = 0; for( ; c >= 0; c--) { switch(string[c]) { case 'A'..'Z', 'А'..'Я': upperChars++; default: continue; } } if((floatdiv(upperChars,len) * 100.0) > 75.0) return true; return false; } stock GetSquareDistance(Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2) { x1-=x2; y1-=y2; z1-=z2; x1*=x1; y1*=y1; z1*=z1; return floatround(x1+y1+z1); } stock GetPlayerSpeed(playerid) { new Float:Coord[4]; GetPlayerVelocity(playerid, Coord[0], Coord[1], Coord[2]); Coord[3] = floatsqroot(floatpower(floatabs(Coord[0]), 2.0) + floatpower(floatabs(Coord[1]), 2.0) + floatpower(floatabs(Coord[2]), 2.0)) * 213.3; return floatround(Coord[3]); } stock LoadStaticVehiclesFromFile(const filename[]) { new File:file_ptr; new line[256]; new var_from_line[64]; new vehicletype; new Float:SpawnX; new Float:SpawnY; new Float:SpawnZ; new Float:SpawnRot; new Color1, Color2; new index; new vehicles_loaded; file_ptr = fopen(filename,filemode:io_read); if(!file_ptr) return 0; vehicles_loaded = 0; while(fread(file_ptr,line,256) > 0) { index = 0; // Read type index = token_by_delim(line,var_from_line,',',index); if(index == (-1)) continue; vehicletype = strval(var_from_line); if(vehicletype < 400 || vehicletype > 611) continue; // Read X, Y, Z, Rotation index = token_by_delim(line,var_from_line,',',index+1); if(index == (-1)) continue; SpawnX = floatstr(var_from_line); index = token_by_delim(line,var_from_line,',',index+1); if(index == (-1)) continue; SpawnY = floatstr(var_from_line); index = token_by_delim(line,var_from_line,',',index+1); if(index == (-1)) continue; SpawnZ = floatstr(var_from_line); index = token_by_delim(line,var_from_line,',',index+1); if(index == (-1)) continue; SpawnRot = floatstr(var_from_line); // Read Color1, Color2 index = token_by_delim(line,var_from_line,',',index+1); if(index == (-1)) continue; Color1 = strval(var_from_line); index = token_by_delim(line,var_from_line,';',index+1); Color2 = strval(var_from_line); //printf("%d,%.2f,%.2f,%.2f,%.4f,%d,%d",vehicletype,SpawnX,SpawnY,SpawnZ,SpawnRot,Color1,Color2); AddStaticVehicleEx(vehicletype,SpawnX,SpawnY,SpawnZ,SpawnRot,Color1,Color2,(30*60)); // respawn 30 minutes /*new numplate_test[32+1]; format(numplate_test,32,"GRLC{44AA33}%d",vid); SetVehicleNumberPlate(vid, numplate_test);*/ vehicles_loaded++; } fclose(file_ptr); return vehicles_loaded; } //---------------------------------------------------------- stock strtok(const string[], &index) { new length = strlen(string); while ((index < length) && (string[index] <= ' ')) { index++; } new offset = index; new result[20]; while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; } //------------------------------------------------ stock strrest(const string[], &index) { new length = strlen(string); while ((index < length) && (string[index] <= ' ')) { index++; } new offset = index; new result[128]; while ((index < length) && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; } stock token_by_delim(const string[], return_str[], delim, start_index) { new x=0; while(string[start_index] != EOS && string[start_index] != delim) { return_str[x] = string[start_index]; x++; start_index++; } return_str[x] = EOS; if(string[start_index] == EOS) start_index = (-1); return start_index; } stock isNumeric(const string[]) { new length=strlen(string); if (length==0) return false; for (new i = 0; i < length; i++) { if ( (string[i] > '9' || string[i] < '0' && string[i]!='-' && string[i]!='+') // Not a number,'+' or '-' || (string[i]=='-' && i!=0) // A '-' but not at first. || (string[i]=='+' && i!=0) // A '+' but not at first. ) return false; } if (length==1 && (string[0]=='-' || string[0]=='+')) return false; return true; } stock IsKeyJustDown(key, newkeys, oldkeys) { if((newkeys & key) && !(oldkeys & key)) return 1; return 0; } stock PlaySoundForAll(soundid, Float:x, Float:y, Float:z) { for(new i=0; i=0 && userid < MAX_PLAYERS) { if(IsPlayerConnected(userid)) return userid; return RETURN_USER_FAILURE; } } // They entered [part of] a name or the id search failed (check names just incase) new len = strlen(text[pos]); new count = 0; new name[MAX_PLAYER_NAME+1]; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { GetPlayerName(i, name, sizeof(name)); if(strcmp(name, text[pos], true, len) == 0) // Check segment of name { if(len == strlen(name)) { // Exact match return i; } else { // Partial match count++; userid = i; } } } } if(!count) return RETURN_USER_FAILURE; if(count > 1) return RETURN_USER_MULTIPLE; return userid; } forward Others(playerid); public Others(playerid) { for(new i = 0; i < MAX_PLAYERS; i++) { armedbody_pTick[playerid] = GetTickCount(); new AnimLib[30], AnimName[30]; GetAnimationName(GetPlayerAnimationIndex(playerid), AnimLib, sizeof(AnimLib), AnimName, sizeof(AnimName)); if(GetPlayerSpeed(playerid) > 60 && strcmp(AnimLib, "SWIM", true) == 0 && strcmp(AnimName, "SWIM_crawl", true) == 0) { SendClientMessage(playerid, COLOR_LIGHTRED, "Вы были кинуты по подозрению в читерстве"); Kick(playerid); } if(GetPlayerWeapon(playerid) == WEAPON_MINIGUN) { Kick(playerid); return 0; } if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK) { Kick(playerid); return 0; } if(GetPlayerWeapon(playerid) == 44 || GetPlayerWeapon(playerid) == 45) { Kick(playerid); return 0; } } if(GetTickCount() - armedbody_pTick[playerid] > 113){ new weaponid[13],weaponammo[13],pArmedWeapon; pArmedWeapon = GetPlayerWeapon(playerid); GetPlayerWeaponData(playerid,1,weaponid[1],weaponammo[1]); GetPlayerWeaponData(playerid,2,weaponid[2],weaponammo[2]); GetPlayerWeaponData(playerid,4,weaponid[4],weaponammo[4]); GetPlayerWeaponData(playerid,5,weaponid[5],weaponammo[5]); GetPlayerWeaponData(playerid,7,weaponid[7],weaponammo[7]); if(weaponid[1] && weaponammo[1] > 0) { if(pArmedWeapon != weaponid[1]) { if(!IsPlayerAttachedObjectSlotUsed(playerid,0)) { SetPlayerAttachedObject(playerid,0,GetWeaponModel(weaponid[1]),1, 0.199999, -0.139999, 0.030000, 0.500007, -115.000000, 0.000000, 1.000000, 1.000000, 1.000000); } } else { if(IsPlayerAttachedObjectSlotUsed(playerid,0)) { RemovePlayerAttachedObject(playerid,0); } } } else if(IsPlayerAttachedObjectSlotUsed(playerid,0)) { RemovePlayerAttachedObject(playerid,0); } if(weaponid[2] && weaponammo[2] > 0) { if(pArmedWeapon != weaponid[2]) { if(!IsPlayerAttachedObjectSlotUsed(playerid,1)) { SetPlayerAttachedObject(playerid,1,GetWeaponModel(weaponid[2]),8, -0.079999, -0.039999, 0.109999, -90.100006, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000); } } else { if(IsPlayerAttachedObjectSlotUsed(playerid,1)) { RemovePlayerAttachedObject(playerid,1); } } } else if(IsPlayerAttachedObjectSlotUsed(playerid,1)) { RemovePlayerAttachedObject(playerid,1); } if(weaponid[4] && weaponammo[4] > 0) { if(pArmedWeapon != weaponid[4]) { if(!IsPlayerAttachedObjectSlotUsed(playerid,2)) { SetPlayerAttachedObject(playerid,2,GetWeaponModel(weaponid[4]),7, 0.000000, -0.100000, -0.080000, -95.000000, -10.000000, 0.000000, 1.000000, 1.000000, 1.000000); } } else { if(IsPlayerAttachedObjectSlotUsed(playerid,2)) { RemovePlayerAttachedObject(playerid,2); } } } else if(IsPlayerAttachedObjectSlotUsed(playerid,2)) { RemovePlayerAttachedObject(playerid,2); } if(weaponid[5] && weaponammo[5] > 0) { if(pArmedWeapon != weaponid[5]) { if(!IsPlayerAttachedObjectSlotUsed(playerid,3)) { SetPlayerAttachedObject(playerid,3,GetWeaponModel(weaponid[5]),1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000); } } else { if(IsPlayerAttachedObjectSlotUsed(playerid,3)) { RemovePlayerAttachedObject(playerid,3); } } } else if(IsPlayerAttachedObjectSlotUsed(playerid,3)) { RemovePlayerAttachedObject(playerid,3); } if(weaponid[7] && weaponammo[7] > 0) { if(pArmedWeapon != weaponid[7]){ if(!IsPlayerAttachedObjectSlotUsed(playerid,4)) { SetPlayerAttachedObject(playerid,4,GetWeaponModel(weaponid[7]),1,-0.100000, 0.000000, -0.100000, 84.399932, 112.000000, 10.000000, 1.099999, 1.000000, 1.000000); } } else { if(IsPlayerAttachedObjectSlotUsed(playerid,4)) { RemovePlayerAttachedObject(playerid,4); } } } else if(IsPlayerAttachedObjectSlotUsed(playerid,4)) { RemovePlayerAttachedObject(playerid,4); } } return 1; } public UpdateTimeAndWeather() { gettime(hour, minute); format(timestr,32,"%02d:%02d",hour,minute); TextDrawSetString(txtTimeDisp,timestr); SetWorldTime(hour); new x=0; while(x!=MAX_PLAYERS) { if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE) { SetPlayerTime(x,hour,minute); } x++; } } stock UpdateWorldWeather() { new next_weather_prob = random(100); if(next_weather_prob < 70) SetWeather(fine_weather_ids[random(sizeof(fine_weather_ids))]); else if(next_weather_prob < 95) SetWeather(foggy_weather_ids[random(sizeof(foggy_weather_ids))]); else SetWeather(wet_weather_ids[random(sizeof(wet_weather_ids))]); } public KickTimer(playerid) return RKick(playerid); stock RKick(playerid, time = 5000) { if(GetPVarInt(playerid, "Kick") == -1) Kick(playerid); else if(!GetPVarInt(playerid, "Kick")) SetPVarInt(playerid, "Kick", SetTimerEx("KickTimer", time, 0, "d", playerid)); else { KillTimer(GetPVarInt(playerid, "Kick")); SetPVarInt(playerid, "Kick", -1); RKick(playerid); } return 1; } //-------------------------------------------------------------------------------------------------------------------------------- CMD:pay(playerid, params[]) { new string[50]; new name[MAX_PLAYER_NAME]; if(sscanf(params, "ui", params[0], params[1])) return SendClientMessage(playerid, COLOR_WHITE, "Введите: /pay [id игрока] [сумма]"); if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid, COLOR_GREY, "Игрок не найден!"); if(params[1] > GetPlayerMoney(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Недостаточно денег"); GetPlayerName(params[0],name,sizeof(name)); format(string,sizeof(string),"Вы передали %d $ игроку %s",params[1],name); SendClientMessage(playerid,COLOR_GREEN,string); GetPlayerName(playerid,name,sizeof(name)); format(string,sizeof(string),"Вы получили %d $ от %s",params[1],name); SendClientMessage(params[0],COLOR_GREEN,string); GivePlayerMoney(playerid, -params[1]); GivePlayerMoney(params[0], params[1]); return 1; } CMD:hp(playerid,params[]) { new Float:health; GetPlayerHealth(playerid, health); if(GetPVarInt(playerid,"hp") > gettime()) return SendClientMessage(playerid, -1,"Команду можно использовать раз в минуту."); if(health >= 100.0) return SendClientMessage(playerid,COLOR_GREEN,"У тебя и так 100% HP"); if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid,COLOR_GREEN,"Тебе не хватает денег"); GivePlayerMoney(playerid , -1000); SendClientMessage(playerid,COLOR_GREEN,"HP пополенно до 100%"); SetPlayerHealth(playerid,100.0); SetPVarInt(playerid,"hp",gettime()+60); return 1; } CMD:kill(playerid,params[]) return SetPlayerHealth(playerid,0.0); CMD:gun(playerid,params[]) return ShowPlayerDialog(playerid, 7000, DIALOG_STYLE_LIST, "[Оружейная]","{40BF99}Desert Eagle\t\t\t2000$\ \n{40BF99}Shotgun\t\t\t3500$\ \n{40BF99}Combat Shotgun\t\t3500$\ \n{40BF99}SMG/Uzi\t\t\t3000$\ \n{40BF99}MP5\t\t\t\t3000$\ \n{40BF99}AK47\t\t\t\t4000$\ \n{40BF99}M4\t\t\t\t4000$\ \n{40BF99}Tec9\t\t\t\t3000$\ \n{40BF99}Country Rifle\t\t\t4500$\ \n{40BF99}Sniper Rifle\t\t\t5000$", "Выбрать", "Отмена"); CMD:pm(playerid, params[]) { new otp, message[128]; if(sscanf(params, "us", otp, message)) return SendClientMessage(playerid, 0xFFFFFFA, "{40BF99}/pm (ID) (текст)"); else if(otp == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFFFFFFA, "Игрок не подключен"); else { new string[150]; format(string, 150, "[PM от %s]: %s", PInfo[playerid][Name], message); SendClientMessage(otp, 0xCCCC00AA, string); format(string, 150, "[PM сообщение к %s]: %s", PInfo[params[0]][Name], message); SendClientMessage(playerid, 0xCCEE00AA, string); PlayerPlaySound(playerid, 1150, 0, 0, 0); PlayerPlaySound(otp, 1150, 0, 0, 0); } GameTextForPlayer(otp, "~y~PM", 1000, 1); GameTextForPlayer(playerid, "~y~PM", 1000, 1); return true; } CMD:rules(playerid, params[]) { static str[500]; strcat(str, "{006400}[!] Незнание правил не освобождает вас от ответственности\n"); strcat(str, "{FF4500}[#] Запрещено использовать читы, трейнеры, моды или любые другие способы получения нечестного превосходства над противником.\n"); strcat(str, "{FF4500}[#] Запрещен флуд в чате и в PM. Также запрещена реклама любых ресурсов (Хабы, сервера, сайты)\n"); strcat(str, "{FF4500}[#] 3апрещено убивать пешеходов из транспорта. Так же запрещено давить пешеходов транспортом (ДБ).\n"); strcat(str, "{FF4500}[#] 3апрещено злоупотребление нецензурной лексикой, и оскорбления по отношению к кому либо.\n"); strcat(str, "{FF4500}[#] Запрещено Злоупотребление игровыми возможностями для создания неудобств игрокам.\n"); strcat(str, "{FF4500}[#] Запрещена Любого рода реклама!\n"); ShowPlayerDialog(playerid, 1337, DIALOG_STYLE_MSGBOX, "[Правила сервере]", str, "Согласен", ""); return true; } CMD:colors(playerid, params[]) { ShowPlayerDialog(playerid,767,DIALOG_STYLE_LIST,"[Выбор цвета]",COLORS,"Выбрать"," Отмена"); return true; }