SA-MP Forums Archive
Pawn compiler output - 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: Pawn compiler output (/showthread.php?tid=83799)



Pawn compiler output - gytisx - 27.06.2009

hi,

now i change my script and I have this....

Код:
Header size:      2304 bytes
Code size:      42360 bytes
Data size:      48320 bytes
Stack/heap size:   16384 bytes; estimated max. usage=25812 cells (103248 bytes)
Total requirements: 109368 bytes
What I should do?

This is good string?

Код:
new DriftClockStr[MAX_PLAYERS][128];



Re: Pawn compiler output - mamorunl - 27.06.2009

This is a warning that the compiler generates if you use a lot of memory. You should consider changing the variable sizes and such to decrease the use of memory


Re: Pawn compiler output - gytisx - 27.06.2009

Quote:
Originally Posted by [NT
mamoru ]
This is a warning that the compiler generates if you use a lot of memory. You should consider changing the variable sizes and such to decrease the use of memory
This is code:

Код:
//==============================================================================
public Driftas(playerid)
{
	if(driftInfo[playerid][DriftCount] < 1)
	{
		GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ GO! ~g~-",1000,3);
		TogglePlayerControllable(playerid,1);
		driftInfo[playerid][DriftCp][0] = SetPlayerRaceCheckpoint(playerid,2,-302.0554,1511.0476,75.0219,0.0,0.0,0.0,10); // finish
		driftInfo[playerid][DriftCount] = 4;
		KillTimer(driftInfo[playerid][DriftoTimer]);
		driftInfo[playerid][DriftoClockTimer] = SetTimerEx("DriftoClock",1000,true,"d",playerid);
		driftInfo[playerid][DriftoCpTimer] = SetTimerEx("DriftoCpCount",100,true,"d",playerid);
	} else {
		driftInfo[playerid][DriftCount]--;
		new DriftStr[128];
		format(DriftStr,128,"~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ %d ~g~-",driftInfo[playerid][DriftCount]);
		GameTextForPlayer(playerid,DriftStr,1000,3);
	}
	return 1;
}
//==============================================================================
public DriftoClock(playerid)
{
	  driftInfo[playerid][DriftClockSekundes]++;
	  new DriftClockStr[MAX_PLAYERS][128];
  	TextDrawHideForPlayer(playerid, Text:driftInfo[playerid][DriftClockTextDraw]);
  	
  	 	format(DriftClockStr[playerid],128," Laikas: %d min. %d sek.",driftInfo[playerid][DriftClockMinutes], driftInfo[playerid][DriftClockSekundes]);
  	driftInfo[playerid][DriftClockTextDraw] = TextDrawCreate(206.000000,379.000000,DriftClockStr[playerid]);
		TextDrawAlignment(driftInfo[playerid][DriftClockTextDraw],0);
		TextDrawBackgroundColor(driftInfo[playerid][DriftClockTextDraw],0xffffffff);
		TextDrawFont(driftInfo[playerid][DriftClockTextDraw],2);
		TextDrawLetterSize(driftInfo[playerid][DriftClockTextDraw],0.699999,2.299999);
		TextDrawColor(driftInfo[playerid][DriftClockTextDraw],0x000000ff);
	
		if(driftInfo[playerid][DriftClockSekundes] == 59)
	  {
	  driftInfo[playerid][DriftClockSekundes] = 0;
	  driftInfo[playerid][DriftClockSekundes]++;
	  driftInfo[playerid][DriftClockMinutes] = (driftInfo[playerid][DriftClockMinutes] +1);

		TextDrawHideForPlayer(playerid, Text:driftInfo[playerid][DriftClockTextDraw]);
  	 	format(DriftClockStr[playerid],128," Laikas: %d min. %d sek.",driftInfo[playerid][DriftClockMinutes], driftInfo[playerid][DriftClockSekundes]);
   	driftInfo[playerid][DriftClockTextDraw] = TextDrawCreate(206.000000,379.000000,DriftClockStr[playerid]);
		TextDrawAlignment(driftInfo[playerid][DriftClockTextDraw],0);
		TextDrawBackgroundColor(driftInfo[playerid][DriftClockTextDraw],0xffffffff);
		TextDrawFont(driftInfo[playerid][DriftClockTextDraw],2);
		TextDrawLetterSize(driftInfo[playerid][DriftClockTextDraw],0.699999,2.299999);
		TextDrawColor(driftInfo[playerid][DriftClockTextDraw],0x000000ff);
 		}
		return 1;
}
//==============================================================================
public DriftoCpCount(playerid)
{
    new DriftCpStr[MAX_PLAYERS][128];
    TextDrawHideForPlayer(playerid, Text:driftInfo[playerid][DriftCpTextDraw]);
    format(DriftCpStr[playerid],128,"%d/23",driftInfo[playerid][DriftCpCount]);
    driftInfo[playerid][DriftCpTextDraw] = TextDrawCreate(530.000000,364.000000,DriftCpStr[playerid]);
		TextDrawAlignment(driftInfo[playerid][DriftCpTextDraw],0);
		TextDrawBackgroundColor(driftInfo[playerid][DriftCpTextDraw],0xffffffff);
		TextDrawFont(driftInfo[playerid][DriftCpTextDraw],2);
		TextDrawLetterSize(driftInfo[playerid][DriftCpTextDraw],0.799999,4.899998);
		TextDrawColor(driftInfo[playerid][DriftCpTextDraw],0x000000ff);
		TextDrawShowForPlayer(playerid, Text:driftInfo[playerid][DriftCpTextDraw]);
		return 1;
}
//==============================================================================



Re: Pawn compiler output - Ignas1337 - 27.06.2009

what he meant was decrease size of arrays such as tmp and cmd for strto kfunction. they must be 256 in ur cript I think. You're doing it all wrong if it's true. They never go over 128. that would decrease memory usage. please read some topics about wrong usage of array '256'


Re: Pawn compiler output - Weirdosport - 27.06.2009

Also use global strings rather then redefining new ones in every callback.. And re-use them. You can format a string and send it, then reformat and send it again. That would not require 2 strings. By reducing the size of your strings/arrays this "error" will go away..


Re: Pawn compiler output - luby - 27.06.2009

add at begining
#pragma dynamic 119368


Re: Pawn compiler output - gytisx - 27.06.2009

Quote:
Originally Posted by Luby
add at begining
#pragma dynamic 119368
Thanks Luby