SpRiTe[^_^] |
Дата: Среда, 02.10.2013, 15:06 | Сообщение # 1
|
Новичок
Сообщений: 14
Статус: Offline
|
PHP код: new Text3D:entrancetext; new entrancegate, exitgate; new water1, water2, water3, water4, water5, water6, water7; new usingcarwash = -1; new unwashable[89][0] = { {403},{406},{408},{414},{417}, {423},{424},{425},{430},{431}, {432},{433},{435},{437},{441}, {443},{444},{446},{447},{448}, {452},{453},{454},{455},{456}, {457},{460},{461},{462},{463}, {464},{465},{468},{469},{471}, {472},{473},{476},{481},{484}, {485},{486},{487},{488},{493}, {497},{498},{501},{508},{509}, {510},{511},{512},{513},{514}, {515},{519},{520},{521},{522}, {523},{524},{530},{531},{532}, {539},{544},{548},{553},{556}, {557},{563},{564},{568},{571}, {572},{573},{574},{577},{578}, {581},{583},{586},{588},{592}, {593},{594},{595},{609} };
forward Autocruise(playerid, in); forward OpenExit(playerid); forward EndWash(playerid); forward Water(playerid, on);
потом ищем public OnGameModeInit() и туда вставляем entrancegate = CreateObject(17951,1911.21130371,-1780.68151855,14.15972233,0.00000000,0.00000000,90 .00000000); exitgate = CreateObject(17951,1911.21130371,-1771.97814941,14.15972233,0.00000000,0.00000000,90 .00000000); CreateObject(1250,1908.84997559,-1783.68945312,13.40625000,0.00000000,0.00000000,90 .00000000); CreatePickup(1239, 1, 1911.1886,-1784.2952,13.5, -1); entrancetext = Create3DTextLabel("Свободная автомойка.\nЦена: $5 (введите /carwash)",0x008B00FF,1911.1886,-1784.2952,14.5,50,0,1);
примерно так должен быть public public OnGameModeInit() { entrancegate = CreateObject(17951,1911.21130371,-1780.68151855,14.15972233,0.00000000,0.00000000,90 .00000000); exitgate = CreateObject(17951,1911.21130371,-1771.97814941,14.15972233,0.00000000,0.00000000,90 .00000000); CreateObject(1250,1908.84997559,-1783.68945312,13.40625000,0.00000000,0.00000000,90 .00000000); CreatePickup(1239, 1, 1911.1886,-1784.2952,13.5, -1); entrancetext = Create3DTextLabel("Свободная автомойка.\nЦена: $5 (введите /carwash)",0x008B00FF,1911.1886,-1784.2952,14.5,50,0,1); return 1; }
Потом ищем public OnGameModeExit() и туда вставляем
примерно так должен быть public: public OnGameModeExit() { DestroyObject(entrancegate); DestroyObject(exitgate); DestroyObject(3); DestroyPickup(1); Delete3DTextLabel(entrancetext); for(new i = 0; i < MAX_PLAYERS; i++) { if(GetPlayerVehicleID(i) == GetPlayerVehicleID(usingcarwash)) { DestroyPlayerObject(i, water1); DestroyPlayerObject(i, water2); DestroyPlayerObject(i, water3); DestroyPlayerObject(i, water4); DestroyPlayerObject(i, water5); DestroyPlayerObject(i, water6); DestroyPlayerObject(i, water7); TogglePlayerControllable(i, 1); SetCameraBehindPlayer(i); } } return 1; } [/spoler] Потом ищем public OnPlayerDisconnect и туда вставляем [spoiler]if(usingcarwash == playerid) { SetVehicleToRespawn(GetPlayerVehicleID(playerid)); usingcarwash = -1; Update3DTextLabelText(entrancetext, 0x008B00FF, "Свободная автомойка.\nЦена: $5 (введите /carwash)"); }
public:
Потом ищем public OnPlayerDeath и туда вставляем:
public: public OnPlayerDeath(playerid, killerid, reason) { if(usingcarwash == playerid) { SetVehicleToRespawn(GetPlayerVehicleID(playerid)); usingcarwash = -1; Update3DTextLabelText(entrancetext, 0x008B00FF, "Свободная автомойка.\nЦена: $5 (введите /carwash)"); } return 1; } [/spolier] public OnPlayerCommandText [spoiler] if (strcmp("/carwash", cmdtext, true) == 0) { if(IsPlayerInRangeOfPoint(playerid, 5, 1911.1886,-1784.2952,13.0801)) { if(IsPlayerInAnyVehicle(playerid)) { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { for(new x = 0; x < sizeof(unwashable); x++) { if(GetVehicleModel(GetPlayerVehicleID(playerid)) == unwashable[x][0]) { SendClientMessage(playerid, 0xAA3333AA, "Вы не можете помыть эту машину."); return 1; } } if(GetPlayerMoney(playerid) > 4) { if(usingcarwash == -1) { GivePlayerMoney(playerid, -5); usingcarwash = playerid; Update3DTextLabelText(entrancetext, 0xB0171FFF, "Автомойка занята.\n Подождите..."); for(new i = 0; i < MAX_PLAYERS; i++) { if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) { TogglePlayerControllable(i, 0); SetPlayerCameraPos(i,1907.8804,-1790.0590,15); SetPlayerCameraLookAt(i,1911.0471,-1781.6868,13.3828); } if(GetPlayerSurfingVehicleID(i) == GetPlayerVehicleID(playerid)) { SetPlayerPos(i,1906.9204,-1786.0435,13.5469); SetPlayerFacingAngle(i, 270); } } SetVehiclePos(GetPlayerVehicleID(playerid), 1911.1886, -1784.2952, 13.0801); SetVehicleZAngle(GetPlayerVehicleID(playerid), 0); MoveObject(entrancegate, 1911.21130371, -1780.68151855, 10.50000000, 1); SetTimerEx("Autocruise",3500,0,"ii",playerid, 1); } else { SendClientMessage(playerid, 0xAA3333AA, "Вы не можете что ли подождать? Автомойка занята!"); } } else { SendClientMessage(playerid, 0xAA3333AA, "У тебя нет денег!"); } } else { SendClientMessage(playerid, 0xAA3333AA, "Ты не за рулём!"); } } else { SendClientMessage(playerid, 0xAA3333AA, "Ты не в авто!"); } } else { SendClientMessage(playerid, 0xAA3333AA, "Вы не на автомойке!"); } return 1; } Потом в любое место вставляем функции public Autocruise(playerid, in) { new Float:vehx, Float:vehy, Float:vehz; GetVehiclePos(GetPlayerVehicleID(playerid), vehx, vehy, vehz); if(in == 1) { if(-1777 < vehy) { for(new i = 0; i < MAX_PLAYERS; i++) { if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) { SetPlayerCameraPos(i,1910.4637,-1771.8,15); SetPlayerCameraLookAt(i,1911.2863,-1775.1614,13.3828); } } SetVehicleZAngle(GetPlayerVehicleID(playerid), 0); TogglePlayerControllable(playerid, 0); MoveObject(entrancegate, 1911.21130371, -1780.68151855, 14.15972233, 1); SetTimerEx("Water",4000,0,"ii",playerid, 1); } else { if(vehx != 1911.1886) { SetVehiclePos(GetPlayerVehicleID(playerid), 1911.1886, vehy, vehz); SetVehicleZAngle(GetPlayerVehicleID(playerid), 0); } TogglePlayerControllable(playerid, 1); SetVehicleVelocity(GetPlayerVehicleID(playerid), 0, 0.1, 0); SetTimerEx("Autocruise",100,0,"ii",playerid, 1); } } else { if(-1768 < vehy) { SetVehicleZAngle(GetPlayerVehicleID(playerid), 0); TogglePlayerControllable(playerid, 0); MoveObject(exitgate, 1911.21130371,-1771.97814941,14.15972233, 1); SetTimerEx("EndWash",1000,0,"i",playerid); } else { if(vehx != 1911.1886) { SetVehiclePos(GetPlayerVehicleID(playerid), 1911.1886, vehy, vehz); SetVehicleZAngle(GetPlayerVehicleID(playerid), 0); } TogglePlayerControllable(playerid, 1); SetVehicleVelocity(GetPlayerVehicleID(playerid), 0, 0.1, 0); SetTimerEx("Autocruise",100,0,"ii",playerid, 0); } } return 1; }
public Water(playerid, on) { if(on == 0) { for(new i = 0; i < MAX_PLAYERS; i++) { if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) { DestroyPlayerObject(i, water1); DestroyPlayerObject(i, water2); DestroyPlayerObject(i, water3); DestroyPlayerObject(i, water4); DestroyPlayerObject(i, water5); DestroyPlayerObject(i, water6); DestroyPlayerObject(i, water7); SetTimerEx("OpenExit",500,0,"i",playerid); } } } else { for(new i = 0; i < MAX_PLAYERS; i++) { if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) { water1 = CreatePlayerObject(i, 18747, 1911, -1776, 10, 0, 0, 90); water2 = CreatePlayerObject(i, 18747, 1914, -1776, 10, 0, 0, 90); water3 = CreatePlayerObject(i, 18739, 1910.1821, -1777.8997, 25, 0, 180, 0); water4 = CreatePlayerObject(i, 18739, 1910.1821, -1774.8132, 25, 0, 180, 0); water5 = CreatePlayerObject(i, 18739, 1912.1490, -1774.8132, 25, 0, 180, 0); water6 = CreatePlayerObject(i, 18739, 1912.1490, -1777.8997, 25, 0, 180, 0); water7 = CreatePlayerObject(i, 18739, 1911.2194, -1776.5117, 25, 0, 180, 0); SetTimerEx("Water",15000,0,"ii",playerid, 0); } } } return 1; }
public OpenExit(playerid) { for(new i = 0; i < MAX_PLAYERS; i++) { if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) { SetPlayerCameraPos(i,1909.0697,-1760.7429,15); SetPlayerCameraLookAt(i,1911.2600,-1771.5955,13.3828); } } MoveObject(exitgate, 1911.21130371, -1771.97814941, 10.50000000, 1); SetTimerEx("Autocruise",3500,0,"ii",playerid, 0); return 1; }
public EndWash(playerid) { for(new i = 0; i < MAX_PLAYERS; i++) { if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) { TogglePlayerControllable(i, 1); SetCameraBehindPlayer(i); } } usingcarwash = -1; Update3DTextLabelText(entrancetext, 0x008B00FF, "Свободная автомойка.\nЦена: $5 (введите /carwash)"); return 1; }
Сообщение отредактировал SpRiTe[^_^] - Среда, 02.10.2013, 15:08 |
|
|
|