Jump to content
  • 0

problema /respawn


yonutzz

Question

salut am si eu o problema la un gm cand dau sa respawnez un player nu il dau de unde este locul de respawn il da tot unde este el de exemplu daca este in fata la pd si ii dau /respawn tot acolo in fata la pd il da nu stiu ce sai fac am schimbat si comanda de respawn si tot la fel face, va dau comanda de respawn

[pawn] if(strcmp(cmd, "/respawn", true) == 0) //By Carlos

{

    if(IsPlayerConnected(playerid))

{

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /respawn [playerid/PartOfName]");

return 1;

}

new playa;

  playa = ReturnUser(tmp);

  if (PlayerInfo[playerid][pAdmin] >= 3)

{

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;

}

else if (PlayerInfo[playa][pMember] == 1 || PlayerInfo[playa][pLeader] == 1)//Police Force spawn

{

SetPlayerToTeamColor(playa);

SetPlayerInterior(playa,6);

SetPlayerPos(playa, 246.3338,70.5382,1003.6406);

SetPlayerFacingAngle(playa, 270.0);

PlayerInfo[playa][pInt] = 6;

return 1;

    }

    else if (PlayerInfo[playa][pMember] == 2 || PlayerInfo[playa][pLeader] == 2)//FBI spawn

{

SetPlayerToTeamColor(playa);

SetPlayerInterior(playa,6);

SetPlayerPos(playa, 238.6920,141.8946,1002.6726);

SetPlayerFacingAngle(playa, 90);

PlayerInfo[playa][pInt] = 6;

return 1;

    }

else if (PlayerInfo[playa][pMember] == 3 || PlayerInfo[playa][pLeader] == 3)//National Guard spawn

{

    SetPlayerToTeamColor(playa);

    SetPlayerInterior(playa, 6);

    SetPlayerPos(playa, 246.3338,70.5382,1003.6406);

    PlayerInfo[playa][pInt] = 6;

    return 1;

}

else if (PlayerInfo[playa][pMember] == 4 || PlayerInfo[playa][pLeader] == 4)//Fire/Ambulance spawn

{

    SetPlayerToTeamColor(playa);

    SetPlayerPos(playa, 1180.2388,-1331.6196,1006.4028);

SetPlayerInterior(playa,6);

SetPlayerFacingAngle(playa, 0);

PlayerInfo[playa][pInt] = 6;

    return 1;

}

else if (PlayerInfo[playa][pMember] == 5 || PlayerInfo[playa][pLeader] == 5)//Cripz spawn

{

    SetPlayerToTeamColor(playa);

    SetPlayerInterior(playa, 8);

    SetPlayerPos(playa, 2807.6797,-1169.3540,1025.5703);

    PlayerInfo[playa][pInt] = 8;

    return 1;

}

else if (PlayerInfo[playa][pMember] == 6 || PlayerInfo[playa][pLeader] == 6)//TCC spawn

{

    SetPlayerToTeamColor(playa);

    SetPlayerInterior(playa, 0);

    SetPlayerPos(playa, 2304.9838,1928.0172,10.8993);

    PlayerInfo[playa][pInt] = 0;

    return 1;

}

    else if (PlayerInfo[playa][pMember] == 8 || PlayerInfo[playa][pLeader] == 8) //Hitman spawn

    {

        SetPlayerToTeamColor(playa);

SetPlayerPos(playa, 942.171997,-16.542755,1000.929687);

SetPlayerInterior(playa,3);

PlayerInfo[playa][pInt] = 3;

        return 1;

    }

    else if (PlayerInfo[playa][pMember] == 9 || PlayerInfo[playa][pLeader] == 9) //News spawn

    {

        SetPlayerToTeamColor(playa);

        SetPlayerInterior(playa,3);

SetPlayerPos(playa, 355.7899,204.0173,1008.3828);

PlayerInfo[playa][pInt] = 3;

SafeGivePlayerWeapon(playa, 43, 20);

        return 1;

    }

    else if (PlayerInfo[playa][pMember] == 10 || PlayerInfo[playa][pLeader] == 10) //Taxi Cab Company spawn

    {

        SetPlayerToTeamColor(playa);

SetPlayerPos(playa, 761.412963,1440.191650,1102.703125);

SetPlayerInterior(playa,6);

PlayerInfo[playa][pInt] = 6;

        return 1;

    }

    else if (PlayerInfo[playa][pMember] == 13 || PlayerInfo[playa][pLeader] == 13)//Grove Street

{

    SetPlayerToTeamColor(playa);

    SetPlayerInterior(playa, 3);

    SetPlayerPos(playa, 2496.049804,-1695.238159,1014.742187);

    PlayerInfo[playa][pInt] = 3;

    SafeGivePlayerWeapon(playa, 24, 50);

    return 1;

}

    else if (PlayerInfo[playa][pMember] == 14 || PlayerInfo[playa][pLeader] == 14)//Yakuza Spawn

{

    SetPlayerToTeamColor(playa);

    SetPlayerInterior(playa, 1);

    SetPlayerPos(playa, -2163.5500,644.4084,1057.5938);

    PlayerInfo[playa][pInt] = 1;

    SafeGivePlayerWeapon(playa, 24, 50);

    return 1;

}

else if (PlayerInfo[playa][pMember] == 15 || PlayerInfo[playa][pLeader] == 15)//Ballas spawn

{

    SetPlayerToTeamColor(playa);

    SetPlayerInterior(playa, 18);

    SetPlayerPos(playa, 1710.433715,-1669.379272,20.225049);

    PlayerInfo[playa][pInt] = 18;

    SafeGivePlayerWeapon(playa, 24, 50);

    return 1;

}

else if (PlayerInfo[playa][pMember] == 16 || PlayerInfo[playa][pLeader] == 16)//Corleone Famigla spawn

{

    SetPlayerToTeamColor(playa);

    SetPlayerInterior(playa, 5);

    SetPlayerPos(playa, 1300.6193,-789.7496,1084.0078);

    PlayerInfo[playa][pInt] = 5;

    SafeGivePlayerWeapon(playa, 24, 50);

    return 1;

}

else if(house !=255)

{

    if(SpawnChange[playa]) //If 1, then you get to your house, else spawn somewhere else

    {

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), "* You have respawned player %s.", giveplayer);

SendClientMessage(playerid, COLOR_LIGHTRED, string);

format(string, sizeof(string), "* You have been respawned by Admin %s.", sendername);

SendClientMessage(playa, COLOR_LIGHTRED, string);

format(string, 256, "AdmWarning: %s has respawned the player %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;

}[/pawn]

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

[pawn]

CMD:respawn(playerid,params[ ]) {

new giveplayerid,string[128];

if(IsPlayerConnected(playerid)) {

if(sscanf(params,"u",giveplayerid)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /respawn [playerid/PartOfName]");

if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GRAD2, "You are not authorized to use that command.");

if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD2, "That player is offline.");

SpawnPlayer(giveplayerid);

GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

MedicBill[giveplayerid] = 0;

GetPlayerName(playerid, sendername, sizeof(sendername));

format(string, sizeof(string), "* You have respawned player %s.", giveplayer);

SendClientMessage(playerid, COLOR_LIGHTRED, string);

format(string, sizeof(string), "* You have been respawned by Admin %s.", sendername);

SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);

format(string, 256, "AdmWarning: %s has respawned the player %s (/respawn).", sendername, giveplayer);

ABroadCast(COLOR_YELLOW,string,1);

}

