filmov
tv
PAWN - Commands - Команды и Динамические Объекты - SAMP
Показать описание
//шлагбаум
#define COLOR_GREEN 0x33AA33AA
new pdgateLS;
forward GateCloseLS();
---------------------------------------------------------------
public OnGameModeInit()
---------------------------------------------------------------
CreateVehicle(510,1733.9532,-1894.2675,13.5619,356.8764,99,99,300);
pdgateLS = CreateObject (968,1544.69995117, -1630.80004883,13.10000038,0.00000000,270.00000000,270.00000000);
Create3DTextLabel("Ведите /lspd чтоб открыть шлагбаум.",COLOR_GREEN,1544.0743,-1626.6862,13.3828,50.0,0,1);
---------------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
---------------------------------------------------------------
if (strcmp (cmdtext, "/lspd", true) == 0) // команда для открытия шлагбаума
{
MoveObject (pdgateLS, 1544.69921875,-1630.79980469,13.10000038+0.004, 0.004, 0.00000000,0.00000000,270.00000000);
SetTimer ("GateCloseLS", 7000, 0); // таймер (7 сек)
SendClientMessage (playerid, COLOR_YELLOW, "Шлагбаум открыт"); // сообщение игроку
return 1;
}
----------------------------------------------------------------
public GateCloseLS()
{
MoveObject (pdgateLS,1544.69995117,-1630.80004883,13.10000038-0.004,0.004,0.00000000,270.00000000,270.00000000);
return 1;
}
----------------------------------------------------------------
//ворота
new pdgategar = 0;
new pdgaragegateobj;
----------------------------------------------------------------
public OnGameModeInit()
----------------------------------------------------------------
Create3DTextLabel("Ведите /Gate чтоб открыть ворота.",COLOR_GREEN,1588.5811,-1637.5585,13.4297,50.0,0,1);
pdgaragegateobj = CreateObject(971, 1588.965698, -1637.882690, 15.260185, 0.0000, 0.0000, 180.0000);
----------------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
----------------------------------------------------------------
if(strcmp(cmdtext, "/gate", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,9,1588.3058,-1637.9652,13.4227))
{
if(pdgategar==0)
{
pdgategar = 1;
MoveObject(pdgaragegateobj, 1588.965698, -1637.882690, 7.710285, 1.50);
return 1;
}
else if(pdgategar==1)
{
pdgategar = 0;
MoveObject(pdgaragegateobj, 1588.965698, -1637.882690, 15.260185, 1.50);
return 1;
}
}
#define COLOR_GREEN 0x33AA33AA
new pdgateLS;
forward GateCloseLS();
---------------------------------------------------------------
public OnGameModeInit()
---------------------------------------------------------------
CreateVehicle(510,1733.9532,-1894.2675,13.5619,356.8764,99,99,300);
pdgateLS = CreateObject (968,1544.69995117, -1630.80004883,13.10000038,0.00000000,270.00000000,270.00000000);
Create3DTextLabel("Ведите /lspd чтоб открыть шлагбаум.",COLOR_GREEN,1544.0743,-1626.6862,13.3828,50.0,0,1);
---------------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
---------------------------------------------------------------
if (strcmp (cmdtext, "/lspd", true) == 0) // команда для открытия шлагбаума
{
MoveObject (pdgateLS, 1544.69921875,-1630.79980469,13.10000038+0.004, 0.004, 0.00000000,0.00000000,270.00000000);
SetTimer ("GateCloseLS", 7000, 0); // таймер (7 сек)
SendClientMessage (playerid, COLOR_YELLOW, "Шлагбаум открыт"); // сообщение игроку
return 1;
}
----------------------------------------------------------------
public GateCloseLS()
{
MoveObject (pdgateLS,1544.69995117,-1630.80004883,13.10000038-0.004,0.004,0.00000000,270.00000000,270.00000000);
return 1;
}
----------------------------------------------------------------
//ворота
new pdgategar = 0;
new pdgaragegateobj;
----------------------------------------------------------------
public OnGameModeInit()
----------------------------------------------------------------
Create3DTextLabel("Ведите /Gate чтоб открыть ворота.",COLOR_GREEN,1588.5811,-1637.5585,13.4297,50.0,0,1);
pdgaragegateobj = CreateObject(971, 1588.965698, -1637.882690, 15.260185, 0.0000, 0.0000, 180.0000);
----------------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
----------------------------------------------------------------
if(strcmp(cmdtext, "/gate", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,9,1588.3058,-1637.9652,13.4227))
{
if(pdgategar==0)
{
pdgategar = 1;
MoveObject(pdgaragegateobj, 1588.965698, -1637.882690, 7.710285, 1.50);
return 1;
}
else if(pdgategar==1)
{
pdgategar = 0;
MoveObject(pdgaragegateobj, 1588.965698, -1637.882690, 15.260185, 1.50);
return 1;
}
}
Комментарии