Jump to content

[0.3]Cum faci Register cu ajutoru la Dialog[UP]


IcE.

Recommended Posts

[glow=black,1,300][TUT][0.3]Cum faci Register cu ajutoru la Dialog[uP][/glow]

[glow=red,2,300]1[/glow].Cautam linia:

if(fexist(string))
{
	gPlayerAccount[playerid] = 1;
	SendClientMessage(playerid, COLOR_YELLOW, "SERVER: That nick is registered, please login");
	SendClientMessage(playerid, COLOR_WHITE, "HINT: You can now login by typing /login <password>");
	return 1;
}
else
{
	gPlayerAccount[playerid] = 0;
	SendClientMessage(playerid,COLOR_YELLOW,"You dont have an account. Please register by using /register [password]");
	return 1;
}
Si o inlocuim cu:
 if(fexist(string))
 {
	  gPlayerAccount[playerid] = 1;
	new loginstring[2000];
	new loginname[64];
	GetPlayerName(playerid,loginname,sizeof(loginname));
	format(loginstring,sizeof(loginstring),"{FFFFFF}Salut, {FF0000}%s {FFFFFF}! Bine ai venit.\n{FFFFFF}Esti inregistrat in baza noastra de dare.\n{FFFFFF}\n\n\n\n\n{FFFF00}NumeSV {FFFFFF}te roaga sa te loghezi:",loginname);
	ShowPlayerDialog(playerid,12346,DIALOG_STYLE_INPUT,"{FF0000}Login",loginstring,"Login","Exit");
	return 1;
}
else
{
	gPlayerAccount[playerid] = 0;
	new regstring[1000];
	new regname[64];
	GetPlayerName(playerid,regname,sizeof(regname));
	format(regstring,sizeof(regstring),"Bun venit, {1E90FF}%s\n{FFFFFF}Nu ai cont.\n\n\n\n\n\n{FFFF00}NumeSV te roaga sa te inregistrezi:",regname);
	ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"{FF0000}Register",regstring,"Register","Exit");
	return 1;
}
[glow=red,2,300]2[/glow].Cautam linile:
if(SafeTime[i] == 1)
{
	if(gPlayerAccount[i] == 1 && gPlayerLogged[i] == 0)
	{
		SendClientMessage(i, COLOR_WHITE, "HINT: You can now login by typing /login <password>");
	}
}
Si inlocuim cu:
if(SafeTime[i] == 1)
{
	if(gPlayerAccount[i] == 1 && gPlayerLogged[i] == 0)
	{
		new loginname[64];
		new loginstring[128];
		GetPlayerName(i,loginname,64);
		format(loginstring,sizeof(loginstring),"Bun venit, %s\nTe rugam sa te loghezi:",loginname);
		ShowPlayerDialog(i,12346,DIALOG_STYLE_INPUT,"Login",loginstring,"Login","Exit");
	}
}
[glow=red,2,300]3[/glow].Cautam linile:
fclose(hFile);
SendClientMessage(playerid, COLOR_YELLOW, "Account registered, you can login now (/login [password]).");
Si inlocuim cu:
fclose(hFile);
new loginstring[3000];
new loginname[64];
GetPlayerName(playerid,loginname,sizeof(loginname));
format(loginstring,sizeof(loginstring),"{FFFFFF}Salut, {FF0000}%s {FFFFFF}! Teai inregistrat un cont,.\n{FFFFFF}Acum e momentul sa te loghezi.\n{FFFF00}NumeSV {FFFFFF}te roaga sa te loghezi:",loginname);
ShowPlayerDialog(playerid,12346,DIALOG_STYLE_INPUT,"{FF0000}Login",loginstring,"Login","Exit");
[glow=red,2,300]4[/glow].Cautam linile:
else
{
	SendClientMessage(playerid, COLOR_WHITE, "SERVER: Password does not match your name.");
	fclose(UserFile);
	gPlayerLogTries[playerid] += 1;
	if(gPlayerLogTries[playerid] == 4) { Ban(playerid); }
	return 1;
}
Si inlocuim cu
else
{
	new loginstring[500];
   	new loginname[64];
            GetPlayerName(playerid,loginname,sizeof(loginname));
            format(loginstring,sizeof(loginstring),"{FF0000}WRONG PASSWORD\n\n\n\n\n{FFFF00}IronRp{FFFFFF} te roaga sa scri parola corecta:",loginname);
	ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"{FF0000}Log-in",loginstring,"Log-in","Exit");
            fclose(UserFile);
            gPlayerLogTries[playerid] += 1;
            if(gPlayerLogTries[playerid] == 4) { Kick(playerid); }
            return 1;
}
[glow=red,2,300]5[/glow].Acum avem dialogurile create. Urmeaza sa adaugam dialogurile si la OnDialogResponse. -Mai intai cautati OnDialogResponse. -Sub { adaugam urmatoarele coduri:
new sendername[MAX_PLAYER_NAME];
if(dialogid == 12346 || dialogid == 12347)
{
	if(response)
	{
		if(strlen(inputtext))
		{
			new tmppass[64];
			strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
			OnPlayerLogin(playerid,tmppass);
		}
		else
		{
			new loginstring[500];
			new loginname[64];
			GetPlayerName(playerid,loginname,sizeof(loginname));
			format(loginstring,sizeof(loginstring),"{FF0000}WRONG PASSWORD\n\n\n\n\n{FFFF00}NumeSV{FFFFFF} te roaga sa scri parola corecta:",loginname);
			ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"{FF0000}Log-in",loginstring,"Log-in","Exit");
		}
	}
}

