Death problem/bug/error
#1

i use larp based gm and i have problem with death . When Player die then he/she spawns on his factions spawn.I have tryed fix it long time but i dont know what is wrong.

code is here:
Код:
 if(MedicBill[playerid] == 1 && PlayerInfo[playerid][pJailed] == 0 && PlayerPaintballing[playerid] == 0)
		{
		  if(FirstSpawn[playerid] != 1)
		  {
		  	/*new string[256];
		  	new cut = deathcost; //PlayerInfo[playerid][pLevel]*deathcost;
				SafeGivePlayerMoney(playerid, -cut);
				format(string, sizeof(string), "DOC: Your Medical Bill comes to $%d, Have a nice day.", cut);
				SendClientMessage(playerid, TEAM_CYAN_COLOR, string);
				MedicBill[playerid] = 0;
				MedicTime[playerid] = 0;
				NeedMedicTime[playerid] = 0;*/
				PlayerInfo[playerid][pDeaths] += 1;
				SetPlayerHealth(playerid, 25.0);
		  	SetPlayerInterior(playerid, 3);
		  	PlayerInfo[playerid][pInt] = 3;
	    	rand = random(sizeof(gMedicSpawns));
				SetPlayerPos(playerid, gMedicSpawns[rand][0], gMedicSpawns[rand][1], gMedicSpawns[rand][2]); // Warp the player
				SetPlayerFacingAngle(playerid, 0);
	    	TogglePlayerControllable(playerid, 0);
	    	GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~You need to rest now ...", 30000, 3);
	    	JustDied[playerid] = 1;
	    	MedicTime[playerid] = 1;
	    	ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
	    	if(PlayerInfo[playerid][pDonateRank] > 0)
	    	{
	      	NeedMedicTime[playerid] = 30;
	    	}
	    	else
	    	{
	    		NeedMedicTime[playerid] = 40;
				}
	    	PlayerPlaySound(playerid, 1062, 0.0, 0.0, 0.0);
		  	return 1;
			}
		}
		if(JustDied[playerid] == 1)
		{
		  if(GetPlayerVirtualWorld(playerid) != 0 || PlayerInfo[playerid][pVirWorld] != 0)
		  {
		    SetPlayerVirtualWorld(playerid, 0);
		    PlayerInfo[playerid][pVirWorld] = 0;
		  }
		  SetPlayerPos(playerid, 1182.5638,-1323.5256,13.5790);
		  SetPlayerFacingAngle(playerid, 270.0);
		  SetPlayerInterior(playerid,0);
		  PlayerInfo[playerid][pInt] = 0;
		  return 1;
		}
		if(PlayerInfo[playerid][pCrashed] == 1)
		{
		  if(TutTime[playerid] == 0 && PlayerInfo[playerid][pTut] == 1 && RegistrationStep[playerid] == 0 && AfterTutorial[playerid] == 0 && FirstSpawn[playerid] == 1)
		  {
		    SetPlayerVirtualWorld(playerid,PlayerInfo[playerid][pVirWorld]);
		    SetPlayerInterior(playerid,PlayerInfo[playerid][pInt]);
		  	SetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z] + 1);
		  	//SendClientMessage(playerid, COLOR_WHITE, "Crashed, returning where you been.");
		  	//GameTextForPlayer(playerid, "~p~Crashed~n~~w~returning where you been", 5000, 1);
		  	return 1;
			}
		}
i hope somebody can help me.
Reply
#2

Bump
Reply
#3

If this one is on SetPlayerSpawn function, make your own function and put it there:
Код:
if(MedicBill[playerid] == 1 && PlayerInfo[playerid][pJailed] == 0 && PlayerPaintballing[playerid] == 0)
		{
		  if(FirstSpawn[playerid] != 1)
		  {
		  	/*new string[256];
		  	new cut = deathcost; //PlayerInfo[playerid][pLevel]*deathcost;
				SafeGivePlayerMoney(playerid, -cut);
				format(string, sizeof(string), "DOC: Your Medical Bill comes to $%d, Have a nice day.", cut);
				SendClientMessage(playerid, TEAM_CYAN_COLOR, string);
				MedicBill[playerid] = 0;
				MedicTime[playerid] = 0;
				NeedMedicTime[playerid] = 0;*/
				PlayerInfo[playerid][pDeaths] += 1;
				SetPlayerHealth(playerid, 25.0);
		  	SetPlayerInterior(playerid, 3);
		  	PlayerInfo[playerid][pInt] = 3;
	    	rand = random(sizeof(gMedicSpawns));
				SetPlayerPos(playerid, gMedicSpawns[rand][0], gMedicSpawns[rand][1], gMedicSpawns[rand][2]); // Warp the player
				SetPlayerFacingAngle(playerid, 0);
	    	TogglePlayerControllable(playerid, 0);
	    	GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~You need to rest now ...", 30000, 3);
	    	JustDied[playerid] = 1;
	    	MedicTime[playerid] = 1;
	    	ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
	    	if(PlayerInfo[playerid][pDonateRank] > 0)
	    	{
	      	NeedMedicTime[playerid] = 30;
	    	}
	    	else
	    	{
	    		NeedMedicTime[playerid] = 40;
				}
	    	PlayerPlaySound(playerid, 1062, 0.0, 0.0, 0.0);
		  	return 1;
			}
		}
Reply
#4

Quote:
Originally Posted by Chuck_Taylor
If this one is on SetPlayerSpawn function, make your own function and put it there:
Код:
if(MedicBill[playerid] == 1 && PlayerInfo[playerid][pJailed] == 0 && PlayerPaintballing[playerid] == 0)
		{
		  if(FirstSpawn[playerid] != 1)
		  {
		  	/*new string[256];
		  	new cut = deathcost; //PlayerInfo[playerid][pLevel]*deathcost;
				SafeGivePlayerMoney(playerid, -cut);
				format(string, sizeof(string), "DOC: Your Medical Bill comes to $%d, Have a nice day.", cut);
				SendClientMessage(playerid, TEAM_CYAN_COLOR, string);
				MedicBill[playerid] = 0;
				MedicTime[playerid] = 0;
				NeedMedicTime[playerid] = 0;*/
				PlayerInfo[playerid][pDeaths] += 1;
				SetPlayerHealth(playerid, 25.0);
		  	SetPlayerInterior(playerid, 3);
		  	PlayerInfo[playerid][pInt] = 3;
	    	rand = random(sizeof(gMedicSpawns));
				SetPlayerPos(playerid, gMedicSpawns[rand][0], gMedicSpawns[rand][1], gMedicSpawns[rand][2]); // Warp the player
				SetPlayerFacingAngle(playerid, 0);
	    	TogglePlayerControllable(playerid, 0);
	    	GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~You need to rest now ...", 30000, 3);
	    	JustDied[playerid] = 1;
	    	MedicTime[playerid] = 1;
	    	ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
	    	if(PlayerInfo[playerid][pDonateRank] > 0)
	    	{
	      	NeedMedicTime[playerid] = 30;
	    	}
	    	else
	    	{
	    		NeedMedicTime[playerid] = 40;
				}
	    	PlayerPlaySound(playerid, 1062, 0.0, 0.0, 0.0);
		  	return 1;
			}
		}
im not so pro to do myown death/spawn system :S

i want fix this ,its good system enough but i dont know how to fix it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)