Jump to content

pomoc Co to ?


DaNeX

Recommended Posts

Nevíte proč se vždy při registraci nového hráče  načtou informace posledního hráče co dal /q ?

 

 

connect

 


new Gracz [64];

new Gname [MAX_PLAYER_NAME];

GetPlayerName(playerid,Gname,sizeof(Gname));

format(Gracz,sizeof(Gracz), "/ExpAcc/%s.cfg",Gname);

if(DOF2_FileExists(Gracz))

{

SendClientMessage(playerid, -1, "Tvůj účet /estats /stats /levely se úspěšně načetl!");

pEInfo[playerid][uroven] = DOF2_GetInt(Gracz, "Level");

pEInfo[playerid][Exp] = DOF2_GetInt(Gracz, "Exp");

pEInfo[playerid][Respect] = DOF2_GetInt(Gracz, "Respect");

pEInfo[playerid][Kills] = DOF2_GetInt(Gracz, "Kills");

pEInfo[playerid][Deaths] = DOF2_GetInt(Gracz, "Deaths");

pEInfo[playerid][mExp] = DOF2_GetInt(Gracz, "mExp");

pEInfo[playerid][mMoney] = DOF2_GetInt(Gracz, "mMoney");

pEInfo[playerid][Combo] = DOF2_GetInt(Gracz, "Combo");

SendClientMessage(playerid, -1, "{00CC00}Tohle je Admin Server.{00FF00} ( Pracuje na bázi Expení. Každý další level se ti odemkne nový příkaz /levely )");

}

else

{

SendClientMessage(playerid, -1, "Tvůj účet /estats /stats /levely zde není. Nyní byl zaregistrován!");

DOF2_CreateFile(Gracz);

DOF2_SetInt(Gracz,"Level",0);

DOF2_SetInt(Gracz,"Exp",0);

DOF2_SetInt(Gracz,"Respect",0);

DOF2_SetInt(Gracz,"Kills",0);

DOF2_SetInt(Gracz,"Deaths",0);

DOF2_SetInt(Gracz,"mExp",0);

DOF2_SetInt(Gracz,"mMoney",0);

DOF2_SetInt(Gracz,"Combo",0);

DOF2_SaveFile();

}

 


 

Disconnect

 



public OnPlayerDisconnect(playerid, reason)

{

new Gracz [64];

new Gname[MAX_PLAYER_NAME];

GetPlayerName(playerid,Gname,sizeof(Gname));

format(Gracz,sizeof(Gracz),"/ExpAcc/%s.cfg",Gname);

if(DOF2_FileExists(Gracz))

{

DOF2_SetInt(Gracz,"Level",pEInfo[playerid][uroven]);

DOF2_SetInt(Gracz,"Exp",pEInfo[playerid][Exp]);

DOF2_SetInt(Gracz,"Respect",pEInfo[playerid][Respect]);

DOF2_SetInt(Gracz,"Kills",pEInfo[playerid][Deaths]);

DOF2_SetInt(Gracz,"mExp",pEInfo[playerid][mExp]);

DOF2_SetInt(Gracz,"mMoney",pEInfo[playerid][mMoney]);

DOF2_SetInt(Gracz,"Combo",pEInfo[playerid][mExp]);

DOF2_SaveFile();

}


Edited by DaNeX
Link to comment
Share on other sites

Tiež som mal takýto istý problém s DOF2, aj napriek tomu že som pri disconnecte všetkým premenným nastavil hodnotu na 0.

Vyriešil som to prechodom na klasiku, fread/fwrite.

Link to comment
Share on other sites

To je asi co ? lol..

 

 

SendClientMessage(playerid, -1, "Tvůj účet /estats /stats /levely zde není. Nyní byl zaregistrován!");
DOF2_CreateFile(Gracz);
DOF2_SetInt(Gracz,"Level",0);
DOF2_SetInt(Gracz,"Exp",0);
DOF2_SetInt(Gracz,"Respect",0);
DOF2_SetInt(Gracz,"Kills",0);
DOF2_SetInt(Gracz,"Deaths",0);
DOF2_SetInt(Gracz,"mExp",0);
DOF2_SetInt(Gracz,"mMoney",0);
DOF2_SetInt(Gracz,"Combo",0);
DOF2_SaveFile();
}

Link to comment
Share on other sites

Trotl.. :d 

 

connect

 

 

 

 

