1Kubad1 18 Odesláno: 21. Říjen, 2012 Share Odesláno: 21. Říjen, 2012 cau te mam takovy problem mam tu register ale kdyz se na server pripojim neobjevi se zadna registrace ani se to asi nikam neuklada pls pomuze te mi #include <a_samp> #include <dini> #include <dudb> #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1 #pragma tabsize 0 #define BARVA 0xEFEFF7AA // Pak si můžete změnit ! new PLAYERLIST_authed[MAX_PLAYERS]; stock SystemMsg(playerid,msg[]) { if ((IsPlayerConnected(playerid))&&(strlen(msg)>0)) { SendClientMessage(playerid,COLOR_SYSTEM,msg); } stock PlayerName(playerid) { new name[255]; GetPlayerName(playerid, name, 255); return name; } return 1; } public OnPlayerConnect(playerid) { PLAYERLIST_authed[playerid] = false; if (!PLAYERLIST_authed[playerid]) { if(udb_Exists(PlayerName(playerid))) // Když jeho ucet existuje { ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Registrace","Vítej zpět !\nNapiš heslo !","Použít","Odpojit"); // Když existuje zobrazíme dialog } else { ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Registrace","Vítej !\nZaregistruj se, napiš heslo","Použít","Odpojit"); // Když neexistuje zobrazíme dialog } } return 1; } public OnPlayerDisconnect(playerid, reason) { if (PLAYERLIST_authed[playerid]) // Kdyz je prihlaseny { dUserSetINT(PlayerName(playerid)).("money",GetPlayerMoney(playerid)); // Ulozime penize } PLAYERLIST_authed[playerid] = false; // Dame ho ze neni odpojen return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == 1) { if(response == 1) { if (udb_Exists(PlayerName(playerid))) return ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Registrace","Přihlaš se ! napiš heslo","Použít","Odpojit"); if (strlen(inputtext)==0) return ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Registrace","Musíš napsat heslo !","Použít","Odpojit"); if (udb_Create(PlayerName(playerid),inputtext)) return ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Registrace","Víborně, nyní napiš znovu heslo !","Použít","Odpojit"); } if(response == 2) { Kick(playerid); } } //============================================================================== if(dialogid == 2) { if(response == 1) { if (strlen(inputtext)==0) return ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Registrace","Musíš zadat heslo !\nNapiš heslo !","Použít","Odpojit"); if (udb_CheckLogin(PlayerName(playerid),inputtext)) { GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money")-GetPlayerMoney(playerid)); PLAYERLIST_authed[playerid] = true; return SendClientMessage(playerid, BARVA, "Úspěšně přihlášen !"); } return ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Registrace","Nespravne heslo !","Použít","Odpojit"); } if(response == 2) { Kick(playerid); } return 1; } return 0; } stock PlayerName(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name)); return name; } Link to comment Share on other sites More sharing options...
0 Michael 4 Odesláno: 22. Říjen, 2012 Share Odesláno: 22. Říjen, 2012 "Registrace","vÍborně, nyní napiš znovu heslo !" Dalsí zabiják Link to comment Share on other sites More sharing options...
0 ATomas 291 Odesláno: 22. Říjen, 2012 Share Odesláno: 22. Říjen, 2012 Pokud ten script pouzivas jako filterscript, tak se tam callback OnPlayerConnect a OnPlayerDisconnect nevyvola. Dalsi vec, pokud jsi sem dal jen cast kodu, tak si skontroluj, zda ti to v OnPlayerConnect neco nezastavi (return, nebo zasah do neexistujici promene) driv nez se ti to dostane k dialogu prihlaseni. Link to comment Share on other sites More sharing options...
0 ATomas 291 Odesláno: 22. Říjen, 2012 Share Odesláno: 22. Říjen, 2012 Nevim co se stalo s tlacitkem upravit.... Jinak jsem si vsiml ze response == 2 prepis na response == 0 prvni tlacitko je 1 a druhe je 0 jako true a false. Link to comment Share on other sites More sharing options...
0 Hrb™ 48 Odesláno: 22. Říjen, 2012 Share Odesláno: 22. Říjen, 2012 Založil si několik témat. Tady už to má poopravované. http://pawno.cz/index.php?/topic/43080-helpregistrace-ukladani/ 1 Link to comment Share on other sites More sharing options...
Dotaz
1Kubad1 18
cau te mam takovy problem mam tu register ale kdyz se na server pripojim neobjevi se zadna registrace ani se to asi nikam neuklada pls pomuze te mi
Link to comment
Share on other sites
4 odpovědí na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now