Jump to content

DrakusorU

Membru
  • Posts

    24
  • Joined

  • Last visited

    Never

About DrakusorU

  • Birthday 09/08/1995

DrakusorU's Achievements

Explorer

Explorer (4/14)

  • First Post
  • Collaborator
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. De curiozitate, v-ati uitat cand am creeat topicul si cand am dat reply ?. Stiti macar ce este ala "dublu post" ?. Titlul nu are nicio problema, m-ati inebunit, ce vroiati sa pun ?. "Intrati ba aici ca am problimi cu o casoaie mare!" ?. :-j. Vorbiti si voi ca sa va aflati in treaba ( vorba vine, vorbiti ). Daca era sa fie "RemoveBuildingForPlayer" cauza, nu crezi ca disparea de tot cladirea de acolo ?. Nu doar geamurile alea.
  2. Salut, am si eu o problema, mai mare dar nici chiar atat de mare =)). Bun, deci stiti cladirea aceea cu lift de langa Glen Park, de pe D. Los Santos, ma rog... Ei bine, problema este urmatoarea, pe server aceea cladire nu are geamuri, nimic... Explicatie si rezolvare ?. :-??. Chiar daca este vorba despre un mod RPG, nu cred ca se incadreaza la "GF/RP Stuff" pt. ca am mai intalnit chestia asta si pe un server stunt, drift, parkour, bla, bla...
  3. Salut, am si eu o problema, mai mare dar nici chiar atat de mare =)). Bun, deci stiti cladirea aceea cu lift de langa Glen Park, de pe D. Los Santos, ma rog... Ei bine, problema este urmatoarea, pe server aceea cladire nu are geamuri, nimic... Explicatie si rezolvare ?. :-??. Chiar daca este vorba despre un mod RPG, nu cred ca se incadreaza la "GF/RP Stuff" pt. ca am mai intalnit chestia asta si pe un server stunt, drift, parkour, bla, bla...
  4. Am modificat azi de dimineat?, f?cusem în altfel cu speran?a c? o s? mearg?, dar tot nimic. public InitRestartFunction() { //new string[128]; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { AccountUpdate(i); pData[i][Logged] = false; } } SetTimer("RestartFunction", 5000, 0); return 1; } public RestartFunction() { GameModeExit(); } public OnGameModeExit() { db_close(Database); return 1; } public OnPlayerDisconnect(playerid, reason) { if(pData[playerid][Logged]) { AccountUpdate(playerid); } pData[playerid][Logged] = false; return 1; } public AccountUpdate(playerid) { new query[700], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); if(AccountExists(playerid)) { format(query, sizeof(query), "UPDATE `Users` SET \ `SpawnLocation` = '%d', \ `Registred` = '%d', \ `AdminLevel` = '%d', \ `Level` = '%d', \ `Money` = '%d', \ `Sex` = '%d', \ `Age` = '%d' WHERE ( `Name` = '%s' )", pData[playerid][SpawnLocation], pData[playerid][Registred], pData[playerid][Admin], pData[playerid][Level], pData[playerid][Money], pData[playerid][Sex], pData[playerid][Age], DB_Escape(name)); db_query(Database, query); } else { SendClientMessage(playerid, ~1, "{FFFFFF}This account doesn't exist..."); } } A?a am acum în script, ?i tot nu se actulizeaz? baza de date, am încercat testând adminul, îmi d?deam admin ?i dup? d?deam restart la server sau ie?eam dup? server ?i nimic. Când m? conectam din nou nu mai aveam adminul. ?i comanda : CMD:sadmin( playerid, params[] ) { if(IsPlayerConnected(playerid)) { if(pData[playerid][Admin] >= 0) { if(IsPlayerConnected(playerid)) { pData[playerid][Admin] = 7; SendClientMessage(playerid, ~1, ""#Red"* "#White"Hi, welcome back."); } } } return 1; } EDIT : Rezolvat, nu era de aici, la dialog-ul pentru login nu era un field complet.
  5. LOL !. De aici era... Nu-i d?dusem deloc aten?ie acestui lucru =))). Eu credeam c? e bine f?cut acolo. Po?i închide topic-ul, mersi. EDIT : Am rezolvat chestia asta, dar acum nu reu?esc s? fac s? actualizeze informa?iile din baza de date. Pur ?i simplu nu se actualizeaz?. Am f?cut în urm?torul fel : forward AccountUpdate(playerid); forward InitRestartFunction(); forward RestartFunction(); public InitRestartFunction() { //new string[128]; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { AccountUpdate(i); pData[i][Logged] = false; } } SetTimer("RestartFunction", 5000, 0); return 1; } public RestartFunction() { GameModeExit(); } public OnGameModeExit() { db_close(Database); return 1; } public OnPlayerDisconnect(playerid, reason) { if(pData[playerid][Logged] == true) { AccountUpdate(playerid); pData[playerid][Logged] = false; } return 1; } public AccountUpdate(playerid) { new query[256], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(query, sizeof(query), "UPDATE `Users` SET `SpawnLocation` = '%d', `Registred` = '%d', `AdminLevel` = '%d', `Level` = '%d', `Money` = '%d', `Sex` = '%d', `Age` = '%d' WHERE `Name` = '%s'", pData[playerid][SpawnLocation], pData[playerid][Registred], pData[playerid][Admin], pData[playerid][Level], pData[playerid][Money], pData[playerid][Sex], pData[playerid][Age], DB_Escape(name)); db_query(Database, query); db_free_result(db_query(Database, query)); }
  6. Tot a?a, am pus scriptul mai sus, po?i s?-l testezi ?i tu s? vezi xD. Problema e c? nu insereaz? datele în tabelul Users.
  7. Încerc acum, revin cu edit. Edit : Nu merge nici a?a, dup? ce m? înregistrez, îmi apare dialog-ul pentru login, scriu parola, îmi spune c? este gre?it?, scriu parola din nou, ?i ori îmi apare dialog-ul pentru login din nou, ori dispare de tot. http://www.mediafire.com/?qhukviky28uk25f - Poftim, l-am uplodat aici, poate reu?e?ti s?-l faci, dac? m? crezi c? am început s?-l fac acum o lun?, ?i n-am reu?it deloc s? fac asta... Ce-i drept, dup? 2 s?pt?mâni l-am dat naibi ?i l-am l?sat acolo, iar acum o s?pt?mân? m-am apucat din nou de el.
  8. Alte 24 h trecute, chiar nimeni frate... :| Edit : Cred c? am g?sit ceva, dar nu ?tiu ce s?-i fac, se pare c? nu insereaz? în baza de date informa?iile juc?torului, nici m?car numele ?i parola
  9. Salut, acum ceva timp, m-am apucat s? fac un script RPG de la 0 folosind SQL. Pân? aici totul a fost bine, dar de aici, totul s-a dat peste cap ?i prin încerc?riile mele nereu?ite de a g?si o cale s? rezolv acest? problem?, m-am hot?rât s? cer ajutorul. Problema este urm?toarea : Când m? conectez pe server, îmi apare dialogul pentru a m? înregistra, m? înregistrez, apare dialogul pentru login, pân? aici totul bine. Dar când s? bag parola ca s? m? loghez, "surprise", îmi spune c? parola introdus? nu este corect?. De?i parola era una destul de simpl?, ( 123456 ), bun, o bag din nou, ?i în loc s? m? spawneze cum era normal, îmi apare dialog-ul pentru login din nou. ?i a?a o i-au de la cap?t de fiecare dat?, bag parola, zice c? este gre?it?, o bag din nou, îmi d? dialog-ul pentru login... În?elege?i voi. Scriptul ar fi urm?torul : Aici am mici dubii... Nu ?tiu dac? este corect. Database = db_open("Users.db"); db_query(Database, "CREATE TABLE IF NOT EXISTS `Users` (`Name`, `Password`, `SpawnLocation`, `AccountInfo`, `AdminLevel`, `Level`, `Money`, `Sex`, `Age`)"); return 1; Comenzile pentru înregistrare ?i login. new query[256], DBResult: Result, name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); if(dialogid == Login) { if(response) { format(query, sizeof(query), "SELECT * FROM `Users` WHERE `Name` = '%s' AND `Password` = '%s'", DB_Escape(name), DB_Escape(inputtext)); Result = db_query(Database, query); if(db_num_rows(Result)) { new Field[20] ; db_get_field_assoc(Result, "Level", Field, 30 ); pData[playerid][Level] = strval(Field); db_get_field_assoc(Result, "Money", Field, 30 ); pData[playerid][Money] = strval(Field); SetPlayerScore(playerid, pData[playerid][Level]); ResetPlayerMoney(playerid); GivePlayerMoney(playerid, pData[playerid][Money]); pData[playerid][Logged] = true; SpawnPlayer(playerid); } else { format(query, sizeof(query), "The password entered is wrong, please try again, but now typing the correctly password.\n\n\n\n"); ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Login", query, "Login", "Exit"); } db_free_result(Result); } else return Kick(playerid); } if(dialogid == Register) { if(response) { if(strlen(inputtext) > 15 || strlen(inputtext) < 5) { format(query, sizeof(query), ""#White"Your password length must be from 5 - 15 characters !.\n\n\n\n"); ShowPlayerDialog(playerid, 0, DIALOG_STYLE_INPUT, "Register", query, "Register", "Exit"); } else { format(query, sizeof(query), "INSERT INTO `Users` (`Name`, `Password`, `SpawnLocation`, `AccountInfo`, `AdminLevel`, `Level`, `Money`, `Sex`, `Age`) VALUES ('%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')", DB_Escape(name), DB_Escape(inputtext), pData[playerid][SpawnLocation], pData[playerid][AccountInfo], pData[playerid][Admin], GetPlayerScore(playerid), GetPlayerMoney(playerid), pData[playerid][Sex], pData[playerid][Age]); db_query(Database, query); format(query, sizeof(query), "{FFFFFF}You have registered successfully, {F2B90E}%s{FFFFFF}. Your password is : {F2B90E}%s {FFFFFF}.\n\n\nNow, to login type the password here.", name, DB_Escape(inputtext)); ShowPlayerDialog(playerid, Login, DIALOG_STYLE_INPUT, "Login", query, "Login", "Exit"); db_free_result(db_query(Database, query)); } } else return Kick(playerid); }
  10. DrakusorU

    SQLite

    Pai, faza e ca la register dupa ce bag parola nu-mi apare dialog-ul pentru login . D'asta iti cerusem id-ul de mess, sa te uiti putin la script si sa-mi zici si mie un am gresit.. + ca mai am niste probleme legate de SQLite si eu unu cred ca e mai usor sa le discutam pe mess. xD Am pus mai sus dialoguriile..
  11. DrakusorU

    SQLite

    M-am luat dupa comanda din scriptu' facut de Zh3r0 si asa era si acolo :-?? :-s.. Nu inteleg cum sa fac + ca dupa ce ma inregistrez nu-mi afiseaza dialog-ul pentru login :-s
  12. DrakusorU

    SQLite

    Foarte bun tutorialul. Am incercat sa fac Login-ul si Register-ul inputtext, dar am o problema la register. Acesta este dialog-ul pentru register. [pawn] if(dialogid == Dialog_Register) { if(response) { if(strlen(inputtext)) { new Query[256], DBResult:Result; format(Query, sizeof(Query), "SELECT * FROM `Users` WHERE `Name` = '%s'", Name(playerid)); Result = db_query(Database, Query); if(!db_num_rows(Result)) { if(strlen(inputtext) >= 5 && strlen(inputtext) <= 24) { FormatQuery( Query, "INSERT INTO `Users` (`Name`, `Password`, `Level`, `Money`, `SpawnLocation`, `AccountInfo`, `Sex`, `Age`) VALUES('%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d')", Name(playerid), pData[playerid][Password], GetPlayerScore(playerid), GetPlayerMoney(playerid), pData[playerid][spawnLocation], pData[playerid][AccountInfo], pData[playerid][sex], pData[playerid][Age]); db_free_result( db_query(Database, Query) ); new loginname[64]; GetPlayerName(playerid, loginname, sizeof(loginname)); format(Query, sizeof(Query), "{FFFFFF}You have registered successfully, {F2B90E}%s{FFFFFF}. Your password is : {F2B90E}%s {FFFFFF}.\n\n\nNow, to login type the password here.", loginname, pData[playerid][Password]); ShowPlayerDialog(playerid, Dialog_Login, DIALOG_STYLE_INPUT, "Login", Query, "Login", "Exit"); } else { new registerstring[128]; format(registerstring, sizeof(registerstring), "{FFFFFF}Your password must to be between 5 and 24 characters.\n\n\n\n"); ShowPlayerDialog(playerid, Dialog_Register, DIALOG_STYLE_INPUT, "Register", registerstring, "Register", "Exit"); } } } } else { Kick(playerid); } }[/pawn] Si aceasta este cel pentru login. [pawn] if(dialogid == Dialog_Login) { if(response) { if(strlen(inputtext)) { new Query[256], DBResult:Result ; FormatQuery(Query, "SELECT * FROM `Users` WHERE `Name` = '%s'", Name(playerid)); Result = db_query(Database,Query); if(db_num_rows(Result)) { FormatQuery(Query, "SELECT * FROM `Users` WHERE `Name` = '%s' AND `Password` = '%s'", Name(playerid), pData[playerid][Password]); Result = db_query(Database,Query); if(db_num_rows(Result)) { new Field[30] ; db_get_field_assoc(Result, "Level", Field, 30 ); pData[playerid][Level] = strval(Field); db_get_field_assoc(Result, "Money", Field, 30 ); pData[playerid][Money] = strval(Field); SetPlayerScore(playerid, pData[playerid][Level]); ResetPlayerMoney(playerid); GivePlayerMoney(playerid, pData[playerid][Money]); pData[playerid][Logged] = true; } else { new loginstring[128]; format(loginstring, sizeof(loginstring), "The password entered is wrong, please try again, but now typing the correctly password.\n\n\n\n"); ShowPlayerDialog(playerid, Dialog_Login, DIALOG_STYLE_INPUT, "Login", loginstring, "Login", "Exit"); db_free_result(Result); } } else { new registerstring[128]; format(registerstring, sizeof(registerstring), "{FFFFFF}You don't have a account, please type the password you want and press 'Register' .\n\n\n\n"); ShowPlayerDialog(playerid, Dialog_Register, DIALOG_STYLE_INPUT, "Register", registerstring, "Register", "Exit"); } db_free_result(Result); } } else { Kick(playerid); } }[/pawn] Dupa ce ma inregistrez nu imi afiseaza dialog-ul pentru Login si nu inteleg unde am gresit.. Zh3r0, daca ai putea sa-mi dai pm cu un id de contact sa ma ajuti putin, daca vrei.
  13. Cookie, inainte sa sari de cur in sus uitate mai atent in jurul tau si gandescte de 2 ori inainte de a mai face ceva. Tocmai a zis in postul lui de mai sus ca el pantelimonfl. + Uitate la poze, e facut de un roman, pana si la semnatura are un server romanesc ( xD - pe sa-mp.com ).
×
×
  • 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.