Automatically add to server version define?
#1

I doubt this is possible through PAWN, but could I make it so every time I save my mode, it automatically adds +1 to the server version's define? I usually forget to update the server version and it would be so much easier if it could do it itself.

I'm using Notepad++, for what it's worth!
Reply
#2

Do u mean everytime u compile it .... u can do it threw a variable every u start the server.... or restart the server or close it..... u can make a variable +1 for that
Reply
#3

Yeah maybe not that accurate, but using OnGameModeInit and adding a certain value to a variable and then saving it is as close as you might get. I had this exact same idea and was wondering if it was possible, because it was annoying to constantly change my server.cfg. I was leaning more towards a command for setting the server version, but I wasn't really prepared to try and figure out how to script it to automatically change...
Reply
#4

Benzo Ummm... just put in under GameModeInit.... Or GameModeExit... Like everything the gamemode closed the value ++.... or everytime is starts the value ++... and the value is saved and all is needed a string to be format and problem solved.... just like how u would save any other variable...
Reply
#5

Can't you make a batch file (which you'd run to compile instead of directly running pawncc.exe) to write to a file which you then can include?
Reply
#6

Yes, but this wouldn't really support server crashes... therefore the version would update even if the server restarts itself...
Reply
#7

Here is how simple...... Make A Cmd:newversion everytime a admin does the variable goes up ++ and everyone is happy....
Reply
#8

Quote:
Originally Posted by Glad2BeHere
Посмотреть сообщение
Here is how simple...... Make A Cmd:newversion everytime a admin does the variable goes up ++ and everyone is happy....
He wants it to be automatic.

Create a batch file and run that in notepad++ using a hotkey. (F5?)

Example:

set /p build= <BUILD.bld :: Set variable %build% to the text in BUILD.bld file
set /a build+=1 :: Add 1 to %build%
echo %build% > BUILD.bld :: Write %build% to BUILD.bld file, and overwrite
:: Execute pawncc.exe here...


NOTE: Untested code... no idea if it will work. I know almost nothing about BATCH.
Reply
#9

Schurman, that seems like a logical idea. However, where is this "build.bld" file being made, can I add (f.e) .0001 instead of "1" each time? And, can I use the "version" in the mode?
Reply
#10

Still looking for a valid answer to this...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)