13.07.2009, 03:50
I was just wondering if using a global string like this:
vs making new local strings every time you need one:
Would possibly cause problems?
The reason I ask is because these strings will constantly be getting formatted by different parts of the script.
pawn Код:
new string[128];
...
dcmd_mycommand(playerid, params[])
{
format(string, sizeof(string), "Your player ID is %d.", playerid);
SendClientMessage(playerid, myColour, string);
return 1;
}
...
public OnPlayerSpawn(playerid)
{
format(string, sizeof(string), "You have spawned, and your player ID is %d.", playerid);
SendClientMessage(playerid, myColour, string);
}
pawn Код:
dcmd_mycommand(playerid, params[])
{
new string[128];
format(string, sizeof(string), "Your player ID is %d.", playerid);
SendClientMessage(playerid, myColour, string);
return 1;
}
...
public OnPlayerSpawn(playerid)
{
new string[128];
format(string, sizeof(string), "You have spawned, and your player ID is %d.", playerid);
SendClientMessage(playerid, myColour, string);
}
The reason I ask is because these strings will constantly be getting formatted by different parts of the script.