Defining server name and printing it
#1

How can I define the server name at the top of the script and use that name throughout the script?

So that I can change 1 variable and the server name will be changed in the whole script
Reply
#2

#define SERVERNAME "servername"
and then use SERVERNAME instead of like "servername"
Reply
#3

Код:
#define SERVER_NAME  	"MyAwesomeServer"


main()
{
	printf("%s", SERVER_NAME);
}
Reply
#4

Thanks y'all.
Reply
#5

Quote:
Originally Posted by ******
Посмотреть сообщение
Better:

pawn Код:
const stock SERVER_NAME[] = "MyAwesomeServer";
Otherwise you are making hundreds of copies of the string instead of just referencing the same copy all the time.
That is very smart, thanks for pointing that out.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)