spawn problem :/
#1

Hi guys.. . When someone death wont be spawned in hospital - see the code but he have showed "< > Spawn"
also i am using this https://sampforum.blast.hk/showthread.php?tid=27598
here is the code:
Код:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
	if(InRiot[playerid] == 0) {
	    if(Death[playerid] == 1)
	    {
	        if(LS[playerid] == 1)
	        {
	            SetSpawnInfo(playerid, PlayerInfo[playerid][pSkin], 0, 1184.1594, -1328.6849, 14.6776, Angle[ playerid ], 0, 0, 0, 0, 0, 0);
	            SpawnPlayer(playerid);
	        	Death[playerid] = 0;
	            if(!Dmsg[playerid])
	            {
	            	InfoBox(playerid, 10, "When you die, you will be spawned at nearest hospital!");
	            	Dmsg[playerid] = 1;
				}
	        }
	        if(LSm[playerid] == 1)
	        {
	    		SetSpawnInfo(playerid, PlayerInfo[playerid][pSkin], 0, 1184.1594, -1328.6849, 14.6776, Angle[ playerid ], 0, 0, 0, 0, 0, 0);
	            SpawnPlayer(playerid);
	        	Death[playerid] = 0;
	            if(!Dmsg[playerid])
	            {
	            	InfoBox(playerid, 10, "When you die, you will be spawned at nearest hospital!");
	            	Dmsg[playerid] = 1;
				}
	        }
	        if(LSj[playerid] == 1)
	        {
	    		SetSpawnInfo(playerid, PlayerInfo[playerid][pSkin], 0, 2033.4229, -1415.4733, 17.1177, Angle[ playerid ], 0, 0, 0, 0, 0, 0);
	            SpawnPlayer(playerid);
	        	Death[playerid] = 0;
	            if(!Dmsg[playerid])
	            {
	            	InfoBox(playerid, 10, "When you die, you will be spawned at nearest hospital!");
	            	Dmsg[playerid] = 1;
				}
	        }
	        if(LV[playerid] == 1)
	        {
	    		SetSpawnInfo(playerid, PlayerInfo[playerid][pSkin], 0, 1574.7502, 1765.8085, 11.1280, Angle[ playerid ], 0, 0, 0, 0, 0, 0);
	            SpawnPlayer(playerid);
	        	Death[playerid] = 0;
	            if(!Dmsg[playerid])
	            {
	            	InfoBox(playerid, 10, "When you die, you will be spawned at nearest hospital!");
	            	Dmsg[playerid] = 1;
				}
	        }
	        if(SF[playerid] == 1)
	        {
	    		SetSpawnInfo(playerid, PlayerInfo[playerid][pSkin], 0, -2661.9375, 628.8449, 14.4552, Angle[ playerid ], 0, 0, 0, 0, 0, 0);
	            SpawnPlayer(playerid);
	        	Death[playerid] = 0;
	            if(!Dmsg[playerid])
	            {
	            	InfoBox(playerid, 10, "When you die, you will be spawned at nearest hospital!");
	            	Dmsg[playerid] = 1;
				}
	        }
	        if(WS[playerid] == 1)
	        {
	    		SetSpawnInfo(playerid, PlayerInfo[playerid][pSkin], 0, -2120.4175, -2392.1816, 31.2077, Angle[ playerid ], 0, 0, 0, 0, 0, 0);
	            SpawnPlayer(playerid);
	        	Death[playerid] = 0;
	            if(!Dmsg[playerid])
	            {
	            	InfoBox(playerid, 10, "When you die, you will be spawned at nearest hospital!");
	            	Dmsg[playerid] = 1;
				}
	        }
	        if(FC[playerid] == 1)
	        {
	    		SetSpawnInfo(playerid, PlayerInfo[playerid][pSkin], 0, -2120.4175, -2392.1816, 31.2077, Angle[ playerid ], 0, 0, 0, 0, 0, 0);
	            SpawnPlayer(playerid);
	        	Death[playerid] = 0;
	            if(!Dmsg[playerid])
	            {
	            	InfoBox(playerid, 10, "When you die, you will be spawned at nearest hospital!");
	            	Dmsg[playerid] = 1;
				}
	        }
	        if(TR[playerid] == 1)
	        {
	    		SetSpawnInfo(playerid, PlayerInfo[playerid][pSkin], 0, -1513.8352, 2530.7712, 56.0193, Angle[ playerid ], 0, 0, 0, 0, 0, 0);
	            SpawnPlayer(playerid);
	        	Death[playerid] = 0;
	            if(!Dmsg[playerid])
	            {
	            	InfoBox(playerid, 10, "When you die, you will be spawned at nearest hospital!");
	            	Dmsg[playerid] = 1;
				}
	        }
	        if(RC[playerid] == 1)
	        {
	    		SetSpawnInfo(playerid, PlayerInfo[playerid][pSkin], 0, 1250.7798, 333.8493, 19.6487, Angle[ playerid ], 0, 0, 0, 0, 0, 0);
	            SpawnPlayer(playerid);
	        	Death[playerid] = 0;
	            if(!Dmsg[playerid])
	            {
	            	InfoBox(playerid, 10, "When you die, you will be spawned at nearest hospital!");
	            	Dmsg[playerid] = 1;
				}
	        }
	        if(BC[playerid] == 1)
	        {
	    		SetSpawnInfo(playerid, PlayerInfo[playerid][pSkin], 0, -319.1704, 1056.5596, 19.3622, Angle[ playerid ], 0, 0, 0, 0, 0, 0);
	            SpawnPlayer(playerid);
	        	Death[playerid] = 0;
	            if(!Dmsg[playerid])
	            {
	            	InfoBox(playerid, 10, "When you die, you will be spawned at nearest hospital!");
	            	Dmsg[playerid] = 1;
				}
	        }
	    }
	    else
	    {
	        SetPlayerInterior( playerid, Interior[ playerid ] );
	        SetPlayerVirtualWorld( playerid, VirtualWorld[ playerid ] );
			GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon1], PlayerInfo[playerid][Weapon1a]);
			GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon2], PlayerInfo[playerid][Weapon2a]);
			GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon3], PlayerInfo[playerid][Weapon3a]);
			GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon4], PlayerInfo[playerid][Weapon4a]);
			GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon5], PlayerInfo[playerid][Weapon5a]);
			GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon6], PlayerInfo[playerid][Weapon6a]);
			GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon7], PlayerInfo[playerid][Weapon7a]);
			GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon8], PlayerInfo[playerid][Weapon8a]);
			GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon9], PlayerInfo[playerid][Weapon9a]);
			GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon10], PlayerInfo[playerid][Weapon10a]);
			GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon11], PlayerInfo[playerid][Weapon11a]);
			GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon12], PlayerInfo[playerid][Weapon12a]);
		}
	}
	else {
		new spawn;
	    if(RiotSawn == 1) {
			switch(spawn) {
			    case 0:
			    {
			        SetPlayerPos(playerid, -2758.3179, -243.6515, 8.9289);
			        spawn = 1;
			    }
			    case 1:
			    {
			        SetPlayerPos(playerid, -2760.2749, -255.4630, 6.7088);
			        spawn = 0;
			    }
			}
	    }
	    else if(RiotSmg == 1) {
	        switch(spawn) {
			    case 0:
			    {
			        SetPlayerPos(playerid, 2070.7681, -1580.8771, 13.5860);
			        spawn = 1;
			    }
			    case 1:
			    {
			        SetPlayerPos(playerid, 2085.1616, -1564.6115, 13.1260);
			        spawn = 0;
			    }
			}
	    }
	    else if(RiotRifle == 1) {
	        switch(spawn) {
			    case 0:
			    {
			        SetPlayerPos(playerid, 1633.7115, 742.1631, 10.6474);
			        spawn = 1;
			    }
			    case 1:
			    {
			        SetPlayerPos(playerid, 1694.8658, 696.3823, 12.5670);
			        spawn = 0;
			    }
			}
	    }
	}
    SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
	return 1;
}
 
