[Ajuda] Hospital Spanw
#1

Entao peguei um gm pra comeзar a editar e codar tudo mais.

Fui ver, quando morre ele aparece.

Crack no chao e /aceitarmorrer.

Mais quero que quando morra va direito pro hospital sem precisa disso /aceitarmorre ou /serviзomedico.

Codigo.

Quote:

public Ambu(playerid)
{
SetPlayerPos(playerid, 2003.3408,2288.1384,1011.1256) ;
SetPlayerInterior(playerid, 1);
SetPlayerFacingAngle(playerid, 180.0);
TogglePlayerControllable( playerid, 1);
SetPlayerCameraPos(playerid,2002.6595,2284.1914,10 12.566
;
SetPlayerCameraLookAt(playerid,2003.4644,2288.8337 ,1011.1256) ;
ResetPlayerWeapons(playerid);
GameTextForPlayer(playerid, "~r~Curando...", 30000, 5) ;
Irhosp2 = SetTimerEx("HospitalCountdown", 30000, 0, "i", playerid) ;
return 0;
}

public MorreDeitaTimer(playerid)
{
SetPlayerPos(playerid, mortex[playerid], mortey[playerid], mortez[playerid]) ;
SetPlayerVirtualWorld(playerid, World[playerid]) ;
SetPlayerInterior(playerid, Interior[playerid]);
ApplyAnimation(playerid,"CRACK", "crckdeth2 ", 4.0, 0, 1, 1, 1, 0) ;
SetPlayerHealth(playerid, 10);
SendClientMessage(playerid, COLOR_ALLDEPT, "[BBG] Vocк se feriu e precisa de esperar a ambulвncia. Para aceitar morrer /aceitarmorrer") ;
SendClientMessage(playerid, COLOR_ALLDEPT, "[BBG] Para chamar a ambulвncia /serviзo mйdico") ;
ApertarFnaMorte[playerid] = 1;
return 0;
}

Coodernada da ambulancia do hospital.

Quote:

2003.3408,2288.0271,1011.1256,180.0000,0,0,0,0,0,0 );

Codigo do /aceitarmorrer.

Код:
	if(strcmp(cmd, "/aceitarmorrer", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(PlayerIsDead[playerid] == 1 && PlayerInfo[playerid][pJailTime] == 0)
			{
               Ambu(playerid);
               PlayerIsDead[playerid] = 0;
            }
		}
		return 1;
	}
Se alguem puder agradeзo
Reply
#2

Tira essas bostas aн e pхe sу:

No OnPlayerDeath

SetPVarInt(playerid, "morto", 1);

no OnPlayerSpawn

if(GetPVarInt(playerid, "morto"))
{
SetPlayerPos(playerid, 2003.3408, 2288.0271, 1011.1256);
SetPVarInt(playerid, "morto", 0);
}

Testa e vк se funfa, mas tira as coisas de antes, fmz...
Reply
#3

Ta dando erro aki.

Quote:

//MORRER E NASCER NO PONTO QUE MORREU
GetPlayerPos(playerid, mortex[playerid], mortey[playerid], mortez[playerid]);
World[playerid] = GetPlayerVirtualWorld(playerid);
Interior[playerid] = GetPlayerInterior(playerid);
PlayerIsDead[playerid] = 1;

Conce[playerid] = 0;
new name[MAX_PLAYER_NAME];
new string[256];
new playercash;
new victimteam;
new Floatx,Floaty,Floatz;
new killerteam;

DropWeapons(playerid);
victimteam = gTeam[playerid];
burgerexit[playerid] = 0;
Hospital[playerid] = 1;
storeexit[playerid] = 0;
PlayerInfo[playerid][pInvWeapon] = 0;
PlayerInfo[playerid][pInvAmmo] = 0;
cherifeexit[playerid] = 0;
killerteam = gTeam[killerid];
gPlayerSpawned[playerid] = 0;
GetPlayerName(playerid, name, sizeof(name));
PlayerInfo[playerid][pLocal] = 255;
GetPlayerPos(playerid, px, py, pz);
if(IsPlayerInMorro(playerid))
{
MorreuNoMorro[playerid] = 1;
SetTimerEx("MorreuMorroTimer", 600000, false, "i", playerid);
}
if(IsPlayerInShop(playerid))
{
MorreuNoShop[playerid] = 1;
SetTimerEx("MorreuShopTimer", 600000, false, "i", playerid);
}
if(IsPlayerInSkate(playerid))
{
MorreuNoSkate[playerid] = 1;
SetTimerEx("MorreuSkateTimer", 600000, false, "i", playerid);
}
if(IsPlayerInPier(playerid))
{
MorreuNoPier[playerid] = 1;
SetTimerEx("MorreuPierTimer", 600000, false, "i", playerid);
}
if(IsPlayerInAero(playerid))
{
MorreuNoAero[playerid] = 1;
SetTimerEx("MorreuAeroTimer", 600000, false, "i", playerid);
}
if(killerid != 255)
{
new killername[MAX_PLAYER_NAME];
new victimname[MAX_PLAYER_NAME];
if(GetPlayerState(killerid) == 2)
{
GetPlayerName(killerid, killername, sizeof(killername));
GetPlayerName(playerid, victimname, sizeof(killername));
SendClientMessage(killerid, COLOR_RED, "[Atenзгo] Nгo abuse de DRIVE BY ou serб punido.");
format(string, sizeof(string), "[Aviso] %s fez Drive By em %s !!!", killername,victimname);
SendClientMessageToAll(ORANGE, string);
PlayerInfo[killerid][pKills] += 1;
WantedPoints[killerid] += 1;
SetPlayerWantedLevel(killerid, WantedPoints[killerid]);
return 1;
}
}

Quando eu apago isso ele fica dando Fatal erro

@Edit.

Botei ele ta spawn no ponto de spawn
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)