Jump to content
  • 0

pomoc Login problém


Kvostyc

Dotaz

čus mám urobenú registráciu cez dini ale ked sa odpojím tak sa mi nevytvára zložka

 

 

onplayerdisconnect:

 

 

 

 

 

 

new cesta[50];
format(cesta, sizeof(cesta), "/PlayerInfo/%s.ini", PlayerName(playerid));
if(dini_Exists(cesta))
{
   dini_Create(cesta);
   GetPlayerHealth(playerid,pInfo[playerid][pHealth]);
   GetPlayerArmour(playerid,pInfo[playerid][pArmour]);
GetPlayerPos(playerid, pInfo[playerid][pX], pInfo[playerid][pY], pInfo[playerid][pZ]);
dini_IntSet(cesta,"Heslo",pInfo[playerid][Heslo]);
dini_Set(cesta, "Meno", PlayerName(playerid));
dini_FloatSet(cesta, "X", pInfo[playerid][pX]);
dini_FloatSet(cesta, "Y", pInfo[playerid][pY]);
dini_FloatSet(cesta, "Z", pInfo[playerid][pZ]);
dini_IntSet(cesta, "AdminLevel", pInfo[playerid][pAdminLevel]);
dini_IntSet(cesta, "Money", GetPlayerMoney(playerid));
dini_IntSet(cesta, "Skin", GetPlayerSkin(playerid));
dini_BoolSet(cesta, "Vodicak", pInfo[playerid][Vodicak]);
dini_IntSet(cesta, "WantedLevel", GetPlayerWantedLevel(playerid));
dini_FloatSet(cesta, "HP", floatround(pInfo[playerid][pHealth]));
dini_FloatSet(cesta, "Vesta", floatround(pInfo[playerid][pArmour]));
dini_IntSet(cesta, "Vezenie", pInfo[playerid][Vezenie]);
}








dialogy:




if(dialogid == DIALOG_REGISTER)
{
         
       if(response)
{
           if(strlen(inputtext))
{
new cesta[50];
format(cesta, sizeof(cesta), "/PlayerInfo/%s.ini", PlayerName(playerid));
   GetPlayerHealth(playerid,pInfo[playerid][pHealth]);
   GetPlayerArmour(playerid,pInfo[playerid][pArmour]);
GetPlayerPos(playerid, pInfo[playerid][pX], pInfo[playerid][pY], pInfo[playerid][pZ]);
dini_Create(cesta);
dini_IntSet(cesta,"Heslo",num_hash(inputtext));
dini_Set(cesta, "Meno", PlayerName(playerid));
dini_FloatSet(cesta, "X", pInfo[playerid][pX]);
dini_FloatSet(cesta, "Y", pInfo[playerid][pY]);
dini_FloatSet(cesta, "Z", pInfo[playerid][pZ]);
dini_IntSet(cesta, "AdminLevel", pInfo[playerid][pAdminLevel]);
dini_IntSet(cesta, "Money", GetPlayerMoney(playerid));
dini_IntSet(cesta, "Skin", GetPlayerSkin(playerid));
dini_BoolSet(cesta, "Vodicak", pInfo[playerid][Vodicak]);
dini_IntSet(cesta, "WantedLevel", GetPlayerWantedLevel(playerid));
dini_FloatSet(cesta, "HP", floatround(pInfo[playerid][pHealth]));
dini_FloatSet(cesta, "Vesta", floatround(pInfo[playerid][pArmour]));
dini_IntSet(cesta, "Vezenie", pInfo[playerid][Vezenie]);
           }
       }
       else
{
           Kick(playerid);
       }
     }
     if(dialogid == DIALOG_LOGIN)
{
new cesta[50];
format(cesta, sizeof(cesta), "/PlayerInfo/%s.ini", PlayerName(playerid));
        if(response)
{
            if(strlen(inputtext))
{
                 if(num_hash(inputtext) != dini_Int(cesta, "Heslo"))
{
                     ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", "Zadaj heslo", "Ok", "Cancel");
                 }
                 else
{
strmid(PlayerName(playerid), dini_Get(cesta, "Meno"), false, strlen(dini_Get(cesta, "Meno")), MAX_PLAYER_NAME);
pInfo[playerid][pX] = dini_Float(cesta, "X");
pInfo[playerid][pY] = dini_Float(cesta, "Y");
pInfo[playerid][pZ] = dini_Float(cesta, "Z");
pInfo[playerid][pAdminLevel] = dini_Int(cesta, "AdminLevel");
pInfo[playerid][Vodicak] = dini_Bool(cesta, "Vodicak");
GivePlayerMoney(playerid, dini_Int(cesta, "Money"));
pInfo[playerid][pHealth] = dini_Float(cesta, "HP");
pInfo[playerid][pArmour] = dini_Float(cesta, "Vesta");
SetPlayerSkin(playerid, dini_Int(cesta, "Skin"));
SetPlayerPos(playerid, pInfo[playerid][pX], pInfo[playerid][pY], pInfo[playerid][pZ]);
SetPlayerHealth(playerid,pInfo[playerid][pHealth]);
SetPlayerArmour(playerid,pInfo[playerid][pArmour]);
                 }
     }
         }
        else
{
            Kick(playerid);
        }
        }
}

 

Link to comment
Share on other sites

4 odpovědí na tuto otázku

Recommended Posts

  • 0

A ty lomítka před PlayerInfo jsou na co?

format(cesta, sizeof(cesta), "/PlayerInfo/%s.ini", PlayerName(playerid));

takhle (bez lomítka před PlayerInfo) :

format(cesta, sizeof(cesta), "PlayerInfo/%s.ini", PlayerName(playerid));
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...