Player is spawned not at HQ
#1

Problem: if you are in a group (faction),you are spawned at the civillian spawn,not in HQ.


Public:
Code:
public SetPlayerSpawn(playerid)
{
	if(IsPlayerConnected(playerid))
	{
		InHouse[playerid] = -1;
		InBussines[playerid] = -1;
		InHQ[playerid] = -1;
		StopAudioStreamForPlayer(playerid);
		SetPlayerVirtualWorld(playerid,0);
		SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
	    if(PlayerInfo[playerid][pTut] == 0)
	    {
			gOoc[playerid] = 1; gNews[playerid] = 1; gFam[playerid] = 1; gRad[playerid] = 1; gTeamFac[playerid] = 1; gClChat[playerid] = 1;
			TogglePlayerControllable(playerid, 0);
			RegistrationStep[playerid] = 1;
			new sendername[30],stringy[128];
			GetPlayerName(playerid, sendername,  sizeof(sendername));
			SendClientMessage(playerid, COLOR_TEAL, "----------------------------------------------------------------------------");
			format(stringy,sizeof(stringy),"Welcome to Pear RPG, %s.", sendername);
			SendClientMessage(playerid, COLOR_YELLOW, stringy);
			SetPlayerInterior(playerid,0);
			SetPlayerVirtualWorld(playerid, 9994);
			SetPlayerPosEx(playerid, 1742.9814,-1863.0938,16.2048);
			InterpolateCameraPos(playerid, 1804.1313,-1732.0179,21.7294, 1037.3715,-1732.7358,25.2859, 30000, CAMERA_MOVE);
			InterpolateCameraLookAt(playerid,1441.6654,-1732.0317,18.0373,1037.3715,-1732.7358,25.2859, 30000, CAMERA_MOVE);
			ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_MSGBOX, "Language", "Alege limba in care vrei sa fie afisate mesajele de pe server.\nChoose the language that you speak.", "Romana", "English");
			return 1;
		}
		new rand,
			house = PlayerInfo[playerid][pPhousekey];
		if(PlayerInfo[playerid][pPaintBallG] >= 1)
		{
		    curatj[playerid] = 1;
		    SetPlayerToTeamColor(playerid);
		    if(PlayerInfo[playerid][pPaintBallG] == 2 && paintt[PlayerInfo[playerid][pPaintBallG]] > 0)
		    {
		        SetPlayerArmourEx(playerid, 100.0);
			}
			if(PlayerInfo[playerid][pPaintBallG] == 1 || PlayerInfo[playerid][pPaintBallG] == 2)
			{
		    	if(paintg[PlayerInfo[playerid][pPaintBallG]] == 1 && paintt[PlayerInfo[playerid][pPaintBallG]] > 0)
		    	{
		        	GivePlayerWeaponEx(playerid, 24, 1000);
		        	GivePlayerWeaponEx(playerid, 31, 1000);
		        	GivePlayerWeaponEx(playerid, 16, 1);
		        	GivePlayerWeaponEx(playerid, 41, 1000);
				}
				else if(paintg[PlayerInfo[playerid][pPaintBallG]] == 2 && paintt[PlayerInfo[playerid][pPaintBallG]] > 0)
		    	{
		        	GivePlayerWeaponEx(playerid, 5, 1);
				}
				else if(paintg[PlayerInfo[playerid][pPaintBallG]] == 3 && paintt[PlayerInfo[playerid][pPaintBallG]] > 0)
		    	{
		       	 	GivePlayerWeaponEx(playerid, 9, 1);
				}
			}
			else if(PlayerInfo[playerid][pPaintBallG] == 3 && paintt[PlayerInfo[playerid][pPaintBallG]] > 0)
			{
				if(PlayerInfo[playerid][pPaintBallKills] >= 0 && PlayerInfo[playerid][pPaintBallKills] <= 1) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 24, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 2 && PlayerInfo[playerid][pPaintBallKills] <= 3) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 29, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 4 && PlayerInfo[playerid][pPaintBallKills] <= 5) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 28, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 6 && PlayerInfo[playerid][pPaintBallKills] <= 7) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 33, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 8 && PlayerInfo[playerid][pPaintBallKills] <= 9) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 32, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 10 && PlayerInfo[playerid][pPaintBallKills] <= 11) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 25, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 12 && PlayerInfo[playerid][pPaintBallKills] <= 13) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 26, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 14 && PlayerInfo[playerid][pPaintBallKills] <= 15) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 34, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 16 && PlayerInfo[playerid][pPaintBallKills] <= 17) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 27, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 18 && PlayerInfo[playerid][pPaintBallKills] <= 19) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 31, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 20 && PlayerInfo[playerid][pPaintBallKills] <= 21) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 30, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 22 && PlayerInfo[playerid][pPaintBallKills] <= 23) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 23, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 24 && PlayerInfo[playerid][pPaintBallKills] <= 25) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 22, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 26 && PlayerInfo[playerid][pPaintBallKills] <= 27) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 9, 1); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 28) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 4, 1); }
			}
			else if(PlayerInfo[playerid][pPaintBallG] == 4 && paintt[PlayerInfo[playerid][pPaintBallG]] > 0)
			{
			    GivePlayerWeaponEx(playerid, 24, 1000);
			}
			if(paintm[PlayerInfo[playerid][pPaintBallG]] == 1)
			{
   				rand = random(sizeof(gRandomSpawnRC));
			    SetPlayerPosEx(playerid,gRandomSpawnRC[rand][0],gRandomSpawnRC[rand][1],gRandomSpawnRC[rand][2]);
			    SetPlayerSkin(playerid, 250);
			    SetPlayerInterior(playerid, 10);
			    if(PlayerInfo[playerid][pPaintBallG] == 1)
			    {
			    	SetPlayerVirtualWorld(playerid,125);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 2)
			    {
			    	SetPlayerVirtualWorld(playerid,126);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 3)
			    {
			    	SetPlayerVirtualWorld(playerid,127);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 4)
			    {
			    	SetPlayerVirtualWorld(playerid,128);
				}
			    SetTimerEx("UnFreezeStation", 100, false, "i", playerid);
			}
			else if(paintm[PlayerInfo[playerid][pPaintBallG]] == 2)
			{
   				rand = random(sizeof(gRandomSpawnTennis));
			    SetPlayerPosEx(playerid,gRandomSpawnTennis[rand][0],gRandomSpawnTennis[rand][1],gRandomSpawnTennis[rand][2]);
			    SetPlayerSkin(playerid, 96);
	     		SetPlayerWorldBounds(playerid, -2712.4683, -2792.2351,-229.3094, -274.6794);
	     		SetPlayerInterior(playerid, 0);
			    if(PlayerInfo[playerid][pPaintBallG] == 1)
			    {
			    	SetPlayerVirtualWorld(playerid,125);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 2)
			    {
			    	SetPlayerVirtualWorld(playerid,126);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 3)
			    {
			    	SetPlayerVirtualWorld(playerid,127);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 4)
			    {
			    	SetPlayerVirtualWorld(playerid,128);
				}
			    SetTimerEx("UnFreezeStation", 100, false, "i", playerid);
			}
			else if(paintm[PlayerInfo[playerid][pPaintBallG]] == 3)
			{
   				rand = random(sizeof(gRandomSpawnFarm));
			    SetPlayerPosEx(playerid,gRandomSpawnFarm[rand][0],gRandomSpawnFarm[rand][1],gRandomSpawnFarm[rand][2]);
			    SetPlayerSkin(playerid, 158);
			    SetPlayerWorldBounds(playerid, 135.3258, -287.9915, 57.6137 ,-74.2723);
			    SetPlayerInterior(playerid, 0);
			    if(PlayerInfo[playerid][pPaintBallG] == 1)
			    {
			    	SetPlayerVirtualWorld(playerid,125);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 2)
			    {
			    	SetPlayerVirtualWorld(playerid,126);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 3)
			    {
			    	SetPlayerVirtualWorld(playerid,127);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 4)
			    {
			    	SetPlayerVirtualWorld(playerid,128);
				}
			    SetTimerEx("UnFreezeStation", 100, false, "i", playerid);
			}
			else if(paintm[PlayerInfo[playerid][pPaintBallG]] == 4)
			{
   				rand = random(sizeof(gRandomSpawnBeach));
			    SetPlayerPosEx(playerid,gRandomSpawnBeach[rand][0],gRandomSpawnBeach[rand][1],gRandomSpawnBeach[rand][2]);
			    SetPlayerSkin(playerid, 97);
			    SetPlayerWorldBounds(playerid, 708.0417, 409.4930, -1806.0677, -1907.7119);
			    SetPlayerInterior(playerid, 0);
			    if(PlayerInfo[playerid][pPaintBallG] == 1)
			    {
			    	SetPlayerVirtualWorld(playerid,125);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 2)
			    {
			    	SetPlayerVirtualWorld(playerid,126);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 3)
			    {
			    	SetPlayerVirtualWorld(playerid,127);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 4)
			    {
			    	SetPlayerVirtualWorld(playerid,128);
				}
			    SetTimerEx("UnFreezeStation", 100, false, "i", playerid);
			}
			else if(paintm[PlayerInfo[playerid][pPaintBallG]] == 5)
			{
   				rand = random(sizeof(gRandomSpawnLSPD));
			    SetPlayerPosEx(playerid,gRandomSpawnLSPD[rand][0],gRandomSpawnLSPD[rand][1],gRandomSpawnLSPD[rand][2]);
			    SetPlayerSkin(playerid, 285);
			    SetPlayerWorldBounds(playerid, 1558.4261, 1387.0891, -1578.9333, -1776.6854);
			    SetPlayerInterior(playerid, 0);
			    if(PlayerInfo[playerid][pPaintBallG] == 1)
			    {
			    	SetPlayerVirtualWorld(playerid,125);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 2)
			    {
			    	SetPlayerVirtualWorld(playerid,126);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 3)
			    {
			    	SetPlayerVirtualWorld(playerid,127);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 4)
			    {
			    	SetPlayerVirtualWorld(playerid,128);
				}
			    SetTimerEx("UnFreezeStation", 100, false, "i", playerid);
			}
			return 1;
		}
		if(BeforeSpectate[playerid][pSpectating])
  		{
   			SetPlayerVirtualWorld(playerid, BeforeSpectate[playerid][pWorld]);
   			SetPlayerInterior(playerid, BeforeSpectate[playerid][pInt]);

   			if(BeforeSpectate[playerid][pState] == PLAYER_STATE_DRIVER)
    		PutPlayerInVehicle(playerid, BeforeSpectate[playerid][pInVehicle], 0);

   			else if(BeforeSpectate[playerid][pState] == PLAYER_STATE_PASSENGER)
    			PutPlayerInVehicle(playerid, BeforeSpectate[playerid][pInVehicle], 1 + random(3));

   			else
    			SetPlayerPos(playerid, BeforeSpectate[playerid][pOldPos][0], BeforeSpectate[playerid][pOldPos][1], BeforeSpectate[playerid][pOldPos][2]);

   			BeforeSpectate[playerid][pSpectating] = false;
   			return 1;
  		}
		if(PlayerInfo[playerid][pJailed] == 1)
		{
			SetPlayerWantedLevel(playerid, 0);
			DestroyDynamic3DTextLabel(WantedScris[playerid]);
			PlayerTextDrawHide(playerid, WantedText[playerid]);
			SetPlayerInterior(playerid, 6);
			rand = random(sizeof(gRandomJailSpawns));
			SetPlayerPosEx(playerid,gRandomJailSpawns[rand][0],gRandomJailSpawns[rand][1],gRandomJailSpawns[rand][2]);
			TogglePlayerControllable(playerid, 0);
			SetTimerEx("UnFreezeStation", 1000, false, "i", playerid);
			if(PlayerInfo[playerid][pVirtualPD] == 3)
			{
			    SetPlayerVirtualWorld(playerid, 3);
			}
			else
			{
			    SetPlayerVirtualWorld(playerid, 0);
			}
			return 1;
		}
		if(PlayerInfo[playerid][pJailed] == 2)
		{
			DestroyDynamic3DTextLabel(WantedScris[playerid]);
			PlayerTextDrawHide(playerid, WantedText[playerid]);
			SetPlayerInterior(playerid, 10);
			rand = random(sizeof(gRandomJailSpawns));
			SetPlayerPosEx(playerid,gRandomJailSpawns[rand][0],gRandomJailSpawns[rand][1],gRandomJailSpawns[rand][2]);
			TogglePlayerControllable(playerid, 0);
			SetTimerEx("UnFreezeStation", 1000, false, "i", playerid);
			return 1;
		}
		if(fight2[playerid] != 999)
		{
		    new string[100];
		    SetPlayerVirtualWorld(fight2[playerid],0);
		    fight2[fight2[playerid]] = 999;
		    GivePlayerCash(fight2[playerid],5000);
		    Update(fight2[playerid],pCashx);
		    SCM(fight2[playerid],COLOR_PRIMIRE,"(+) Ai castigat lupta si ai primit $5,000.");
		    new randomrp = random(6);
            if(randomrp == 5)
            {
			    PlayerInfo[fight2[playerid]][pExp] += 1;
                Update(fight2[playerid],pRP);
                SCM(fight2[playerid],COLOR_LIGHTBLUE,"{FFFFFF} Ai primit 1 {0080FF}respect point{FFFFFF} si {0080FF}1 premium point {FFFFFF}deoarece ai castigat lupta.");
            }
		    new fightname[25];
		    GetPlayerName(fight2[playerid],fightname,sizeof(fightname));
			foreach(Player,i)
			{
				if(IsPlayerInRangeOfPoint(i,15.0,1510.2313,-1058.1528,25.0625))
				{
				    format(string,sizeof(string),"** %s a castigat lupta.",fightname);
					SendClientMessage(i,COLOR_WHITE,string);
				}
			}
	        if(PlayerInfo[fight2[playerid]][pModel] > 0)
	        {
				SetPlayerSkin(fight2[playerid], PlayerInfo[fight2[playerid]][pModel]);
	        }
	        else
	        {
				SetPlayerSkin(fight2[playerid], PlayerInfo[fight2[playerid]][pModel]);
	        }
	        TogglePlayerControllable(fight2[playerid], 1);
	        SetPlayerPos(fight2[playerid],1510.46,-1059.55,25.0625);
			fight2[playerid] = 999;
			fightr[playerid] = 1;
		    fighta = 0;
		}
		if(fightr[playerid] == 1)
		{
	        SetPlayerPos(playerid,1510.46,-1059.55,25.0625);
	        fightr[playerid] = 0;
		    return 1;
		}
		if(fight2n[playerid] != 999)
		{
		    new string[100];
		    SetPlayerVirtualWorld(fight2n[playerid],0);
		    fight2n[fight2n[playerid]] = 999;
		    GivePlayerCash(fight2n[playerid],5000);
		    Update(fight2n[playerid],pCashx);
		    SCM(fight2n[playerid],COLOR_PRIMIRE,"(+) Ai castigat lupta si ai primit $5,000.");
		    new randomrp = random(6);
            if(randomrp == 5)
            {
			    PlayerInfo[fight2n[playerid]][pExp] += 1;
                Update(fight2n[playerid],pRP);
                SCM(fight2n[playerid],COLOR_LIGHTBLUE,"{FFFFFF} Ai primit 1 {0080FF}respect point{FFFFFF} si {0080FF}1 premium point {FFFFFF}deoarece ai castigat lupta.");
            }
		    new fightname[25];
		    GetPlayerName(fight2n[playerid],fightname,sizeof(fightname));
			foreach(Player,i)
			{
				if(IsPlayerInRangeOfPoint(i,15.0,1328.1801,-1558.2500,13.5469))
				{
				    format(string,sizeof(string),"** %s a castigat lupta.",fightname);
					SendClientMessage(i,COLOR_WHITE,string);
				}
			}
			ResetPlayerWeaponsEx(fight2n[playerid]);
		    ResetPlayerWeapons(fight2n[playerid]);
	        if(PlayerInfo[fight2n[playerid]][pModel] > 0)
	        {
				SetPlayerSkin(fight2n[playerid], PlayerInfo[fight2n[playerid]][pModel]);
	        }
	        else
	        {
				SetPlayerSkin(fight2n[playerid], PlayerInfo[fight2n[playerid]][pModel]);
	        }
	        TogglePlayerControllable(fight2n[playerid], 1);
	        SetPlayerPos(fight2n[playerid],1328.1801,-1558.2500,13.5469);
			fight2n[playerid] = 999;
			fightrn[playerid] = 1;
		    fightnin = 0;
		}
		if(fightrn[playerid] == 1)
		{
	        SetPlayerPos(playerid,1328.1801,-1558.2500,13.5469);
	        fightrn[playerid] = 0;
		    return 1;
		}
		if(house != 0)
		{
		    if(PlayerInfo[playerid][pSpawnChange] == 1)
		    {
				SetPlayerToTeamColor(playerid);
				SetPlayerInterior(playerid,HouseInfo[house][hInterior]);
				SetPlayerPosEx(playerid, HouseInfo[house][hExitx], HouseInfo[house][hExity],HouseInfo[house][hExitz]);
                SetPlayerVirtualWorld(playerid, HouseInfo[house][hVirtual]);
				PlayerInfo[playerid][pLocal] = house;
				PlayerInfo[playerid][pInt] = HouseInfo[house][hInterior];
				InHouse[playerid] = house;
				if(strlen(housestring[InHouse[playerid]]) > 0)
				{
    				StopAudioStreamForPlayer(playerid);
					PlayAudioStreamForPlayer(playerid, housestring[InHouse[playerid]]);
				}
				return 1;
			}
		}
		if (PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1) // LSPD
		{
			SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid, 246.7732,65.1425,1003.6406);
			SetPlayerFacingAngle(playerid, 270.0);
			SetPlayerInterior(playerid,6);
			PlayerInfo[playerid][pInt] = 6;
			return 1;
	    }
		if (PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2) // FBI
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerInterior(playerid, 3);
		    SetPlayerPosEx(playerid, 230.0687,165.1646,1003.0234);
		    PlayerInfo[playerid][pInt] = 3;
			InHQ[playerid] = 2;
		    return 1;
		}
		if (PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3) // NG
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerInterior(playerid, 0);
		    SetPlayerPosEx(playerid, 213.8154,1866.6807,13.1406);
		    PlayerInfo[playerid][pInt] = 0;
		    return 1;
		}
		if (PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4) // Los Aztecas
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerInterior(playerid, 2);
		    SetPlayerPosEx(playerid, 2545.1477,-1304.1975,1054.640);
		    PlayerInfo[playerid][pInt] = 2;
		    SetPlayerVirtualWorld(playerid, 1);
			InHQ[playerid] = 4;
			if(PlayerInfo[playerid][pGunLic] == 1)
			{
				GivePlayerWeaponEx(playerid, 24, 50);
			}
		    return 1;
		}
		if (PlayerInfo[playerid][pHelper] >= 1  && PlayerInfo[playerid][pMember] == 0 || PlayerInfo[playerid][pAdmin] >= 1  && PlayerInfo[playerid][pMember] == 0) // STAFF
		{
		    SetPlayerInterior(playerid, 5);
            SetPlayerPosEx(playerid, 1267.663208,-781.323242,1091.906250);
            SetPlayerVirtualWorld(playerid, 696969);
            PlayerInfo[playerid][pInt] = 5;
		    return 1;
		}
		if (PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5) // Grove Street
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerPosEx(playerid,2545.1477,-1304.1975,1054.640);
		    SetPlayerInterior(playerid, 2);
		    PlayerInfo[playerid][pInt] = 2;
			InHQ[playerid] = 5;
			if(PlayerInfo[playerid][pGunLic] == 1)
			{
				GivePlayerWeaponEx(playerid, 24, 50);
			}
			SetPlayerVirtualWorld(playerid,2);
		    return 1;
		}
		if (PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6) // Los Vagos
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerInterior(playerid, 2);
		    SetPlayerPosEx(playerid, 2545.1477,-1304.1975,1054.640);
		    PlayerInfo[playerid][pInt] = 2;
			InHQ[playerid] = 6;
			if(PlayerInfo[playerid][pGunLic] == 1)
			{
				GivePlayerWeaponEx(playerid, 24, 50);
			}
			SetPlayerVirtualWorld(playerid,3);
		    return 1;
		}
	    if (PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8) // Tow Car Company
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid, 246.8886,64.7381,1003.6406);
			SetPlayerInterior(playerid,6);
			PlayerInfo[playerid][pInt] = 6;
			InHQ[playerid] = 8;
			SetPlayerVirtualWorld(playerid, 3);
	        return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 20 || PlayerInfo[playerid][pLeader] == 20) // LVPD
		{
			SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid, 246.8886,64.7381,1003.6406);
			SetPlayerInterior(playerid,6);
			PlayerInfo[playerid][pInt] = 6;
			InHQ[playerid] = 20;
			SetPlayerVirtualWorld(playerid, 20);
			return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9) // News Reporter
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid, -2027.0515,-104.5211,1035.1719);
			SetPlayerInterior(playerid,3);
			PlayerInfo[playerid][pInt] = 3;
			GivePlayerWeaponEx(playerid,43,50);
			InHQ[playerid] = 9;
	        return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10) // Ballas
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid, 2545.1477,-1304.1975,1054.640);
			SetPlayerInterior(playerid,2);
			PlayerInfo[playerid][pInt] = 2;
			InHQ[playerid] = 10;
			if(PlayerInfo[playerid][pGunLic] == 1)
			{
				GivePlayerWeaponEx(playerid, 24, 50);
			}
			SetPlayerVirtualWorld(playerid, 4);
	        return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11) // Hitman
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid, 2323.9993,-1148.0469,1050.7101);
			SetPlayerInterior(playerid,12);
			PlayerInfo[playerid][pInt] = 12;
			InHQ[playerid] = 11;
			SetPlayerVirtualWorld(playerid, 2);
	        return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) // SI
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid,1494.325195,1304.942871,1093.289062);
			SetPlayerInterior(playerid,3);
			PlayerInfo[playerid][pInt] = 3;
			SetPlayerVirtualWorld(playerid, 3);
			InHQ[playerid] = 12;
	        return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16) // SI LS
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid,1494.325195,1304.942871,1093.289062);
			SetPlayerInterior(playerid,3);
			PlayerInfo[playerid][pInt] = 3;
			SetPlayerVirtualWorld(playerid, 6);
			InHQ[playerid] = 16;
	        return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17) // SI SF
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid,1494.325195,1304.942871,1093.289062);
			SetPlayerInterior(playerid,3);
			PlayerInfo[playerid][pInt] = 3;
			SetPlayerVirtualWorld(playerid, 9);
			InHQ[playerid] = 17;
	        return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13) // LS TAXI
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid,1700.9830,-1667.8865,20.2188);
			SetPlayerInterior(playerid,18);
			PlayerInfo[playerid][pInt] = 18;
			SetPlayerVirtualWorld(playerid, 5);
			InHQ[playerid] = 13;
	        return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14) // Paramedic LV
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid,1494.325195,1304.942871,1093.289062);
			SetPlayerInterior(playerid,3);
			PlayerInfo[playerid][pInt] = 3;
			SetPlayerVirtualWorld(playerid, 7);
			InHQ[playerid] = 14;
	        return 1;
	    }
   		if (PlayerInfo[playerid][pMember] == 21 || PlayerInfo[playerid][pLeader] == 21) //The Rifa
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerInterior(playerid, 2);
		    SetPlayerPosEx(playerid, 2545.1477,-1304.1975,1054.640);
		    PlayerInfo[playerid][pInt] = 2;
			InHQ[playerid] = 21;
			if(PlayerInfo[playerid][pGunLic] == 1)
			{
				GivePlayerWeaponEx(playerid, 24, 50);
			}
			SetPlayerVirtualWorld(playerid,5);
		    return 1;
		}
		if (PlayerInfo[playerid][pMember] == 24 || PlayerInfo[playerid][pLeader] == 24) //The Italian Mafia
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerInterior(playerid, 2);
		    SetPlayerPosEx(playerid, 2545.1477,-1304.1975,1054.6406);
		    PlayerInfo[playerid][pInt] = 2;
			InHQ[playerid] = 24;
			if(PlayerInfo[playerid][pGunLic] == 1)
			{
				GivePlayerWeaponEx(playerid, 24, 50);
			}
			SetPlayerVirtualWorld(playerid,6);
		    return 1;
		}
		if (PlayerInfo[playerid][pMember] == 25 || PlayerInfo[playerid][pLeader] == 25) //SF Bikers
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerInterior(playerid, 2);
		    SetPlayerPosEx(playerid, 2545.1477,-1304.1975,1054.6406);
		    PlayerInfo[playerid][pInt] = 2;
			InHQ[playerid] = 25;
			if(PlayerInfo[playerid][pGunLic] == 1)
			{
				GivePlayerWeaponEx(playerid, 24, 50);
			}
			SetPlayerVirtualWorld(playerid,7);
		    return 1;
		}
		if (PlayerInfo[playerid][pMember] == 22 || PlayerInfo[playerid][pLeader] == 22) //The Russian Mafia
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerInterior(playerid, 2);
		    SetPlayerPosEx(playerid, 2545.1477,-1304.1975,1054.640);
		    PlayerInfo[playerid][pInt] = 2;
			InHQ[playerid] = 22;
			if(PlayerInfo[playerid][pGunLic] == 1)
			{
				GivePlayerWeaponEx(playerid, 24, 50);
			}
			SetPlayerVirtualWorld(playerid,9);
		    return 1;
		}
		if (PlayerInfo[playerid][pMember] == 23 || PlayerInfo[playerid][pLeader] == 23) //Red Dragon Triads
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerInterior(playerid, 2);
		    SetPlayerPosEx(playerid, 2545.1477,-1304.1975,1054.640);
		    PlayerInfo[playerid][pInt] = 2;
			InHQ[playerid] = 23;
			if(PlayerInfo[playerid][pGunLic] == 1)
			{
				GivePlayerWeaponEx(playerid, 24, 50);
			}
			SetPlayerVirtualWorld(playerid,8);
		    return 1;
		}
	    if (PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 19) // Paramedic SF
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid,1494.325195,1304.942871,1093.289062);
			SetPlayerInterior(playerid,3);
			PlayerInfo[playerid][pInt] = 3;
			SetPlayerVirtualWorld(playerid, 10);
			InHQ[playerid] = 19;
	        return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15) // Taxi LV
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid,1700.9830,-1667.8865,20.2188);
			SetPlayerInterior(playerid,18);
			PlayerInfo[playerid][pInt] = 18;
			SetPlayerVirtualWorld(playerid, 4);
			InHQ[playerid] = 15;
	        return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 18) // Taxi LV
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid,1700.9830,-1667.8865,20.2188);
			SetPlayerInterior(playerid,18);
			PlayerInfo[playerid][pInt] = 18;
			SetPlayerVirtualWorld(playerid, 8);
			InHQ[playerid] = 18;
	        return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 0 || PlayerInfo[playerid][pLeader] == 0) // Civilian
	    {
			SetPlayerPosEx(playerid, 1284.8737,-1337.8431,13.5569); // Noul Spawn LS
			SetPlayerFacingAngle(playerid, 6.9127);
			SetPlayerInterior(playerid,0);
			PlayerInfo[playerid][pInt] = 0;
			SetPlayerVirtualWorld(playerid, 0);
	        return 1;
	    }
	    if ((gTeam[playerid]) == 3)
	    {
			SetPlayerPosEx(playerid, 1284.8737,-1337.8431,13.5569);
			SetPlayerFacingAngle(playerid, 6.9127);
			SetPlayerInterior(playerid,0);
			PlayerInfo[playerid][pInt] = 0;
			SetPlayerVirtualWorld(playerid, 0);
			return 1;
		}
	    else
	    {
			SetPlayerToTeamColor(playerid);
			if(PlayerInfo[playerid][pOrigin] == 1) // Europa
			{
				SetPlayerPosEx(playerid, 1284.8737,-1337.8431,13.5569);
				SetPlayerFacingAngle(playerid, 6.9127);
				SetPlayerInterior(playerid,0);
				PlayerInfo[playerid][pInt] = 0;
				SetPlayerVirtualWorld(playerid, 0);
			}
			else if(PlayerInfo[playerid][pOrigin] == 2) // America
			{
				SetPlayerPosEx(playerid, 1284.8737,-1337.8431,13.5569);
				SetPlayerFacingAngle(playerid, 6.9127);
				SetPlayerInterior(playerid,0);
				PlayerInfo[playerid][pInt] = 0;
				SetPlayerVirtualWorld(playerid, 0);
			}
			else if(PlayerInfo[playerid][pOrigin] == 3) // Asia
			{
				SetPlayerPosEx(playerid, 1284.8737,-1337.8431,13.5569);
				SetPlayerFacingAngle(playerid, 6.9127);
				SetPlayerInterior(playerid,0);
				PlayerInfo[playerid][pInt] = 0;
				SetPlayerVirtualWorld(playerid, 0);
			}
			else if(PlayerInfo[playerid][pOrigin] == 4) // Africa
			{
				SetPlayerPosEx(playerid, 1284.8737,-1337.8431,13.5569);
				SetPlayerFacingAngle(playerid, 6.9127);
				SetPlayerInterior(playerid,0);
				PlayerInfo[playerid][pInt] = 0;
				SetPlayerVirtualWorld(playerid, 0);
			}
			else if(PlayerInfo[playerid][pOrigin] == 5) // Australia
			{
				SetPlayerPosEx(playerid, 1284.8737,-1337.8431,13.5569);
				SetPlayerFacingAngle(playerid, 6.9127);
				SetPlayerInterior(playerid,0);
				PlayerInfo[playerid][pInt] = 0;
				SetPlayerVirtualWorld(playerid, 0);
			}
			else
			{
                SetPlayerPosEx(playerid,358.0976,-1841.3488,5.1257);
				SetPlayerInterior(playerid,0);
			    SetPlayerFacingAngle(playerid, 90.0);
		        SetPlayerCameraPos(playerid,1460.0, -1324.0, 287.2);
			    SetPlayerCameraLookAt(playerid,1374.5, -1291.1, 239.0);
	            PlayerPlaySound(playerid, 1097,-119.9460,23.1096,12.2238);
			}
		}
		SetTimerEx("UpdateSecondary", 3000, false, "i", playerid);
	}
	return 1;
}
Where i use it:

