Jump to content
  • 0

vreau sa invat dini


amaru

Question

Am gasit un singur tutorial pe forumul asta din care sincer am inteles ceva, dar este cu dcmd si momentan nu ma intereseaza.

Nu-mi ziceti sa incerc y_ini. Vreau sa invat ce e mai simplu.

Am luat tot fisierul .inc la mana si am scos toate functiile sa mi le explicati. Unde stiu scriu eu, unde nu ma ajutati voi.

dini_Exists - se foloseste sa vada daca exista fisierul
dini_Remove - banuiesc ca sterge fisierul
dini_Create - creaza fisierul
dini_Set - ?
dini_IntSet - Aici am vazut un raven's ce face dar nu m-am convins care e diferenta intre Set si IntSet
dini_Int - ?
dini_FloatSet - ?
Float:dini_Float - ?
dini_Bool - ?
dini_BoolSet - ?
dini_Unset - ?
dini_Get - ?
dini_Isset - ?
DINI_StripNewLine - ?
DINI_fcopytextfile - ?

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

dini_Set - Seteaza un string, nu doar integrale, numere ...

dini_Int - Se foloseste pentru a luat o cifra dintr-un fisier, rand.

dini_FloatSet - Seteaza un float intr-un fisier.

dini_Float - Ia un float dintr-un fisier, rand.

dini_Bool - Ia un bool, d'alea cu true/false dintr-un fisier,rand.

dini_BoolSet - Seteaza un bool, d'alea cu true/false.

dini_Unset - Cred ca sterge un rand.

dini_Get - Ia un string dintr-un fisiere (dini_Set)

dini_Isset - Nu stiu ce face

DINI_StripNewLine - E folosit in functiile de mai sus doar

DINI_fcopytextfile - E folosit in functiile de mai sus doar

Sper ca te-am ajutat.

Link to comment
Share on other sites

Acum am facut eu ce am facut si ma spawneaza. Dar am cateva probleme.

Pot sa scriu orice parola ca ma spawneaza.

La OnPlayerLogin am asa.

public OnPlayerLogin(playerid,password[])
{
	new tmp2[256];
        new string2[64];
        new string[128];
	new playername2[MAX_PLAYER_NAME];
	GetPlayerName(playerid, playername2, sizeof(playername2));
	format(string2, sizeof(string2), "users/%s.ini", playername2);
	if (dini_Exists(string2))
	{
		new password2 = PlayerInfo[playerid][pKey];
		if(dini_Int(string2,"Password") == password2)
		{
 			PlayerInfo[playerid][pKey] = dini_Int(string2,"Password");
Codul de la OnDialogResponse Login
if(dialogid == 12346 || dialogid == 12347)
		{
		    if(strlen(inputtext))
		    {
				new tmppass[64];
				strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
				//Encrypt(tmppass);
				OnPlayerLogin(playerid,tmppass);
			}
			else
			{
				new loginstring[128];
				new loginname[64];
				GetPlayerName(playerid,loginname,sizeof(loginname));
				format(loginstring,sizeof(loginstring),"WRONG PASSWORD\nPlease enter the correct password:",loginname);
				ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"Login",loginstring,"Login","Exit");
				gPlayerLogTries[playerid] += 1;
				if(gPlayerLogTries[playerid] == 5) { Ban(playerid); }
			}
  		}
Si register
if(dialogid == 12345)
		{
		    if(strlen(inputtext))
		    {
				GetPlayerName(playerid, sendername, sizeof(sendername));
				format(string, sizeof(string), "users/%s.ini", sendername);
				new File: hFile = fopen(string, io_read);
				if (hFile)
				{
					SendClientMessage(playerid, COLOR_YELLOW, "That Username is already taken, please choose a different one.");
					fclose(hFile);
					return 1;
				}
				new tmppass[64];
				strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
				//Encrypt(tmppass);
				OnPlayerRegister(playerid,tmppass);
			}
			else
			{
 				new regstring[128];
				new regname[64];
				GetPlayerName(playerid,regname,sizeof(regname));
				format(regstring,sizeof(regstring),"Welcome, %s\nYou dont have an account.\nPlease register:",regname);
				ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"Register",regstring,"Register","Exit");
			}
		}

Explicati-mi va rog ce nu e bine si incerc sa repar.

LE: La parola, in fisier imi arata 0

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Similar Content

    • By Marinel GamerOver
      caut scripter sa ma ajute la un server sa scripteaza sms rog am nevoie urgent 
    • By GamerulFOX
      Salutareee ! Am si eu o problema ! Cine ma poate ajuta ? Vreau ca prin aceasta comanda doar daca te cheama pe samp GamerulFOX sa poti intra in casa accea!
      Dar nu am stiut cum !

      CMD:enterhouse1(playerid, params[])
      {
          new name[MAX_PLAYER_NAME], GamerulFOX[MAX_PLAYERS];
          GetPlayerName(playerid, name, sizeof(name));
          if(!IsPlayerInRangeOfPoint(playerid, 3.0, 124.0870, 1747.3165, 17.5925)) return SendClientMessage(playerid, 0xff0000FF, "Nu esti la usa acelei case!");
          if(GetPlayerName(playerid, name, sizeof(name)) != GamerulFOX[playerid]) return SendClientMessage(playerid, 0xff0000FF, "Nu este casa ta!");
          else
              SendClientMessage(playerid, 0xff0000FF, "Bun venit acasa!");
          return 1;
      }
    • By thestafy
      Salut,ma intrebam daca stiti ceva videouri/pdf uri de unde pot incepe sa invat pawn de la 0. Si se mai merita sa inveti pawn in aproape 2021?
    • By NuamNume
      Ma poate ajuta cineva? Cand dau de ex /ban PetardaBUM1998 0 NeAuzim imi apare "syntax: /ban etc
      Va rog...
      COD: 
      YCMD:ban(playerid, params[], help)
      {
          if(!PlayerInfo[playerid][pAdmin])
              return SCM(playerid, 0xa3e080FF, "You are not an admin!");
          if(GetPVarInt(playerid, "ban_cooldown") > gettime())
              return SendFormatMessage(playerid, COLOR_GREY, "You need to wait %d seconds for another ban.", (GetPVarInt(playerid, "ban_cooldown") - gettime()));
          new userID, days, reason[64];
          if(sscanf(params, "usd[64]", userID, days, reason) || days < 0)
              return SCM(playerid, -1, "Syntax: /ban <playerid/name> <days (0 = permanent)> <reason>");
          if(!IsPlayerLogged(playerid))
              return SCM(playerid, COLOR_GREY, "This player is not connected!");
          if(userID == playerid)
              return SCM(playerid, COLOR_GREY, "Nu poti folosi aceasta comanda aspura ta.");
          if(PlayerInfo[playerid][pAdmin] >= PlayerInfo[playerid][pAdmin] && !strmatch(GetPlayerNameEx(playerid), "R4uL"))
              return SCM(playerid, COLOR_GREY, "Nu poti folosi aceasta comanda pe acel jucator.");
          banPlayer(userID, playerid, days, reason);
          return true;

      se poate fast?
    • By Onehitkill
      Cum pot executa : GivePlayerCash si GetPlayerCash dintr-un filterscript, sa mearga ca si la gamemode ?
      Ca nu stiu sa bag FS in gamemode
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.