Format() - Creating Dynamic Messages
#2

You can use the string variable twice, no need to create the additional string as you can just:

pawn Code:
GetPlayerName....str....
format( str...."INFO: %s(ID: %i) has joined.", str....
This will save you 24 characters (98, 24 * 4).

Also this could cause issues if the string needs to be used more than once at the same time, small risk but could happen as it is global but aslong as it is formatted before it's used (each time) then there shouldn't be an issue unless I'm overlooking something.
Reply


Messages In This Thread
Format() - Creating Dynamic Messages - by Fresh_X - 25.10.2009, 14:56
Re: Format() - Creating Dynamic Messages - by Donny_k - 25.10.2009, 15:37
Re: Format() - Creating Dynamic Messages - by SpiderPork - 25.10.2009, 16:00
Re: Format() - Creating Dynamic Messages - by Peter_Corneile - 25.10.2009, 16:04
Re: Format() - Creating Dynamic Messages - by Fresh_X - 25.10.2009, 17:35
Re: Format() - Creating Dynamic Messages - by Peter_Corneile - 25.10.2009, 17:36
Re: Format() - Creating Dynamic Messages - by Fresh_X - 25.10.2009, 17:38
Re: Format() - Creating Dynamic Messages - by Peter_Corneile - 25.10.2009, 17:41
Re: Format() - Creating Dynamic Messages - by Fresh_X - 25.10.2009, 17:45
Re: Format() - Creating Dynamic Messages - by Peter_Corneile - 25.10.2009, 17:48

Forum Jump:


Users browsing this thread: 1 Guest(s)