Results 1 to 10 of 11

Thread: Store player informations with MySQL.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Private
    Join Date
    Jun 2015
    Posts
    15
    Thanks
    5
    Thanked 3 Times in 3 Posts

    Cool

    The problem is solved! Thanks IzNoGod!
    Indeed all informations are uploaded/downloaded as string, I post the final version of the functions (that work):

    PHP Code:
    get_db_field(fieldnamevartype)
    {
        if(
    isDefined(self.isbot))
            return 
    undefined;
        
        if(
    fieldname == "user_guid")
            
    mysql_query(level.mysql_connection"SELECT `"+fieldname+"` FROM `"+level.table+"` WHERE `user_name`= '"+self.name+"' LIMIT 1");
        else
            
    mysql_query(level.mysql_connection"SELECT `"+fieldname+"` FROM `"+level.table+"` WHERE `user_guid`= '"+self.guid+"' LIMIT 1");
        
    mysql_store_result(level.mysql_connection);
        if(
    isdefined(r))
        {
            
    row mysql_fetch_row(r);
            if(
    isdefined(row) && isdefined(row[0]))
            {
                
    mysql_free_result(r);
                if(
    vartype == "int")
                    
    row[0] = (int)(row[0]);
                if(
    vartype == "float")
                    
    row[0] = (float)(row[0]);
                return 
    row[0];
            }
            
    mysql_free_result(r);
        }
        
        if(
    vartype == "int" || vartype == "float")
            return 
    0;
        else
            return 
    undefined;

    }  

    set_db_field(fieldnamevalue
    {
        if(
    isDefined(self.isBot))
            return;
        
        
    mysql_query(level.mysql_connection"INSERT INTO `"+level.table+"`(`user_guid`, `"+fieldname+"`) VALUES ('"+self.guid+"', "+value+") ON DUPLICATE KEY UPDATE `"+fieldname+"`="+value+"");
        
        
    wait 0.05;
    }

    set_db_field_string(fieldnamevalue
    {
        if(
    isDefined(self.isBot))
            return;
        
        
    mysql_query(level.mysql_connection"INSERT INTO `"+level.table+"`(`user_guid`, `"+fieldname+"`) VALUES ('"+self.guid+"', '"+value+"') ON DUPLICATE KEY UPDATE `"+fieldname+"`='"+value+"'");
        
    wait 0.05;

    I want to learn to create something like CoDExtended or whatsoever, where should I start?

  2. #2
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    Quote Originally Posted by ebusiangamers View Post
    I want to learn to create something like CoDExtended or whatsoever, where should I start?
    1. Grab a cold beer
    2. Place your freshly wetted lips onto it and enjoy
    3. Have some programming expirience in C and understand the basics (pointer arithmetics etc.) also know some CoD-Script (its kind of managed and simplified C)
    4. have a look here:
    5. post some extensions on killtube.org


    If you want to hook some other games/programs, you can also have a look at ollydbg etc. and watch some easy tutorials on how to simply bypass instructions etc. or inject some dll or have an API hook with 'detours' (windows)
    Last edited by serthy; 6th July 2015 at 11:10.

  3. The Following 3 Users Say Thank You to serthy For This Useful Post:

    ebusiangamers (7th July 2015),kung foo man (6th July 2015),Ni3ls (6th July 2015)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •