Question about Strings
#1

Hello,
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);
}
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?
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);
}
Reply


Messages In This Thread
Question about Strings - by NeroX98 - 11.06.2015, 16:07
Re: Question about Strings - by Sawalha - 11.06.2015, 16:09
Re: Question about Strings - by Konstantinos - 11.06.2015, 16:11
Re: Question about Strings - by NeroX98 - 11.06.2015, 16:12
Re: Question about Strings - by Vince - 11.06.2015, 16:16
Re: Question about Strings - by Sawalha - 11.06.2015, 16:21
Re: Question about Strings - by NeroX98 - 11.06.2015, 16:22
Re: Question about Strings - by Stanford - 11.06.2015, 16:25

Forum Jump:


Users browsing this thread: 1 Guest(s)