[bug] Hospital Spawn bug ((I will pay for it))
#1

Importent!:If you can fix this problem for me and make it work you will get some cash/$29,72 USD ((PAYPAL))/

Hey i have a huge problem here, i use my own gamemode based on me not and GF and i got an hospital idйa from a friend as where in an GF script i gess but dont care lets jump to the point here. The problem i have is that when you are dead you are spawning in a hospital/system and you are laying on a bed and waiting to get heald when you are done you are spawning outside hospital but the thing is that when you have been heald you are spawning outside the hospital and in like an half second you are inside the hospital agen and it you are back at the begining agen, and i was seaching and trying to find the problem but cant find it at all and the scaryest part is that it works 100% good in 0.2 so now I'm here and asking all guys as know a lot of scripting.


You can see the video here.

-----------------------------------------------------Here is my code--------------------------------------------------------------

This Code here is under "public SetPlayerSpawn(playerid)"
Code:
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]);
				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, 1608.15,1823.17,11.0359);
		  SetPlayerFacingAngle(playerid, 270.0);
		  SetPlayerInterior(playerid,0);
		  PlayerInfo[playerid][pInt] = 0;
		  return 1;
		}
this one is under "public SetPlayerUnjail()"
Code:
        if(MedicTime[i] > 0)
			{
			  if(MedicTime[i] == 3)
			  {
			    SetPlayerInterior(i, 3);
			    PlayerInfo[i][pInt] = 3;
			    new Float:X, Float:Y, Float:Z;
			    GetPlayerPos(i, X,Y,Z);
			    SetPlayerCameraPos(i, X - 3, Y, Z);
			    SetPlayerCameraLookAt(i,X,Y,Z);
			  }
			  MedicTime[i] ++;
			  if(MedicTime[i] >= NeedMedicTime[i])
			  {
					new cut = deathcost; //PlayerInfo[playerid][pLevel]*deathcost;
					//SafeGivePlayerMoney(i, -cut);
					format(string, sizeof(string), "Doctor: Your Medical Bill comes to $%d, Have a nice day.", cut);
					SendClientMessage(i, TEAM_CYAN_COLOR, string);
					TogglePlayerControllable(i, 1);
			    MedicBill[i] = 0;
			    MedicTime[i] = 0;
			    NeedMedicTime[i] = 0;
			    PlayerInfo[i][pDeaths] += 1;
			    PlayerFixRadio(i);
			    ClearAnimations(i);
			    SpawnPlayer(i);
			  }
			}
I realy need some help here and i have heard that manny othere server owner have this same problem but never get any answer and i have search on the forum for it to and see if i could find anything but no one have find this problem, If there is some one as can find and fix this problem i will pay them $29,72 USD ((PAYPAL))
Reply
#2

What does FirstSpawn do?
Reply
#3

Quote:
Originally Posted by Dresden
What does FirstSpawn do?
Not much its like do dissable it hard to describe its like if that one isn't there you can't respawn you will probebly crash
Reply
#4

http://forum.sa-mp.com/index.php?topic=127471.0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)