29.05.2010, 14:05
PHP код:
new PDGate1;
new PDGate2;
PHP код:
public OnGameModeInit()
{ PDGate1 =CreateObject(971, 2334.970947, 2443.327393, 8.078720, 0.0000, 0.0000, 239.6789);
PDGate2 =CreateObject(971, 2294.079346, 2499.256592, 5.468350, 0.0000, 0.0000, 269.7591);}
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/gatedown", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 2294.079346, 2499.256592, 5.468350))
{
SendClientMessage(playerid, 0xAA3333AA, "Your gate is open");
MoveObject(PDGate2, 2334.962891, 2443.288574, 0.264874, 2.5);
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "Your remote control does not get the signal");
}
return 1;
}
//
if(strcmp(cmdtext, "/gateup", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 20.0, 2294.079346, 2499.256592, 5.468350))
{
SendClientMessage(playerid, 0xAA3333AA, "Your gate is closed");
MoveObject(PDGate2, 2294.079346, 2499.256592, 5.468350, 3.0);
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "Your remote control does not get the signal");
return 1;
}
}
if(strcmp(cmdtext, "/gatedown", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 20.0, 2334.970947, 2443.327393, 8.078720))
{
SendClientMessage(playerid, 0xAA3333AA, "Your gate is open");
MoveObject(PDGate1, 2334.962891, 2443.288574, 0.264874, 2.5);
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "Your remote control does not get the signal");
}
return 1;
}
//
if(strcmp(cmdtext, "/gateup", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 20.0, 2334.970947, 2443.327393, 8.078720))
{
SendClientMessage(playerid, 0xAA3333AA, "Your gate is closed");
MoveObject(PDGate1, 2334.970947, 2443.327393, 8.078720, 3.0);
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "Your remote control does not get the signal");
}
return 1;
}
}