[DUV]~~> OnDialogResponde <~~
#1

[b][font=Calibri]Gente й o seguinte... queria que voces dissesem oq eu devo colocar no OnDialogResponse(Login Box).
Desse Script de Regsitro e Login:
Код:
//==============================================================================
	if(strcmp(cmd, "/registrar", true) == 0) {
		new tmp[256];
		tmp = strtok(cmdtext, idx);
  	// The command shouldn't work if an account with this
  	// nick already exists
  	if (udb_Exists(PlayerName(playerid))) {
			SendClientMessage(playerid, COLOR_RED, "Tб querendo se registrar duas vezes???");
	  	return 1;
		}

		// The command shouldn't work if we already are authed
  	if (PLAYERLIST_authed[playerid] == 1) {
			SendClientMessage(playerid, COLOR_RED, "Vocк nгo pode se registrar logado!");
		  return 1;
		}

  	// Did he forgot the password?
  	if (strlen(tmp)==0) {
			SendClientMessage(playerid, COLOR_RED, "Ei, vocк esqueceu de mencionar uma senha. Use /registrar [senha]");
	  	return 1;
		}

  	// We save the money to the accstate
  	else{
  	  PLAYERLIST_authed[playerid] = 1;
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------E AQUI TB NO X Y Z --------------------------------------------------------//
			udb_Create(PlayerName(playerid), tmp /*senha*/,0 /*crйditos*/, 0 /*grana*/, 165 /*skin*/, 5000 /*gbanco*/, 0 /*gas*/, 0 /*har*/, 0 /*hterra*/, 0 /*hmar*/, 0 /*preso*/, 1 /*prof*/, ""/*clantag*/, -1757.9701/*X*/, 960.9874/*Y*/, 24.8828/*Z*/, 180.0000/*ang*/, 100.0 /*hp*/);
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
			new Float:X, Float:Y, Float:Z, Float:ang;
			udb_getPosition(PlayerName(playerid), X, Y, Z);
			udb_getAng(PlayerName(playerid), ang);
			udb_setGasoline(PlayerName(playerid), 15);
			Petrol[playerid] = 15;
//--------------------------------------------------------MUDE AKI NO X Y Z ---------------------------------------------------//
			SetSpawnInfo(playerid, 1, udb_getSkin(PlayerName(playerid)), 1243.1599,-1693.4703,16.1974,177.2275,0,0,0,0,0,0);
//-----------------------------------------------------------------------------------------------------------------------------//
			SpawnPlayer(playerid);
			SetPlayerColor(playerid, COLOR_DESEMPREGADO);
			SendClientMessage(playerid, COLOR_GREEN, "Vocк tкm $5000 no banco para comeзar a viver e mais 20%% de combustнvel no tanque.");
    	return 1;
		}
 	}
//==============================================================================
	if(strcmp(cmd, "/logar", true) == 0 && IsPlayerConnected(playerid)) {
		new tmp[256];
		tmp = strtok(cmdtext, idx);
	  // Tentativa de login sem registrar
	  if (!udb_Exists(PlayerName(playerid))) {
			SendClientMessage(playerid, COLOR_RED, "[LOGIN]Para vocк poder se logar, й preciso se registrar primeiro.");
		  return 1;
		}

		// Quando tenta loga de novo
	  if (PLAYERLIST_authed[playerid] == 1) {
			SendClientMessage(playerid, COLOR_RED, "[LOGIN]Vocк sу pode se logar uma vez!");
		  return 1;
		}

	  // Quando tenta registrar mesmo tendo uma conta
	  if (strlen(tmp)==0) {
			SendClientMessage(playerid, COLOR_RED, "[LOGIN]Vocк tem senha. Digite /logar [senha]");
		  return 1;
		}
		  // Quando ele loga ;D
	  if (udb_CheckLogin(PlayerName(playerid),tmp)) {
			PLAYERLIST_authed[playerid] = 1;
			SetTimerEx("GanharLevel",30*60*1000, true, "i", playerid);
			LogarPlayer(playerid);
 			udb_setProf(PlayerName(playerid), Profissao[playerid]);
			udb_setCreditos(PlayerName(playerid), Creditos[playerid]);
			udb_setGasoline(PlayerName(playerid), Petrol[playerid]);
		  return 1;
		}
		else {
	    // Quando a senha esta incorreta
			SendClientMessage(playerid, COLOR_RED, "[LOGIN]A senha nгo esta correta!");
	  	return 1;
	  }
	}
Reply
#2

mais facil vc procurar um script de login em dialog e adaptar no seu , ou tirar o seu e por o pronto ... lol
Reply
#3

pow eu ja tenho o Script, quero saber oq devo tirar do /registrar e do /logar pra por nas funзхes do Public OnDialogResponse manolo!
Reply
#4

Alguem ai ajuda
Reply
#5

Alguem ai ajuda, to com essa dъvida faz um tempao!
Reply
#6

baixa em script que jб tenha isso e estuda.. й o mais facil para todos
Reply
#7

umas dicas p/ vc:

sem Double post, isso ja ta enxendo.
quer um login box? aprede a fazer ninguem aki vai te dar isso de graзa.
Crie seu gm
Reply
#8

[MPA]PoweR ou [MPA]Revolution detected.
Reply
#9

Porra perdi a cabeзa!

vo pagar R$ 20,00 pra quem da esse script!
Reply
#10

Pesquisar Mata ?

Seja Feliz Use Search

Deathers Dialog Register : http://forum.sa-mp.com/index.php?topic=151105.0

Easy Registration Opcional dialogs : http://forum.sa-mp.com/index.php?topic=141737.0

Sistema Normal de Registro e login /register /login : http://forum.sa-mp.com/index.php?topic=132345.0




Quero minha Grana velho !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)