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



Need help with gate. - N00bKiller - 24.05.2013

Hello guys!
I need someone to fix my gate because it cames an error:
C:\My Folders\Script Files\Test\pawno\Admin Script Pawn\SDBGS.pwn(82) : error 030: compound statement not closed at the end of file (started at line 59)

My codes:

Код:
#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

new sdcb1g1;
new sdcb1g2;
new sdcb1g3;
new GatesClosed = 0;

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("\n--------------------------------------");
    print("--------------------------------------\n");
    sdcb1g1 = CreateObject(976,-394.6000100,1741.8000500,47.1000000,0.0000000,0.0000000,66.5000000);
    sdcb1g2 = CreateObject(976,-394.5996100,1742.0000000,41.0000000,0.0000000,0.0000000,65.9950000);
    sdcb1g3 = CreateObject(976,-394.7000100,1741.9000200,44.1000000,0.0000000,0.0000000,65.7450000);
    return 1;
}

public OnFilterScriptExit()
{
        return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print("\n----------------------------------");
	print("----------------------------------\n");
}

#endif

strtok(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	}
	new offset = index;
	new result[20];
	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    new tmp[256];
    new cmd[256];
    new idx;
    cmd = strtok(cmdtext, idx);
	if (strcmp(cmd, "/sdcontactb1g1open", true) == 0)
	{
	
		MoveObject(sdcb1g1 ,-391.3999900,1749.1999500,47.1000000, 1.5);
		MoveObject(sdcb1g2 ,-391.3999900,1749.1999500,41.0000000, 1.5);
		MoveObject(sdcb1g3 ,-391.3999900,1749.1999500,44.1000000, 1.5);
		SendClientMessage(playerid,0x2C2727AA,"You have opened the base gates.");
        return 1;
	}
	
    if (strcmp(cmd, "/sdcontactb1g1close", true) == 0)
    {

		MoveObject(sdcb1g1 ,-394.6000100,1741.8000500,47.1000000, 1.5);
		MoveObject(sdcb1g2 ,-394.5996100,1742.0000000,41.0000000, 1.5);
		MoveObject(sdcb1g3 ,-394.7000100,1741.9000200,44.1000000, 1.5);
		SendClientMessage(playerid,0x2C2727AA,"You have closed the base gates.");
		return 1;
	}



Re: Need help with gate. - SilverKiller - 24.05.2013

pawn Код:
#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

new sdcb1g1;
new sdcb1g2;
new sdcb1g3;
new GatesClosed = 0;

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("\n--------------------------------------");
    print("--------------------------------------\n");
    sdcb1g1 = CreateObject(976,-394.6000100,1741.8000500,47.1000000,0.0000000,0.0000000,66.5000000);
    sdcb1g2 = CreateObject(976,-394.5996100,1742.0000000,41.0000000,0.0000000,0.0000000,65.9950000);
    sdcb1g3 = CreateObject(976,-394.7000100,1741.9000200,44.1000000,0.0000000,0.0000000,65.7450000);
    return 1;
}

public OnFilterScriptExit()
{
        return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print("\n----------------------------------");
    print("----------------------------------\n");
}

#endif

strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }
    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    new tmp[256];
    new cmd[256];
    new idx;
    cmd = strtok(cmdtext, idx);
    if (strcmp(cmd, "/sdcontactb1g1open", true) == 0)
    {
        MoveObject(sdcb1g1 ,-391.3999900,1749.1999500,47.1000000, 1.5);
        MoveObject(sdcb1g2 ,-391.3999900,1749.1999500,41.0000000, 1.5);
        MoveObject(sdcb1g3 ,-391.3999900,1749.1999500,44.1000000, 1.5);
        SendClientMessage(playerid,0x2C2727AA,"You have opened the base gates.");
        return 1;
    }
    if (strcmp(cmd, "/sdcontactb1g1close", true) == 0)
    {
        MoveObject(sdcb1g1 ,-394.6000100,1741.8000500,47.1000000, 1.5);
        MoveObject(sdcb1g2 ,-394.5996100,1742.0000000,41.0000000, 1.5);
        MoveObject(sdcb1g3 ,-394.7000100,1741.9000200,44.1000000, 1.5);
        SendClientMessage(playerid,0x2C2727AA,"You have closed the base gates.");
        return 1;
    }
    return 0;
}



Re: Need help with gate. - N00bKiller - 24.05.2013

Thank you