SA-MP Forums Archive
help with a .inc from seif - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help with a .inc from seif (/showthread.php?tid=97694)



help with a .inc from seif - [SOB]Chris - 16.09.2009

the inc is this
Код:
/*x---------------------------------Important-------------------------------------x*/
//**INCLUDES**//
#include <a_samp>
/*x---------------------------------Defining-------------------------------------x*/
//**VARIABLES**//
new pos1;
new pos2;
new Text:Text[100];
new gametextdrawforplayer;
new gametextdraw;
//**FORWARDS**//
forward GameTextRemoval(textid);
//**NATIVES**//
/*
native DisplayTextForPlayer(playerid, text[], time, font);
native DisplayTextForAll(text[], time, font);
*/
/*x---------------------------------CallBacks-------------------------------------x*/
stock DisplayTextForPlayer(playerid, text[], time, font, pos1, pos2) // Max Fonts: 3(0-3)  <->  Max Styles: 4(1-4)
{
	if (gametextdrawforplayer >= 99) gametextdrawforplayer = 0;
	gametextdrawforplayer++;
	Text[gametextdrawforplayer] = TextDrawCreate(pos1,pos2,text);
	TextDrawAlignment(Text[gametextdrawforplayer],2);
	TextDrawBackgroundColor(Text[gametextdrawforplayer],0x000000ff);
	TextDrawFont(Text[gametextdrawforplayer],font);
	TextDrawLetterSize(Text[gametextdrawforplayer],0.600000,2.400000);
	TextDrawColor(Text[gametextdrawforplayer],0xffffffff);
	TextDrawSetOutline(Text[gametextdrawforplayer],1);
	TextDrawSetProportional(Text[gametextdrawforplayer],1);
	TextDrawSetShadow(Text[gametextdrawforplayer],1);
	TextDrawShowForPlayer(playerid,Text[gametextdrawforplayer]);
	SetTimerEx("GameTextRemoval",time*1000,false,"d",gametextdrawforplayer);
}

stock DisplayTextForAll(text[], time, font, pos1, pos2) // Max Fonts: 3(0-3)  <->  Max Styles: 4(1-4)
{
	if (gametextdraw >= 99) gametextdraw = 0;
	Text[gametextdraw] = TextDrawCreate(pos1, pos2,text);
	TextDrawAlignment(Text[gametextdraw],2);
	TextDrawBackgroundColor(Text[gametextdraw],0x000000ff);
	TextDrawFont(Text[gametextdraw],font);
	TextDrawLetterSize(Text[gametextdraw],0.600000,2.400000);
	TextDrawColor(Text[gametextdraw],0xffffffff);
	TextDrawSetOutline(Text[gametextdraw],1);
	TextDrawSetProportional(Text[gametextdraw],1);
	TextDrawSetShadow(Text[gametextdraw],1);
	TextDrawShowForAll(Text[gametextdraw]);
	SetTimerEx("GameTextRemoval",time*1000,false,"d",gametextdraw);
}

public GameTextRemoval(textid)
{
	TextDrawDestroy(Text[textid]);
	return true;
}
i mod the .inc for can modify the x and y of the text drawns but when i compile show this error
Quote:
Originally Posted by error
seif_text.inc(19) : warning 219: local variable "pos1" shadows a variable at a preceding level
seif_text.inc(19) : warning 219: local variable "pos2" shadows a variable at a preceding level
seif_text.inc(36) : warning 219: local variable "pos1" shadows a variable at a preceding level
seif_text.inc(36) : warning 219: local variable "pos2" shadows a variable at a preceding level
ChrisDM.pwn(554) : warning 203: symbol is never used: "pos1"
ChrisDM.pwn(554) : warning 203: symbol is never used: "pos2"
i added the variables pos1 pos2 but why dont work?.


Re: help with a .inc from seif - Chaprnks - 16.09.2009

Somewhere else in your script (other inc or gamemode) uses that same variable "pos1,pos2". Interfering them, try renaming it.


Re: help with a .inc from seif - Peter_Corneile - 16.09.2009

Quote:

seif_text.inc(19) : warning 219: local variable "pos1" shadows a variable at a preceding level
seif_text.inc(19) : warning 219: local variable "pos2" shadows a variable at a preceding level
seif_text.inc(36) : warning 219: local variable "pos1" shadows a variable at a preceding level
seif_text.inc(36) : warning 219: local variable "pos2" shadows a variable at a preceding level

These errors mean that you have defined pos1 globally but they dont need to be

Quote:

ChrisDM.pwn(554) : warning 203: symbol is never used: "pos1"
ChrisDM.pwn(554) : warning 203: symbol is never used: "pos2"

This means that after defining them , you have not even used them


Re: help with a .inc from seif - [SOB]Chris - 16.09.2009

so i dont need put this?? how i fix that?
Quote:
new pos1
new pos2




Re: help with a .inc from seif - _Vortex - 16.09.2009

Just post in Seif's topic about your problem.


Re: help with a .inc from seif - [SOB]Chris - 16.09.2009

Quote:
Originally Posted by [B
Vortex ]
Just post in Seif's topic about your problem.
D= Man the dude Peter Corneile have reason, only delete the new pos1 xD
helpme in the down topic


Re: help with a .inc from seif - Jakku - 16.09.2009

Maybe you have defined those "pos1 etc.." twice?


Re: help with a .inc from seif - Peter_Corneile - 16.09.2009

I think that pos1 is defined in the include file and you defined it in the script too ?


Re: help with a .inc from seif - Clavius - 16.09.2009

Ctrl + H (Replace) and search for pos1 and replace them with position1 or something. Do the same for pos2, in you script, ofc.