Code:
public OnPlayerSpawn(playerid)
{
    StopAudioStreamForPlayer(playerid);
    SetPlayerHealthEx(playerid, 100);
    SetPlayerArmourEx(playerid, 0);
	TextDrawShowForPlayer(playerid, Time);
	TextDrawShowForPlayer(playerid, Date);
    SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWantedLevel]);
    DestroyDynamic3DTextLabel(WantedScris[playerid]);
	OnPlayerDateUpdateX2(playerid);

    if(PlayerInfo[playerid][pConnectTime] >= 1 && PlayerInfo[playerid][pConnectTime] <= 2 && PlayerInfo[playerid][pMyRefferals] == 0)
	{
	    new string[200];
	    format(string,sizeof(string),
		"{FFFFFF}\tPentru ca ai facut o ora jucata\
		\nTe rugam sa specifici cine te-a adus pe server.\n\
		\tScrie numele Exact al jucatorului");
		ShowPlayerDialog(playerid, DIALOG_REFERAL, DIALOG_STYLE_INPUT, "{FFFFFF}REFERRAL",string,"OK","SKIP->");
	}

    PlayerTextDrawHide(playerid, caseTD[0]);
    PlayerTextDrawHide(playerid, caseTD[1]);
	PlayerTextDrawHide(playerid, caseTD[2]);
	PlayerTextDrawHide(playerid, caseTD[3]);
	PlayerTextDrawHide(playerid, caseTD[4]);
	PlayerTextDrawHide(playerid, caseTD[5]);
	PlayerTextDrawHide(playerid, caseTD[6]);
	PlayerTextDrawHide(playerid, caseTD[7]);
    if(PlayerInfo[playerid][pWantedLevel] > 0)
    {
        Tigaanel[playerid] = 1;
        DestroyDynamic3DTextLabel(WantedScris[playerid]);
    	new str2[256];
    	format(str2,sizeof(str2),"{FF3333}Nivel de urmarire: %d", PlayerInfo[playerid][pWantedLevel]);
    	WantedScris[playerid] = CreateDynamic3DTextLabel(str2, COLOR_WHITE, 0, 0, -20, 20, playerid);
		Streamer_SetFloatData(STREAMER_TYPE_3D_TEXT_LABEL, WantedScris[playerid] , E_STREAMER_ATTACH_OFFSET_Z, 0.48);
	}
    DestroyDynamic3DTextLabel(DeadScris[playerid]);
    if(PlayerInfo[playerid][pWantedLevel] >= 1)
    {
        new str1[256];
        PlayerTextDrawShow(playerid, WantedText[playerid]);
        format(str1,sizeof(str1),"WANTED SCADE IN: ~r~%d MINUTE",wantedlost[playerid]/60+1);
		PlayerTextDrawSetString(playerid, WantedText[playerid], str1);
	}
    SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
    if(Diceid[playerid] >= 0)
	{
		Joacabarbut[playerid] = 0;
		Joacabarbut[Diceid[playerid]] = 0;
		for(new i = 0; i < 17; i++)
		{
			PlayerTextDrawHide(playerid, BarbutTD[i]);
			PlayerTextDrawHide(Diceid[playerid], BarbutTD[i]);
		}
		CancelSelectTextDraw(playerid);
		CancelSelectTextDraw(Diceid[playerid]);
		Diceid[Diceid[playerid]] = -1;
		sumabarbut[Diceid[playerid]] = 10000;
		secundebarbut[Diceid[playerid]] = -1;
		secundebarbut[playerid] = -1;
		new string[256];
		format(string, sizeof(string), "{FFB870}%s a murit, meciul de barbut s-a sfarsit.",GetName(playerid));
		SCM(Diceid[playerid], -1 , string);
		Diceid[playerid] = -1;
	}
	secundebarbut[playerid] = -1;
	if(PlayerInfo[playerid][pHair] != 0)
	{
 		RemovePlayerAttachedObject(playerid, 7);
		new skin = GetPlayerSkin(playerid);
  		if(PlayerInfo[playerid][pHair] == 1)
	   	SetPlayerAttachedObject(playerid, 7, 19077, 2, SkinOffSett[skin][0], SkinOffSett[skin][1], SkinOffSett[skin][2], SkinOffSett[skin][3], SkinOffSett[skin][4], SkinOffSett[skin][5], SkinOffSett[skin][8], SkinOffSett[skin][8], SkinOffSett[skin][8]);
		else if(PlayerInfo[playerid][pHair] == 2)
        SetPlayerAttachedObject(playerid, 7, 18975, 2, SkinOffSett[skin][0], SkinOffSett[skin][1], SkinOffSett[skin][2], SkinOffSett[skin][3], SkinOffSett[skin][4], SkinOffSett[skin][5], SkinOffSett[skin][8], SkinOffSett[skin][8], SkinOffSett[skin][8]);
		else if(PlayerInfo[playerid][pHair] == 7)
	    SetPlayerAttachedObject(playerid, 7, 19136, 2, SkinOffSett[skin][0], SkinOffSett[skin][1], SkinOffSett[skin][2], SkinOffSett[skin][3], SkinOffSett[skin][4], SkinOffSett[skin][5], SkinOffSett[skin][8], SkinOffSett[skin][8], SkinOffSett[skin][8]);
 		else if(PlayerInfo[playerid][pHair] == 5)
	    SetPlayerAttachedObject(playerid, 7, 19274, 2, SkinOffSett[skin][0], SkinOffSett[skin][1], SkinOffSett[skin][2], SkinOffSett[skin][3], SkinOffSett[skin][4], SkinOffSett[skin][5], SkinOffSett[skin][8], SkinOffSett[skin][8], SkinOffSett[skin][8]);
		else RemovePlayerAttachedObject(playerid, 7);
	}
    if(OnDuty[playerid] > 0)
	{
		if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
		{
			GivePlayerWeaponEx(playerid, 24, 500);
			GivePlayerWeaponEx(playerid, 3, 1);
			GivePlayerWeaponEx(playerid, 41, 500);
			GivePlayerWeaponEx(playerid, 29, 1000);
			GivePlayerWeaponEx(playerid, 31, 1000);
			SetPlayerArmourEx(playerid, 100);
			SetPlayerHealthEx(playerid, 100);
		}
		if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
 		{
			GivePlayerWeaponEx(playerid, 24, 500);
			GivePlayerWeaponEx(playerid, 3, 1);
			GivePlayerWeaponEx(playerid, 41, 500);
			GivePlayerWeaponEx(playerid, 29, 1000);
			GivePlayerWeaponEx(playerid, 31, 1000);
			SetPlayerArmourEx(playerid, 100);
			SetPlayerHealthEx(playerid, 100);
		}
		if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
 		{
			GivePlayerWeaponEx(playerid, 24, 500);
			GivePlayerWeaponEx(playerid, 41, 500);
			GivePlayerWeaponEx(playerid, 29, 1000);
			GivePlayerWeaponEx(playerid, 31, 1000);
			SetPlayerArmourEx(playerid, 100);
			SetPlayerHealthEx(playerid, 100);
		}
		if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
 		{
			GivePlayerWeaponEx(playerid, 24, 500);
			GivePlayerWeaponEx(playerid, 3, 1);
			GivePlayerWeaponEx(playerid, 41, 500);
			GivePlayerWeaponEx(playerid, 29, 1000);
			GivePlayerWeaponEx(playerid, 31, 1000);
			SetPlayerArmourEx(playerid, 100);
			SetPlayerHealthEx(playerid, 100);
		}
		if(PlayerInfo[playerid][pMember] == 20 || PlayerInfo[playerid][pLeader] == 20)
 		{
			GivePlayerWeaponEx(playerid, 24, 500);
			GivePlayerWeaponEx(playerid, 3, 1);
			GivePlayerWeaponEx(playerid, 41, 500);
			GivePlayerWeaponEx(playerid, 29, 1000);
			GivePlayerWeaponEx(playerid, 31, 1000);
			SetPlayerArmourEx(playerid, 100);
			SetPlayerHealthEx(playerid, 100);
		}
	}
	if(!gPlayerAnimLibsPreloaded[playerid])
	{
   		PreloadAnimLib(playerid,"BOMBER");
   		PreloadAnimLib(playerid,"RAPPING");
    	PreloadAnimLib(playerid,"SHOP");
   		PreloadAnimLib(playerid,"BEACH");
   		PreloadAnimLib(playerid,"SMOKING");
    	PreloadAnimLib(playerid,"FOOD");
    	PreloadAnimLib(playerid,"ON_LOOKERS");
    	PreloadAnimLib(playerid,"DEALER");
    	PreloadAnimLib(playerid,"MISC");
    	PreloadAnimLib(playerid,"SWEET");
    	PreloadAnimLib(playerid,"RIOT");
    	PreloadAnimLib(playerid,"PED");
    	PreloadAnimLib(playerid,"POLICE");
		PreloadAnimLib(playerid,"CRACK");
		PreloadAnimLib(playerid,"CARRY");
		PreloadAnimLib(playerid,"COP_AMBIENT");
		PreloadAnimLib(playerid,"PARK");
		PreloadAnimLib(playerid,"INT_HOUSE");
		PreloadAnimLib(playerid,"FOOD");
		gPlayerAnimLibsPreloaded[playerid] = 1;
	}
	gTeam[playerid] = PlayerInfo[playerid][pTeam];
	if(gTeam[playerid] == 4)
	{
		gTeam[playerid] = 4;
	}
	if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pMember] == 20 || PlayerInfo[playerid][pLeader] == 20)
	{
		gTeam[playerid] = 2;
		PlayerInfo[playerid][pTeam] = 2;
	}
	if(JoinedDeathMatch[playerid] > 0)
	{
 		JoinedDeathMatch[playerid] = 0;
		ResetPlayerWeapons(playerid);
	}
	if(JoinedDeathMatch1[playerid] > 0)
		{
			JoinedDeathMatch1[playerid] = 0;
			SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
			ResetPlayerWeapons(playerid);
		}
	if(gPlayerLogged[playerid] == 0)
	{
    	SendClientMessage(playerid, COLOR_LIGHTRED, "** Trebuie sa te loghezi inainte de spawn (Kicked) **");
    	Kick(playerid);
		return 1;
 	}
 	ChosenSkin[playerid] = 1;
	SetPlayerSpawn(playerid);
	SetPlayerToTeamColor(playerid);
	playerdeath[playerid] = 0;
	Undercover[playerid] = 0;
	SetPlayerTeam(playerid,4);
	StopAudioStreamForPlayer(playerid);
	return 1;
}
Reply
#2