new Gracz [64];
new Gname [MAX_PLAYER_NAME];
GetPlayerName(playerid,Gname,sizeof(Gname));
format(Gracz,sizeof(Gracz), "/ExpAcc/%s.cfg",Gname);
if(DOF2_FileExists(Gracz))
{
SendClientMessage(playerid, -1, "Tvůj účet /estats /stats /levely se úspěšně načetl!");
pEInfo[playerid][uroven] = DOF2_GetInt(Gracz, "Uroven");
pEInfo[playerid][Exp] = DOF2_GetInt(Gracz, "Exp");
pEInfo[playerid][Respect] = DOF2_GetInt(Gracz, "Respect");
pEInfo[playerid][Kills] = DOF2_GetInt(Gracz, "Kills");
pEInfo[playerid][Deaths] = DOF2_GetInt(Gracz, "Deaths");
pEInfo[playerid][mExp] = DOF2_GetInt(Gracz, "mExp");
pEInfo[playerid][mMoney] = DOF2_GetInt(Gracz, "mMoney");
pEInfo[playerid][Combo] = DOF2_GetInt(Gracz, "Combo");
SendClientMessage(playerid, -1, "{00CC00}Tohle je Admin Server.{00FF00} ( Pracuje na bázi Expení. Každý další level se ti odemkne nový příkaz /levely )");
}
else
{
SendClientMessage(playerid, -1, "Tvůj účet /estats /stats /levely zde není. Nyní byl zaregistrován!");
DOF2_CreateFile(Gracz);
DOF2_SetInt(Gracz,"Uroven",0);
DOF2_SetInt(Gracz,"Exp",0);
DOF2_SetInt(Gracz,"Respect",0);
DOF2_SetInt(Gracz,"Kills",0);
DOF2_SetInt(Gracz,"Deaths",0);
DOF2_SetInt(Gracz,"mExp",0);
DOF2_SetInt(Gracz,"mMoney",0);
DOF2_SetInt(Gracz,"Combo",0);
DOF2_SaveFile();
pEInfo[playerid][uroven] = 0;
pEInfo[playerid][Exp] = 0;
pEInfo[playerid][Respect] = 0;
pEInfo[playerid][Kills] = 0;
pEInfo[playerid][Deaths] = 0;
pEInfo[playerid][mExp] = 0;
pEInfo[playerid][mMoney] = 0;
pEInfo[playerid][Combo] = 0;
}
 

 
 
Dává furt 0 i když již je registrováno 
 
disconnect
 

new Gracz [64];
new Gname[MAX_PLAYER_NAME];
GetPlayerName(playerid,Gname,sizeof(Gname));
format(Gracz,sizeof(Gracz),"/ExpAcc/%s.cfg",Gname);
if(DOF2_FileExists(Gracz))
{
DOF2_SetInt(Gracz,"Level",pEInfo[playerid][uroven]);
DOF2_SetInt(Gracz,"Exp",pEInfo[playerid][Exp]);
DOF2_SetInt(Gracz,"Respect",pEInfo[playerid][Respect]);
DOF2_SetInt(Gracz,"Kills",pEInfo[playerid][Deaths]);
DOF2_SetInt(Gracz,"mExp",pEInfo[playerid][mExp]);
DOF2_SetInt(Gracz,"mMoney",pEInfo[playerid][mMoney]);
DOF2_SetInt(Gracz,"Combo",pEInfo[playerid][mExp]);
DOF2_SaveFile();
}


?

Edited by DaNeX
Link to comment
Share on other sites

dini je sice mnohel lehčí než DOF2 a y_ini, ale je taky o dost (a to opravdu o hodně) pomalejší. Takže je rozhodně lepší se naučit tyhle novější. Beztak za to nemůže dof2, chybu bude mít někde on, protože s tím zřejmě neumí. :d;)

Link to comment
Share on other sites

dini je sice mnohel lehčí než DOF2 a y_ini, ale je taky o dost (a to opravdu o hodně) pomalejší. Takže je rozhodně lepší se naučit tyhle novější. Beztak za to nemůže dof2, chybu bude mít někde on, protože s tím zřejmě neumí. :d;)

ano DOF2 je težká protože tam má v názvu 2 že?

 

DOF2_SetInt(Soubor,key,int);

 

dini_SetInt(Soubor,key,int);

 

fakt je to moc složité je tam ta dvojka no... :d

  • Líbí se mi to! (+1) 1
Link to comment
Share on other sites

Mám to furt stejně ( jak v poslením mém komentáři)

 

Při novém účtě mám vše na nule. Dám si Level na 33 , odpojím se ze hry .. připojím se a stejně se to zase dá všechno na nulu .. 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...