Death/Spawn bug.
#1

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;
			}
		}
Reply
#2

OnPlayerSpawn it seems like.
Reply
#3

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

post your OnPlayerDeath and OnPlayerSpawn code
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)