11.06.2015, 16:07
Hello,
I have a question about strings. Can i use one universal string for all purposes?
For example:
So as you can see there, I format the same string i declared on the start of the gamemode.
Is is better to make the strings this way or to declare new strings when i need like this?
I have a question about strings. Can i use one universal string for all purposes?
For example:
pawn Код:
new UniversalString[126];
public OnplayerConnect
{
//Other Code
format (UniversalString, sizeof(UniversalString), "{3D53F5}(Server Info) {FFFFFF}%s has joined the server!", name);
SendClientMessage(playerid, ServerInfo, UniversalString);
}
public OnplayerDisconnect
{
//Other Code
format (UniversalString, sizeof(UniversalString), "{3D53F5}(Server Info) {FFFFFF}%s has left the server!", name);
SendClientMessage(playerid, ServerInfo, UniversalString);
}
Is is better to make the strings this way or to declare new strings when i need like this?
pawn Код:
public OnplayerConnect
{
//Other Code
new LocalString[128];
format (LocalString, sizeof(LocalString), "{3D53F5}(Server Info) {FFFFFF}%s has joined the server!", name);
SendClientMessage(playerid, ServerInfo, LocalString);
}
public OnplayerDisconnect
{
//Other Code
new LocalString[128];
format (LocalString, sizeof(LocalString), "{3D53F5}(Server Info) {FFFFFF}%s has left the server!", name);
SendClientMessage(playerid, ServerInfo, LocalString);
}