SA-MP Forums Archive
Uh, Compiling question - 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: Uh, Compiling question (/showthread.php?tid=148164)



Uh, Compiling question - Anthony_Brassi - 16.05.2010

I just added an NRG and Infernus code, and got this
Код:
Header size:      5184 bytes
Code size:      560036 bytes
Data size:      589556 bytes
Stack/heap size:   16384 bytes; estimated max. usage=4224 cells (16896 bytes)
Total requirements: 1171160 bytes
Will it be a problem?


this is the code
Код:
new inf[MAX_PLAYERS]; // Declared here so it's a constant
new nrg[MAX_PLAYERS];
Код:
new Float:Pos[MAX_PLAYERS][4]; // You only need to declare one, not two

  if(!strcmp(cmdtext,"/inf",true))
  {
  if(PlayerInfo[playerid][pIsStunting] == 1)
   {
    DestroyVehicle(inf[playerid]);
     GetPlayerPos(playerid,Pos[playerid][1],Pos[playerid][2],Pos[playerid][3]);
     inf[playerid]=CreateVehicle(411,Pos[playerid][1],Pos[playerid][2],Pos[playerid][3],0,-1,-1,10);
     PutPlayerInVehicle(playerid,inf[playerid], 0);
    SendClientMessage(playerid,LIGHTBLUE,"You have Spawned An Infernus.");
     return 1;
}
  }
  if(!strcmp(cmdtext,"/nrg",true))
  {
  if(PlayerInfo[playerid][pIsStunting] == 1)
   {
   	DestroyVehicle(nrg[playerid]);
   	GetPlayerPos(playerid,Pos[playerid][1],Pos[playerid][2],Pos[playerid][3]);
     nrg[playerid]=CreateVehicle(522,Pos[playerid][1],Pos[playerid][2],Pos[playerid][3],0,-1,-1,10);
     PutPlayerInVehicle(playerid,nrg[playerid], 0);
    SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have Spawned An NRG-500.");
}
   return 1;
  }/code



Re: Uh, Compiling question - Anthony_Brassi - 16.05.2010

Quote:
Originally Posted by Seif_
It's not a problem, but it might be in the future. If you have too many cells, your script can stop functioning. Try optimizing your script.
eh, >< How can i optimize it?, any suggestions?

Btw, thanks for quick response


Re: Uh, Compiling question - Anthony_Brassi - 16.05.2010

Quote:
Originally Posted by Seif_
thanks again, ill check it out in the morning =/, will it take long to do it? lol


Re: Uh, Compiling question - Thrarod - 16.05.2010

Not much, about 20 mins or less


Re: Uh, Compiling question - Micko9 - 16.05.2010

Quote:
Originally Posted by Anthony_Brassi
Quote:
Originally Posted by Seif_
It's not a problem, but it might be in the future. If you have too many cells, your script can stop functioning. Try optimizing your script.
eh, >< How can i optimize it?, any suggestions?

Btw, thanks for quick response
how did you make your proggress bar in the signature?


Re: Uh, Compiling question - Anthony_Brassi - 16.05.2010


Quote:

how did you make your proggress bar in the signature?

http://www.shareyouraim.com/


and thanks for the help