Jump to content
  • 0

pomoc dini nenačitáva


Vyholený*_*Sandokán

Dotaz

zdravím,mám menší problem. Ak si nastavim VIP na 1,odpojim sa zo servera a znova napojim tak ho nemam,znová ho musim nastavovať.. ak by niekto vedel čo z tým,dajte mi vedieť :/

 

načitanie:

 

case DIALOG_LOGIN:
    {
	    if(!response) Kick(playerid);
	    if(response)
	    {
		    new file[64];
		    GetPlayerName(playerid,file,sizeof(file));
		    format(file,sizeof(file),"/Account/%s.ini",(file));
		    if(dini_Exists(file))
		    {
			    if(strcmp(dini_Get(file, "Heslo"),inputtext,true))
			    {
				    PlayerInfo[playerid][Kill] = dini_Int(file,"Kill");
				    PlayerInfo[playerid][Vip] = dini_Int(file,"Vip");
				    PlayerInfo[playerid][Admin] = dini_Int(file,"Admin");
				    PlayerInfo[playerid][Death] = dini_Int(file,"Death");
				    PlayerInfo[playerid][Money] = dini_Int(file,"Money");
				    GivePlayerMoney(playerid, PlayerInfo[playerid][Money]);                  
				    Login[playerid] = 1;
				    return 0;
			    }
			    else
			    {
				    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"{FF0000}*{FFFFFF}Prihlasenie{FF0000}*","{FF0000}Napisal si nesprávne heslo!\n{FFFFFF}Ak sa chceš prihlásiť,napíš svoje heslo!","Login","Odpojit");
				    return 0;
			    }
		    }
	    }
    }

Link to comment
Share on other sites

18 odpovědí na tuto otázku

Recommended Posts

  • 0

if(strcmp(dini_Get(file, "Heslo"),inputtext,true))

 

WIKI: strcmp

 

Returns -1 if string1 comes before string2

1 if string1 comes after string2

0 if the strings are the same (for the matched length)

 

Tudíž to má vypadat takto:

if(strcmp(dini_Get(file, "Heslo"),inputtext,true) == 0)

Link to comment
Share on other sites

  • 0

public OnPlayerDisconnect(playerid, reason)
{
Login[playerid] = 1;
new file[128];
format(file, sizeof(file), "Account/%s.ini", Meno(playerid));
if(!dini_Exists(file))
{
dini_Create(file);
dini_IntSet(file, "Kill", PlayerInfo[playerid][Kill]);
dini_IntSet(file, "Death", PlayerInfo[playerid][Death]);
dini_IntSet(file, "Money", PlayerInfo[playerid][Money]);
dini_IntSet(file, "Admin", PlayerInfo[playerid][Admin]);
dini_IntSet(file, "VIP", PlayerInfo[playerid][Vip]);
}
Login[playerid] = 0;
return 1;
}

 

čo tu mám zle?

Link to comment
Share on other sites

  • 0

Už dlouho (asi 2 roky) jsem v pawnu nedelal takze nevim jak moc na tom zalezi,

ale vsimni si ze kdyz ukladas tak tam mas "Vip"

PlayerInfo[playerid][Vip] = dini_Int(file,"Vip");

 

a kdyz nacitas tak "VIP"

dini_IntSet(file, "VIP", PlayerInfo[playerid][Vip]);

 

takze bych rekl ze je problem ve velikosti pismen a diky tomu se nacita neulozena informace jestli me chapes

Link to comment
Share on other sites

  • 0

Takze jsi zmenil v ukladani i nacitani to "Vip" na stejne velka pismena aby v obou bylo napsano "Vip"? a ne v jednom "Vip" a v druhem "VIP" protoze v tom by mel byt problem. Tet jsem se dival na sa-mp forum kde mel jeden chlap taky problem s ukladanim a taky tam mel ruznou velikost pismen...

Link to comment
Share on other sites

  • 0

Login[playerid] = 0;

 

SMAZAT !

BLbosť. Zmazať Login[playerid] = 1; // toto zmazať tamto nechať.

ee,nepomohlo.. to iste my robí aj z admin lvl

 

Presne ako to ukladáš tak to aj načítavaj ok ? :d Daj zaradom, Kill, deaths, money, admin, vip.. chápeš?

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