SA-MP Forums Archive
Adding new vars to the server.cfg - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Adding new vars to the server.cfg (/showthread.php?tid=82773)



Adding new vars to the server.cfg - ledzep - 20.06.2009

Is this possible? When I try to add a new var, it does not show in the console when I type "varlist", and if I try to GetServerVarAsString the server crashes.


Re: Adding new vars to the server.cfg - ledzep - 20.06.2009

Bump.


Re: Adding new vars to the server.cfg - ledzep - 27.06.2009

Bump.


Re: Adding new vars to the server.cfg - yom - 27.06.2009

No. That is possible but not 'legally'.


Re: Adding new vars to the server.cfg - ledzep - 27.06.2009

Well I just wanted to use it for an honest application.

I wanted to set MySQL credentials without having to edit/compile or read through files.


Re: Adding new vars to the server.cfg - Andom - 27.06.2009

Maybe?
Код:
new string[128];
new rcon_string[32];
GetServerVarAsString("newvar", rcon_string, sizeof(rcon_string));
format(string, sizeof(string), "newvar: %s", rcon_string);
SendClientMessage(playerid, COLOR_YELLOW, string);



Re: Adding new vars to the server.cfg - ledzep - 27.06.2009

That is essentially what I have done, but it crashes.

Now that I think about it, "varlist" even lists things that are not in the server list by default, i.e. "version", "timestamp", "bind", etc...

So maybe you cannot add new server variables through the server.cfg, but where?