Open gate - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Open gate (
/showthread.php?tid=179313)
Open gate -
Scriptissue - 26.09.2010
Hello, I was trying to scrip a command that allows to close a random gate from a proper distance, and limited, meaning they have to stand right in front of the gate to open it.
I used this script :
PHP код:
#pragma tabsize 0
if(strcmp(cmdtext, "/closegate", true) == 0)
{
[B]Line 211:[/B] if(IsPlayerInRangeOfPoint(playerid, 3.0, 1588.9812011719, -1638.0415039063, 14.952730178833);
new string[50];
new movetime = MoveObject(obj, 1588.9812011719, -1638.0415039063, 14.952730178833, 2.00);
format(string, sizeof(string), "Object will finish moving in %d milliseconds", movetime);
SendClientMessage(playerid, 0xFF000000, string);
return 1;
}
And these two error messages showed up :
PHP код:
pwn(211) : error 001: expected token: ")", but found ";"
pwn(211) : error 036: empty statement
How can I solve this irritating issue ?
Re: Open gate -
Flyfishes - 26.09.2010
PHP код:
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1588.9812011719, -1638.0415039063, 14.952730178833));
That will not produce any errors
Re: Open gate -
LarzI - 26.09.2010
Why do you use PHP highlighting? o.o
Much better to use PAWN for pawn code..
Re: Open gate -
Scriptissue - 26.09.2010
Quote:
Originally Posted by Flyfishes
PHP код:
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1588.9812011719, -1638.0415039063, 14.952730178833));
That will not produce any errors
|
This reduced one error, however there is one more error left .
PHP код:
(211) : error 036: empty statement
How can I solve it ?
Re: Open gate -
LarzI - 26.09.2010
Remove the semi-colon ' ; '
And add braces..
pawn Код:
if(strcmp(cmdtext, "/closegate", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1588.9812011719, -1638.0415039063, 14.952730178833))
{
new string[50];
new movetime = MoveObject(obj, 1588.9812011719, -1638.0415039063, 14.952730178833, 2.00);
format(string, sizeof(string), "Object will finish moving in %d milliseconds", movetime);
SendClientMessage(playerid, 0xFF000000, string);
return 1;
}
}
Re: Open gate -
Scriptissue - 26.09.2010
No further warning can be seen, however when I logged into the game to check the command, when I wrote down /closegate it didn't work and said "Unknown command " .
How can this be solved ? .
Re: Open gate -
LarzI - 26.09.2010
It will return false if you're not in range of the gate..
Re: Open gate -
Scriptissue - 26.09.2010
I was standing right near the gate, touching it, and it responded as unknown command .