Raised This Month: $344 Target: $400
 86%   Almost there!

Save variables


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tripaloski
Member
Join Date: Jul 2017
Old 07-26-2017 , 14:53   Save variables
Reply With Quote #1

How can I save variables?
Like for example:
PHP Code:
new Test 
How can I save the "Test"
Tripaloski is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 07-26-2017 , 15:14   Re: Save variables
Reply With Quote #2

Define "save". What do you actually mean?

Last edited by klippy; 07-26-2017 at 15:14.
klippy is offline
Tripaloski
Member
Join Date: Jul 2017
Old 07-26-2017 , 15:53   Re: Save variables
Reply With Quote #3

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
Tripaloski is offline
leonardo121
Member
Join Date: Sep 2013
Old 07-26-2017 , 16:33   Re: Save variables
Reply With Quote #4

use the nvault ou fvault
https://forums.alliedmods.net/showthread.php?t=91503
leonardo121 is offline
Tripaloski
Member
Join Date: Jul 2017
Old 07-26-2017 , 16:45   Re: Save variables
Reply With Quote #5

I realize little of that. Can you edit the plugin I sent as an example?
Tripaloski is offline
leonardo121
Member
Join Date: Sep 2013
Old 07-26-2017 , 17:17   Re: Save variables
Reply With Quote #6

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 )
    


Last edited by leonardo121; 07-27-2017 at 16:17.
leonardo121 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:33.


Powered by vBulletin®
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Theme made by Freecode