Spec NPC
#1

Holaa, bueno tengo una duda, hice mi grabacion de un NPC entonces quiero que el player al conectar lo specte, aqui les paso mi codigo que tengo en OnPlayerRequestClass, lo hice asi no mas, y nose nose donde puede estar el error.

Код:
	for(new i=0; i<MAX_PLAYERS; i++)
	{
	  new targetid = Spectate[i];
		if(IsPlayerInAnyVehicle(targetid))
		{
			PlayerSpectateVehicle(i, 213);
			SetPlayerInterior(playerid, 0);
		}
	}
No es fallo del NPC ya que cuando me goteo a el si que esta
Reply
#2

Se pone a spectear un vehнculo cualquiera o no hace absolutamente nada?
Si es que no hace nada, mostrame el callback completo.
Reply
#3

No hace nada directamente ai te lo paso

Код:
public OnPlayerRequestClass(playerid, classid)
{
  if(IsPlayerNPC(playerid)) return 1;
	new string[128];
	PlayerPlaySound(playerid, 1185, 0.0, 0.0, 0.0);
	PlayerInfo[playerid][pModel] = Peds[classid][0];
	for(new i=0; i<MAX_PLAYERS; i++)
	{
	  new targetid = Spectate[i];
		if(IsPlayerInAnyVehicle(targetid))
		{
			PlayerSpectateVehicle(i, 213);
			SetPlayerInterior(playerid, 0);
		}
	}
	if (RegistrationStep[playerid] == 0 && gPlayerLogged[playerid] != 1)
	{
		//ClearChatbox(playerid, 10);
		SendClientMessage(playerid, COLOR_LIGHTRED,  "===============================================================");
		format(string, sizeof(string), "Bienvenido a Gaming World Platinum Roleplay, %s", SCRIPT_VERSION);
		SendClientMessage(playerid, COLOR_YELLOW, string);
		SendClientMessage(playerid, COLOR_YELLOW2, " ");
		if (gPlayerAccount[playerid] != 0)
		{
      SendClientMessage(playerid, COLOR_LIGHTRED, "==============================================================");
			SendClientMessage(playerid, COLOR_YELLOW2, "Logueate.");
			SendClientMessage(playerid, COLOR_RED, "Si no inicia en 30 Segundos sera kickeado !");
			SendClientMessage(playerid, COLOR_LIGHTRED, "==============================================================");
			new loginstring[128];
			new loginname[64];
			GetPlayerName(playerid,loginname,sizeof(loginname));
			format(loginstring,sizeof(loginstring),"-[Gaming World Platinum]-\n\nBienvenido, %s!\n\n Por favor escriba su contraseсa:",loginname);
			ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Conectando con tu cuenta",loginstring,"Loguear","Salir");
		}
		else
		{
      SendClientMessage(playerid, COLOR_LIGHTRED, "========================================================================================");
			SendClientMessage(playerid, COLOR_YELLOW2, "La Immigation Departamento: Por favor, facilite los documentos de inmigraciуn necesarios.");
			SendClientMessage(playerid, COLOR_LIGHTRED, "========================================================================================");
			new loginname[64];
			GetPlayerName(playerid,loginname,sizeof(loginname));
			new loginstring[128];
			SendClientMessage(playerid, COLOR_YELLOW2, "VV Departamento: Porfavor , rellena los documentos para entrar a la ciudad.");
			format(loginstring,sizeof(loginstring),"-[Gaming World Platinum]-\n\n Bienbenido, %s!\n\nTu nombre no existe en nuestros datos. \n\nEscriba una contrsaeсa para registrarse:", loginname);
			ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,"Creando tu cuenta",loginstring,"Crear","Salir");
		}
		//SetPlayerCameraLookAt(playerid,1581.5955,-1792.9506,104.6984);
		//SetPlayerCameraPos(playerid,1581.5955,-1792.9506,104.6984);

		//SetPlayerCameraLookAt(playerid, 2118.4761,1284.2144,37.1306);
		//SetPlayerCameraPos(playerid, 167.6306,1285.4617,37.1306);

/*    SetPlayerCameraPos(playerid, -1091.0662,1243.0714,97.2797);
		SetPlayerCameraLookAt(playerid, -1556.0560,735.6566,74.1830);
		PlayerPlaySound(playerid, 1097, 0.0, 0.0, 0.0);
		PlayerInfo[playerid][pModel] = Peds[classid][0];
		SetPlayerTeamFromClass(playerid,classid);*/
	}
	else SpawnPlayer(playerid);
	return false;
 	/*if (classid == 1)
	{
			format(string, sizeof(string), "~y~> ~p~Jefe de policia ~y~< ~n~Solo lideres!");
			GameTextForPlayer(playerid,string,3500,6);
	}
	else if (classid == 2)
	{
			format(string, sizeof(string), "~y~> ~p~Jefe del FBI ~y~< ~n~Solo lideres!");
			GameTextForPlayer(playerid,string,3500,6);
	}
	else if (classid == 3)
	{
			format(string, sizeof(string), "~y~> ~p~General de la Guardia Nacional ~y~< ~n~Solo lideres!");
			GameTextForPlayer(playerid,string,3500,6);
	}
	else if (classid == 4)
	{
			format(string, sizeof(string), "~y~> ~p~Jefe de servicios de emergencias ~y~< ~n~Solo lideres!");
			GameTextForPlayer(playerid,string,3500,6);
	}
	else if (classid == 5)
	{
			format(string, sizeof(string), "~y~> ~p~Lider de La Cosa Nostra ~y~< ~n~Solo lideres!");
			GameTextForPlayer(playerid,string,3500,6);
	}
	else if (classid == 6)
	{
			format(string, sizeof(string), "~y~> ~p~Lider de la Yakuza ~y~< ~n~Solo lideres!");
			GameTextForPlayer(playerid,string,3500,6);
	}
	else if (classid == 7)
	{
			format(string, sizeof(string), "~y~> ~p~Alcalde ~y~< ~n~Solo lideres!");
			GameTextForPlayer(playerid,string,3500,6);
	}
	else if (classid == 8)
	{
			format(string, sizeof(string), "~y~> ~p~Lider de los Hitman ~y~< ~n~Solo lideres!");
			GameTextForPlayer(playerid,string,3500,6);
	}
	else if (classid == 9)
	{
			format(string, sizeof(string), "~y~> ~p~Lider de los reporteros ~y~< ~n~Solo lideres!");
			GameTextForPlayer(playerid,string,3500,6);
	}
	else if (classid == 10)
	{
			format(string, sizeof(string), "~y~> ~p~Jefe de la Compaсia de Taxi ~y~< ~n~Solo lideres!");
			GameTextForPlayer(playerid,string,3500,6);
	}
	else if (classid == 11)
	{
			format(string, sizeof(string), "~y~> ~p~Lider de los licenciadores ~y~< ~n~Solo lideres!");
			GameTextForPlayer(playerid,string,3500,6);
	}
	else
	{
		format(string, sizeof(string), "~y~> ~g~Civil ~y~<");
		GameTextForPlayer(playerid,string,3500,6);
	}
	SetPlayerTeamFromClass(playerid,classid);
	SetupPlayerForClassSelection(playerid);
	return 1;*/
}
Reply
#4

Alguno sabe como puedo arreglarlo?
Reply
#5

AyudaAї
Reply
#6

Quote:
Originally Posted by Gw-platinum
AyudaAї
Tal vez te falte aсadir TogglePlayerSpectating(playerid, 1);
Reply
#7

no, no consigo ver cual es el fallo
Reply
#8

Tengo el Mismisimo Problema.
Reply
#9

Sawc o zamaroht te podran ayudar mas preguntales a ellos.
Reply
#10

pawn Код:
TogglePlayerSpectating(i, 1);
PlayerSpectateVehicle(i, GetPlayerVehicleID(targetid));
Se utiliza el ID del vehiculo, no su modelo ni el ID del jugador que estб adentro de йl.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)