SA-MP Forums Archive
a little Dini question for saving languages - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: a little Dini question for saving languages (/showthread.php?tid=138633)



a little Dini question for saving languages - a-day - 02.04.2010

Hey quys i have a little question about Dini, i never had work with dini bevor, i had read some tutorials but i dont had found a answer for my problem

so i have a simple languagesystem wish was made with

Код:
language[MAX_PLAYERS]
the system has 2 languages german and english so

Код:
language[playerid] = 0  is german and
language[playerid] = 1  is english
i want to save the languages with dini so i use

Код:
dini_IntSet(Spielerdatei,"lang", 0);
for the registration

and for the login

Код:
language[playerid] = dini_Int(Spielerdatei, "lang");
ok it works perfectly but it always saves 0 because

Код:
dini_IntSet(Spielerdatei,"lang", 0);
is 0 too

now i want to change the number via command how can i do this, i had use


Код:
new Spielerdatei[256];
Код:
if (strcmp("/0", cmdtext, true) == 0)
  {
  language[playerid] = 0;
  dini_IntSet(Spielerdatei,"lang", 0);
  LSendClientMessage(playerid,gelb,"deutsch.","german.");
  return 1;
  }

  if (strcmp("/1", cmdtext, true) == 0)
  {
  language[playerid] = 1;
  dini_IntSet(Spielerdatei,"lang", 1);
  LSendClientMessage(playerid,gelb,"englisch.","english");
  return 1;
  }
but it didnґt work nothing is changed



Re: a little Dini question for saving languages - a-day - 02.04.2010

Quote:
Originally Posted by Antoni0
Hey quys i have a little question about Dini, i never had work with dini bevor, i had read some tutorials but i dont had found a answer for my problem

so i have a simple languagesystem wish was made with

Код:
language[MAX_PLAYERS]
the system has 2 languages german and english so

Код:
language[playerid] = 0 is german and
language[playerid] = 1 is english
i want to save the languages with dini so i use

Код:
dini_IntSet(Spielerdatei,"lang", 0);
for the registration

and for the login

Код:
language[playerid] = dini_Int(Spielerdatei, "lang");
ok it works perfectly but it always saves 0 because

Код:
dini_IntSet(Spielerdatei,"lang", 0);
is 0 too

now i want to change the number via command how can i do this, i had use


Код:
new Spielerdatei[256];
Код:
if (strcmp("/0", cmdtext, true) == 0)
  {
  language[playerid] = 0;
  dini_IntSet(Spielerdatei,"lang", 0);
  LSendClientMessage(playerid,gelb,"deutsch.","german.");
  return 1;
  }

  if (strcmp("/1", cmdtext, true) == 0)
  {
  language[playerid] = 1;
  dini_IntSet(Spielerdatei,"lang", 1);
  LSendClientMessage(playerid,gelb,"englisch.","english");
  return 1;
  }
but it didnґt work nothing is changed