das unter OnPlayerCommandText
if(strcmp(cmd,"/auf1", true) == 0)
{
{
MoveObject(Tor1, 1067.599609375, 1358.099609375, 17.39999961853, 3.0);
SetTimer("CloseTor1", 5000, 0);
SendClientMessage(playerid, 0xAF0000FF,"Tor 1 offen es geht in 5 Sekunden zu!");
}
return 1;
}
if(strcmp(cmd,"/auf2", true) == 0)
{
{
MoveObject(Tor2, 1877.1999511719, 702.70001220703, 17, 3.0);
SetTimer("CloseTor2", 5000, 0);
SendClientMessage(playerid, 0xAF0000FF,"Tor 2 offen es geht in 5 Sekunden zu!");
}
return 1;
}
if(strcmp(cmd,"/auf3", true) == 0)
{
{
MoveObject(Tor3, 1976.0999755859, 702.09997558594, 17.89999961853, 3.0);
SetTimer("CloseTor3", 5000, 0);
SendClientMessage(playerid, 0xAF0000FF,"Tor 3 offen es geht in 5 Sekunden zu!");
}
return 1;
}
Das ganz oben
new Tor1;
new Tor2;
new Tor3;
Unter Ongamemodeinit:
Tor1 = CreateObject(980, 1067.599609375, 1358.099609375, 12.39999961853, 0, 0, 0);
Tor2 = CreateObject(980, 1877.1999511719, 702.70001220703, 12, 0, 0, 90);
Tor3 = CreateObject(980, 1976.0999755859, 702.09997558594, 11.89999961853, 0, 0, 90);
Ganz unten:
public CloseTor1()
{
MoveObject(Tor1, 1067.599609375, 1358.099609375, 12.39999961853, 3.0);
return 1;
}
public CloseTor2()
{
MoveObject(Tor2,1877.1999511719, 702.70001220703, 12, 3.0);
return 1;
}
public CloseTor3()
{
MoveObject(Tor3,1976.0999755859, 702.09997558594, 11.89999961853, 6, 3.0);
return 1;
}