Help with respawn system
#1

I am trying to make a paintball system. So, I made a function to give weapons, teleport and change the virtual world and put it under 'OnPlayerSpawn'. However, whenever the player dies and respawns it instantly dies again then respawns then dies again and again. Not sure what's the problem. but here's the code.
Код:
public OnPlayerSpawn(playerid)
{   if(pInfo[playerid][pbstatus]==true){
	pbrespawn(playerid);
	}
	return 1;
}
Here is the 'pbrespawn' function-
Код:
public pbrespawn(playerid)
{
    new rand;
	rand=random(4);
    switch(rand)
    {
    	case 0: SetPlayerPos(playerid,-1679.0305,1376.4728,12.3906);
		case 1:	SetPlayerPos(playerid,-1641.2963,1401.5313,7.1875);
		case 2:	SetPlayerPos(playerid,-1648.1776,1369.9368,7.1797);
		case 3: SetPlayerPos(playerid,-1692.3961,1353.3668,9.8047);
	}
    GivePlayerWeapon(playerid,pbarena[PB_ACTIVE][wep1],999);
	GivePlayerWeapon(playerid,pbarena[PB_ACTIVE][wep2],999);
	SetPlayerHealth(playerid,pbarena[PB_ACTIVE][pbhp]);
	SetPlayerArmour(playerid,pbarena[PB_ACTIVE][pbarmor]);
	SetPlayerVirtualWorld(playerid,1);
	return 1;
}
Reply


Messages In This Thread
Help with respawn system - by slxsh - 25.10.2018, 04:17
Re: Help with respawn system - by GameOvr - 25.10.2018, 05:15
Re: Help with respawn system - by DIRTYBYT3 - 25.10.2018, 06:57
Re: Help with respawn system - by slxsh - 26.10.2018, 11:41
Re: Help with respawn system - by slxsh - 28.10.2018, 10:26
Re: Help with respawn system - by Infin1ty - 28.10.2018, 10:53
Re: Help with respawn system - by slxsh - 28.10.2018, 15:36

Forum Jump:


Users browsing this thread: 1 Guest(s)