return 1;

}

[/pawn]

daca nu ai zcmd si sscanf in gm, te sfatuiesc sa le bagi

Link to comment
Share on other sites

Daca ne gandim bine civilii  au pMember respectiv pLeader 0 adica gTeam[playerid] = 3 Deci va trebuii sa faci in felul urmator:

else if (PlayerInfo[playa][pMember] == 0 || PlayerInfo[playa][pLeader] == 0)//Police Force spawn
	{
		SetPlayerToTeamColor(playa);
		SetPlayerInterior(playa,6);
		SetPlayerPos(playa, x,y,z);
		SetPlayerFacingAngle(playa, angle);
		PlayerInfo[playa][pInt] = interior;
		return 1;
	}
Cordonatele, interiorul, FacingAngle le pui ale tale :) Daca doresti comanda /respawn ( original facut de mine >:) ) poftim:
	if(strcmp(cmd, "/respawn", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(PlayerInfo[playerid][pAdmin] >= 1)
			{
				tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
					SendClientMessage(playerid, -1, "Utilizare: /respawn [Nume/ID Jucator]");
					return 1;
				}
	            giveplayerid = ReturnUser(tmp);
				if(IsPlayerConnected(giveplayerid))
				{
				    if(giveplayerid != INVALID_PLAYER_ID)
				    {
				        if(PlayerInfo[playerid][pAdmin] >= 1)
						{
							SpawnPlayer(giveplayerid);
							GetPlayerName(playerid, sendername, sizeof(sendername));
							format(string, sizeof(string),"* Ai primit respawn de Adminul %s !",sendername);
							SendClientMessage(playerid, COLOR_YELLOW2, string);
						}
					}
				} else return SendClientMessage(playerid, COLOR_GREY, "Acel jucator nu este conectat.");
			} else return SendClientMessage(playerid, COLOR_GREY, "you are not authorized to use this command.");
		}
		return 1;
	}

Bafta la scriptat.

Link to comment
Share on other sites

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.