SA-MP Forums Archive
gates: all the time same warning but why? - 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: gates: all the time same warning but why? (/showthread.php?tid=343919)



gates: all the time same warning but why? - kepa333 - 19.05.2012

My Code:

Code:
#include <a_samp>
new Gate1a;
forward close();

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" wiz wrate");
	print("--------------------------------------\n");
 	Gate1a = CreateObject(971,321.10000610,-1188.59997559,76.30000305,0.00000000,0.00000000,38.00000000)
  	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/wiz", cmdtext, true, 10) == 0)
	{
       	MoveObject(Gate1a,316.20001221, -1192.45495605, 76.30000305, 10.00);
       	SetTimer("close", 5000, 0);
       	SendClientMessage(playerid,0xFF0000FF,"You are opening a Gate, and will be closed automaticly..");
 	return 1;
	}
	return 0;
}

public close()
{
    MoveObject(Gate1a,321.10000610, -1188.59997559, 76.30000305 10.00);
    return 1;
}

#endif
EROR CODE:
Code:
C:\Users\MaticKepa\Desktop\WIZ WRATA.pwn(39) : warning 203: symbol is never used: "Gate1a"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.



Re: gates: all the time same warning but why? - MechaTech - 19.05.2012

Quote:
Originally Posted by kepa333
View Post
My Code:

Code:
#include <a_samp>
new Gate1a;
forward close();

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" wiz wrate");
	print("--------------------------------------\n");
 	Gate1a = CreateObject(971,321.10000610,-1188.59997559,76.30000305,0.00000000,0.00000000,38.00000000)
  	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/wiz", cmdtext, true, 10) == 0)
	{
       	MoveObject(Gate1a,316.20001221, -1192.45495605, 76.30000305, 10.00);
       	SetTimer("close", 5000, 0);
       	SendClientMessage(playerid,0xFF0000FF,"You are opening a Gate, and will be closed automaticly..");
 	return 1;
	}
	return 0;
}

public close()
{
    MoveObject(Gate1a,321.10000610, -1188.59997559, 76.30000305 10.00);
    return 1;
}

#endif
EROR CODE:
Code:
C:\Users\MaticKepa\Desktop\WIZ WRATA.pwn(39) : warning 203: symbol is never used: "Gate1a"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
EDIT: srry didn't say gtae1a


Re: gates: all the time same warning but why? - kepa333 - 19.05.2012

any one?


Re: gates: all the time same warning but why? - JAMMIEISFTW - 19.05.2012

Warnings Are Fine, its errors you need to look out for. First, is the script working ingame? If it isnt, reply.


Re: gates: all the time same warning but why? - Jochemd - 19.05.2012

Quote:
Originally Posted by JAMMIEISFTW
View Post
Warnings Are Fine, its errors you need to look out for. First, is the script working ingame? If it isnt, reply.
That's rubbish advice! Of course warnings are not fine.

You forgot to #define FILTERSCRIPT at the top of your script.


Re: gates: all the time same warning but why? - JAMMIEISFTW - 19.05.2012

Joch, I saw it wasn't a serious warning, if it was working correctly, it's fine, correct?


Re: gates: all the time same warning but why? - Flake. - 19.05.2012

use
pawn Code:
#pragma unused Gate1a



Re: gates: all the time same warning but why? - Jochemd - 19.05.2012

Quote:
Originally Posted by (*|Flake|*)
View Post
use
pawn Code:
#pragma unused Gate1a
Wrong! I gave the right solution to be honest.

And @ JAMMIEISFTW - if it gives a warning, there is something wrong which should be fixed.


Re: gates: all the time same warning but why? - Vince - 19.05.2012

Quote:
Originally Posted by Jochemd
View Post
Wrong! I gave the right solution to be honest.
Indeed.

Quote:
Originally Posted by Jochemd
View Post
You forgot to #define FILTERSCRIPT at the top of your script.
Either that, or remove the preprocessor directives altogether (lines that start with #).


Re: gates: all the time same warning but why? - Jochemd - 19.05.2012

Quote:
Originally Posted by Vince
View Post
Either that, or remove the preprocessor directives altogether (lines that start with #).
Actually you shouldn't do that to - there are certain includes which check if a script is a filterscript by using "#if defined FILTERSCRIPT". The directives SHOULD be used, although not many people realise it.