Jump to content
  • 0

Problema respawn.


Bogdan's

Question

Problema intalnita (descriere): Salut,deci am o problema cu comanda /respawn.Am facut-o dupa gamemode-ul meu care are implementat si un sistem de death(daca mori te da la spital),ok totul bine pana aici...Cand dau /respawn imi apare [id] si cand dau spre exemplu /respawn 1 ma respawneaza pe mine in loc sa il respawneze pe id-ul 1.Deci cum o pot rezolva?Mentionez ca am incercat sa o rezolv,dar nu i-am dat de capat.
Ero(area / rile) / warning-(ul / urile): Nu am avut erori.
Liniile de cod / sursa / script-ul(obligatoriu):

if(strcmp(cmd, "/respawn", true) == 0)
        {
            if(IsPlayerConnected(playerid))
                {
                        tmp = strtok(cmdtext, idx);
                        if(!strlen(tmp))
                        {
                            SendClientMessage(playerid, COLOR_GRAD2, "Folosire: /respawn [playerid/PartOfName]");
                                return 1;
                        }
                        new playa;
                        playa = ReturnUser(tmp);
                        if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pTester] >= 1)
                        {
                                if(IsPlayerConnected(playa))
                        {
                    //new rand;
                                        new house = PlayerInfo[playa][pPhousekey];
                                    if(playa != INVALID_PLAYER_ID)
                                {
                                                //if(SpawnChange[playerid])
                                                {
                    if(PlayerInfo[playa][pLeader] == 7)//Mayor spawn
                {
                    SetPlayerToTeamColor(playa);
                    SetPlayerInterior(playa, 3);
                    SetPlayerPos(playa, 356.2998,151.9914,1025.7891);
                    PlayerInfo[playa][pInt] = 3;
                        PlayerInfo[playa][pLocal] = 241;
                    return 1;
                }
                if (PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)//Politia spawn
		{
			SetPlayerToTeamColor(playerid);
			SetPlayerInterior(playerid,6);
			SetPlayerPos(playerid, 230.3608,74.7934,1005.0391); // Warp the player
			SetPlayerFacingAngle(playerid, 272.8690);
			PlayerInfo[playerid][pInt] = 6;
			SendClientMessage(playerid, COLOR_LIGHTBLUE, ">>{FFFFFF}Ai primit respawn.");
                        return 1;
            }
            else if (PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)//Jandarmeria spawn
		{
			SetPlayerToTeamColor(playerid);
			SetPlayerInterior(playerid,10);
			SetPlayerPos(playerid, 246.5519,111.6367,1003.2188);
			SetPlayerFacingAngle(playerid, 90);
			PlayerInfo[playerid][pInt] = 10;
			SetPlayerVirtualWorld(playerid, 1);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, ">>{FFFFFF}Ai primit respawn.");
			return 1;
	    }
		else if (PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)//Armata spawn
		{
		    SetPlayerToTeamColor(playerid);
			SetPlayerInterior(playerid,10);
			SetPlayerPos(playerid, 255.4952,114.5436,1008.8130);
			SetPlayerFacingAngle(playerid, 90);
			PlayerInfo[playerid][pInt] = 10;
			SetPlayerVirtualWorld(playerid, 2);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, ">>{FFFFFF}Ai primit respawn.");
		    return 1;
		}
		else if (PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)//Politia de frontiera
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerPos(playerid, 246.13771057129,186.54634094238,1008.171875);
			SetPlayerInterior(playerid,3);
			SetPlayerFacingAngle(playerid, 0);
			PlayerInfo[playerid][pInt] = 3;
			SetPlayerVirtualWorld(playerid, 1);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, ">>{FFFFFF}Ai primit respawn.");
		    return 1;
		}
		else if (PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)//SRI
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerPos(playerid, 246.13771057129,186.54634094238,1008.171875);
			SetPlayerInterior(playerid,3);
			SetPlayerFacingAngle(playerid, 0);
			PlayerInfo[playerid][pInt] = 3;
			SetPlayerVirtualWorld(playerid, 2);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, ">>{FFFFFF}Ai primit respawn.");
		    return 1;
		}
		else if (PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)//Ambulanta spawn
		{
		    SetPlayerToTeamColor(playerid);
		    SetPlayerInterior(playerid, 0);
		    SetPlayerPos(playerid, 1251.1843,320.5573,-11.7422);
		    SendClientMessage(playerid, COLOR_LIGHTBLUE, ">>{FFFFFF}Ai primit respawn.");
		    FreezeThenAutoUnfreeze(playerid, 10000)// time is in Milliseconds, to make the player controllable again.
		    return 1;
		}
	    else if (PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7) //Pompieri spawn
	    {
	        SetPlayerToTeamColor(playerid);
	        SetPlayerInterior(playerid,3);
			SetPlayerPos(playerid, 384.8909,173.2522,1008.3828);
			PlayerInfo[playerid][pInt] = 3;
			SafeGivePlayerWeapon(playerid, 42, 1000);
			SetPlayerVirtualWorld(playerid, 1);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, ">>{FFFFFF}Ai primit respawn.");
	        return 1;
	    }
	    else if (PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8) //Corleone spawn
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPos(playerid,1459.9377,2773.6567,10.8203);
			PlayerInfo[playerid][pInt] = 0;
			SafeGivePlayerWeapon(playerid, 29, 50);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, ">>{FFFFFF}Ai primit respawn.");
	        return 1;
	    }
	    else if (PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9) //Vagabontz spawn
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPos(playerid,-687.9667,935.7599,13.6328);
			PlayerInfo[playerid][pInt] = 0;
			SafeGivePlayerWeapon(playerid, 29, 50);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, ">>{FFFFFF}Ai primit respawn.");
	        return 1;
	    }
	    else if (PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10) //Yakuza  spawn
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPos(playerid,689.7922,-1276.1019,13.5594);
			PlayerInfo[playerid][pInt] = 0;
			SafeGivePlayerWeapon(playerid, 29, 50);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, ">>{FFFFFF}Ai primit respawn.");
	        return 1;
	    }
	    else if (PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11) //Barzini  spawn
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPos(playerid,1125.2219,-2036.6458,69.8820);
			PlayerInfo[playerid][pInt] = 0;
			SafeGivePlayerWeapon(playerid, 29, 50);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, ">>{FFFFFF}Ai primit respawn.");
	        return 1;
	    }
	    else if (PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) //Tattaglia  spawn
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPos(playerid,-50.2542,-273.1814,6.0331);
			PlayerInfo[playerid][pInt] = 0;
			SafeGivePlayerWeapon(playerid, 29, 50);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, ">>{FFFFFF}Ai primit respawn.");
	        return 1;
	    }
	    else if (PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13) // Zaluchi spawn
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPos(playerid,2223.1956,1837.0769,10.8203);
			PlayerInfo[playerid][pInt] = 0;
			SafeGivePlayerWeapon(playerid, 29, 50);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, ">>{FFFFFF}Ai primit respawn.");
	        return 1;
	    }
	    else if (PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14) // Toretto spawn
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPos(playerid,2231.6187,-1159.8622,25.8358);
			PlayerInfo[playerid][pInt] = 0;
			SafeGivePlayerWeapon(playerid, 29, 50);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, ">>{FFFFFF}Ai primit respawn.");
	        return 1;
	    }
	    else if (PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15) // Pro Racers spawn
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPos(playerid,1453.1459,750.9892,11.0234);
			PlayerInfo[playerid][pInt] = 0;
			SafeGivePlayerWeapon(playerid, 29, 50);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, ">>{FFFFFF}Ai primit respawn.");
	        return 1;
	    }
	    else if (PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16) // Grove spawn
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPos(playerid,2495.1924,-1689.0425,14.1838);
			PlayerInfo[playerid][pInt] = 0;
			SafeGivePlayerWeapon(playerid, 29, 50);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, ">>{FFFFFF}Ai primit respawn.");
	        return 1;
	    }
	    else if (PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17) // Ballas spawn
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPos(playerid,-2238.2212,2353.2046,4.9801);
			PlayerInfo[playerid][pInt] = 0;
			SafeGivePlayerWeapon(playerid, 29, 50);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, ">>{FFFFFF}Ai primit respawn.");
	        return 1;
	    }
		else if (PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 18) // News spawn
	    {
	        SetPlayerToTeamColor(playerid);
			SetPlayerPos(playerid,1279.3862,369.1019,19.5547);
			PlayerInfo[playerid][pInt] = 0;
			SafeGivePlayerWeapon(playerid, 43, 50);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, ">>{FFFFFF}Ai primit respawn.");
	        return 1;
	    }
                else if(IsPlayerConnected(playerid))
	{
		SetPlayerPos(playerid,711.3453,-569.7787,16.3359);
		SetPlayerFacingAngle(playerid, 0);
		SetPlayerInterior(playerid,0);
		PlayerInfo[playerid][pInt] = 0;
		SendClientMessage(playerid, COLOR_LIGHTBLUE, ">>{FFFFFF}Ai primit respawn.");
		return 1;
	}
                else if(house !=255)
                {
                    if(SpawnChange[playa]) //
                    {
                                SetPlayerToTeamColor(playa);
                                SetPlayerPos(playa, HouseInfo[house][hExitx], HouseInfo[house][hExity],HouseInfo[house][hExitz]); // Warp the player
                                SetPlayerInterior(playa,HouseInfo[house][hInt]);
                                PlayerInfo[playa][pInt] = HouseInfo[house][hInt];
                                SetPlayerVirtualWorld(playa,HouseInfo[house][hWorld]);
                                PlayerInfo[playa][pLocal] = house;
                                return 1;
                        }
                }
                else {
                        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                        SetPlayerSpawn(playa);
                        MedicBill[playa] = 0;
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "*L-ai respawnat pe %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTRED, string);
                        format(string, sizeof(string), "*Ai primit respawn de la %s.", sendername);
                        SendClientMessage(playa, COLOR_LIGHTRED, string);
                        format(string, 256, "ATENTIE ADMINI!! %s l-a respawnat pe  %s (/respawn).", sendername, giveplayer);
                        ABroadCast(COLOR_YELLOW,string,1);
                        return 1;
                        }
                                }
                                        }
                                }
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GRAD1, " Nu ai voie sa folosesti aceasta comanda!");
                        }
                }
                return 1;
        }

