SA-MP Forums Archive
OnPlayerRequestClass - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerRequestClass (/showthread.php?tid=520954)



OnPlayerRequestClass - FullCircle - 21.06.2014

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?


Re: OnPlayerRequestClass - Ciandlah - 21.06.2014

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

Please give us more information on the matter


Respuesta: Re: OnPlayerRequestClass - FullCircle - 21.06.2014

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


Re: OnPlayerRequestClass - Ciandlah - 21.06.2014

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


Respuesta: Re: OnPlayerRequestClass - FullCircle - 21.06.2014

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");




Respuesta: Re: OnPlayerRequestClass - FullCircle - 21.06.2014

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


Re: OnPlayerRequestClass - RedFusion - 21.06.2014

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);



Respuesta: Re: OnPlayerRequestClass - FullCircle - 21.06.2014

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



Re: OnPlayerRequestClass - RedFusion - 21.06.2014

Because you didn't do it like i told you


Respuesta: Re: OnPlayerRequestClass - FullCircle - 21.06.2014

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;
}