1 error with Gates
#1

Код HTML:
#include <a_samp>

#define FILTERSCRIPT

new LSPDGate;
new hq;

public OnFilterScriptExit()
{
    return 1;
}

public OnFilterScriptInit()
{
    LSPDGate = CreateObject(3055,1588.5000000,-1637.9000200,14.6000000,0.0000000,0.0000000,0.0000000);
	hq = CreateObject(1569,245.3999900,72.5000000,1002.5999800,0.0000000,0.0000000,0.0000000);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/open", true))
    {
        if(IsPlayerInRangeOfPoint(playerid,10.0,1588.5000000,-1637.9000200,14.6000000))
        {
            MoveObject(LSPDGate,1588.5000000,-1637.9000200,19.4000000,2.0000000, 0.0, 0.0, 0.0);
            return 1;
        }
    }
    else if(!strcmp(cmdtext, "/close", true))
    {
        if(IsPlayerInRangeOfPoint(playerid,10.0,1588.5000000,-1637.9000200,14.6000000))
        {
            MoveObject(LSPDGate,1588.5000000,-1637.9000200,14.6000000,2.0000000, 0.0, 0.0, 0.0);
            return 1;
        }
        
        if(!strcmp(cmdtext, "/openhq", true))
    {
        if(IsPlayerInRangeOfPoint(playerid,10.0,244.0000000,72.5000000,1002.5999800))
        {
            MoveObject(LSPDGate,244.0000000,72.5000000,1002.5999800,2.0000000, 0.0, 0.0, 0.0);
            return 1;
        }
    }
    else if(!strcmp(cmdtext, "/closehq", true))
    {
        if(IsPlayerInRangeOfPoint(playerid,10.0,245.3999900,72.5000000,1002.5999800))
        {
            MoveObject(LSPDGate,245.3999900,72.5000000,1002.5999800,2.0000000, 0.0, 0.0, 0.0);
            return 1;
        }
    }
    return 0;
}
I get one error but cant find out what it is.
Reply
#2

Can you post the error? It's a bit hard to find a mistake if we don't have a line+error..
Reply
#3

Код HTML:
 C:\Users\Game\Desktop\Ny mappe\filterscripts\gate.pwn(46) : warning 217: loose indentation
C:\Users\Game\Desktop\Ny mappe\filterscripts\gate.pwn(54) : warning 217: loose indentation
C:\Users\Game\Desktop\Ny mappe\filterscripts\gate.pwn(56) : error 030: compound statement not closed at the end of file (started at line 22)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

Missing closing bracket after
pawn Код:
else if(!strcmp(cmdtext, "/close", true))
Reply
#5

I get the same error. Can you send the fs when you have fixed it or.
Reply
#6

pawn Код:
else if(!strcmp(cmdtext, "/close", true))
    {
        if(IsPlayerInRangeOfPoint(playerid,10.0,1588.5000000,-1637.9000200,14.6000000))
        {
            MoveObject(LSPDGate,1588.5000000,-1637.9000200,14.6000000,2.0000000, 0.0, 0.0, 0.0);
            return 1;
        }
    }    //<< Here
        if(!strcmp(cmdtext, "/openhq", true))
    {
        if(IsPlayerInRangeOfPoint(playerid,10.0,244.0000000,72.5000000,1002.5999800))
        {
            MoveObject(LSPDGate,244.0000000,72.5000000,1002.5999800,2.0000000, 0.0, 0.0, 0.0);
            return 1;
        }
    }
I won't comment about indentation
Reply
#7

pawn Код:
#include <a_samp>

#define FILTERSCRIPT

new LSPDGate;
new hq;

public OnFilterScriptExit()
{
    return 1;
}

public OnFilterScriptInit()
{
    LSPDGate = CreateObject(3055,1588.5000000,-1637.9000200,14.6000000,0.0000000,0.0000000,0.0000000);
    hq = CreateObject(1569,245.3999900,72.5000000,1002.5999800,0.0000000,0.0000000,0.0000000);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/open", true))
    {
        if(IsPlayerInRangeOfPoint(playerid,10.0,1588.5000000,-1637.9000200,14.6000000))
        {
            MoveObject(LSPDGate,1588.5000000,-1637.9000200,19.4000000,2.0000000, 0.0, 0.0, 0.0);
            return 1;
        }
    }
    if(!strcmp(cmdtext, "/close", true))
    {
        if(IsPlayerInRangeOfPoint(playerid,10.0,1588.5000000,-1637.9000200,14.6000000))
        {
            MoveObject(LSPDGate,1588.5000000,-1637.9000200,14.6000000,2.0000000, 0.0, 0.0, 0.0);
            return 1;
        }
    }
     if(!strcmp(cmdtext, "/openhq", true))
    {
        if(IsPlayerInRangeOfPoint(playerid,10.0,244.0000000,72.5000000,1002.5999800))
        {
            MoveObject(LSPDGate,244.0000000,72.5000000,1002.5999800,2.0000000, 0.0, 0.0, 0.0);
            return 1;
        }
    }
    if(!strcmp(cmdtext, "/closehq", true))
    {
        if(IsPlayerInRangeOfPoint(playerid,10.0,245.3999900,72.5000000,1002.5999800))
        {
            MoveObject(LSPDGate,245.3999900,72.5000000,1002.5999800,2.0000000, 0.0, 0.0, 0.0);
            return 1;
        }
    }
    return 0;
}
Try that, I don't know why you're using the function "else if" when it's not showing any difference between the first code and the second one.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)