[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


Messages In This Thread
[DUV]~~> OnDialogResponde <~~ - by luandriftlogkdr - 21.03.2010, 22:49
Re: [DUV]~~> OnDialogResponde <~~ - by Chivits - 22.03.2010, 01:44
Re: [DUV]~~> OnDialogResponde <~~ - by luandriftlogkdr - 22.03.2010, 02:53
Re: [DUV]~~> OnDialogResponde <~~ - by luandriftlogkdr - 22.03.2010, 03:12
Re: [DUV]~~> OnDialogResponde <~~ - by luandriftlogkdr - 22.03.2010, 12:11
Re: [DUV]~~> OnDialogResponde <~~ - by andmeida10 - 22.03.2010, 13:50
Re: [DUV]~~> OnDialogResponde <~~ - by xolp25 - 22.03.2010, 16:09
Re: [DUV]~~> OnDialogResponde <~~ - by DarkFinderX - 22.03.2010, 19:08
Re: [DUV]~~> OnDialogResponde <~~ - by luandriftlogkdr - 22.03.2010, 21:16
Re: [DUV]~~> OnDialogResponde <~~ - by ortaguinon - 23.03.2010, 03:36

Forum Jump:


Users browsing this thread: 1 Guest(s)