if(dialogid == 12345)
{
	if(response)
	{
		if(strlen(inputtext))
		{
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "%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 passtring[128];
			new tmppass[64];
			strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
			format(passtring,sizeof(passtring),"{FFFFFF}Your password is( {FF0000}%s {FFFFFF}).Please don't forget your password or you lost the account",tmppass);
                		SendClientMessage(playerid, COLOR_ROSUAPRINS, passtring);
			OnPlayerRegister(playerid,tmppass);
		}
		else
		{
			new regstring[1000];
			new regname[64];
			GetPlayerName(playerid,regname,sizeof(regname));
			format(regstring,sizeof(regstring),"Bun venit, {1E90FF}%s\n{FFFFFF}Nu ai cont.\n\n\n\n\n\n{FFFF00}NumeSV te roaga sa te inregistrezi:",regname);
			ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"{FF0000}Register",regstring,"Register","Exit");
		}
	}
}

[glow=red,2,300]6[/glow].Acum trebuie sa dezactivam comenzile /register & /login.

-Cautam comanda /register si o "bagam" intre /* si */ .

--Aveti grija ca comanda sa "fie" verde.

-Cautam comanda /login si facem lafel cum e sus.

[glow=black,2,300]ATENTIE[/glow]

-Nu este chear un tutorial ci o mai mult iti arat cum sa inlocui.

-Cui nui place "munca" mea sa nu posteze.

-Nu vreau sa vad acest tutorial pe alte forumi fara acordu meu (il cereti prin PM).

[glow=black,2,300]CREDIT[/glow]

-Tutorial By:IcE(me)

-Functile de dialog gasite in postul original de la gm-u GF. (editat de mine)

Acesta nu este postu original, am facut un update la el deoarece vechea medoda nu e era chear buna.

Stiu si eu ... branza e pe bani, dar eu tot ma joc pe gratis!

Link to comment
Share on other sites

  • Replies 58
  • Created
  • Last Reply

Top Posters In This Topic

  • 1 month later...
  • 3 weeks later...
  • 2 weeks later...

Bun +1 de la mine,dar cum modifici boxul sa fie mai lung sau inalt..?

lungimea si inaltimea depind de marimea textului

daca vrei sa fie mai inalt lasa spatiu intre propozitii

ex: "Welcome, %s\n \nThat nick is registered.\n \nYou can now login:"

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...

pff mia dat error X(

/*

C:\DOCUME~1\GetGo\Desktop\FRESHM~1\pawno\include\utils.inc(1) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(1396) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(1440) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(1469) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(1538) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(1638) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(1661) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(2001) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(2181) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(2216) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(2229) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(2239) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(2268) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(2290) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(2385) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(2400) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(2447) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(2462) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(2515) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(2608) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(2738) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(2935) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(3377) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(3387) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(3397) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(3407) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(3419) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(3757) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4146) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4344) : error 029: invalid expression, assumed zero

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4345) : error 029: invalid expression, assumed zero

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4346) : error 029: invalid expression, assumed zero

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4347) : error 029: invalid expression, assumed zero

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4347 -- 4348) : warning 215: expression has no effect

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4348) : error 001: expected token: ";", but found "return"

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4350) : error 055: start of function body without function header

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4352) : error 021: symbol already defined: "PlayerPlaySound"

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4354) : error 010: invalid function or declaration

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4359) : error 010: invalid function or declaration

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4364) : error 010: invalid function or declaration

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4369) : error 010: invalid function or declaration

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4374) : error 010: invalid function or declaration

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4379) : error 010: invalid function or declaration

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4384) : error 010: invalid function or declaration

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4389) : error 010: invalid function or declaration

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4394) : error 010: invalid function or declaration

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4399) : error 010: invalid function or declaration

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4404) : error 010: invalid function or declaration

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4409) : error 010: invalid function or declaration

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4416) : error 010: invalid function or declaration

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4629) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(4825) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(5549) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(5586) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(5975) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(6674) : warning 217: loose indentation

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(6674) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(6992) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(7073) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(7137) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(7171) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(7295) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(7713) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(7714) : warning 217: loose indentation

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(7714) : error 017: undefined symbol "response"

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(7716) : error 017: undefined symbol "dialogid"

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(7718) : error 017: undefined symbol "inputtext"

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(7721) : warning 217: loose indentation

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(7721) : error 017: undefined symbol "inputtext"

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(7723) : warning 217: loose indentation

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(7725) : warning 217: loose indentation

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(7736) : warning 217: loose indentation

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(7736) : error 017: undefined symbol "dialogid"

C:\Documents and Settings\GetGo\Desktop\FreshMania\gamemodes\gf.pwn(7738) : error 017: undefined symbol "inputtext"

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

26 Errors.

GOO 77.36.64.43:7777 Fakes-Zone

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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