Dangerous | Дата: Пятница, 28.12.2007, 12:52 | Сообщение # 1 |
Новенький
Группа:
Продвинутые
Сообщений: 32
Награды: 2
Город: Астрахань
Репутация: 13
Замечания: 20%
Статус:
| Code Кому интересно как добавить заправки:
forward isPlayerInArea(playerID, Float:data[4]);
#define MAX_POINTS 17 //(Relevant code!)
//Coordinate check var (Relevant code!) new Float:checkCoords[MAX_POINTS][4] = { //{1903.7,-1795.8,1955.6,-1759.5,12.5,15.5}, {1705.4,-2444.7,1750.4,-2400.7}, {2098.1316,901.7380,2137.7456,963.0146}, {2617.5967,1062.8710 ,2656.6526,1142.5109}, {501.7475,1626.7821,653.2095,1774.1093}, {-1351.2833,2638.8943,-1265.1661,2738.6450}, {-2450.3767,949.5080,-2400.8 530,1069.8329}, {-1715.5112,349.5567,-1658.8451,458.3686}, {-2265.3027,-2586.3762,-2219.1868,-2558.2539}, {-1657.4102,-2763.3518,-1501.53 03,-2666.7454}, {1903.7450,-1795.7990,1955.5667,-1759.5187}, {-135.2077,-1199.8291,-43.7008,-1134.7999}, {1336.7378,454.7961,1430.0760,48 3.9776}, {648.2494,-592.9003,670.9278,-540.8264}, {-1494.2593,1854.1290,-1449.4076,1885.2032}, {2097.0452,2708.1218,2172.7161,2762.7495}, {2187.6587,2462.8057,2215.5042,2495.0332}, {1577.7729,2182.5112,1616.5842,2242.3628} }; new Float:mapicons[MAX_POINTS][3] = { //{1939.3,-1767.6,13.2}, {1725.4,-2414.7,13.5}, {2109.2126,917.5845,10.8203}, {2640.1831,1103.9224,10.8203}, {611.8934,1694.7921,6.7193}, { -1327.5398,2682.9771,49.7896}, {-2413.7427,975.9317,45.0031}, {-1672.3597,414.2950,6.8866,}, {-2244.1365,-2560.6294,31.6276}, {-1603.016 6,-2709.3589,48.2419}, {1939.3275,-1767.6813,13.2787}, {-94.7651,-1174.8079,1.9979}, {1381.6699,462.6467,19.8540}, {657.8167,-559.6507,1 6.0630}, {-1478.2916,1862.8318,32.3617}, {2147.3054,2744.9377,10.5263}, {2204.9602,2480.3494,10.5278}, {1590.9493,2202.2637,10.5247} };
public OnPlayerSpawn(playerid) { if (gdebug >=1){printf("OnPlayerSpawn Playerid:%d", playerid);} SetPlayerMapIcon(playerid,1,mapicons[0][0],mapicons[0][1],mapicons[0][2],55,COLOR_RED); SetPlayerMapIcon(playerid,2,mapicons[1][0],mapicons[1][1],mapicons[1][2],55,COLOR_RED); SetPlayerMapIcon(playerid,3,1481.108154,-1767.629516,18.795755,52,COLOR_RED); SetPlayerMapIcon(playerid,4,1352.320556,-1756.388427,13.507812,25,COLOR_RED); SetPlayerMapIcon(playerid,5,1834.466552,-1682.079467,13.430337,49,COLOR_RED); SetPlayerMapIcon(playerid,6,2771.041259,-2437.491455,13.648437,51,COLOR_RED); SetPlayerMapIcon(playerid,7,mapicons[2][0],mapicons[2][1],mapicons[2][2],55,COLOR_RED); SetPlayerMapIcon(playerid,8,mapicons[3][0],mapicons[3][1],mapicons[3][2],55,COLOR_RED); SetPlayerMapIcon(playerid,9,mapicons[4][0],mapicons[4][1],mapicons[4][2],55,COLOR_RED); SetPlayerMapIcon(playerid,10,mapicons[5][0],mapicons[5][1],mapicons[5][2],55,COLOR_RED); SetPlayerMapIcon(playerid,11,mapicons[6][0],mapicons[6][1],mapicons[6][2],55,COLOR_RED); SetPlayerMapIcon(playerid,12,mapicons[7][0],mapicons[7][1],mapicons[7][2],55,COLOR_RED); SetPlayerMapIcon(playerid,13,mapicons[8][0],mapicons[8][1],mapicons[8][2],55,COLOR_RED); SetPlayerMapIcon(playerid,14,mapicons[9][0],mapicons[9][1],mapicons[9][2],55,COLOR_RED); SetPlayerMapIcon(playerid,15,mapicons[10][0],mapicons[10][1],mapicons[10][2],55,COLOR_RED); SetPlayerMapIcon(playerid,16,mapicons[11][0],mapicons[11][1],mapicons[11][2],55,COLOR_RED); SetPlayerMapIcon(playerid,17,mapicons[12][0],mapicons[12][1],mapicons[12][2],55,COLOR_RED); SetPlayerMapIcon(playerid,18,mapicons[13][0],mapicons[13][1],mapicons[13][2],55,COLOR_RED); SetPlayerMapIcon(playerid,19,mapicons[13][0],mapicons[14][1],mapicons[14][2],55,COLOR_RED); SetPlayerMapIcon(playerid,20,mapicons[15][0],mapicons[15][1],mapicons[15][2],55,COLOR_RED); SetPlayerMapIcon(playerid,21,mapicons[16][0],mapicons[16][1],mapicons[16][2],55,COLOR_RED); if (teamcarlock) {
public isPlayerInArea(playerID, Float:data[4]) { new Float:X, Float:Y, Float:Z; GetPlayerPos(playerID, X, Y, Z); if(X >= data[0] && X <= data[2] && Y >= data[1] && Y <= data[3]) // if(X >= data[0] && X <= data[2] && Y >= data[1] && Y <= data[3] && Z >= data[4] && Z <= data[5]) { return 1; } return 0; } В игре становится 17 заправочных станций. Если кто-то после длинной гонки застрянет в другом городе то ему можно будет заправиться и поехать домой
|
|
|
|