Garages / Gates Help [[Got ERRORS]]
#1

The Filterscript i made

Код:
// By:Karl195
#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

new Egate;
new G1gate;
new G2gate;
new G3gate;

public OnFilterScriptInit()

{
				Egate = CreateObject(980,1812.79760742,-2072.06640625,15.33264923,0.00000000,0.00000000,270.00000000);
				return 1;

				G1gate = CreateObject(3294,1801.29541016,-2035.99865723,15.41870403,0.00000000,0.00000000,270.00000000);
				return 1;

				G2gate = CreateObject(3294,1794.21655273,-2035.96887207,15.41273212,0.00000000,0.00000000,270.00000000);
				return 1;

				G3gate = CreateObject(3294,1787.19348145,-2036.11938477,15.41094589,0.00000000,0.00000000,270.00000000);
				return 1;
}
#endif

public OnPlayerCommandText(playerid, cmdtext[]) //Main Gate command here
{
        if(strcmp("/vipopengaragegate", cmdtext, true))
        {
                MoveObject(Egate, 1812.64038086,-2064.03857422, 9, 2);
				return 1;
        }
        if(strcmp("/vipclosegaragegate", cmdtext, true))
        {
                MoveObject(Egate,1812.79760742,-2072.06640625, 15.33264923, 2);
				return 1;
        }
		return 0;
}

public OnPlayerCommandText(playerid, cmdtext[]) //Garage 1 Command here
{
        if(strcmp("/vipopengarage1", cmdtext, true))
        {
        	MoveObject(G1gate,1808.07263184, -2035.85705566, 9, 2);
			return 1;
        }
        if(strcmp("/vipclosegarage1", cmdtext, true))
        {
        	MoveObject(G1gate,1801.29541016,-2035.99865723, 15.41870403, 2);
			return 1;
        }
		return 0;
}

public OnPlayerCommandText(playerid, cmdtext[]) // Garage 2 command here
{
        if(strcmp("/vipopengarage2", cmdtext, true))
        {
                MoveObject(G2gate,1794.27233887, -2035.93017578, 9, 2);
				return 1;
        }
        if(strcmp("/vipclosegarage2", cmdtext, true))
        {
                MoveObject(G2gate,1794.21655273,-2035.96887207, 15.41273212, 2);
				return 1;
        }
		return 0;
}

public OnPlayerCommandText(playerid, cmdtext[]) // Garage 3 command here
{
        if(strcmp("/vipopengarage3", cmdtext, true))
        {
                MoveObject(G3gate,1787.35986328, -2036.01171875, 9, 2);
				return 1;
        }
        if(strcmp("/vipclosegarage3", cmdtext, true))
        {
                MoveObject(G3gate,1787.19348145,-2036.11938477, 15.41094589, 2);
				return 1;
        }
		return 0;
}
Errors / Warnings :
Код:
C:\Documents and Settings\Karl\Desktop\Garagegatestest.pwn(19) : warning 225: unreachable code
C:\Documents and Settings\Karl\Desktop\Garagegatestest.pwn(22) : warning 225: unreachable code
C:\Documents and Settings\Karl\Desktop\Garagegatestest.pwn(25) : warning 225: unreachable code
C:\Documents and Settings\Karl\Desktop\Garagegatestest.pwn(46) : error 021: symbol already defined: "OnPlayerCommandText"
C:\Documents and Settings\Karl\Desktop\Garagegatestest.pwn(61) : error 021: symbol already defined: "OnPlayerCommandText"
C:\Documents and Settings\Karl\Desktop\Garagegatestest.pwn(76) : error 021: symbol already defined: "OnPlayerCommandText"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Thanks a lot again from

Karl1195.
Reply
#2

lol delete public nplayercommandtext.. u used it 3 times too much its like this:
Onplayercommandtext(blabla)
{
ifstrcmp(/see)
bla bla bla
return 1;
}

ifstrcmp(/lol
bla bla bla
return 1;
}

see, always use 1 onplayercommandtext :P
Reply
#3

Код:
// By:Karl195
#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

new Egate;
new G1gate;
new G2gate;
new G3gate;

public OnFilterScriptInit()

{
				Egate = CreateObject(980,1812.79760742,-2072.06640625,15.33264923,0.00000000,0.00000000,270.00000000);
				return 1;

				G1gate = CreateObject(3294,1801.29541016,-2035.99865723,15.41870403,0.00000000,0.00000000,270.00000000);
				return 1;

				G2gate = CreateObject(3294,1794.21655273,-2035.96887207,15.41273212,0.00000000,0.00000000,270.00000000);
				return 1;

				G3gate = CreateObject(3294,1787.19348145,-2036.11938477,15.41094589,0.00000000,0.00000000,270.00000000);
				return 1;
}
#endif

public OnPlayerCommandText(playerid, cmdtext[]) //Main Gate command here
{
        if(strcmp("/vipopengaragegate", cmdtext, true))
        {
                MoveObject(Egate, 1812.64038086,-2064.03857422, 9, 2);
				return 1;
        }
        if(strcmp("/vipclosegaragegate", cmdtext, true))
        {
                MoveObject(Egate,1812.79760742,-2072.06640625, 15.33264923, 2);
				return 1;
        }
        if(strcmp("/vipopengarage1", cmdtext, true))
        {
        	MoveObject(G1gate,1808.07263184, -2035.85705566, 9, 2);
			return 1;
        }
        if(strcmp("/vipclosegarage1", cmdtext, true))
        {
        	MoveObject(G1gate,1801.29541016,-2035.99865723, 15.41870403, 2);
			return 1;
        }
        if(strcmp("/vipopengarage2", cmdtext, true))
        {
                MoveObject(G2gate,1794.27233887, -2035.93017578, 9, 2);
				return 1;
        }
        if(strcmp("/vipclosegarage2", cmdtext, true))
        {
                MoveObject(G2gate,1794.21655273,-2035.96887207, 15.41273212, 2);
				return 1;
        }
        if(strcmp("/vipopengarage3", cmdtext, true))
        {
                MoveObject(G3gate,1787.35986328, -2036.01171875, 9, 2);
				return 1;
        }
        if(strcmp("/vipclosegarage3", cmdtext, true))
        {
                MoveObject(G3gate,1787.19348145,-2036.11938477, 15.41094589, 2);
				return 1;
        }
		return 0;
}
I didn't tested it though,
you are doing some simple things wrong, I didn't even tried to indent your code :P, also if you get an error now delete "#end if"
Reply
#4

Thanks a lot mate do u know the problem for the warnings.. i really wanna fix them i know it's cool with them but i wanna learn ;PPP
Reply
#5

uhhm Loose indentation? or unreacheable code?
Reply
#6

unreacheable code


C:\Documents and Settings\Karl\Desktop\FS by me\GarageFS.pwn(19) : warning 225: unreachable code
C:\Documents and Settings\Karl\Desktop\FS by me\GarageFS.pwn(22) : warning 225: unreachable code
C:\Documents and Settings\Karl\Desktop\FS by me\GarageFS.pwn(25) : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Warnings.
Reply
#7

delete the retruns after the createobjects
Reply
#8

Done thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)