neviem prečo ale stále to nejde
Se nechce prostě ukládat dám si peníze ve hře vypnu se a stejně mi to nedá do %s.ini nevím čím to je prosím help
public OnPlayerConnect(playerid)
{
logged[playerid] = 0;
new file[50];
format(file,sizeof(file),"/%s.ini",PlayerName(playerid)); //%s - je Hráčové meno ktoré je za čiarkou. pravdaže tam môže byť aj nejaká premenná
if(!dini_Exists(file)){ //Ak neexistuje súbor
dini_Create(file); // Vytvorí ho
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Registrácia","Zadajte svoje heslo:","Registrovať","Zrušiť"); /// Zobrazenie dialógu s registráciou
}else{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Prihlásenie","Zadajte svoje heslo:","Prihlásiť","Zrušiť"); // Zobrazenie dialógu s prihlásením
}
return 1;
}
registrace:
new cesta[100]; // zadefinujeme novu cestu ukladania
format(cesta, sizeof(cesta), "/%s.ini", PlayerName(playerid)); // Zas to čo aj v OnPlayerConnect
ShowPlayerDialog(playerid,99,DIALOG_STYLE_MSGBOX,"{CC0000}Registrace","{00FF33}Úspěšně ses zaregistroval !","OK",""); // Naskočí dialog že sa úspešne registroval
dini_Set(cesta,"Nick",PlayerName(playerid)); // Uloží meno
dini_Set(cesta,"Heslo",inputtext);
dini_IntSet(cesta,"Skin",GetPlayerSkin(playerid)); // skin
dini_IntSet(cesta,"Ridicak",Ridicak[playerid]);
dini_IntSet(cesta,"Letecak",Letecak[playerid]);
dini_IntSet(cesta,"Money",GetPlayerMoney(playerid)); // prachy
logged[playerid] = 1; // Nastaví ho za prihláseného
Login:
format(cesta, sizeof(cesta), "/%s.ini", PlayerName(playerid));
if(!strcmp(dini_Get(cesta, "heslo"), inputtext)){ // Získa heslo a skontroluje ho s textom
if(strlen(inputtext)>1) // Ak je tam viac ako 1znak (pre istotu)
{ //
ShowPlayerDialog(playerid,100,DIALOG_STYLE_MSGBOX,"{CC0000}Přihlášení","{00FF33}Přihlášení proběhlo úspěšne!","OK","");
SetPlayerMoney(playerid, dini_Int(cesta, "Money"));
SetPlayerSkin(playerid, dini_Int(cesta, "Skin"));
Ridicak[playerid] = dini_Int(cesta,"Ridicak");
Letecak[playerid] = dini_Int(cesta,"Letecak");
logged[playerid] = 1; // Prihlási ho