Respawn problem :(
#1

I have a very big problem with my script... every time i die, i get taken to a character select screen, i have to click select, when i do, i start falling over blueberry a loading message pops up and my screen goes apeshit, i will edit this post once i get a screenshot.
Reply
#2

Post some code.
Reply
#3

Код:
----------- That is my On death-----------------
public OnPlayerDeath(playerid, killerid, reason)
{
  PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid);
  PlayerInfo[playerid][pHospital] = 1;
  SafeResetPlayerWeapons(playerid);
  ResetPlayerWantedLevelEx(playerid);
  InShamal[playerid] = 0;
  InAndrom[playerid] = 0;
  CopOnDuty[playerid] = 0;
  	if(AdminDuty[playerid] == 1)
	{
	  PlayerInfo[playerid][pHospital] = 1;
	}
	return 1;
}
--------------------------- Set Spawn ----------------
Код:
public SetPlayerSpawn(playerid)
{
	if(IsPlayerConnected(playerid))
	{
	  SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
	  
	  if(PlayerInfo[playerid][pLoadPos])
		{
		  SetPlayerPos(playerid,PlayerInfo[playerid][pLoadPosX],PlayerInfo[playerid][pLoadPosY],PlayerInfo[playerid][pLoadPosZ]);
		  SetPlayerInterior(playerid,PlayerInfo[playerid][pLoadPosInt]);
			SetPlayerVirtualWorld(playerid,PlayerInfo[playerid][pLoadPosW]);
			PlayerInfo[playerid][pLoadPos] = 0;
			return 1;
		}
		if(PlayerInfo[playerid][pRegistered] == 0)
		{
			TogglePlayerControllable(playerid, 0);
		}
		if(PlayerCuffed[playerid] == 1)
		{
			PlayerInfo[playerid][pJailed] = 1;
			PlayerInfo[playerid][pJailTime] = 15;
		}
	/*	if(PlayerInfo[playerid][pHospital] > 0)
	  {
	    DoHospital(playerid);
	    return 1;
	  }*/
	  if(AdminDuty[playerid])
	  {
	  	SetPlayerColor(playerid,COLOR_ADMINDUTY);
			SetPlayerHealth(playerid,999);
			SetPlayerArmour(playerid,999);
	  }
	  if(PlayerInfo[playerid][pFaction] != 255)
	  {
			SetPlayerToFactionColor(playerid);
			SetPlayerToFactionSkin(playerid);
   	}
  		if(PlayerInfo[playerid][pJailed] > 0)
	  {
  			if(PlayerInfo[playerid][pJailed] == 1)
			{
		  	SetPlayerVirtualWorld(playerid,2);
		  	SetPlayerInterior(playerid,6);
				SetPlayerPos(playerid,264.5743,77.5118,1001.0391);
				SendClientMessage(playerid, COLOR_WHITE, "Do your time!");
				return 1;
			}
			else if(PlayerInfo[playerid][pJailed] == 2)
			{
			  SetPlayerVirtualWorld(playerid,0);
		  	SetPlayerInterior(playerid,0);
				SetPlayerPos(playerid,3312.4163,-1935.4459,10.9682);
				SendClientMessage(playerid, COLOR_WHITE, "Do your time!");
				return 1;
			}
		}
 		new house = PlayerInfo[playerid][pHouseKey];
  		if(house != 255)
		{
		  if(PlayerInfo[playerid][pSpawnPoint])
		  {
				SetPlayerInterior(playerid,Houses[house][ExitInterior]);
				SetPlayerPos(playerid, Houses[house][ExitX], Houses[house][ExitY],Houses[house][ExitZ]);
				SetPlayerVirtualWorld(playerid,house);
  			return 1;
			}
		}
 		if(PlayerInfo[playerid][pFaction] != 255)
		{
		  if(PlayerInfo[playerid][pSpawnPoint] == 0)
		  {
				SetPlayerPos(playerid,DynamicFactions[PlayerInfo[playerid][pFaction]][fX],DynamicFactions[PlayerInfo[playerid][pFaction]][fY],DynamicFactions[PlayerInfo[playerid][pFaction]][fZ]);
				SetPlayerInterior(playerid,0);
				SetPlayerVirtualWorld(playerid,0);
				return 1;
			}
		}
	  else
	  {
  			SetPlayerPos(playerid,CivilianSpawn[X],CivilianSpawn[Y],CivilianSpawn[Z]);
			SetPlayerVirtualWorld(playerid, CivilianSpawn[World]);
			SetPlayerInterior(playerid, CivilianSpawn[Interior]);
			SetPlayerFacingAngle(playerid,CivilianSpawn[Angle]);
			return 1;
		}
	}
	return 1;
}
Spawn and death, now.. i tested this by parachuting and than doing gotols without pulling chute and doing /kill. ill post those two as well
Код:
	if(strcmp(cmd, "/kill", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	    ClearAnimations(playerid);
	    SetPlayerHealth(playerid, 0.0);
	    PlayerInfo[playerid][pHospital] = 1;
			return 1;
   	}
	}
-----------------------
i
Код:
f(strcmp(cmd, "/skydive", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			if (PlayerInfo[playerid][pAdmin] >= 1)
			{
			  new Float:rx, Float:ry, Float:rz;
				GetPlayerPos(playerid, rx, ry, rz);
				if (IsPlayerConnected(playerid))
				{
					SafeGivePlayerWeapon(playerid, 46, 0);
					SetPlayerPos(playerid,rx, ry, rz+1500);
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not authorized to use that command");
			}
		}
		return 1;
	}
Reply
#4

Same problem as the last page on SAGC only the guy having the problem is using LS, my script is centered around dillmore!
http://forum.sa-mp.com/index.php?topic=126113.810
Reply
#5

OnPlayerSpawn ?

And you start falling in Blueberry, because the coords there are 0.0, 0.0, 0.0
Some of your arrays in SetPlayerSpawn are empty, eg like these
pawn Код:
SetPlayerPos(playerid,PlayerInfo[playerid][pLoadPosX],PlayerInfo[playerid][pLoadPosY],PlayerInfo[playerid][pLoadPosZ]);
SetPlayerPos(playerid, Houses[house][ExitX], Houses[house][ExitY],Houses[house][ExitZ]);
SetPlayerPos(playerid,DynamicFactions[PlayerInfo[playerid][pFaction]][fX],DynamicFactions[PlayerInfo[playerid][pFaction]][fY],DynamicFactions[PlayerInfo[playerid][pFaction]][fZ]);
SetPlayerPos(playerid,CivilianSpawn[X],CivilianSpawn[Y],CivilianSpawn[Z]);
Reply
#6

Wow! i didnt see that... thanks,. ill let you now how it goes

facepalm, i forgot to come back to that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)