Jump to content

Registrace přes dialog


AvestX

Recommended Posts

Zdar, takže Mizi udělal registraci přes dialog, to tu bylo před tim, ale nyní jsem udělal vlastní 100% Funkční registraci přes dialog !

Takže, nahoru do modu:

#include  // Má každý 
#include  // Pokud nemáte stahněte www.pawno.cz/include
#include  // Pokud nemáte stahněte www.pawno.cz/include

nyní pokud nemáte definaci DCMD tak nahoru:

#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

Nyní si nadefinujeme barvu pro ty co to chtějí skusit:

#define BARVA 0xEFEFF7AA // Pak si můžete změnit !

a pod to

new PLAYERLIST_authed[MAX_PLAYERS];

pod to znovu pokud nemáte vložte:

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;
}


Nyní do OnPlayerConnect:

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
}
}


Nyní OnPlayerDisconnect

if (PLAYERLIST_authed[playerid]) // Kdyz je prihlaseny
{
dUserSetINT(PlayerName(playerid)).("money",GetPlayerMoney(playerid)); // Ulozime penize
}
PLAYERLIST_authed[playerid] = false; // Dame ho ze neni odpojen 


A nyní OnDialogResponse

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);
}
}

Všechno není popsaný pac me to nebaví :d ale kdyz tomu nerozumite tak si to nedělejte ... je to predelana normal registracka od Daffyho ..

Link to comment
Share on other sites

  • Replies 312
  • Created
  • Last Reply

Top Posters In This Topic

ja mam errory jak svina:

 

C:\Users\David PC.DAVID-PC\Desktop\untitlm.pwn(200) : error 021: symbol already defined: "Jmeno"

C:\Users\David PC.DAVID-PC\Desktop\untitlm.pwn(249) : warning 204: symbol is assigned a value that is never used: "Informace"

C:\Users\David PC.DAVID-PC\Desktop\untitlm.pwn(783) : error 017: undefined symbol "Informace"

C:\Users\David PC.DAVID-PC\Desktop\untitlm.pwn(783) : warning 215: expression has no effect

C:\Users\David PC.DAVID-PC\Desktop\untitlm.pwn(783) : error 001: expected token: ";", but found "]"

C:\Users\David PC.DAVID-PC\Desktop\untitlm.pwn(783) : error 029: invalid expression, assumed zero

C:\Users\David PC.DAVID-PC\Desktop\untitlm.pwn(783) : fatal error 107: too many error messages on one line

 

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

 

 

5 Errors.

Link to comment
Share on other sites

Tvl.. Jsi sem mel hodit muj ze stolkara..

Lol tu tvoju

čo musimš napisať login aby sa ty zobrazilo okno :d a ked už sa zaregistruješ a potom sa chceš prihlasiť tak stači dať esc a nemusiš sa ani prihlasiť alebo znova napisať register a zmeniť heslo :d

Link to comment
Share on other sites

  • Majitel
Tvl.. Jsi sem mel hodit muj ze stolkara..

Lol tu tvoju

čo musimš napisať login aby sa ty zobrazilo okno :d a ked už sa zaregistruješ a potom sa chceš prihlasiť tak stači dať esc a nemusiš sa ani prihlasiť alebo znova napisať register a zmeniť heslo :d

 

Kdybys nebyl blbej tak si to upravis :)

Link to comment
Share on other sites

E:\DOCUME~1\free\Plocha\PEOPLE~1.PWN(2) : fatal error 100: cannot read from file: "dini"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Error.

 

Help co stim je?

Link to comment
Share on other sites

  • 2 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...