Everytime a player logins, these 2 variables changes to a fixed value
#1

On my login system(mysql r39-6), whenever a player logins these 2 variables(Playa[playerid][Level], Playa[playerid][Respect]) gets values 101 and 0. I've rewritten the code for several times, same results. He're are some codes to look into
PHP код:
public OnPlayerConnect(playerid)
{
    new 
clean[PlayerInfo]; Playa[playerid] = clean;
    
Playa[playerid][Vehicle] = -1;    Playa[playerid][Level] = 1Playa[playerid][Respect] = 1;
    
String[0] = '\0';
    
format(String128"{FFFFFF}Welcome, {FF0000}%s{FFFFFF}!\nPlease select your language wich you will use to play on this server"SendName(playerid));
    
ShowPlayerDialog(playeridAccDDIALOG_STYLE_MSGBOX"Language"String"Romana""English");
    return 
1;

PHP код:
        case AccD//Language
        
{
            if(
response)
            {
                
Playa[playerid][Language] = 1msQuery[0] = '\0';
                
mysql_format(VelocitymsQuery256"SELECT * FROM `accounts` WHERE `Name` = '%s' LIMIT 1"SendName(playerid));
                
mysql_tquery(VelocitymsQuery"CheckPlayerLogin""d"playerid);
            }
            else
            {
                
Playa[playerid][Language] = 0msQuery[0] = '\0';
                
mysql_format(VelocitymsQuery256"SELECT * FROM `accounts` WHERE `Name` = '%s' LIMIT 1"SendName(playerid));
                
mysql_tquery(VelocitymsQuery"CheckPlayerLogin""d"playerid);
            } 
Here's checking password and things, now loadings:
PHP код:
    Playa[playerid][Respect]    =        cache_get_field_content_int(0,  "Respect",  Velocity);
    [
17:45:50 05/08/18] [DEBUGcache_get_field_content_int row0field_name"Respect"connection1
    
[17:45:50 05/08/18] [DEBUGCMySQLResult::GetRowDataByName row'0'field"Respect"data"1"
    
Playa[playerid][Level]        =        cache_get_field_content_int(0,  "Level",       Velocity);
    [
17:45:50 05/08/18] [DEBUGcache_get_field_content_int row0field_name"Level"connection1
    
[17:45:50 05/08/18] [DEBUGCMySQLResult::GetRowDataByName row'0'field"Level"data"1" 
The loadings are correct but when it shows me the variable result in server, it gets value 101.

Firstly, i thought there should be a format problem
PHP код:
                format(String2150"{FFFFFF}Level: {00FF00}%d\n"Playa[playerid][Level]);
                
strcat(StringString2);
                
format(String2150"{FFFFFF}Respect Points: {00FF00}%d{FFFFFF}/{00FF00}%d\n\n"Playa[playerid][Respect], Playa[playerid][Level] * 3);
                
strcat(StringString2);
                
strcat(String"{FFFFFF}For more statistics, use {FF0000}/stats{FFFFFF}.\n\n"); 
but i've put under comments the code and same thing hapenned when i checked the database.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)