Quote:
Originally Posted by Longover
View Post
Problem: if you are in a group (faction),you are spawned at the civillian spawn,not in HQ.


Public:
Code:
public SetPlayerSpawn(playerid)
{
	if(IsPlayerConnected(playerid))
	{
		InHouse[playerid] = -1;
		InBussines[playerid] = -1;
		InHQ[playerid] = -1;
		StopAudioStreamForPlayer(playerid);
		SetPlayerVirtualWorld(playerid,0);
		SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
	    if(PlayerInfo[playerid][pTut] == 0)
	    {
			gOoc[playerid] = 1; gNews[playerid] = 1; gFam[playerid] = 1; gRad[playerid] = 1; gTeamFac[playerid] = 1; gClChat[playerid] = 1;
			TogglePlayerControllable(playerid, 0);
			RegistrationStep[playerid] = 1;
			new sendername[30],stringy[128];
			GetPlayerName(playerid, sendername,  sizeof(sendername));
			SendClientMessage(playerid, COLOR_TEAL, "----------------------------------------------------------------------------");
			format(stringy,sizeof(stringy),"Welcome to Pear RPG, %s.", sendername);
			SendClientMessage(playerid, COLOR_YELLOW, stringy);
			SetPlayerInterior(playerid,0);
			SetPlayerVirtualWorld(playerid, 9994);
			SetPlayerPosEx(playerid, 1742.9814,-1863.0938,16.2048);
			InterpolateCameraPos(playerid, 1804.1313,-1732.0179,21.7294, 1037.3715,-1732.7358,25.2859, 30000, CAMERA_MOVE);
			InterpolateCameraLookAt(playerid,1441.6654,-1732.0317,18.0373,1037.3715,-1732.7358,25.2859, 30000, CAMERA_MOVE);
			ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_MSGBOX, "Language", "Alege limba in care vrei sa fie afisate mesajele de pe server.\nChoose the language that you speak.", "Romana", "English");
			return 1;
		}
		new rand,
			house = PlayerInfo[playerid][pPhousekey];
		if(PlayerInfo[playerid][pPaintBallG] >= 1)
		{
		    curatj[playerid] = 1;
		    SetPlayerToTeamColor(playerid);
		    if(PlayerInfo[playerid][pPaintBallG] == 2 && paintt[PlayerInfo[playerid][pPaintBallG]] > 0)
		    {
		        SetPlayerArmourEx(playerid, 100.0);
			}
			if(PlayerInfo[playerid][pPaintBallG] == 1 || PlayerInfo[playerid][pPaintBallG] == 2)
			{
		    	if(paintg[PlayerInfo[playerid][pPaintBallG]] == 1 && paintt[PlayerInfo[playerid][pPaintBallG]] > 0)
		    	{
		        	GivePlayerWeaponEx(playerid, 24, 1000);
		        	GivePlayerWeaponEx(playerid, 31, 1000);
		        	GivePlayerWeaponEx(playerid, 16, 1);
		        	GivePlayerWeaponEx(playerid, 41, 1000);
				}
				else if(paintg[PlayerInfo[playerid][pPaintBallG]] == 2 && paintt[PlayerInfo[playerid][pPaintBallG]] > 0)
		    	{
		        	GivePlayerWeaponEx(playerid, 5, 1);
				}
				else if(paintg[PlayerInfo[playerid][pPaintBallG]] == 3 && paintt[PlayerInfo[playerid][pPaintBallG]] > 0)
		    	{
		       	 	GivePlayerWeaponEx(playerid, 9, 1);
				}
			}
			else if(PlayerInfo[playerid][pPaintBallG] == 3 && paintt[PlayerInfo[playerid][pPaintBallG]] > 0)
			{
				if(PlayerInfo[playerid][pPaintBallKills] >= 0 && PlayerInfo[playerid][pPaintBallKills] <= 1) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 24, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 2 && PlayerInfo[playerid][pPaintBallKills] <= 3) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 29, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 4 && PlayerInfo[playerid][pPaintBallKills] <= 5) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 28, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 6 && PlayerInfo[playerid][pPaintBallKills] <= 7) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 33, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 8 && PlayerInfo[playerid][pPaintBallKills] <= 9) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 32, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 10 && PlayerInfo[playerid][pPaintBallKills] <= 11) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 25, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 12 && PlayerInfo[playerid][pPaintBallKills] <= 13) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 26, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 14 && PlayerInfo[playerid][pPaintBallKills] <= 15) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 34, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 16 && PlayerInfo[playerid][pPaintBallKills] <= 17) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 27, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 18 && PlayerInfo[playerid][pPaintBallKills] <= 19) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 31, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 20 && PlayerInfo[playerid][pPaintBallKills] <= 21) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 30, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 22 && PlayerInfo[playerid][pPaintBallKills] <= 23) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 23, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 24 && PlayerInfo[playerid][pPaintBallKills] <= 25) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 22, 1000); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 26 && PlayerInfo[playerid][pPaintBallKills] <= 27) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 9, 1); }
				else if(PlayerInfo[playerid][pPaintBallKills] >= 28) { ResetPlayerWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerWeaponEx(playerid, 4, 1); }
			}
			else if(PlayerInfo[playerid][pPaintBallG] == 4 && paintt[PlayerInfo[playerid][pPaintBallG]] > 0)
			{
			    GivePlayerWeaponEx(playerid, 24, 1000);
			}
			if(paintm[PlayerInfo[playerid][pPaintBallG]] == 1)
			{
   				rand = random(sizeof(gRandomSpawnRC));
			    SetPlayerPosEx(playerid,gRandomSpawnRC[rand][0],gRandomSpawnRC[rand][1],gRandomSpawnRC[rand][2]);
			    SetPlayerSkin(playerid, 250);
			    SetPlayerInterior(playerid, 10);
			    if(PlayerInfo[playerid][pPaintBallG] == 1)
			    {
			    	SetPlayerVirtualWorld(playerid,125);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 2)
			    {
			    	SetPlayerVirtualWorld(playerid,126);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 3)
			    {
			    	SetPlayerVirtualWorld(playerid,127);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 4)
			    {
			    	SetPlayerVirtualWorld(playerid,128);
				}
			    SetTimerEx("UnFreezeStation", 100, false, "i", playerid);
			}
			else if(paintm[PlayerInfo[playerid][pPaintBallG]] == 2)
			{
   				rand = random(sizeof(gRandomSpawnTennis));
			    SetPlayerPosEx(playerid,gRandomSpawnTennis[rand][0],gRandomSpawnTennis[rand][1],gRandomSpawnTennis[rand][2]);
			    SetPlayerSkin(playerid, 96);
	     		SetPlayerWorldBounds(playerid, -2712.4683, -2792.2351,-229.3094, -274.6794);
	     		SetPlayerInterior(playerid, 0);
			    if(PlayerInfo[playerid][pPaintBallG] == 1)
			    {
			    	SetPlayerVirtualWorld(playerid,125);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 2)
			    {
			    	SetPlayerVirtualWorld(playerid,126);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 3)
			    {
			    	SetPlayerVirtualWorld(playerid,127);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 4)
			    {
			    	SetPlayerVirtualWorld(playerid,128);
				}
			    SetTimerEx("UnFreezeStation", 100, false, "i", playerid);
			}
			else if(paintm[PlayerInfo[playerid][pPaintBallG]] == 3)
			{
   				rand = random(sizeof(gRandomSpawnFarm));
			    SetPlayerPosEx(playerid,gRandomSpawnFarm[rand][0],gRandomSpawnFarm[rand][1],gRandomSpawnFarm[rand][2]);
			    SetPlayerSkin(playerid, 158);
			    SetPlayerWorldBounds(playerid, 135.3258, -287.9915, 57.6137 ,-74.2723);
			    SetPlayerInterior(playerid, 0);
			    if(PlayerInfo[playerid][pPaintBallG] == 1)
			    {
			    	SetPlayerVirtualWorld(playerid,125);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 2)
			    {
			    	SetPlayerVirtualWorld(playerid,126);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 3)
			    {
			    	SetPlayerVirtualWorld(playerid,127);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 4)
			    {
			    	SetPlayerVirtualWorld(playerid,128);
				}
			    SetTimerEx("UnFreezeStation", 100, false, "i", playerid);
			}
			else if(paintm[PlayerInfo[playerid][pPaintBallG]] == 4)
			{
   				rand = random(sizeof(gRandomSpawnBeach));
			    SetPlayerPosEx(playerid,gRandomSpawnBeach[rand][0],gRandomSpawnBeach[rand][1],gRandomSpawnBeach[rand][2]);
			    SetPlayerSkin(playerid, 97);
			    SetPlayerWorldBounds(playerid, 708.0417, 409.4930, -1806.0677, -1907.7119);
			    SetPlayerInterior(playerid, 0);
			    if(PlayerInfo[playerid][pPaintBallG] == 1)
			    {
			    	SetPlayerVirtualWorld(playerid,125);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 2)
			    {
			    	SetPlayerVirtualWorld(playerid,126);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 3)
			    {
			    	SetPlayerVirtualWorld(playerid,127);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 4)
			    {
			    	SetPlayerVirtualWorld(playerid,128);
				}
			    SetTimerEx("UnFreezeStation", 100, false, "i", playerid);
			}
			else if(paintm[PlayerInfo[playerid][pPaintBallG]] == 5)
			{
   				rand = random(sizeof(gRandomSpawnLSPD));
			    SetPlayerPosEx(playerid,gRandomSpawnLSPD[rand][0],gRandomSpawnLSPD[rand][1],gRandomSpawnLSPD[rand][2]);
			    SetPlayerSkin(playerid, 285);
			    SetPlayerWorldBounds(playerid, 1558.4261, 1387.0891, -1578.9333, -1776.6854);
			    SetPlayerInterior(playerid, 0);
			    if(PlayerInfo[playerid][pPaintBallG] == 1)
			    {
			    	SetPlayerVirtualWorld(playerid,125);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 2)
			    {
			    	SetPlayerVirtualWorld(playerid,126);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 3)
			    {
			    	SetPlayerVirtualWorld(playerid,127);
				}
				else if(PlayerInfo[playerid][pPaintBallG] == 4)
			    {
			    	SetPlayerVirtualWorld(playerid,128);
				}
			    SetTimerEx("UnFreezeStation", 100, false, "i", playerid);
			}
			return 1;
		}
		if(BeforeSpectate[playerid][pSpectating])
  		{
   			SetPlayerVirtualWorld(playerid, BeforeSpectate[playerid][pWorld]);
   			SetPlayerInterior(playerid, BeforeSpectate[playerid][pInt]);

   			if(BeforeSpectate[playerid][pState] == PLAYER_STATE_DRIVER)
    		PutPlayerInVehicle(playerid, BeforeSpectate[playerid][pInVehicle], 0);

   			else if(BeforeSpectate[playerid][pState] == PLAYER_STATE_PASSENGER)
    			PutPlayerInVehicle(playerid, BeforeSpectate[playerid][pInVehicle], 1 + random(3));

   			else
    			SetPlayerPos(playerid, BeforeSpectate[playerid][pOldPos][0], BeforeSpectate[playerid][pOldPos][1], BeforeSpectate[playerid][pOldPos][2]);

   			BeforeSpectate[playerid][pSpectating] = false;
   			return 1;
  		}
		if(PlayerInfo[playerid][pJailed] == 1)
		{
			SetPlayerWantedLevel(playerid, 0);
			DestroyDynamic3DTextLabel(WantedScris[playerid]);
			PlayerTextDrawHide(playerid, WantedText[playerid]);
			SetPlayerInterior(playerid, 6);
			rand = random(sizeof(gRandomJailSpawns));
			SetPlayerPosEx(playerid,gRandomJailSpawns[rand][0],gRandomJailSpawns[rand][1],gRandomJailSpawns[rand][2]);
			TogglePlayerControllable(playerid, 0);
			SetTimerEx("UnFreezeStation", 1000, false, "i", playerid);
			if(PlayerInfo[playerid][pVirtualPD] == 3)
			{
			    SetPlayerVirtualWorld(playerid, 3);
			}
			else
			{
			    SetPlayerVirtualWorld(playerid, 0);
			}
			return 1;
		}
		if(PlayerInfo[playerid][pJailed] == 2)
		{
			DestroyDynamic3DTextLabel(WantedScris[playerid]);
			PlayerTextDrawHide(playerid, WantedText[playerid]);
			SetPlayerInterior(playerid, 10);
			rand = random(sizeof(gRandomJailSpawns));
			SetPlayerPosEx(playerid,gRandomJailSpawns[rand][0],gRandomJailSpawns[rand][1],gRandomJailSpawns[rand][2]);
			TogglePlayerControllable(playerid, 0);
			SetTimerEx("UnFreezeStation", 1000, false, "i", playerid);
			return 1;
		}
		if(fight2[playerid] != 999)
		{
		    new string[100];
		    SetPlayerVirtualWorld(fight2[playerid],0);
		    fight2[fight2[playerid]] = 999;
		    GivePlayerCash(fight2[playerid],5000);
		    Update(fight2[playerid],pCashx);
		    SCM(fight2[playerid],COLOR_PRIMIRE,"(+) Ai castigat lupta si ai primit $5,000.");
		    new randomrp = random(6);
            if(randomrp == 5)
            {
			    PlayerInfo[fight2[playerid]][pExp] += 1;
                Update(fight2[playerid],pRP);
                SCM(fight2[playerid],COLOR_LIGHTBLUE,"{FFFFFF} Ai primit 1 {0080FF}respect point{FFFFFF} si {0080FF}1 premium point {FFFFFF}deoarece ai castigat lupta.");
            }
		    new fightname[25];
		    GetPlayerName(fight2[playerid],fightname,sizeof(fightname));
			foreach(Player,i)
			{
				if(IsPlayerInRangeOfPoint(i,15.0,1510.2313,-1058.1528,25.0625))
				{
				    format(string,sizeof(string),"** %s a castigat lupta.",fightname);
					SendClientMessage(i,COLOR_WHITE,string);
				}
			}
	        if(PlayerInfo[fight2[playerid]][pModel] > 0)
	        {
				SetPlayerSkin(fight2[playerid], PlayerInfo[fight2[playerid]][pModel]);
	        }
	        else
	        {
				SetPlayerSkin(fight2[playerid], PlayerInfo[fight2[playerid]][pModel]);
	        }
	        TogglePlayerControllable(fight2[playerid], 1);
	        SetPlayerPos(fight2[playerid],1510.46,-1059.55,25.0625);
			fight2[playerid] = 999;
			fightr[playerid] = 1;
		    fighta = 0;
		}
		if(fightr[playerid] == 1)
		{
	        SetPlayerPos(playerid,1510.46,-1059.55,25.0625);
	        fightr[playerid] = 0;
		    return 1;
		}
		if(fight2n[playerid] != 999)
		{
		    new string[100];
		    SetPlayerVirtualWorld(fight2n[playerid],0);
		    fight2n[fight2n[playerid]] = 999;
		    GivePlayerCash(fight2n[playerid],5000);
		    Update(fight2n[playerid],pCashx);
		    SCM(fight2n[playerid],COLOR_PRIMIRE,"(+) Ai castigat lupta si ai primit $5,000.");
		    new randomrp = random(6);
            if(randomrp == 5)
            {
			    PlayerInfo[fight2n[playerid]][pExp] += 1;
                Update(fight2n[playerid],pRP);
                SCM(fight2n[playerid],COLOR_LIGHTBLUE,"{FFFFFF} Ai primit 1 {0080FF}respect point{FFFFFF} si {0080FF}1 premium point {FFFFFF}deoarece ai castigat lupta.");
            }
		    new fightname[25];
		    GetPlayerName(fight2n[playerid],fightname,sizeof(fightname));
			foreach(Player,i)
			{
				if(IsPlayerInRangeOfPoint(i,15.0,1328.1801,-1558.2500,13.5469))
				{
				    format(string,sizeof(string),"** %s a castigat lupta.",fightname);
					SendClientMessage(i,COLOR_WHITE,string);
				}
			}
			ResetPlayerWeaponsEx(fight2n[playerid]);
		    ResetPlayerWeapons(fight2n[playerid]);
	        if(PlayerInfo[fight2n[playerid]][pModel] > 0)
	        {
				SetPlayerSkin(fight2n[playerid], PlayerInfo[fight2n[playerid]][pModel]);
	        }
	        else
	        {
				SetPlayerSkin(fight2n[playerid], PlayerInfo[fight2n[playerid]][pModel]);
	        }
	        TogglePlayerControllable(fight2n[playerid], 1);
	        SetPlayerPos(fight2n[playerid],1328.1801,-1558.2500,13.5469);
			fight2n[playerid] = 999;
			fightrn[playerid] = 1;
		    fightnin = 0;
		}
		if(fightrn[playerid] == 1)
		{
	        SetPlayerPos(playerid,1328.1801,-1558.2500,13.5469);
	        fightrn[playerid] = 0;
		    return 1;
		}
		if(house != 0)
		{
		    if(PlayerInfo[playerid][pSpawnChange] == 1)
		    {
				SetPlayerToTeamColor(playerid);
				SetPlayerInterior(playerid,HouseInfo[house][hInterior]);
				SetPlayerPosEx(playerid, HouseInfo[house][hExitx], HouseInfo[house][hExity],HouseInfo[house][hExitz]);
                SetPlayerVirtualWorld(playerid, HouseInfo[house][hVirtual]);
				PlayerInfo[playerid][pLocal] = house;
				PlayerInfo[playerid][pInt] = HouseInfo[house][hInterior];
				InHouse[playerid] = house;
				if(strlen(housestring[InHouse[playerid]]) > 0)
				{
    				StopAudioStreamForPlayer(playerid);
					PlayAudioStreamForPlayer(playerid, housestring[InHouse[playerid]]);
				}
				return 1;
			}
		}
		if (PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1) // LSPD
		{
			SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid, 246.7732,65.1425,1003.6406);
			SetPlayerFacingAngle(playerid, 270.0);
			SetPlayerInterior(playerid,6);
			PlayerInfo[playerid][pInt] = 6;
			return 1;
	    }
		if (PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2) // FBI
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerInterior(playerid, 3);
		    SetPlayerPosEx(playerid, 230.0687,165.1646,1003.0234);
		    PlayerInfo[playerid][pInt] = 3;
			InHQ[playerid] = 2;
		    return 1;
		}
		if (PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3) // NG
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerInterior(playerid, 0);
		    SetPlayerPosEx(playerid, 213.8154,1866.6807,13.1406);
		    PlayerInfo[playerid][pInt] = 0;
		    return 1;
		}
		if (PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4) // Los Aztecas
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerInterior(playerid, 2);
		    SetPlayerPosEx(playerid, 2545.1477,-1304.1975,1054.640);
		    PlayerInfo[playerid][pInt] = 2;
		    SetPlayerVirtualWorld(playerid, 1);
			InHQ[playerid] = 4;
			if(PlayerInfo[playerid][pGunLic] == 1)
			{
				GivePlayerWeaponEx(playerid, 24, 50);
			}
		    return 1;
		}
		if (PlayerInfo[playerid][pHelper] >= 1  && PlayerInfo[playerid][pMember] == 0 || PlayerInfo[playerid][pAdmin] >= 1  && PlayerInfo[playerid][pMember] == 0) // STAFF
		{
		    SetPlayerInterior(playerid, 5);
            SetPlayerPosEx(playerid, 1267.663208,-781.323242,1091.906250);
            SetPlayerVirtualWorld(playerid, 696969);
            PlayerInfo[playerid][pInt] = 5;
		    return 1;
		}
		if (PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5) // Grove Street
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerPosEx(playerid,2545.1477,-1304.1975,1054.640);
		    SetPlayerInterior(playerid, 2);
		    PlayerInfo[playerid][pInt] = 2;
			InHQ[playerid] = 5;
			if(PlayerInfo[playerid][pGunLic] == 1)
			{
				GivePlayerWeaponEx(playerid, 24, 50);
			}
			SetPlayerVirtualWorld(playerid,2);
		    return 1;
		}
		if (PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6) // Los Vagos
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerInterior(playerid, 2);
		    SetPlayerPosEx(playerid, 2545.1477,-1304.1975,1054.640);
		    PlayerInfo[playerid][pInt] = 2;
			InHQ[playerid] = 6;
			if(PlayerInfo[playerid][pGunLic] == 1)
			{
				GivePlayerWeaponEx(playerid, 24, 50);
			}
			SetPlayerVirtualWorld(playerid,3);
		    return 1;
		}
	    if (PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8) // Tow Car Company
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid, 246.8886,64.7381,1003.6406);
			SetPlayerInterior(playerid,6);
			PlayerInfo[playerid][pInt] = 6;
			InHQ[playerid] = 8;
			SetPlayerVirtualWorld(playerid, 3);
	        return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 20 || PlayerInfo[playerid][pLeader] == 20) // LVPD
		{
			SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid, 246.8886,64.7381,1003.6406);
			SetPlayerInterior(playerid,6);
			PlayerInfo[playerid][pInt] = 6;
			InHQ[playerid] = 20;
			SetPlayerVirtualWorld(playerid, 20);
			return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9) // News Reporter
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid, -2027.0515,-104.5211,1035.1719);
			SetPlayerInterior(playerid,3);
			PlayerInfo[playerid][pInt] = 3;
			GivePlayerWeaponEx(playerid,43,50);
			InHQ[playerid] = 9;
	        return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10) // Ballas
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid, 2545.1477,-1304.1975,1054.640);
			SetPlayerInterior(playerid,2);
			PlayerInfo[playerid][pInt] = 2;
			InHQ[playerid] = 10;
			if(PlayerInfo[playerid][pGunLic] == 1)
			{
				GivePlayerWeaponEx(playerid, 24, 50);
			}
			SetPlayerVirtualWorld(playerid, 4);
	        return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11) // Hitman
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid, 2323.9993,-1148.0469,1050.7101);
			SetPlayerInterior(playerid,12);
			PlayerInfo[playerid][pInt] = 12;
			InHQ[playerid] = 11;
			SetPlayerVirtualWorld(playerid, 2);
	        return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) // SI
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid,1494.325195,1304.942871,1093.289062);
			SetPlayerInterior(playerid,3);
			PlayerInfo[playerid][pInt] = 3;
			SetPlayerVirtualWorld(playerid, 3);
			InHQ[playerid] = 12;
	        return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16) // SI LS
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid,1494.325195,1304.942871,1093.289062);
			SetPlayerInterior(playerid,3);
			PlayerInfo[playerid][pInt] = 3;
			SetPlayerVirtualWorld(playerid, 6);
			InHQ[playerid] = 16;
	        return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17) // SI SF
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid,1494.325195,1304.942871,1093.289062);
			SetPlayerInterior(playerid,3);
			PlayerInfo[playerid][pInt] = 3;
			SetPlayerVirtualWorld(playerid, 9);
			InHQ[playerid] = 17;
	        return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13) // LS TAXI
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid,1700.9830,-1667.8865,20.2188);
			SetPlayerInterior(playerid,18);
			PlayerInfo[playerid][pInt] = 18;
			SetPlayerVirtualWorld(playerid, 5);
			InHQ[playerid] = 13;
	        return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14) // Paramedic LV
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid,1494.325195,1304.942871,1093.289062);
			SetPlayerInterior(playerid,3);
			PlayerInfo[playerid][pInt] = 3;
			SetPlayerVirtualWorld(playerid, 7);
			InHQ[playerid] = 14;
	        return 1;
	    }
   		if (PlayerInfo[playerid][pMember] == 21 || PlayerInfo[playerid][pLeader] == 21) //The Rifa
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerInterior(playerid, 2);
		    SetPlayerPosEx(playerid, 2545.1477,-1304.1975,1054.640);
		    PlayerInfo[playerid][pInt] = 2;
			InHQ[playerid] = 21;
			if(PlayerInfo[playerid][pGunLic] == 1)
			{
				GivePlayerWeaponEx(playerid, 24, 50);
			}
			SetPlayerVirtualWorld(playerid,5);
		    return 1;
		}
		if (PlayerInfo[playerid][pMember] == 24 || PlayerInfo[playerid][pLeader] == 24) //The Italian Mafia
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerInterior(playerid, 2);
		    SetPlayerPosEx(playerid, 2545.1477,-1304.1975,1054.6406);
		    PlayerInfo[playerid][pInt] = 2;
			InHQ[playerid] = 24;
			if(PlayerInfo[playerid][pGunLic] == 1)
			{
				GivePlayerWeaponEx(playerid, 24, 50);
			}
			SetPlayerVirtualWorld(playerid,6);
		    return 1;
		}
		if (PlayerInfo[playerid][pMember] == 25 || PlayerInfo[playerid][pLeader] == 25) //SF Bikers
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerInterior(playerid, 2);
		    SetPlayerPosEx(playerid, 2545.1477,-1304.1975,1054.6406);
		    PlayerInfo[playerid][pInt] = 2;
			InHQ[playerid] = 25;
			if(PlayerInfo[playerid][pGunLic] == 1)
			{
				GivePlayerWeaponEx(playerid, 24, 50);
			}
			SetPlayerVirtualWorld(playerid,7);
		    return 1;
		}
		if (PlayerInfo[playerid][pMember] == 22 || PlayerInfo[playerid][pLeader] == 22) //The Russian Mafia
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerInterior(playerid, 2);
		    SetPlayerPosEx(playerid, 2545.1477,-1304.1975,1054.640);
		    PlayerInfo[playerid][pInt] = 2;
			InHQ[playerid] = 22;
			if(PlayerInfo[playerid][pGunLic] == 1)
			{
				GivePlayerWeaponEx(playerid, 24, 50);
			}
			SetPlayerVirtualWorld(playerid,9);
		    return 1;
		}
		if (PlayerInfo[playerid][pMember] == 23 || PlayerInfo[playerid][pLeader] == 23) //Red Dragon Triads
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerInterior(playerid, 2);
		    SetPlayerPosEx(playerid, 2545.1477,-1304.1975,1054.640);
		    PlayerInfo[playerid][pInt] = 2;
			InHQ[playerid] = 23;
			if(PlayerInfo[playerid][pGunLic] == 1)
			{
				GivePlayerWeaponEx(playerid, 24, 50);
			}
			SetPlayerVirtualWorld(playerid,8);
		    return 1;
		}
	    if (PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 19) // Paramedic SF
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid,1494.325195,1304.942871,1093.289062);
			SetPlayerInterior(playerid,3);
			PlayerInfo[playerid][pInt] = 3;
			SetPlayerVirtualWorld(playerid, 10);
			InHQ[playerid] = 19;
	        return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15) // Taxi LV
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid,1700.9830,-1667.8865,20.2188);
			SetPlayerInterior(playerid,18);
			PlayerInfo[playerid][pInt] = 18;
			SetPlayerVirtualWorld(playerid, 4);
			InHQ[playerid] = 15;
	        return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 18) // Taxi LV
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPosEx(playerid,1700.9830,-1667.8865,20.2188);
			SetPlayerInterior(playerid,18);
			PlayerInfo[playerid][pInt] = 18;
			SetPlayerVirtualWorld(playerid, 8);
			InHQ[playerid] = 18;
	        return 1;
	    }
	    if (PlayerInfo[playerid][pMember] == 0 || PlayerInfo[playerid][pLeader] == 0) // Civilian
	    {
			SetPlayerPosEx(playerid, 1284.8737,-1337.8431,13.5569); // Noul Spawn LS
			SetPlayerFacingAngle(playerid, 6.9127);
			SetPlayerInterior(playerid,0);
			PlayerInfo[playerid][pInt] = 0;
			SetPlayerVirtualWorld(playerid, 0);
	        return 1;
	    }
	    if ((gTeam[playerid]) == 3)
	    {
			SetPlayerPosEx(playerid, 1284.8737,-1337.8431,13.5569);
			SetPlayerFacingAngle(playerid, 6.9127);
			SetPlayerInterior(playerid,0);
			PlayerInfo[playerid][pInt] = 0;
			SetPlayerVirtualWorld(playerid, 0);
			return 1;
		}
	    else
	    {
			SetPlayerToTeamColor(playerid);
			if(PlayerInfo[playerid][pOrigin] == 1) // Europa
			{
				SetPlayerPosEx(playerid, 1284.8737,-1337.8431,13.5569);
				SetPlayerFacingAngle(playerid, 6.9127);
				SetPlayerInterior(playerid,0);
				PlayerInfo[playerid][pInt] = 0;
				SetPlayerVirtualWorld(playerid, 0);
			}
			else if(PlayerInfo[playerid][pOrigin] == 2) // America
			{
				SetPlayerPosEx(playerid, 1284.8737,-1337.8431,13.5569);
				SetPlayerFacingAngle(playerid, 6.9127);
				SetPlayerInterior(playerid,0);
				PlayerInfo[playerid][pInt] = 0;
				SetPlayerVirtualWorld(playerid, 0);
			}
			else if(PlayerInfo[playerid][pOrigin] == 3) // Asia
			{
				SetPlayerPosEx(playerid, 1284.8737,-1337.8431,13.5569);
				SetPlayerFacingAngle(playerid, 6.9127);
				SetPlayerInterior(playerid,0);
				PlayerInfo[playerid][pInt] = 0;
				SetPlayerVirtualWorld(playerid, 0);
			}
			else if(PlayerInfo[playerid][pOrigin] == 4) // Africa
			{
				SetPlayerPosEx(playerid, 1284.8737,-1337.8431,13.5569);
				SetPlayerFacingAngle(playerid, 6.9127);
				SetPlayerInterior(playerid,0);
				PlayerInfo[playerid][pInt] = 0;
				SetPlayerVirtualWorld(playerid, 0);
			}
			else if(PlayerInfo[playerid][pOrigin] == 5) // Australia
			{
				SetPlayerPosEx(playerid, 1284.8737,-1337.8431,13.5569);
				SetPlayerFacingAngle(playerid, 6.9127);
				SetPlayerInterior(playerid,0);
				PlayerInfo[playerid][pInt] = 0;
				SetPlayerVirtualWorld(playerid, 0);
			}
			else
			{
                SetPlayerPosEx(playerid,358.0976,-1841.3488,5.1257);
				SetPlayerInterior(playerid,0);
			    SetPlayerFacingAngle(playerid, 90.0);
		        SetPlayerCameraPos(playerid,1460.0, -1324.0, 287.2);
			    SetPlayerCameraLookAt(playerid,1374.5, -1291.1, 239.0);
	            PlayerPlaySound(playerid, 1097,-119.9460,23.1096,12.2238);
			}
		}
		SetTimerEx("UpdateSecondary", 3000, false, "i", playerid);
	}
	return 1;
}
Where i use it:

