Jump to content
Sign in to follow this  
_Alex_

Help nesaglabajas acconti iekš DB MySQL R39

Recommended Posts


Es izmantoju Open Server! 

Ir problēma kad man GM nesaglaba Kontus iekš Datu Bazes, db savienojas. Agrak izmantoju Denwer, bet tas vispār vairs neiet pat nesavieno..

MySQL Logs fails neizveidojas.. 

Kurš šarī ja varat palīdzat.. Es jau trešo dienu mēģinu safiksot

<Kods kur seivoju akkontus!>

=============================================================================================================================================

    if(clickedid == td_select_skin[playerid][2])
     {
         for(new i; i != 3; i++) TextDrawHideForPlayer(playerid, td_select_skin[playerid]);
        SCM(playerid, COLOR_WHITE, !"Jūs pieregistrējāt akontu");
        login_check{playerid} = true;
        update_timer[playerid] = SetTimerEx("@_UpdateTime", 1_000, false, "i", playerid);
        Freeze(playerid, 1);
         number_skin{playerid} = 0;
        CancelSelectTextDraw(playerid);
        // ACC IZVEIDE
        player[playerid][plevel] = 1;
        player[playerid][pmoney] = 0;
        player[playerid][pskin] = GetPlayerSkin(playerid);
        //
        static
         fmt_str[] = "ISERT INTO `accounts` (`Name`, `Pass`, `Mail`, `Sex`, `Skin`, `Age`, `Nations`, `Level`, Referal, `ReferalCheck`) VALUES ('%s, '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%d')",
          fmt_str_2[] = "SELECT * FROM `accounts` WHERE `Name` = '%s'";

        new string[sizeof(fmt_str)+MAX_PLAYER_NAME*2+85],
            string_2[sizeof(fmt_str_2)+MAX_PLAYER_NAME-1];

        mysql_format(connect_mysql, string, sizeof(string), fmt_str, player[playerid][pname], player[playerid][ppass], player[playerid][pmail], player[playerid][psex], player[playerid][pskin], player[playerid]
        mysql_format(connect_mysql, string_2, sizeof(string_2), fmt_str_2, player[playerid][pname]);
        mysql_function_query(connect_mysql, string, true, "", "");
        mysql_function_query(connect_mysql, string_2, true, "@_GetID", "i", playerid);
        SpawnPlayer(playerid);


, player[playerid][pnations], player[playerid][plevel], player[playerid][preferal], player[playerid][preferal_check]);

===============================================================================================================================================

<Kods ar mysql savienošanu>

===============================================================================================================================================

new connect_mysql;

#define SQL_HOST    "localhost"
#define SQL_USER    "root"
#define SQL_DB      "advanced"
#define SQL_PASS    ""

enum pInfo {                           // new connect_mysql; Augstāk šis ir! \\
    pname[MAX_PLAYER_NAME+1], ppass[32+1], pmail[60+1], pmoney, psex, pskin, page, pnations, plevel, pid, preferal_check, preferal[MAX_PLAYER_NAME+1]
}
new player[MAX_PLAYERS][pInfo];
// ============================== [ PUBLIC ] ==============================
public OnGameModeInit()
{
    SetGameModeText(gamemode_text);
    AddPlayerClass(0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
    ShowPlayerMarkers(PLAYER_MARKERS_MODE_STREAMED);
    ShowNameTags(true);
    SetNameTagDrawDistance(20.0);
    DisableInteriorEnterExits();
    EnableStuntBonusForAll(0);
    connect_mysql = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
    mysql_function_query(connect_mysql, "SET NAMES utf8", false, "", "");
    mysql_function_query(connect_mysql, "SET CHARACTER SET 'cp1251'", false, "", "");
    return true;
}
public OnGameModeExit()
{
    return true;
}
public OnPlayerRequestClass(playerid, classid)
{
    return true;
}
public OnPlayerConnect(playerid)
{
    GetPlayerName(playerid, player [playerid][pname], MAX_PLAYER_NAME);
    static
        fmt_str[] = "SELECT * FROM `accounts` WHERE `Name` = '%s'";
     new string[sizeof(fmt_str)+MAX_PLAYER_NAME-1];
    mysql_format(connect_mysql, string, sizeof(string), fmt_str, sendername(playerid));
    mysql_function_query(connect_mysql, fmt_str, true, "@_PlayerCheck", "d", playerid);
    Clear(playerid);
    PlayerTextDraws(playerid);
    return true;
}
public OnPlayerDisconnect(playerid, reason)
{
    KillTimers(playerid);
    return true;
}

===============================================================================================================================================

 

Share this post


Link to post
Share on other sites

`ReferalCheck` nav tāda kollona struktūrā. 
Neizskatās, ka esi 3 dienas mēģinājis salabot. Vairāk izskatās, ka iemeti, lai vnk kāds atrisina problēmas tavas.

  • Upvote 1

Share this post


Link to post
Share on other sites

http://prntscr.com/omign3 || http://prntscr.com/omigtc ||http://prntscr.com/omihca || http://prntscr.com/omihut

Es viu rakstu laikam nedēļu gandriz 2! Es vel neesu pro skripteris.. Ieļauju tādas traģiskas kļūdas, bet es nesapratu man Referal Check visur ir sarakstits vienigais PAWN tur nav atstarpes, bet man liekas tur īsti nav svarigi ir vai nav atstarpes!! 

MySQL struktūra

http://prntscr.com/omilkd

Nezinu man drizāk liekas ka tas ir OpenServer vaina, jo man citi gm ari neaizgaja. Bet ja tā tiešām ir tā to safiksot diez var

http://prntscr.com/omipzk

Edited by _Alex_

Share this post


Link to post
Share on other sites
14 minutes ago, _Alex_ said:

http://prntscr.com/omign3 || http://prntscr.com/omigtc ||http://prntscr.com/omihca || http://prntscr.com/omihut

Es viu rakstu laikam nedēļu gandriz 2! Es vel neesu pro skripteris.. Ieļauju tādas traģiskas kļūdas, bet es nesapratu man Referal Check visur ir sarakstits vienigais PAWN tur nav atstarpes, bet man liekas tur īsti nav svarigi ir vai nav atstarpes!! 

MySQL struktūra

http://prntscr.com/omilkd

Nezinu man drizāk liekas ka tas ir OpenServer vaina, jo man citi gm ari neaizgaja. Bet ja tā tiešām ir tā to safiksot diez var

https://prnt.sc/omihca => 'ReferalCheck', bet te https://prnt.sc/omigtc => 'Referal Check'!

 

EDIT:

Kāpēc SCM(playerid, COLOR_WHITE, !"Jūs pieregistrējāt akontu"); ?

Edited by Jenotinsssss

Share this post


Link to post
Share on other sites
On 7/31/2019 at 5:18 PM, Jenotinsssss said:

Ja nav svarīgi, tad lūdzu aizver pawno un ej samp elvee spēlē.

Tu mani nesaprati! Es domāju tjipa tur var arī nebut atstarpe nejau ka nav svarigi pats mods!! Es šeit iepostoju, jo ir cilvēki kuri ir gudrāki un spēj palidzet. Es tagad arī skatos interneta viss kas varetu but iemesls tai problemai!!

Domju parliku es atpakaļ Win7  uz tā noteikti strada Open Server! Ja  uz hosta neaizies. Ja uz hosta aizies tatad kods vainigs

Edited by _Alex_

Share this post


Link to post
Share on other sites

TC. paldies kuri centās palīdzēt problēma bija iekš Open Server.. Parinstalēšu datoru uzlikšu windows 7! Cerams aizies

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.