Raised This Month: $105 Target: $400
 26% 

Change Case Sensitivity on Register System


Post New Thread Reply   
 
Thread Tools Display Modes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-08-2020 , 20:18   Re: Change Case Sensitivity on Register System
Reply With Quote #11

Here's the code to set the key to lower-case in all of your existing vault data. Just set your vault name accordingly and check that the max key/value/records values are set large enough for your vault.

nVault Utility
PHP Code:

#include <amxmodx>
#include <nvault_util>

//** Verify/edit as needed **
new const szVaultName[] = "YOURVAULT";
const 
MaxKeySize 32;
const 
MaxDataSize 32;
const 
MaxRecords 1000;
//***************************

enum NVRecord
{
    
szKeyMaxKeySize ],
    
szValMaxDataSize ],
    
iTimeStamp
}

new 
nvRecordsMaxRecords ][ NVRecord ];

public 
plugin_init() 
{
    new 
iVault nvault_util_openszVaultName );
    new 
iCount nvault_util_countiVault );
    new 
iSlot;
    
    for ( new 
iNextPos <= iCount i++ )
    {
        
iNextPos nvault_util_readiVault iNextPos nvRecordsiSlot ][ szKey ] , charsmaxnvRecords[][ szKey ] ) , nvRecordsiSlot ][ szVal ] , charsmaxnvRecords[][ szVal ] ) , nvRecordsiSlot ][ iTimeStamp ] );
        
iSlot++;
    }
    
nvault_util_closeiVault );
    
    
iVault nvault_openszVaultName );

    
nvault_pruneiVault get_systime() );
    
    for ( new 
iSlot i++ )
    {
        
strtolowernvRecords][ szKey ] );
        
nvault_setiVault nvRecords][ szKey ] , nvRecords][ szVal ] );
        
nvault_touchiVault nvRecords][ szKey ] , nvRecords][ iTimeStamp ] );
    }
    
    
nvault_closeiVault );
    
    
console_print"%d record(s) set to lower-case." iCount );

__________________
Bugsy is online now
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-08-2020 , 21:35   Re: Change Case Sensitivity on Register System
Reply With Quote #12

Quote:
Originally Posted by Bugsy View Post
Of course ... if he does not care about losing the existing data.
Oh, I thought you meant delete when you said "clean".
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 21:56.


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