public OnPlayerDeath(playerid, killerid, reason)
{
	SendDeathMessage(killerid, playerid, reason);
    if(InRiot[playerid] == 0)return GivePlayerMoney(playerid, GetPlayerMoney(playerid)-500);
	if(InRiot[killerid] == 0) {
		if(GetPlayerWantedLevel(killerid) > 6)
		{
			SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) + 1);
			Wanted[killerid] = 1;
    		SetPlayerColor(killerid, COLOR_RED);
		}
	}
	
	if(InRiot[playerid] == 0) {
		Death[playerid] = 1;
		if(IsPlayerInZone(playerid, "Fallen Tree")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Beacon Hill")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Flint Intersection")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Flint Range")) return LS[playerid] = 1;
	    if(IsPlayerInZone(playerid, "Market")) return LSm[playerid] = 1;
		if(IsPlayerInZone(playerid, "Jefferson")) return LSj[playerid] = 1;
		if(IsPlayerInZone(playerid, "Santa Maria Beach")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Rodeo")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Richman")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Dillimore")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Verona Beach")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Marina")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Vinewood")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Verdant Bluffs")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Conference Center")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Temple")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Mulholland")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Los Santos International")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "City Hall")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Pershing Square")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Commerce")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Downtown Los Santos")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Montgomery Intersection")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "El Corona")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Little Mexico")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Idlewood")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Glen Park")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Ocean Docks")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Willowfield")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Ganton")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "East Los Santos")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Las Colinas")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Playa del Seville")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "East Beach")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Los Flores")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "North Rock")) return LS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Los Santos")) return LS[playerid] = 1;

		if(IsPlayerInZone(playerid, "Greenglass College")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Blackfield")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Whitewood Estates")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Blackfield Intersection")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Pilson Intersection")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Yellow Bell Station")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Blackfield Chapel")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Randolph Industrial Estate")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "LVA Freight Depot")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Las Venturas Airport")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Redsands West")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Prickle Pine")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Harry Gold Parkway")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Last Dime Motel")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Julius Thruway South")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "The Four Dragons Casino")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "The Pink Swan")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "The Strip")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "The High Roller")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Pirates in Men's Pants")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "The Visage")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Redsands East")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "The Emerald Isle")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Rockshore West")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Come-A-Lot")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "The Camel's Toe")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Royal Casino")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Caligula's Palace")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Pilgrim")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Old Venturas Strip")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Roca Escalante")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Julius Thruway North")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Spinybed")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "K.A.C.C. Military Fuels")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Rockshore East")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Linden Side")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Linden Station")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Julius Thruway East")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Sobell Rail Yards")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Creek")) return LV[playerid] = 1;
		if(IsPlayerInZone(playerid, "Las Venturas")) return LV[playerid] = 1;

		if(IsPlayerInZone(playerid, "Downtown")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Avispa Country Club")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Missionary Hill")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Easter Bay Airport")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Ocean Flats")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Hashbury")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Doherty")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Garcia")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "City Hall")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Queens")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "King's")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Easter Basin")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Santa Flora")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Chinatown")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Palisades")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Juniper Hill")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Kincaid Bridge")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Foster Valley")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Financial")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Paradiso")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Calton Heights")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Garver Bridge")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Juniper Hollow")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Battery Point")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Esplanade North")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Esplanade East")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "Easter Bay Chemicals")) return SF[playerid] = 1;
		if(IsPlayerInZone(playerid, "San Friero")) return SF[playerid] = 1;

		if(IsPlayerInZone(playerid, "Whetstone")) return WS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Angel Pine")) return WS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Shady Creeks")) return WS[playerid] = 1;
		if(IsPlayerInZone(playerid, "Shady Cabin")) return WS[playerid] = 1;

		if(IsPlayerInZone(playerid, "The Farm")) return FC[playerid] = 1;
		if(IsPlayerInZone(playerid, "Leafy Hollow")) return FC[playerid] = 1;
		if(IsPlayerInZone(playerid, "Back o Beyond")) return FC[playerid] = 1;

		if(IsPlayerInZone(playerid, "The Panopticon")) return RC[playerid] = 1;
		if(IsPlayerInZone(playerid, "Blueberry Acres")) return RC[playerid] = 1;
		if(IsPlayerInZone(playerid, "Blueberry")) return RC[playerid] = 1;
		if(IsPlayerInZone(playerid, "Hilltop Farm")) return RC[playerid] = 1;
		if(IsPlayerInZone(playerid, "Fern Ridge")) return RC[playerid] = 1;
		if(IsPlayerInZone(playerid, "Hampton Barns")) return RC[playerid] = 1;
		if(IsPlayerInZone(playerid, "Martin Bridge")) return RC[playerid] = 1;
		if(IsPlayerInZone(playerid, "Fallow Bridge")) return RC[playerid] = 1;
		if(IsPlayerInZone(playerid, "Montgomery")) return RC[playerid] = 1;
		if(IsPlayerInZone(playerid, "Montgomery Intersection")) return RC[playerid] = 1;
		if(IsPlayerInZone(playerid, "The Mako Span")) return RC[playerid] = 1;
		if(IsPlayerInZone(playerid, "Palomino Creek")) return RC[playerid] = 1;
		if(IsPlayerInZone(playerid, "Hankypanky Point")) return RC[playerid] = 1;
		if(IsPlayerInZone(playerid, "Frederick Bridge")) return RC[playerid] = 1;

		if(IsPlayerInZone(playerid, "Gant Bridge")) return TR[playerid] = 1;
		if(IsPlayerInZone(playerid, "Bayside")) return TR[playerid] = 1;
		if(IsPlayerInZone(playerid, "Bayside Marina")) return TR[playerid] = 1;
		if(IsPlayerInZone(playerid, "El Quebrados")) return TR[playerid] = 1;
		if(IsPlayerInZone(playerid, "Aldea Malvada")) return TR[playerid] = 1;
		if(IsPlayerInZone(playerid, "The Sherman Dam")) return TR[playerid] = 1;
		if(IsPlayerInZone(playerid, "Las Barrancas")) return TR[playerid] = 1;
		if(IsPlayerInZone(playerid, "Arco del Oeste")) return TR[playerid] = 1;
		if(IsPlayerInZone(playerid, "Valle Ocultado")) return TR[playerid] = 1;

		if(IsPlayerInZone(playerid, "Fort Carson")) return BC[playerid] = 1;
		if(IsPlayerInZone(playerid, "Lil' Probe Inn")) return BC[playerid] = 1;
		if(IsPlayerInZone(playerid, "Regular Tom")) return BC[playerid] = 1;
		if(IsPlayerInZone(playerid, "Las Brujas")) return BC[playerid] = 1;
		if(IsPlayerInZone(playerid, "El Castillo del Diablo")) return BC[playerid] = 1;
		if(IsPlayerInZone(playerid, "Las Payasadas")) return BC[playerid] = 1;
		if(IsPlayerInZone(playerid, "Hunter Quarry")) return BC[playerid] = 1;
		if(IsPlayerInZone(playerid, "Green Palms")) return BC[playerid] = 1;
		if(IsPlayerInZone(playerid, "Octane Springs")) return BC[playerid] = 1;
		if(IsPlayerInZone(playerid, "Verdant Meadows")) return BC[playerid] = 1;
	}
	else {
 		if(InRiot[killerid] == 1) {
			GameTextForPlayer(killerid,"+100$",3000,3);
			GivePlayerMoney(killerid, 100);
 		}
	}
	
	
    GameTextForPlayer(playerid, "Wasted", 5000, 2);
	if(!reason)
	    return 1;

	
    return 1;
}
i cant see the mistake can you help me?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)