Imagini / Video (optional): Daca doriti pun.
Ati incercat sa rezolvati singur?: Da am incercat,dar nu mia mers.Am pus asta:

else {
                        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                        SetPlayerSpawn(playa);
                        MedicBill[playa] = 0;
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "*L-ai respawnat pe %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTRED, string);
                        format(string, sizeof(string), "*Ai primit respawn de la %s.", sendername);
                        SendClientMessage(playa, COLOR_LIGHTRED, string);
                        format(string, 256, "ATENTIE ADMINI!! %s l-a respawnat pe  %s (/respawn).", sendername, giveplayer);
                        ABroadCast(COLOR_YELLOW,string,1);
                        return 1;
                        }

Dar tot asa este,si fara dar si cu asta..

 

Multumesc de ajutorul acordat.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Serios? ce cauta playerid in conditiile astea? :

		if (PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)//Politia spawn
	
		else if (PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)//Jandarmeria spawn
	
		else if (PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)//Armata spawn

		else if (PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)//Politia de frontiera
	
		else if (PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)//SRI

		else if (PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)//Ambulanta spawn

	    else if (PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7) //Pompieri spawn

	    else if (PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8) //Corleone spawn

	    else if (PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9) //Vagabontz spawn

	    else if (PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10) //Yakuza  spawn

	    else if (PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11) //Barzini  spawn

	    else if (PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) //Tattaglia  spawn

	    else if (PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13) // Zaluchi spawn

	    else if (PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14) // Toretto spawn

	    else if (PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15) // Pro Racers spawn

	    else if (PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16) // Grove spawn

	    else if (PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17) // Ballas spawn

		else if (PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 18) // News spawn
	    

