AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Save variables (https://forums.alliedmods.net/showthread.php?t=299810)

Tripaloski 07-26-2017 14:53

Save variables
 
How can I save variables?
Like for example:
PHP Code:

new Test 

How can I save the "Test"

klippy 07-26-2017 15:14

Re: Save variables
 
Define "save". What do you actually mean?

Tripaloski 07-26-2017 15:53

Re: Save variables
 
PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Teste"
#define VERSION "1.0"
#define AUTHOR "MonSter '|RUCA| <3*"

new TWins
new CTWins

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event"SendAudio""TerroristsWin""a""2&%!MRAD_terwin" )
    
register_event"SendAudio""CounterTerroristsWin""a""2&%!MRAD_ctwin" )    
}
public 
TerroristsWin( )
    
TWins++

public 
CounterTerroristsWin( )
    
CTWins++ 

For example here how can I save CTWins and TWins

leonardo121 07-26-2017 16:33

Re: Save variables
 
use the nvault ou fvault
https://forums.alliedmods.net/showthread.php?t=91503

Tripaloski 07-26-2017 16:45

Re: Save variables
 
I realize little of that. Can you edit the plugin I sent as an example?

leonardo121 07-26-2017 17:17

Re: Save variables
 
search more, talking about this ?

PHP Code:

/** THIS IS AN EXAMPLE */
LoadCTWins(  )
{
    new 
vaultkey64 ], vaultdata256 ];
    
    
formatvaultkeycharsmaxvaultkey ), "CTWINS");

    if(!
nvault_getvaultvaultkeyvaultdata255 )) return PLUGIN_HANDLED

    parse
vaultdataCTWins32 );

    
// your variable 
    
CTWins str_to_numvaultdata );
    
}


SaveCTWins( )
{
    new 
vaultkey64 ], vaultdata256 ];

    
formatexvaultkeycharsmaxvaultkey ), "CTWINS")
    
formatexvaultdatacharsmaxvaultdata ), "%i"CTWins)
    
    
//store
    
nvault_setvaultvaultkeyvaultdata )
    




All times are GMT -4. The time now is 13:38.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.