OnPlayerRequestClass
#1

Here is the code in the public:
Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(!fexist(UbicacionArchivo(playerid)))
	{
		ShowPlayerDialog(playerid, Registro, DIALOG_STYLE_INPUT, "Registro", "Coloque su contraseсa para crear su cuenta", "Registrar", "Cancelar");
 	}
   	else
   	{
    	INI_ParseFile(UbicacionArchivo(playerid), "Cargar_%s", .bExtra = true, .extra = playerid);
      	ShowPlayerDialog(playerid, Ingreso, DIALOG_STYLE_PASSWORD, "Ingreso", "Coloque su contraseсa para ingresar", "Conectar", "Cancelar");
   	}
   	return 1;
}
Press F4 and The dialog open... And when close, the cam stay here.
How to disable F4 button for do nothing?
Reply
#2

Add SpawnPlayer(playerid); or SetCameraBehindPlayer(playerid);

Please give us more information on the matter
Reply
#3

Quote:
Originally Posted by Ciandlah
Посмотреть сообщение
Add SpawnPlayer(playerid); or SetCameraBehindPlayer(playerid);

Please give us more information on the matter
But, If I remove OnPlayerRequestClass the login and register dialog doesn't appear
Reply
#4

When the player logs into the server - you then SpawnPlayer you dont need to delete anything
Reply
#5

Quote:
Originally Posted by Ciandlah
Посмотреть сообщение
When the player logs into the server - you then SpawnPlayer you dont need to delete anything
And The dialogs?...

Quote:

ShowPlayerDialog(playerid, Ingreso, DIALOG_STYLE_PASSWORD, "Ingreso", "Coloque su contraseсa para ingresar", "Conectar", "Cancelar");

Reply
#6

Quote:
Originally Posted by Ciandlah
Посмотреть сообщение
When the player logs into the server - you then SpawnPlayer you dont need to delete anything
When Im logued and spawned, press F4 and show the login dialog...
Seeking that pressing the button, this does not happen, ie, nothing happens...
Reply
#7

pawn Код:
public OnPlayerConnect(playerid)
{
    if(!fexist(UbicacionArchivo(playerid)))
        ShowPlayerDialog(playerid, Registro, DIALOG_STYLE_INPUT, "Registro", "Coloque su contraseсa para crear su cuenta", "Registrar", "Cancelar");
    else
    {
        INI_ParseFile(UbicacionArchivo(playerid), "Cargar_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, Ingreso, DIALOG_STYLE_PASSWORD, "Ingreso", "Coloque su contraseсa para ingresar", "Conectar", "Cancelar");
    }
    TogglePlayerSpectating(playerid, true);
}
..And then when the player registers / logins successfully in OnDialogResponse
pawn Код:
TogglePlayerSpectating(playerid, false);
Reply
#8

Quote:
Originally Posted by RedFusion
Посмотреть сообщение
pawn Код:
public OnPlayerConnect(playerid)
{
    if(!fexist(UbicacionArchivo(playerid)))
        ShowPlayerDialog(playerid, Registro, DIALOG_STYLE_INPUT, "Registro", "Coloque su contraseсa para crear su cuenta", "Registrar", "Cancelar");
    else
    {
        INI_ParseFile(UbicacionArchivo(playerid), "Cargar_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, Ingreso, DIALOG_STYLE_PASSWORD, "Ingreso", "Coloque su contraseсa para ingresar", "Conectar", "Cancelar");
    }
    TogglePlayerSpectating(playerid, true);
}
..And then when the player registers / logins successfully in OnDialogResponse
pawn Код:
TogglePlayerSpectating(playerid, false);
This is the result :/
Reply
#9

Because you didn't do it like i told you
Reply
#10

Quote:
Originally Posted by RedFusion
Посмотреть сообщение
Because you didn't do it like i told you
Код:
case Ingreso:
		{
			if (!strlen(inputtext)) return ShowPlayerDialog(playerid, Ingreso, DIALOG_STYLE_PASSWORD, "Ingreso", "Por Favor, ingrese la contraseсa", "Aceptar", "Salir");
			if (!response) return Kick(playerid);
			if (!strcmp(inputtext,Informacion[playerid][Contra]))
			{
            	Logueado[playerid] = true;
            	CargarCuenta(playerid);
            	SetPlayerVirtualWorld(playerid, 0);
            	TogglePlayerControllable(playerid, 1);
            	TogglePlayerSpectating(playerid, false);
            	new string[54];
            	format(string,sizeof(string),"%s ha entrado al servidor.", NombreJ(playerid));
				BroadCast(COLOR_CELESTECLARO, string);
			}
			else
			{
				ShowPlayerDialog(playerid, Ingreso, DIALOG_STYLE_PASSWORD, "Ingreso", "Por Favor, ingrese alguna contraseсa", "Aceptar", "Salir");
			}
		}
Код:
public OnPlayerConnect(playerid)
{
    if(!fexist(UbicacionArchivo(playerid)))
        ShowPlayerDialog(playerid, Registro, DIALOG_STYLE_INPUT, "Registro", "Coloque su contraseсa para crear su cuenta", "Registrar", "Cancelar");
    else
    {
        INI_ParseFile(UbicacionArchivo(playerid), "Cargar_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, Ingreso, DIALOG_STYLE_PASSWORD, "Ingreso", "Coloque su contraseсa para ingresar", "Conectar", "Cancelar");
    }
    TogglePlayerSpectating(playerid, true);
	TogglePlayerControllable(playerid, 0);
    SetPlayerPos(playerid, -2523.2991, 1000.9221, 145);
	SetPlayerCameraPos(playerid, -2523.2991, 1000.9221, 134.2669);
    SetPlayerCameraLookAt(playerid, -2615.5237, 916.3397, 64.9844);
    SetPlayerVirtualWorld(playerid, 1);
    foreach(Player, i)
    {
		new string[54];
        format(string,sizeof(string),"%s ha entrado al servidor.", NombreJ(playerid));
		Logs("Seguridad", string);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)