Tu ai definit playa ca fiind persoana pe care folosesti comanda, deci ar veni asa:

if (PlayerInfo[playa][pMember] == 1 || PlayerInfo[playa][pLeader] == 1)//Politia spawn
{
	SetPlayerToTeamColor(playa);
	SetPlayerInterior(playa,6);
	SetPlayerPos(playa, 230.3608,74.7934,1005.0391); // Warp the player
	SetPlayerFacingAngle(playa, 272.8690);
	PlayerInfo[playa][pInt] = 6;
	SendClientMessage(playa, COLOR_LIGHTBLUE, ">>{FFFFFF}Ai primit respawn.");
	return 1;
}
else if (PlayerInfo[playa][pMember] == 2 || PlayerInfo[playa][pLeader] == 2)//Jandarmeria spawn
{
	SetPlayerToTeamColor(playa);
	SetPlayerInterior(playa,10);
	SetPlayerPos(playa, 246.5519,111.6367,1003.2188);
	SetPlayerFacingAngle(playa, 90);
	PlayerInfo[playa][pInt] = 10;
	SetPlayerVirtualWorld(playa, 1);
	SendClientMessage(playa, COLOR_LIGHTBLUE, ">>{FFFFFF}Ai primit respawn.");
	return 1;
}

Inlocuiesti si la celelalte, eu ti-am facut doar un model.

  • Upvote 1
Link to comment
Share on other sites

  • 0
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.