15.03.2013, 09:35
Quote:
You need to reduce cell size where ever required within your game mode. Remember where it is required.
Example:
Lets consider you have this code.
pawn Код:
public OnPlayerConnect(playerid)
{
new str[256],name[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
format(str,sizeof(str),"Hello %s , Welcome to SA-MP Server." , name);
SendClientMessage(playerid, -1, str);
return 1;
}
The corrected code should be:
pawn Код:
public OnPlayerConnect(playerid)
{
new str[59],name[MAX_PLAYER_NAME+1]; // You can put 60 also. Not a big deal. But having 256 utilises lot of memory and it is too slow.
GetPlayerName(playerid, name, sizeof(name));
format(str,sizeof(str),"Hello %s , Welcome to SA-MP Server." , name);
SendClientMessage(playerid, -1, str);
return 1;
}