SA-MP Forums Archive
Death/Spawn bug. - 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: Death/Spawn bug. (/showthread.php?tid=219018)



Death/Spawn bug. - KaleOtter - 31.01.2011

Ey, I had this bug before but I forgot what the cause is.
I made a event system and when a player get killed he SOMETIMES get bugged.
His health is 0 but he doesn't respawns. Is the cause of this in OnPlayerDeath or OnPlayerSpawn?
And how can I fix it?
Maybe not a difficult question but the thing that me annoys it that it only happends sometimes, that makes it wierd.
I gues it happends at this point in OnPlayerSpawn:
Код:
		if(pS[Zone] == EventZone)
		{
			SetPlayerPos(playerid,Event[eID][ePosX],Event[eID][ePosY],Event[eID][ePosZ]+2);
			SetPlayerFacingAngle(playerid,Event[eID][ePosA]);
			SetPlayerInterior(playerid,Event[eID][eInterior]);
		 	SetPlayerVirtualWorld(playerid,EventWorld);
			if(Event[eID][eSkin] != 0) SetPlayerSkin(playerid,Event[eID][eSkin]);
			if(Event[eID][eWeapon1] != 0) GivePlayerGun(playerid,Event[eID][eWeapon1],99999);
			if(Event[eID][eWeapon2] != 0) GivePlayerGun(playerid,Event[eID][eWeapon2],99999);
			if(Event[eID][eWeapon3] != 0) GivePlayerGun(playerid,Event[eID][eWeapon3],99999);
			SetPlayerHealth(playerid,Event[eID][eHealth]);
			SetPlayerArmour(playerid,Event[eID][eArmour]);
			if(Event[eID][eCarModel] != 0)
			{
			    new vehicle;
	   			if(pS[Car] != -1)
				EraseVeh(pS[Car]);
				vehicle = CreateVehicle(Event[eID][eCarModel],Event[eID][ePosX],Event[eID][ePosY],Event[eID][ePosZ]+2, Event[eID][ePosA], 1, 1, -1);
				SetVehicleVirtualWorld(vehicle, EventWorld);
				PutPlayerInVehicle(playerid,vehicle,0);
				LinkVehicleToInterior(vehicle,Event[eID][eInterior]);
				pS[Car] = vehicle;
			}
		}



Re: Death/Spawn bug. - David5290 - 31.01.2011

OnPlayerSpawn it seems like.


Re: Death/Spawn bug. - KaleOtter - 01.02.2011

Lol why don't your read my question next time?


Re: Death/Spawn bug. - Steven Paul - 01.02.2011

post your OnPlayerDeath and OnPlayerSpawn code