SA-MP Forums Archive
Need help Gate bugged? - 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)
+--- Thread: Need help Gate bugged? (/showthread.php?tid=423471)



Need help Gate bugged? - canip - 17.03.2013

Hallo i need help to find out why my gate are bugged.

Its working when i use /open but then i use /close its says " Unknown Command"

If you need more info post it...

I hope you can help me


Re: Need help Gate bugged? - Scenario - 17.03.2013

Post your commands!


Re: Need help Gate bugged? - canip - 17.03.2013

#include <a_samp>

#define FILTERSCRIPT
new LSPDGate;

public OnFilterScriptInit()
{
LSPDGate = CreateObject(3055,1588.5000000,-1637.9000200,14.6000000,0.0000000,0.0000000,0.0000 000);
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/open", true)){
if(IsPlayerInRangeOfPoint(playerid, 15000.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, 15000.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;
}
}
return 0;
}
public OnFilterScriptExit()
{
return 1;
}


But can there be a problem with sscanf or...


Re: Need help Gate bugged? - Scenario - 17.03.2013

Wrap your code in pawn tags, please! [ pawn ] [ / pawn ] (without all of the spaces)

pawn Код:
#include <a_samp>

#define FILTERSCRIPT

new LSPDGate;

public OnFilterScriptInit()
{
    LSPDGate = CreateObject(3055,1588.5000000,-1637.9000200,14.6000000,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;
        }
    }
    return 0;
}

public OnFilterScriptExit()
{
    return 1;
}
Not sure why it's returning 0. Do you have other /open or /close commands in your GM (or other FS's)?


Re: Need help Gate bugged? - canip - 17.03.2013

I have not any other /open or /close commands. But can there be a plugin or someting there blocking the FS?


Re: Need help Gate bugged? - canip - 17.03.2013

Its fixed thanks for the help. Im very happy now