Jump to content
  • 0

pomoc Login


Vyholený*_*Sandokán

Dotaz

mam menši problem...ale až teraz som si to všimol..keď sa pripojim na server a zadam zle heslo vypiše Zadal si zle heslo bla bla..ale možem sa SPAWNUŤ! nevie niekto ako to spraviť že až keď nezada spravne heslo sa nemože spawnuť??

:lolol:

Link to comment
Share on other sites

12 odpovědí na tuto otázku

Recommended Posts

  • 0

načo pastebin..hodim se riadky :DD

 

public OnPlayerConnect(playerid)
{
//LOGIN===========
PLAYERLIST_authed[playerid] = false;
if (!PLAYERLIST_authed[playerid])
{
if(udb_Exists(Meno(playerid))) // Když jeho ucet existuje
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{FF1212}Prihlasenie","Vytaj späť !\nNapiš svoje heslo:","Pripojiť","Odpojiť"); // Když existuje zobrazíme dialog
}    else    {
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"{FF1212}registracia","Vytaj na servery Beta {FF1212}by Sonic !\n{FFFFFF}Prosim zaregistruj sa,napiš svoje nove heslo:","Použiť","Odpojiť"); // Když neexistuje zobrazíme dialog
}
}
LoadStats(playerid);
adminlevel[playerid] = dUserINT(Meno(playerid)).("aLevel ");
   return 0;
}

public OnPlayerDisconnect(playerid, reason)
{
//LOGIN==============
if (PLAYERLIST_authed[playerid]) // Kdyz je prihlaseny
{
dUserSetINT(Meno(playerid)).("money",GetPlayerMoney(playerid)); // Ulozime penize
}
PLAYERLIST_authed[playerid] = false; // Dame ho ze neni odpojen
//---------
   new Float:x;
new Float:y;
new Float:z;

GetPlayerPos(playerid,x,y,z);
positionx = x;
positiony = y;
positionz = z;
if (!dini_Exists(FileStats(playerid)))
{
	dini_Create(FileStats(playerid));
}

SaveStats(playerid);
dUserSetINT(Meno(playerid)).("aLevel ",adminlevel[playerid]);
return 0;
}

 

a do OnDialogResponse

 

{
   if(dialogid == 1)
{
if(response == 1)
{
if (udb_Exists(Meno(playerid))) return ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{FF1212}Registracia","\nNapiš svoje nove heslo:","Registrovať","Odpojiť");
if (strlen(inputtext)==0) return ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"{FF1212}Registracia","{FF1212}Nezadal si žiadne heslo!","Použiť","Odpojiť");
if (udb_Create(Meno(playerid),inputtext)) return ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{FF1212}Registracia","Úspešne si sa zaregistroval,prosim teraz napiš svoje heslo znova !","Použiť","Odpojiť");
}
if(response == 0)
{
Kick(playerid);
}
}
//==============================================================================
if(dialogid == 2)
{
if(response == 1)
{
if (strlen(inputtext)==0) return ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{FF1212}Registracia","{FF1212}Zadal si neplatne heslo!\nMusíš napisať svoje heslo!","Použiť","Odpojiť");
if (udb_CheckLogin(Meno(playerid),inputtext))
{
GivePlayerMoney(playerid,dUserINT(Meno(playerid)).("money")-GetPlayerMoney(playerid));
PLAYERLIST_authed[playerid] = true;
return SendClientMessage(playerid, WHITE, "{FFFFFF}[{FF1212} LOGIN {FFFFFF}]Úspešne si sa prihlasil !");
}
return ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{FF1212}Registracia","{FF1212}Zadal si nespravne heslo !","Použiť","Odpojiť");
}
if(response == 0)
{
Kick(playerid);
}
}
   return 1;
}

Link to comment
Share on other sites

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