27.09.2010, 13:17
I made a new script that allows me to open a certain gate.
Now, I want to be able use /gate twice, once to open and once to close, just to save free space, and make everything much easier.
Here is my script, seems like no warnings, but it doesn't work, it only opens one side.
Now, I want to be able use /gate twice, once to open and once to close, just to save free space, and make everything much easier.
Here is my script, seems like no warnings, but it doesn't work, it only opens one side.
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/gate", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid, 10, 1588.9812011719, -1638.0415039063, 14.952730178833))
{
MoveObject(obj, 1588.9812011719, -1638.0415039063, 7.952730178833, 2.00);
}
}
return 1;
}
else if(strcmp(cmdtext, "/gate", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid, 10, 1588.9812011719, -1638.0415039063, 14.952730178833))
{
MoveObject(obj, 1588.9812011719, -1638.0415039063, 14.952730178833, 2.00);
}
}
return 1;
}