AMXX: Saving data over mapchange?
Hello,
it seems, my AMXX variables (of a plugin) get reset at mapchange ... I would like to save data for a plugin between mapchanges. Is my configuration broken? Is that possible to do such at all? How? :) Thanx for any advice! |
Re: AMXX: Saving data over mapchange?
You can create a plugin that will save in a text file the info that you would like and retrive it after map change ;).
|
Re: AMXX: Saving data over mapchange?
OK, if that is the only way, i need to go that road :D
Any advice or example of that - f.e. here in the forum? :) |
Re: AMXX: Saving data over mapchange?
Just a moment, I will come with an edit!
Edit: Here is my plugin that works with settings saved in a file. Take a look at the code ;). http://forums.alliedmods.net/showthread.php?p=651444 |
Re: AMXX: Saving data over mapchange?
Wowuahahauah!
OK, that will take some time to read :D Thanx! |
Re: AMXX: Saving data over mapchange?
No it will not. Here are the lines that are important, I edited them so you can understand them better:
PHP Code:
PHP Code:
PHP Code:
|
Re: AMXX: Saving data over mapchange?
Ah.
I understand. Thanx a real bunch for the work! :) It is required to write out data in a format that allows HL to read it in again - as list of CVARs. But when i just use CVARs, for me i do not even need to write them to a file - CVARs stay set between mapchanges, as long as they are not changed in a plugin or a cfg-file. I was searching a way to save my pluginīs variables, which are nto CVARS - just "tk_count[MAXPLAYERS]" for example. If i understand you correctly, there is no way to do this - beside creating 32 CVARs that allow to save the values between mapchanges: ta_count_1, ..., ta_count_32 Ufff :-O |
Re: AMXX: Saving data over mapchange?
You could save the data in nVault, this is the simplest way IMO.
You can use the players STEAMID\IP as the save\lookup key and save the appropriate variable info as the data. Example, on map change (client_disconnect) save the below key to vault. new szKey[256]; formatex( szKey , 255 , "%d %d %d %d" , g_TK[id] , g_HS[id] , g_Kills[id] , g_Deaths[id] ) //The entry to vault will look like this: 44 0 123 3434 nvault_set( g_Vault , szAuthID , szKey ) On client_putinserver, read these values, parse them, and assign to appropriate variables. new szKey[256]; //44 0 123 3434 nvault_get( g_Vault , szAuthID , szKey , 255 ) |
Re: AMXX: Saving data over mapchange?
Ahhh!
Thatīs what i was looking for! Thanx a real bunch - i start to code :) |
| All times are GMT -4. The time now is 02:19. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.