Code:
public OnPlayerSpawn(playerid)
{
    StopAudioStreamForPlayer(playerid);
    SetPlayerHealthEx(playerid, 100);
    SetPlayerArmourEx(playerid, 0);
	TextDrawShowForPlayer(playerid, Time);
	TextDrawShowForPlayer(playerid, Date);
    SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWantedLevel]);
    DestroyDynamic3DTextLabel(WantedScris[playerid]);
	OnPlayerDateUpdateX2(playerid);

    if(PlayerInfo[playerid][pConnectTime] >= 1 && PlayerInfo[playerid][pConnectTime] <= 2 && PlayerInfo[playerid][pMyRefferals] == 0)
	{
	    new string[200];
	    format(string,sizeof(string),
		"{FFFFFF}\tPentru ca ai facut o ora jucata\
		\nTe rugam sa specifici cine te-a adus pe server.\n\
		\tScrie numele Exact al jucatorului");
		ShowPlayerDialog(playerid, DIALOG_REFERAL, DIALOG_STYLE_INPUT, "{FFFFFF}REFERRAL",string,"OK","SKIP->");
	}

    PlayerTextDrawHide(playerid, caseTD[0]);
    PlayerTextDrawHide(playerid, caseTD[1]);
	PlayerTextDrawHide(playerid, caseTD[2]);
	PlayerTextDrawHide(playerid, caseTD[3]);
	PlayerTextDrawHide(playerid, caseTD[4]);
	PlayerTextDrawHide(playerid, caseTD[5]);
	PlayerTextDrawHide(playerid, caseTD[6]);
	PlayerTextDrawHide(playerid, caseTD[7]);
    if(PlayerInfo[playerid][pWantedLevel] > 0)
    {
        Tigaanel[playerid] = 1;
        DestroyDynamic3DTextLabel(WantedScris[playerid]);
    	new str2[256];
    	format(str2,sizeof(str2),"{FF3333}Nivel de urmarire: %d", PlayerInfo[playerid][pWantedLevel]);
    	WantedScris[playerid] = CreateDynamic3DTextLabel(str2, COLOR_WHITE, 0, 0, -20, 20, playerid);
		Streamer_SetFloatData(STREAMER_TYPE_3D_TEXT_LABEL, WantedScris[playerid] , E_STREAMER_ATTACH_OFFSET_Z, 0.48);
	}
    DestroyDynamic3DTextLabel(DeadScris[playerid]);
    if(PlayerInfo[playerid][pWantedLevel] >= 1)
    {
        new str1[256];
        PlayerTextDrawShow(playerid, WantedText[playerid]);
        format(str1,sizeof(str1),"WANTED SCADE IN: ~r~%d MINUTE",wantedlost[playerid]/60+1);
		PlayerTextDrawSetString(playerid, WantedText[playerid], str1);
	}
    SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
    if(Diceid[playerid] >= 0)
	{
		Joacabarbut[playerid] = 0;
		Joacabarbut[Diceid[playerid]] = 0;
		for(new i = 0; i < 17; i++)
		{
			PlayerTextDrawHide(playerid, BarbutTD[i]);
			PlayerTextDrawHide(Diceid[playerid], BarbutTD[i]);
		}
		CancelSelectTextDraw(playerid);
		CancelSelectTextDraw(Diceid[playerid]);
		Diceid[Diceid[playerid]] = -1;
		sumabarbut[Diceid[playerid]] = 10000;
		secundebarbut[Diceid[playerid]] = -1;
		secundebarbut[playerid] = -1;
		new string[256];
		format(string, sizeof(string), "{FFB870}%s a murit, meciul de barbut s-a sfarsit.",GetName(playerid));
		SCM(Diceid[playerid], -1 , string);
		Diceid[playerid] = -1;
	}
	secundebarbut[playerid] = -1;
	if(PlayerInfo[playerid][pHair] != 0)
	{
 		RemovePlayerAttachedObject(playerid, 7);
		new skin = GetPlayerSkin(playerid);
  		if(PlayerInfo[playerid][pHair] == 1)
	   	SetPlayerAttachedObject(playerid, 7, 19077, 2, SkinOffSett[skin][0], SkinOffSett[skin][1], SkinOffSett[skin][2], SkinOffSett[skin][3], SkinOffSett[skin][4], SkinOffSett[skin][5], SkinOffSett[skin][8], SkinOffSett[skin][8], SkinOffSett[skin][8]);
		else if(PlayerInfo[playerid][pHair] == 2)
        SetPlayerAttachedObject(playerid, 7, 18975, 2, SkinOffSett[skin][0], SkinOffSett[skin][1], SkinOffSett[skin][2], SkinOffSett[skin][3], SkinOffSett[skin][4], SkinOffSett[skin][5], SkinOffSett[skin][8], SkinOffSett[skin][8], SkinOffSett[skin][8]);
		else if(PlayerInfo[playerid][pHair] == 7)
	    SetPlayerAttachedObject(playerid, 7, 19136, 2, SkinOffSett[skin][0], SkinOffSett[skin][1], SkinOffSett[skin][2], SkinOffSett[skin][3], SkinOffSett[skin][4], SkinOffSett[skin][5], SkinOffSett[skin][8], SkinOffSett[skin][8], SkinOffSett[skin][8]);
 		else if(PlayerInfo[playerid][pHair] == 5)
	    SetPlayerAttachedObject(playerid, 7, 19274, 2, SkinOffSett[skin][0], SkinOffSett[skin][1], SkinOffSett[skin][2], SkinOffSett[skin][3], SkinOffSett[skin][4], SkinOffSett[skin][5], SkinOffSett[skin][8], SkinOffSett[skin][8], SkinOffSett[skin][8]);
		else RemovePlayerAttachedObject(playerid, 7);
	}
    if(OnDuty[playerid] > 0)
	{
		if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
		{
			GivePlayerWeaponEx(playerid, 24, 500);
			GivePlayerWeaponEx(playerid, 3, 1);
			GivePlayerWeaponEx(playerid, 41, 500);
			GivePlayerWeaponEx(playerid, 29, 1000);
			GivePlayerWeaponEx(playerid, 31, 1000);
			SetPlayerArmourEx(playerid, 100);
			SetPlayerHealthEx(playerid, 100);
		}
		if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
 		{
			GivePlayerWeaponEx(playerid, 24, 500);
			GivePlayerWeaponEx(playerid, 3, 1);
			GivePlayerWeaponEx(playerid, 41, 500);
			GivePlayerWeaponEx(playerid, 29, 1000);
			GivePlayerWeaponEx(playerid, 31, 1000);
			SetPlayerArmourEx(playerid, 100);
			SetPlayerHealthEx(playerid, 100);
		}
		if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
 		{
			GivePlayerWeaponEx(playerid, 24, 500);
			GivePlayerWeaponEx(playerid, 41, 500);
			GivePlayerWeaponEx(playerid, 29, 1000);
			GivePlayerWeaponEx(playerid, 31, 1000);
			SetPlayerArmourEx(playerid, 100);
			SetPlayerHealthEx(playerid, 100);
		}
		if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
 		{
			GivePlayerWeaponEx(playerid, 24, 500);
			GivePlayerWeaponEx(playerid, 3, 1);
			GivePlayerWeaponEx(playerid, 41, 500);
			GivePlayerWeaponEx(playerid, 29, 1000);
			GivePlayerWeaponEx(playerid, 31, 1000);
			SetPlayerArmourEx(playerid, 100);
			SetPlayerHealthEx(playerid, 100);
		}
		if(PlayerInfo[playerid][pMember] == 20 || PlayerInfo[playerid][pLeader] == 20)
 		{
			GivePlayerWeaponEx(playerid, 24, 500);
			GivePlayerWeaponEx(playerid, 3, 1);
			GivePlayerWeaponEx(playerid, 41, 500);
			GivePlayerWeaponEx(playerid, 29, 1000);
			GivePlayerWeaponEx(playerid, 31, 1000);
			SetPlayerArmourEx(playerid, 100);
			SetPlayerHealthEx(playerid, 100);
		}
	}
	if(!gPlayerAnimLibsPreloaded[playerid])
	{
   		PreloadAnimLib(playerid,"BOMBER");
   		PreloadAnimLib(playerid,"RAPPING");
    	PreloadAnimLib(playerid,"SHOP");
   		PreloadAnimLib(playerid,"BEACH");
   		PreloadAnimLib(playerid,"SMOKING");
    	PreloadAnimLib(playerid,"FOOD");
    	PreloadAnimLib(playerid,"ON_LOOKERS");
    	PreloadAnimLib(playerid,"DEALER");
    	PreloadAnimLib(playerid,"MISC");
    	PreloadAnimLib(playerid,"SWEET");
    	PreloadAnimLib(playerid,"RIOT");
    	PreloadAnimLib(playerid,"PED");
    	PreloadAnimLib(playerid,"POLICE");
		PreloadAnimLib(playerid,"CRACK");
		PreloadAnimLib(playerid,"CARRY");
		PreloadAnimLib(playerid,"COP_AMBIENT");
		PreloadAnimLib(playerid,"PARK");
		PreloadAnimLib(playerid,"INT_HOUSE");
		PreloadAnimLib(playerid,"FOOD");
		gPlayerAnimLibsPreloaded[playerid] = 1;
	}
	gTeam[playerid] = PlayerInfo[playerid][pTeam];
	if(gTeam[playerid] == 4)
	{
		gTeam[playerid] = 4;
	}
	if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pMember] == 20 || PlayerInfo[playerid][pLeader] == 20)
	{
		gTeam[playerid] = 2;
		PlayerInfo[playerid][pTeam] = 2;
	}
	if(JoinedDeathMatch[playerid] > 0)
	{
 		JoinedDeathMatch[playerid] = 0;
		ResetPlayerWeapons(playerid);
	}
	if(JoinedDeathMatch1[playerid] > 0)
		{
			JoinedDeathMatch1[playerid] = 0;
			SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
			ResetPlayerWeapons(playerid);
		}
	if(gPlayerLogged[playerid] == 0)
	{
    	SendClientMessage(playerid, COLOR_LIGHTRED, "** Trebuie sa te loghezi inainte de spawn (Kicked) **");
    	Kick(playerid);
		return 1;
 	}
 	ChosenSkin[playerid] = 1;
	SetPlayerSpawn(playerid);
	SetPlayerToTeamColor(playerid);
	playerdeath[playerid] = 0;
	Undercover[playerid] = 0;
	SetPlayerTeam(playerid,4);
	StopAudioStreamForPlayer(playerid);
	return 1;
}
Someone?
Reply
#3

EXAMPLE:
Code:
if(PlayerInfo[playerid][pGroup])
{
	SpawnPlayerInHQ(playerid);
}

SpawnPlayerInHQ(playerid)
{
	if(PlayerInfo[playerid][pGroup] == 1)
	{
		SetPlayerPos(playerid, Float:x, Float:y, Float:z);
		SetPlayerInterior(playerid, interiorid);
		SetPlayerVirtualWorld(playerid, worldid);
	}
	if(PlayerInfo[playerid][pGroup] == 2)
	{
		SetPlayerPos(playerid, Float:x, Float:y, Float:z);
		SetPlayerInterior(playerid, interiorid);
		SetPlayerVirtualWorld(playerid, worldid);
	}
	//...
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)