[Doubt]SpawnPlayer.
#1

Hi, I have a question about these codes that I will put below.

This is a warning sign that you create so that new people will appear before the login, as you can see I did so that it will appear only to those who have not accepted the agreement, to those who did not accept the sign.


Код:
function ShowAcuerdoAviso(playerid)
{
if(Info[playerid][pAcuerdo] != 1)
{
SetPlayerPos(playerid, -1017.973754, 932.508850, 42.257812);
SetPlayerFacingAngle(playerid,122.755401);
SetPlayerCameraPos(playerid, -1134.602661, 1007.212829, 93.570144);
SetPlayerCameraLookAt(playerid, -2270.17, 1007.212829, 93.570144);
TextDrawHideForPlayer(playerid, cargando);
TextDrawHideForPlayer(playerid, looking);
TextDrawShowForPlayer(playerid, TextAcuerdo[0]);
TextDrawShowForPlayer(playerid, TextAcuerdo[1]);
TextDrawShowForPlayer(playerid, TextAcuerdo[2]);
TextDrawShowForPlayer(playerid, TextAcuerdo[3]);
TextDrawHideForPlayer(playerid, box);
TextDrawHideForPlayer(playerid, Entrada);
SelectTextDraw(playerid, 0x222222FF);
new string[512];                     //-----------------------------------
format(string, sizeof(string), 		"Hola, bienvenido a este servidor.~n~\
									 ~n~\
									 Antes de comenzar a jugar, queremos~n~\
									 hacerte tomar en cuenta que este es~n~\
									 un servidor de tipo '~y~Rol~w~'.~n~\
									 ~n~\
									 Por ello: cualquier actividad~n~\
								     antideportiva que vaya en contra de~n~\
									 nuestras normas, sera sancionada.~n~\
									 ~n~\
									 Si no estas de acuerdo, puedes utilizar~n~\
									 el boton '~r~SPAWN~w~' para salir. Ha sido~n~\
									 un placer.~n~\
									 ~n~\
									 Atentamente, la ~g~Administracion~w~.");
TextDrawSetString(TextAcuerdo[3], string);
}
else
{
 	gPlayerLogged{playerid} = 1;
	SpawnPlayer(playerid);
 	SetTimerEx("SafeLogin", 1000, 0, "d", playerid);
}
return 1;
}
But everything is perfect, here is that the people pressing the button, "I accept", load the "SafeLogin" All right.

Код:
if(clickedid == TextAcuerdo[2])
 	{
 	gPlayerLogged{playerid} = 1;
	Info[playerid][pAcuerdo] = 1;
	SpawnPlayer(playerid);
	INI_ParseFile(UserPath(playerid), "LoadLogin_data", .bExtra = true, .extra = playerid);
	SetTimerEx("SafeLogin", 100, 0, "d", playerid);
	return 1;
	}
The problem here is the following and that is that when the "ShowAgreendAnnouncement" does the automatic function of not showing the msg to the people who accepted the agreement it appears that I will leave them here below, something that does not appear when using the "I ACCEPT" BUTTON that shows the new registrants, what am I failing? What am I missing because SpawnPlayer does not want to serve me? and if it is not that, what causes me this error ?.




PD: Sorry for my English is not the best, I hope to have explained.
Reply
#2

SetPlayerSpawnInfo and then use SpawnPlayer.
Reply
#3

How is SetPlayerSpawnInfo used? I do not understand much.


Because I do not know where to put it or how, because in many post I've seen that in OnPlayerRequestClass, but I do not have that Public created in my gm.
Reply
#4

їHello?
Reply
#5

I don't really understand what you're asking about but if it's to remove the spawn bar, you need to TogglePlayerSpectating.

https://sampwiki.blast.hk/wiki/TogglePlayerSpectating
Reply
#6

But it happens that when using "TogglePlayerSpectating" it does not let me use the camera in movement that I have in the login, you know how?
Reply
#7

Use function
PHP код:
SpawnPlayer(playerid); 
on Connect, then afterwards just use Spectate.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)