SA-MP Forums Archive
I don't respawn when I die? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I don't respawn when I die? (/showthread.php?tid=141109)



I don't respawn when I die? - RSC_Quicker - 11.04.2010

Hey, I had the problem before.
When I die my player got 0 health. But it doesn't respawn.
I only can walk around and chat. I cannot use commands or enter a car.
But when I join of a building or something I finaly die?
whats the problem? I had this problem before I forgot how to solve it.
Something with virtualworlds?


Re: I don't respawn when I die? - Amit_B - 11.04.2010

Show your OnPlayerDeath and OnPlayerUpdate...


Re: I don't respawn when I die? - RSC_Quicker - 11.04.2010

I don't got onplayerupdate.
Код:
 public OnPlayerDeath(playerid, killerid, reason)
{
  SetPlayerVirtualWorld(playerid,0);
  pStats[playerid][Spawned] = 0;
  pStats[playerid][Loading] = -1;
  TextDrawSetString(LoadingObj[playerid]," ");
  	if(pStats[playerid][UsingAnim])
	{
    pStats[playerid][UsingAnim] = 0;
    TextDrawHideForPlayer(playerid,txtAnimHelper);
	}
  	if(pStats[killerid][Zone] == 1 || pStats[killerid][Zone] == 3)
	{
	  SendDeathMessage(killerid, playerid, reason);
  		if(pStats[playerid][Admin] >= 1)
		{
			if(pStats[killerid][Zone] == 1) { SendClientMessage(killerid, Green, "Newkill: You received $10.000 and 1 Points for murder an Admin!"); GivePlayerCash(killerid,10000); pStats[killerid][Points]++; }
			if(pStats[killerid][Zone] == 3) { SendClientMessage(killerid, Green, "Newkill: You received $20.000 and 2 Points for murder an Admin!"); GivePlayerCash(killerid,20000); pStats[killerid][Points]+=2;}
		}
		else
		{
			if(pStats[killerid][Zone] == 1) { SendClientMessage(killerid, Green, "Newkill: You received $5.000 and 1 Points for this murder"); GivePlayerCash(killerid,5000); pStats[killerid][Points]++;}
			if(pStats[killerid][Zone] == 3) { SendClientMessage(killerid, Green, "Newkill: You received $10.000 and 2 Points for this murder"); GivePlayerCash(killerid,10000); pStats[killerid][Points]+=2; }
		}
	}
	return 1;
}
Uhm I have to put SetPlayerVirtualWorld in onplayerupdate isn't?



Re: I don't respawn when I die? - Zack9764 - 11.04.2010

I'm probably wrong based on the fact i havent scripted in 2 years but where does it says to set him to the spawn and the cords?


Re: I don't respawn when I die? - RSC_Quicker - 11.04.2010

Were are you talking about?
Normaly it goes like:
OnPlayerDeath > OnPlayerSpawn
... You have to know that.


Re: I don't respawn when I die? - Sergei - 11.04.2010

It's a "death bug" when you die on others screen, but not on your.


Re: I don't respawn when I die? - Steven82 - 12.04.2010

How do i make so they spawn at hospital if they die?


Re: I don't respawn when I die? - RSC_Quicker - 12.04.2010

Steven make your own topic!



Re: I don't respawn when I die? - RSC_Quicker - 12.04.2010

Quote:
Originally Posted by $ЂЯĢ
It's a "death bug" when you die on others screen, but not on your.
yea but its not like that.
In my mode , when a player die. He is death. Because he cannot use commands or enter a vehicle. But he doesn't respawn. His health is 0. When the player jump of a small building he finaly respawn.
Sometimes he respawn sometimes not.
I had this before but I forget how i sloved it...


Re: I don't respawn when I die? - FUNExtreme - 12.04.2010

Quote:
Originally Posted by Vinnie Venutti
Quote:
Originally Posted by $ЂЯĢ
It's a "death bug" when you die on others screen, but not on your.
yea but its not like that.
In my mode , when a player die. He is death. Because he cannot use commands or enter a vehicle. But he doesn't respawn. His health is 0. When the player jump of a small building he finaly respawn.
Sometimes he respawn sometimes not.
I had this before but I forget how i sloved it...
Thats the death bug ...