Jump to content

Robi[adv]

Membru
  • Posts

    28
  • Joined

  • Last visited

Profile Information

  • Sex
    Masculin
  • Location
    Targoviste Romania
  • In-game Name
    Ro_K
  • Level of knowledge
    Începător

Contact Methods

  • Discord
    Ro_K#8757 || https://discord.gg/UfNtHbu

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Robi[adv]'s Achievements

Contributor

Contributor (5/14)

  • First Post
  • Collaborator
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

2

Reputation

  1. Recent am creat cu ajutorul unui tutorial un sistem de register si de login , ceva simplu. Problema nu este intimpinata la cod ci la baza de date. La conexiunea cu serverul nu intampin nici-o problema..se conecteaza. Insa dupa register, la relog contul nu ramane salvat. #define SQL_HOST "localhost" #define SQL_USER "root" #define SQL_PASS "" #define SQL_DB "rpg_db" new SQL; // conexiunea se afla in public OnGameModeInit() SQL = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS); public OnPlayerConnect(playerid) { PlayerInfo[playerid][pLoginTries] = 0; gQuery[0] = EOS; mysql_format(SQL, gQuery, sizeof(gQuery), "SELECT * FROM `users` WHERE `Name` = '%e' LIMIT 1", GetName(playerid)); mysql_tquery(SQL, gQuery, "checkAcount", "i" ,playerid); return 1; } case DIALOG_REGISTER: { if(!response) return Kick(playerid); if(strlen(inputtext) < 6 || strlen(inputtext) > 32) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Bine ai venit!\nScrie o parola pentru a te putea inregistra.\nParola trebuie sa fie intre 6-32 caractere\nParola nu indeplineste cerintele cerute!", "Register", "Quit"); gQuery[0] = EOS; mysql_format(SQL, gQuery, sizeof gQuery, "INSERT INTO `users` ('Name', 'Password') VALUES ('%s', '%s')", GetName( playerid ), inputtext ); mysql_tquery(SQL, gQuery, "insertAccount", "d", playerid); format(PlayerInfo[playerid][pPassword], 32, inputtext); ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "E-Mail", "Seteaza-ti parola de e-mail.\nTe rugam sa folosesti o adresa valida.", "Setez",""); } function insertAccount(playerid) { PlayerInfo[playerid][pSQLID] = cache_insert_id(); printf("%s s-a inregistrat cu SQLID-ul #%d.", GetName(playerid), PlayerInfo[playerid][pSQLID]); return 1; } function checkAcount(playerid) { switch(cache_num_rows()) { case 0: ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Bine ai venit!\nScrie o parola pentru a te putea inregistra.\nParola trebuie sa fie intre 6-32 caractere", "Register", "Quit"); case 1: ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Bine ai venit!\nScrie parola in casuta de mai jos pentru a te loga!", "Login", "Quit"); } return 1; } M-am ajutat de o comanda luata dupa net. public OnQueryError , eroarea este urmatoarea: [20:46:06 03/27/20] [DEBUG] mysql_connect - host: "localhost", user: "root", database: "rpg_db", password: "****", port: 3306, autoreconnect: true, pool_size: 2 [20:46:06 03/27/20] [DEBUG] CMySQLHandle::Create - creating new connection.. [20:46:06 03/27/20] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called [20:46:06 03/27/20] [DEBUG] CMySQLHandle::Create - connection created (id: 1) [20:46:06 03/27/20] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [20:46:06 03/27/20] [DEBUG] CMySQLConnection::Connect - connection was successful [20:46:06 03/27/20] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [20:46:06 03/27/20] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [20:46:06 03/27/20] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [20:46:06 03/27/20] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [20:46:06 03/27/20] [DEBUG] CMySQLConnection::Connect - connection was successful [20:46:06 03/27/20] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [20:46:07 03/27/20] [DEBUG] CMySQLConnection::Connect - connection was successful [20:46:07 03/27/20] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [20:46:07 03/27/20] [DEBUG] CMySQLConnection::Connect - connection was successful [20:46:07 03/27/20] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [20:46:37 03/27/20] [DEBUG] mysql_format - connection: 1, len: 256, format: "SELECT * FROM `users` WHERE `Name` = '%e' LIMIT 1" [20:46:37 03/27/20] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `users` WHERE `Name` = 'wRoby' LIMIT 1", callback: "checkAcount", format: "i" [20:46:37 03/27/20] [DEBUG] CMySQLQuery::Execute[checkAcount] - starting query execution [20:46:38 03/27/20] [DEBUG] CMySQLQuery::Execute[checkAcount] - query was successfully executed within 1188.293 milliseconds [20:46:38 03/27/20] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [20:46:38 03/27/20] [DEBUG] Calling callback "checkAcount".. [20:46:38 03/27/20] [DEBUG] cache_get_row_count - connection: 1 [20:46:38 03/27/20] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [20:46:41 03/27/20] [DEBUG] mysql_format - connection: 1, len: 256, format: "INSERT INTO `users` ('Name', 'Password') VALUES ('%s', '%s')" [20:46:41 03/27/20] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO `users` ('Name', 'Password') VALUES ('wRoby', '03200", callback: "insertAccount", format: "d" [20:46:41 03/27/20] [DEBUG] CMySQLQuery::Execute[insertAccount] - starting query execution [20:46:41 03/27/20] [ERROR] CMySQLQuery::Execute[insertAccount] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''Name', 'Password') VALUES ('wRoby', '032003')' at line 1 (Query: "INSERT INTO `users` ('Name', 'Password') VALUES ('wRoby', '032003')") [20:46:41 03/27/20] [DEBUG] CMySQLQuery::Execute[insertAccount] - error will be triggered in OnQueryError [20:46:41 03/27/20] [DEBUG] Calling callback "OnQueryError".. [20:46:43 03/27/20] [DEBUG] mysql_format - connection: 1, len: 256, format: "UPDATE 'users' SET 'Email' = '%s' WHERE 'ID' = '%d'" [20:46:43 03/27/20] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE 'users' SET 'Email' = 'robert' WHERE 'ID' = '0'", callback: "(null)", format: "(null)" [20:46:43 03/27/20] [DEBUG] CMySQLQuery::Execute[] - starting query execution [20:46:43 03/27/20] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''users' SET 'Email' = 'robert' WHERE 'ID' = '0'' at line 1 (Query: "UPDATE 'users' SET 'Email' = 'robert' WHERE 'ID' = '0'") [20:46:43 03/27/20] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError [20:46:43 03/27/20] [DEBUG] Calling callback "OnQueryError"..
  2. Nu ma pricep , da ce e acolo nu are logica
  3. Este facuta din capul tau sau vazuta undeva?
  4. Asta tocmai ce am terminat de facut un sistem de register vazut la un tutorial pe net. Totul mi-a mers foarte ok , nici-o eroare in script. Pana cand am vrut sa testez si am realizat ca nu merge. Dupa ce ma conectez , ma pune sa aleg o parola iar dupa asta nu se face conectarea la baza de date, pur si simplu dialogul cu register dispare si nu mai apare nimic... Putin ajutor?
  5. Recend am vazut un tutorial despre zone text, si in momentul cand trebuia sa adaug textul de m-ai jos , nu am stiut unde , deoarece cel din tutorial avea un pulbic pe care eu nu-l aveam. V-a rug ajutati-ma. foreach(Player, i) { if(ZoneIndicator[i] == 1) { new zone[32]; GetPlayer3DZone(i, zone ,sizeof(zone)); PlayerTextDrawSetString(i, ZoneIndicator, string); PlayerTextDrawShow(i, ZoneIndicator); } return }
  6. Simplu , dar nu te descuraja , acorda-i m-ai mult timp si fii sigur ca v-a iesii belea.
  7. Salut manilor , am creeat un textdraw ce contine informatii despre statusul playerului[click], health ,money ,armour ,hours , si vreau sa-l adaug in colt dreapta sus , si nu stiu cum sa scot ,fist-ul , money bar ,health bar , etc . Daca ma puteti ajuta , aveti tot respectul meu . Am m-ai vazut faza aceasta , deci se poate.
  8. public OnPlayerConnect(playerid) { ShowPlayerMarkers(2); return 1; }
  9. Dar Stock-ul acela il modifica si il foloseste pe unde vrea. Dar sunt de acord si cu tine
  10. Frumos , stiu ca e asa simplu , dar nu reuseam sa fac ,multumesc.
×
×
  • 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. For more details you can also review our Terms of Use and Privacy Policy.