public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp("/opengate", cmdtext, true, 10) == 0) MoveObject(gate,-293.828,1507.450,76.070,1.5000); // 1.5000 means how fast it has to open return 1; }
MoveObject(gate,-302.628,1507.450,76.070,1.500);
Originally Posted by {Awaran};
Now why are you creating ANOTHER topic?
|
Originally Posted by dclaw
i got a command for my gate:
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp("/opengate", cmdtext, true, 10) == 0) MoveObject(gate,-293.828,1507.450,76.070,1.5000); // 1.5000 means how fast it has to open return 1; } Some one can make that? Code for closing: Код:
MoveObject(gate,-302.628,1507.450,76.070,1.500); |
Originally Posted by Klutty
I think you can do it via making a timer, if I'm not totally wrong.
|
forward closegate();
public closegate()
{
MoveObject(gate,X,Y,Z, 1.5000);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/opengate", true) == 0)
{
MoveObject(gate,-293.828,1507.450,76.070,1.5000);
SetTimer("closegate", 7000, false);
return 1;
}
}
Originally Posted by CueЯvo
You need to Forward the Function closegate, so you can Make the command...
pawn Код:
pawn Код:
Once, You can make the command... You set the timer... (1000 Milliseconds = 1 Second) pawn Код:
For More Info Visit the Wiki Functions Used: MoveObject SetTimer |
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/opengate", true) == 0)
{
MoveObject(gate,-293.828,1507.450,76.070,1.5000);
SetTimerEx("closegate", 7000, false, "i", playerid);
return 1;
}
}