Raised This Month: $ Target: $400
 0% 

Check "^"


Post New Thread Reply   
 
Thread Tools Display Modes
fmfs10
Senior Member
Join Date: Mar 2009
Location: Brasil
Old 04-13-2011 , 12:58   Re: Check "^"
Reply With Quote #11

I tried and in fact it skiped the ^

The problem is that now it's adding the users with ^^

LOL

Can someone help me plz? =/
fmfs10 is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 04-13-2011 , 15:10   Re: Check "^"
Reply With Quote #12

#pragma ctrlchar '\'
Seta00 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-13-2011 , 23:34   Re: Check "^"
Reply With Quote #13

Quote:
Originally Posted by fmfs10 View Post
I tried and in fact it skiped the ^

The problem is that now it's adding the users with ^^

LOL

Can someone help me plz? =/
Show the code.

Quote:
Originally Posted by Seta00 View Post
#pragma ctrlchar '\'
Ok, but now he want's to escape the backslash character. .
__________________
fysiks is offline
fmfs10
Senior Member
Join Date: Mar 2009
Location: Brasil
Old 04-14-2011 , 21:15   Re: Check "^"
Reply With Quote #14

Oh I just forgot that
Sorry :X

This is a plugin that I did to take the old users from my old admins file, and add to MySql :

PHP Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init() {
    
register_plugin("ADD ADMIN SQL""1.0""KoN")
    
}

public 
plugin_cfg() {
    
    new 
configs_dir[64]
    
get_configsdir(configs_dir,charsmax(configs_dir))
    
    new 
vippath[100]
    
formatex(vippath99"%s/users.ini"configs_dir)
    
    new 
fileadd[100]
    
formatex(fileadd99"%s/adminsadd.ini"configs_dir)
    
    new 
File=fopen(vippath,"r");
    
    if (
File)
    {
        new 
Text[512];
        new 
Flags[32];
        new 
Access[32]
        new 
AuthData[50];
        new 
Password[32];
        
        while (!
feof(File))
        {
            
fgets(File,Text,sizeof(Text)-1);
            
            
trim(Text);
            
            
// comment
            
if (Text[0]==';' || Text[0]=='/' || Text[0]==' '
            {
                continue;
            }
            
            
Flags[0]=0;
            
Access[0]=0;
            
AuthData[0]=0;
            
Password[0]=0;
            
            
// not enough parameters
            
if (parse(Text,AuthData,sizeof(AuthData)-1,Password,sizeof(Password)-1,Access,sizeof(Access)-1,Flags,sizeof(Flags)-1) < 2)
            {
                continue;
            }
            
            
replace_all(AuthDatasizeof(AuthData)-1"^^""^^^^")    
            
            
server_cmd("amx_addadmin ^"%s^" ^"%s^" ^"%s^" name"AuthDataAccessPassword)
            
            
log_to_file(fileadd"Adicionado admin: %s"AuthData)
        }
        
        
fclose(File);
    }

So it will save in the database with "^^"

That's the only think that I've did. The admins.sma isn't changed...

Last edited by fmfs10; 04-14-2011 at 21:18.
fmfs10 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-14-2011 , 21:22   Re: Check "^"
Reply With Quote #15

Quote:
Originally Posted by fmfs10 View Post
PHP Code:
            replace_all(AuthDatasizeof(AuthData)-1"^^""^^^^"
So it will save in the database with "^^"
That's because that is what you told it to do.

Easiest Solution: Use SteamIDs.
__________________
fysiks is offline
fmfs10
Senior Member
Join Date: Mar 2009
Location: Brasil
Old 04-14-2011 , 21:33   Re: Check "^"
Reply With Quote #16

I know that solution very well . In fact I've used it for a long time xD

The problem is that as I have a LOT of vips, it is hard to manage accounts by steamids. And by name, you can have multiple accounts in the servers, that some of my vips like to have (for super hero)

Oh, and not counting the fact about using the best method, I want to know how to don't have this bug anymore, as I want to implement a new system to do something in the future
this >>> cliente.ntsbr.net (it's a site)

EDIT@

Oh I know I told... The problem is not to SAVE ^^, the problem is to READ ^

Last edited by fmfs10; 04-14-2011 at 21:35.
fmfs10 is offline
Reply



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 14:40.


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