need help with compile error and warning
#1

can someone help me wit this ?


compile errors:

O:\samp\***\filterscripts\poorten.pwn(76) : warning 209: function "OnPlayerCommandText" should return a value
O:\samp\***\filterscripts\poorten.pwn(77) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

script

To see the lines:
http://pastebin.com/m5c053055

Код:
#include <a_samp>
//-----define------
#define FILTERSCRIPT
#define COLOR_DARKBLUE 0x0000D0FF
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_LIGHTBLUE 0xBBFFFFFF
#define COLOR_BLACK 0x000000FF
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW2 0xFFCC33FF
#define COLOR_ALLDEPT 0xFF8282AA
#if defined FILTERSCRIPT
//------new files------
new poort1;
new poort2;
new i;
//------forwardings---------
forward sluitpoort1();
forward sluitpoort2();
forward IsPlayerInArea(playerid, Float:maxx, Float:minx, Float:maxy, Float:miny);


public OnFilterScriptInit()

{
print("|__________________poorten_script_______________|");
print("|___________Created By Thomas_Walters___________|");
print("|___________________© 2009____________________|");

//---gesloten poorten---
poort1 = CreateObject(969, 2228.108887, -2209.316162, 12.713751, 0.0000, 0.0000, -45);//poort1 vooraan (gesloten)
poort2 = CreateObject(969, 2234.360352, -2215.564209, 12.713753, 0.0000, 0.0000, -45);//poort2 vooraan (gesloten)
return 1;
}


public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print(" COCA-COLA poorten_script LOADED");
}

#endif


public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/colahelp", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid, COLOR_BLACK, "__________________________________________________");
		SendClientMessage(playerid, COLOR_DARKBLUE, "|~|~|gate_Commands|~|~|");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "/COCA-COLA - This opens the COCA-COLA fabriek gate.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "/stockplaats - This opens the gate of the magazein.");
		SendClientMessage(playerid, COLOR_BLACK, "__________________________________________________");
    return 1;
	}
	if(strcmp(cmdtext,"/COCA-COLA",true)==0)//poort 1,2
	{
	if(IsPlayerInArea(i, 1588.9767,-1642.4318,12.3557,183.5738))
	{
		MoveObject(poort1,2228.108887, -2209.316162, 12.713751,3);//gesloten (poort1)
		MoveObject(poort1,2223.254883, -2204.496338, 12.713753,3);//open (poort1)
		SetTimer("sluitpoort1", 5000, 0);
		MoveObject(poort2,2234.360352, -2215.564209, 12.713753,3);//gesloten (poort2)
		MoveObject(poort2,2239.288574, -2220.468018, 12.713753,3);//open (poort2)
		SetTimer("sluitpoort2", 5000, 0);
		GameTextForPlayer(playerid, "~w~COCA-COLA gate ~g~open", 5000, 1);
		SendClientMessage(playerid, COLOR_YELLOW2,"Welcome to the COCA-COLA fabriek the Gate will Close in 5 Seconds");
   }
  }
}
  return 0;
}
)

public sluitpoort1()
{
	MoveObject(poort1,2223.254883, -2204.496338, 12.713753,3);//open
	MoveObject(poort1,2228.108887, -2209.316162, 12.713751,3);//gesloten

}
public sluitpoort2()
{
	MoveObject(poort2,2239.288574, -2220.468018, 12.713753,3);//open
	MoveObject(poort2,2234.360352, -2215.564209, 12.713753,3);//gesloten

}

public IsPlayerInArea(playerid, Float:maxx, Float:minx, Float:maxy, Float:miny)
{
	new Float:x, Float:y, Float:z;
	GetPlayerPos(playerid, x, y, z);
	if (x > minx && x < maxx && y > miny && y < maxy) return 1;
	return 0;
}
Reply
#2

it would be usefull if we knew what line it was
Reply
#3

shoud it be return 1; not return 0;?
Reply
#4

I edited the post.
you klik right now the link to see the line nummers.

Quote:

it would be usefull if we knew what line it was

done.

Quote:

shoud it be return 1; not return 0;?

if i change those i get the same error
Reply
#5

pawn Код:
#include <a_samp>
//-----define------
#define FILTERSCRIPT
#define COLOR_DARKBLUE 0x0000D0FF
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_LIGHTBLUE 0xBBFFFFFF
#define COLOR_BLACK 0x000000FF
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW2 0xFFCC33FF
#define COLOR_ALLDEPT 0xFF8282AA
#if defined FILTERSCRIPT
//------new files------
new poort1;
new poort2;
new i;
//------forwardings---------
forward sluitpoort1();
forward sluitpoort2();
forward IsPlayerInArea(playerid, Float:maxx, Float:minx, Float:maxy, Float:miny);


public OnFilterScriptInit()

{
print("|__________________poorten_script_______________|");
print("|___________Created By Thomas_Walters___________|");
print("|___________________© 2009____________________|");

//---gesloten poorten---
poort1 = CreateObject(969, 2228.108887, -2209.316162, 12.713751, 0.0000, 0.0000, -45);//poort1 vooraan (gesloten)
poort2 = CreateObject(969, 2234.360352, -2215.564209, 12.713753, 0.0000, 0.0000, -45);//poort2 vooraan (gesloten)
return 1;
}


public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print(" COCA-COLA poorten_script LOADED");
}

#endif


public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/colahelp", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, COLOR_BLACK, "__________________________________________________");
        SendClientMessage(playerid, COLOR_DARKBLUE, "|~|~|gate_Commands|~|~|");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "/COCA-COLA - This opens the COCA-COLA fabriek gate.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "/stockplaats - This opens the gate of the magazein.");
        SendClientMessage(playerid, COLOR_BLACK, "__________________________________________________");
    return 1;
    }
    if(strcmp(cmdtext,"/COCA-COLA",true)==0)//poort 1,2
    {
    if(IsPlayerInArea(i, 1588.9767,-1642.4318,12.3557,183.5738))
    {
        MoveObject(poort1,2228.108887, -2209.316162, 12.713751,3);//gesloten (poort1)
        MoveObject(poort1,2223.254883, -2204.496338, 12.713753,3);//open (poort1)
        SetTimer("sluitpoort1", 5000, 0);
        MoveObject(poort2,2234.360352, -2215.564209, 12.713753,3);//gesloten (poort2)
        MoveObject(poort2,2239.288574, -2220.468018, 12.713753,3);//open (poort2)
        SetTimer("sluitpoort2", 5000, 0);
        GameTextForPlayer(playerid, "~w~COCA-COLA gate ~g~open", 5000, 1);
        SendClientMessage(playerid, COLOR_YELLOW2,"Welcome to the COCA-COLA fabriek the Gate will Close in 5 Seconds");
   }
  }
return 1;
}
  return 0;
}


public sluitpoort1()
{
    MoveObject(poort1,2223.254883, -2204.496338, 12.713753,3);//open
    MoveObject(poort1,2228.108887, -2209.316162, 12.713751,3);//gesloten

}
public sluitpoort2()
{
    MoveObject(poort2,2239.288574, -2220.468018, 12.713753,3);//open
    MoveObject(poort2,2234.360352, -2215.564209, 12.713753,3);//gesloten

}

public IsPlayerInArea(playerid, Float:maxx, Float:minx, Float:maxy, Float:miny)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    if (x > minx && x < maxx && y > miny && y < maxy) return 1;
    return 0;
}
Try now.
Reply
#6

Quote:

Try now.

i got the same error

O:\samp\***\filterscripts\poorten.pwn(76) : warning 217: loose indentation
O:\samp\***\filterscripts\poorten.pwn(7 : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#7

no more help needen its fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)