Open gate
#1

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(playerid3.01588.9812011719, -1638.041503906314.952730178833);
        new 
string[50];
        new 
movetime MoveObject(obj1588.9812011719, -1638.041503906314.9527301788332.00);
        
format(stringsizeof(string), "Object will finish moving in %d milliseconds"movetime);
        
SendClientMessage(playerid0xFF000000string);
        return 
1;
    } 
And these two error messages showed up :
PHP код:
pwn(211) : error 001expected token")"but found ";"
pwn(211) : error 036: empty statement 
How can I solve this irritating issue ?
Reply
#2

PHP код:
if(IsPlayerInRangeOfPoint(playerid3.01588.9812011719, -1638.041503906314.952730178833)); 
That will not produce any errors
Reply
#3

Why do you use PHP highlighting? o.o
Much better to use PAWN for pawn code..
Reply
#4

Quote:
Originally Posted by Flyfishes
Посмотреть сообщение
PHP код:
if(IsPlayerInRangeOfPoint(playerid3.01588.9812011719, -1638.041503906314.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 ?
Reply
#5

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;
        }
    }
Reply
#6

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 ? .
Reply
#7

It will return false if you're not in range of the gate..
Reply
#8

I was standing right near the gate, touching it, and it responded as unknown command .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)