Jump to content

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


Recommended Posts

Posted

[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!

  • Replies 58
  • Created
  • Last Reply

Top Posters In This Topic

Posted

+ tu pune ce trebuie nu pune lucrurile tale de la onplayerconnect register login fiecare playeri poate mai are ceva in plus sau in minus :|

default.png
  • 1 month later...
Posted

E un tutorial excelent pentru incepatori degeaba explica daca ceilalti nu inteleg poate uni da uni nu ... si dupaia vezi numa reply Da ce inseamna ca.... adik.... ? ... deci eu zic ca e bun fiecare intelege dupa experienta gg !

Samp.OnlyPro.ro - RolePlay - Join Us !

  • 3 weeks later...
  • 2 weeks later...
Posted

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:"

Posted

nu imi ia parola in considerare. nu isi face legaturile. daca scriu parola gresita ma conecteaza, nu spune ca nu ai cont etc.

Posted

nu imi ia parola in considerare. nu isi face legaturile. daca scriu parola gresita ma conecteaza, nu spune ca nu ai cont etc.

fals merge perfect

nu e bun pentru modul gf?

ma numa pentru modu GF

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

Posted

Lucrez la asta ;)

1.Fac sa intrebe sex-u Masculin Sau Femenin

2.Fac sa intrebe varsa cu o lista de la 14 la 25 ani

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

  • Administrator
Posted

Compileaza cu Pawno din 0.3b

logo.png

ATENTIE!!! Nu imi trimiteti mesaje private care au legatura cu scriptingul. NU mai scriptez.

  • 4 weeks later...
Posted

la public OnDialogResponse, pentru cei care nu il au si l-au luat din acel link, sa caute forward si sa mai adauge forward OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);

  • 1 month later...
Posted

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.