[Ajuda] Bug ao ser morto
#1

Eu estou com uma GM que usa o hospital. Ok mais ocaso й quando um procurado йmorto pelo PM ou alguma outra org policial ele vai para o hospital e ao msm tempo q esta cumprindo o tempo te saidado hospital ele cumpre a prisгo. e quando o tempo do hospital acaba ele nгo spawna na cadeia. o admin precisa setar. Me ajudem pfv
Reply
#2

Alguem me ajuda
Reply
#3

Poste os cуdigos para podermos ajuda-lo.
Reply
#4

Poste os cуdigos do sistema.
Reply
#5

Em OnPlayerDeath, na verificaзгo do hospital coloque uma verificaзгo secundбria:

PHP код:
if(orgPolicial[killerid] == true)

    
// Funзгo da prisгo
    
return 1// Retorno para nгo seguir a diante

OBS: "orgPolicial" serб a variбvel que apontarб que o jogador que matou й da org dos COP, basta alterar.
Reply
#6

Aqui a sentenзa imcompleta.

Код HTML:
        else if(PlayerInfo[playerid][pHosp] >=1)
        {
            format(gstring,sizeof(gstring),"[Hospital] Vocк voltou ao Hospital para se Recuperar, Aguarde...");
            SendClientMessage(playerid,0xFF8080FF,gstring);
            return EntrarHospital(playerid);
        }
        else if(GetPVarInt(playerid, "PlayerMorto") >= 1)
        {
            SetPVarInt(playerid, "PlayerMorto", 0);
            PlayerInfo[playerid][pHospTime] = 80;
            PlayerInfo[playerid][pHosp] = 1;
            format(gstring,sizeof(gstring),"[Hospital] Recuperando, Aguarde...");
            SendClientMessage(playerid,0xFF8080FF,gstring);
            return EntrarHospital(playerid);
        }
		else if(PlayerInfo[playerid][pJailed] == 1)
		{
		    SetPlayerInterior(playerid, 6);
			rand = random(sizeof(gPresoPmSpawns));
			SetPlayerPos(playerid, gPresoPmSpawns[rand][0], gPresoPmSpawns[rand][1], gPresoPmSpawns[rand][2]); // Warp the player
			SetPlayerFacingAngle(playerid, gPresoPmSpawns[rand][3]);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "Sentenзa incompleta,Vocк voltou para Prisгo");
   //return true;
		}
		else if(PlayerInfo[playerid][pJailed] == 2)
		{
		    SetPlayerInterior(playerid, 0);
            SetPlayerPos(playerid, 346.5848, 306.1026, 999.1484);
            SetPlayerInterior(playerid,6);
            SetPlayerVirtualWorld(playerid,random(20));
   //return true;
		}
		else if(PlayerInfo[playerid][pJailed] == 3)
		{
		    SetPlayerInterior(playerid, 10);
			rand = random(sizeof(gPresoROTASpawns));
			SetPlayerPos(playerid, gPresoROTASpawns[rand][0], gPresoROTASpawns[rand][1], gPresoROTASpawns[rand][2]); // Warp the player
			SetPlayerFacingAngle(playerid, gPresoROTASpawns[rand][3]);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "Sentenзa incompleta,Vocк voltou para Prisгo");
   //return true;
		}
  		else if(PlayerInfo[playerid][pJailed] == 4)
		{
		    SetPlayerInterior(playerid, 18);
			rand = random(sizeof(gPresoPmSpawns));
			SetPlayerPos(playerid, gPresoPmSpawns[rand][0], gPresoPmSpawns[rand][1], gPresoPmSpawns[rand][2]); // Warp the player
			SetPlayerFacingAngle(playerid, gPresoPmSpawns[rand][3]);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "Sentenзa incompleta,Vocк voltou para Prisгo");
   //return true;
		}
		else if(PlayerInfo[playerid][pJailed] == 5)
		{
		    SetPlayerInterior(playerid, 5);
			rand = random(sizeof(gPresoPfSpawns));
			SetPlayerPos(playerid, gPresoPfSpawns[rand][0], gPresoPfSpawns[rand][1], gPresoPfSpawns[rand][2]); // Warp the player
			SetPlayerFacingAngle(playerid, gPresoPfSpawns[rand][3]);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "Sentenзa incompleta,Vocк voltou para Prisгo");
   //return true;
		}
		else if(PlayerInfo[playerid][pJailed] == 6)
		{
		    SetPlayerInterior(playerid, 0);
			SetPlayerPos(playerid,2695.6262,-2126.2393,13.5488);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "Sentenзa incompleta,Vocк voltou para Prisгo");
   //return true;
		}
		else if(PlayerInfo[playerid][pJailed] == 7)
		{
		    SetPlayerInterior(playerid, 0);
			SetPlayerPos(playerid,-1293.2203,490.5885,11.1953);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "Sentenзa incompleta,Vocк voltou para Prisгo");
   //return true;
		}
Aqui aonde o suspeito foi morto.

Код HTML:
    	if(WantedPoints[playerid] >= 1)
    	{
    			new price = WantedPoints[playerid] * 1000;
    		    if(PlayerInfo[killerid][pMembro] == 1 || PlayerInfo[killerid][pLider] == 1)
    		    {
                    if(!IsPlayerInMorro(killerid))
                    {
                        format(string, sizeof(string), "~w~Suspeito ~r~Morto~n~Bonus~g~R$%d", price);
        				GameTextForPlayer(killerid, string, 5000, 1);
        				ConsumingMoney[killerid] = 1;
        				GranaVinny(killerid, price / 2);
        				PlayerPlaySound(killerid, 1058, 0.0, 0.0, 0.0);
        				GranaVinny(playerid, - price);
        				PlayerInfo[playerid][pJailed] = 1;
                        if(PlayerInfo[playerid][pVIP] >= 2)
		                {
        			         PlayerInfo[playerid][pJailTime] = (WantedPoints[playerid])*(150);
                        }
                        else
                        {
                            PlayerInfo[playerid][pJailTime] = (WantedPoints[playerid])*(300);
                        }
        			    format(string, sizeof(string), "* Vocк estб preso por %d Segundos na Policia Militar, e perdeu R$%d por trocar tiros e fugir dos policiais.", PlayerInfo[playerid][pJailTime], price);
        			    SendClientMessage(playerid, COLOR_LIGHTRED, string);
               			WantedPoints[playerid] = 0;
               			SetPlayerWantedLevel(playerid, 0);
        				PlayerInfo[playerid][pDrogas] = 0;
                        PlayerInfo[playerid][pDrogas2] = 0;
                        PlayerInfo[playerid][pDrogas3] = 0;
                        PlayerInfo[playerid][pMats] = 0;
                    }
    			}
    			else if(PlayerInfo[killerid][pMembro] == 2 || PlayerInfo[killerid][pLider] == 2)
    		    {
                    if(!IsPlayerInMorro(killerid))
                    {
                        format(string, sizeof(string), "~w~Suspeito ~r~Morto~n~Bonus~g~R$%d", price);
        				GameTextForPlayer(killerid, string, 5000, 1);
        				ConsumingMoney[killerid] = 1;
        				GranaVinny(killerid, price / 2);
        				PlayerPlaySound(killerid, 1058, 0.0, 0.0, 0.0);
        				GranaVinny(playerid, - price);
        				PlayerInfo[playerid][pJailed] = 4;
                        if(PlayerInfo[playerid][pVIP] >= 2)
		                {
        			         PlayerInfo[playerid][pJailTime] = (WantedPoints[playerid])*(150);
                        }
                        else
                        {
                            PlayerInfo[playerid][pJailTime] = (WantedPoints[playerid])*(300);
                        }
        			    format(string, sizeof(string), "* Vocк estб preso por %d Segundos na HQ Rotam, e perdeu R$%d por trocar tiros e fugir dos policiais.", PlayerInfo[playerid][pJailTime], price);
        			    SendClientMessage(playerid, COLOR_LIGHTRED, string);
               			WantedPoints[playerid] = 0;
               			SetPlayerWantedLevel(playerid, 0);
        				PlayerInfo[playerid][pDrogas] = 0;
                        PlayerInfo[playerid][pDrogas2] = 0;
                        PlayerInfo[playerid][pDrogas3] = 0;
                        PlayerInfo[playerid][pMats] = 0;
                        //ProcuradoPlayer(playerid);
                    }
    			}
    			else if(PlayerInfo[killerid][pMembro] == 3 || PlayerInfo[killerid][pLider] == 3)
    		    {
                    if(!IsPlayerInMorro(killerid))
                    {
                        format(string, sizeof(string), "~w~Suspeito ~r~Morto~n~Bonus~g~R$%d", price);
        				GameTextForPlayer(killerid, string, 5000, 1);
        				ConsumingMoney[killerid] = 1;
        				GranaVinny(killerid, price / 2);
        				PlayerPlaySound(killerid, 1058, 0.0, 0.0, 0.0);
        				GranaVinny(playerid, - price);
        				PlayerInfo[playerid][pJailed] = 7;
                        if(PlayerInfo[playerid][pVIP] >= 2)
		                {
        			         PlayerInfo[playerid][pJailTime] = (WantedPoints[playerid])*(150);
                        }
                        else
                        {
                            PlayerInfo[playerid][pJailTime] = (WantedPoints[playerid])*(300);
                        }
        			    format(string, sizeof(string), "* Vocк estб preso por %d Segundos no Exйrcito, e perdeu R$%d por trocar tiros e fugir dos policiais.", PlayerInfo[playerid][pJailTime], price);
        			    SendClientMessage(playerid, COLOR_LIGHTRED, string);
               			WantedPoints[playerid] = 0;
               			SetPlayerWantedLevel(playerid, 0);
        				PlayerInfo[playerid][pDrogas] = 0;
                        PlayerInfo[playerid][pDrogas2] = 0;
                        PlayerInfo[playerid][pDrogas3] = 0;
                        PlayerInfo[playerid][pMats] = 0;
                        //ProcuradoPlayer(playerid);
                    }
    			}
    			else if(PlayerInfo[killerid][pMembro] == 16 || PlayerInfo[killerid][pLider] == 16)
    		    {
                    if(!IsPlayerInMorro(killerid))
                    {
                        format(string, sizeof(string), "~w~Suspeito ~r~Morto~n~Bonus~g~R$%d", price);
        				GameTextForPlayer(killerid, string, 5000, 1);
        				ConsumingMoney[killerid] = 1;
        				GranaVinny(killerid, price / 2);
        				PlayerPlaySound(killerid, 1058, 0.0, 0.0, 0.0);
        				GranaVinny(playerid, - price);
        				PlayerInfo[playerid][pJailed] = 3;
                        if(PlayerInfo[playerid][pVIP] >= 2)
		                {
        			         PlayerInfo[playerid][pJailTime] = (WantedPoints[playerid])*(150);
                        }
                        else
                        {
                            PlayerInfo[playerid][pJailTime] = (WantedPoints[playerid])*(300);
                        }
        			    format(string, sizeof(string), "* Vocк estб preso por %d Segundos na Polнcia Civil, e perdeu R$%d por trocar tiros e fugir dos policiais.", PlayerInfo[playerid][pJailTime], price);
        			    SendClientMessage(playerid, COLOR_LIGHTRED, string);
               			WantedPoints[playerid] = 0;
               			SetPlayerWantedLevel(playerid, 0);
        				PlayerInfo[playerid][pDrogas] = 0;
                        PlayerInfo[playerid][pDrogas2] = 0;
                        PlayerInfo[playerid][pDrogas3] = 0;
                        PlayerInfo[playerid][pMats] = 0;
                        //ProcuradoPlayer(playerid);
                    }
    			}
    			else if(PlayerInfo[killerid][pMembro] == 11 || PlayerInfo[killerid][pLider] == 11)
    		    {
                    if(!IsPlayerInMorro(killerid))
                    {
                        format(string, sizeof(string), "~w~Suspeito ~r~Morto~n~Bonus~g~R$%d", price);
        				GameTextForPlayer(killerid, string, 5000, 1);
        				ConsumingMoney[killerid] = 1;
        				GranaVinny(killerid, price / 2);
        				PlayerPlaySound(killerid, 1058, 0.0, 0.0, 0.0);
        				GranaVinny(playerid, - price);
        				PlayerInfo[playerid][pJailed] = 5;
                        if(PlayerInfo[playerid][pVIP] >= 2)
		                {
        			         PlayerInfo[playerid][pJailTime] = (WantedPoints[playerid])*(150);
                        }
                        else
                        {
                            PlayerInfo[playerid][pJailTime] = (WantedPoints[playerid])*(300);
                        }
        			    format(string, sizeof(string), "* Vocк estб preso por %d Segundos na Policia Federal, e perdeu R$%d por trocar tiros e fugir dos policiais.", PlayerInfo[playerid][pJailTime], price);
        			    SendClientMessage(playerid, COLOR_LIGHTRED, string);
               			WantedPoints[playerid] = 0;
               			SetPlayerWantedLevel(playerid, 0);
        				PlayerInfo[playerid][pDrogas] = 0;
                        PlayerInfo[playerid][pDrogas2] = 0;
                        PlayerInfo[playerid][pDrogas3] = 0;
                        PlayerInfo[playerid][pMats] = 0;
                        //ProcuradoPlayer(playerid);
                    }
    			}
    	}
Aqui quando o Player da entrada no hospital.

Код HTML:
forward TextHospital(playerid);
public TextHospital(playerid)
{
    new TempoHospital = PlayerInfo[playerid][pHospTime], TextRec[40];
    if(TempoHospital <= 80 && TempoHospital >= 60) TextRec = "Preparando Recuperacao";
    else if(TempoHospital <= 60 && TempoHospital >= 40) TextRec = "Recuperacao Iniciada";
    else if(TempoHospital <= 40 && TempoHospital >= 30) TextRec = "Recuperando ...";
    else if(TempoHospital <= 30 && TempoHospital >= 15) TextRec = "Concluindo Recuperacao";
    else if(TempoHospital <= 15 && TempoHospital >= 0) TextRec = "Preparando sua Saida";
  /*  format(strvinny, sizeof(strvinny), "~n~~n~~n~~n~~n~~n~~n~~b~~h~~h~Progresso da Recuperacao: %s~n~~b~~h~~h~Tempo de Hospital: ~g~~h~~h~ %d",TextRec,PlayerInfo[playerid][pHospTime]);
	GameTextForPlayer(playerid, strvinny, 2000, 3);*/
	format(strvinny,sizeof(strvinny),"~>~~>~ ~p~~h~Hospital ~<~~<~~n~~n~~n~~b~~h~~h~~h~Status: ~n~~g~~h~~h~%s~n~~n~~b~~h~~h~~h~Tempo:~n~~r~~h~%d ~w~Segundos",TextRec,TempoHospital);
	TextDrawSetString(TextPosto[playerid], strvinny);
	ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
}
Espero que seja um desses que vcs estao pedindo --'
Reply
#7

Alguem ?
Reply
#8

Код HTML:
if(orgPolicial[killerid] == true)
{ 
    // Funзгo da prisгo
    return 1; // Retorno para nгo seguir a diante
}
Tipo assim ?

Код HTML:
        else if(PlayerInfo[playerid][pHosp] >=1)
        {
            format(gstring,sizeof(gstring),"[Hospital] Vocк voltou ao Hospital para se Recuperar, Aguarde...");
            SendClientMessage(playerid,0xFF8080FF,gstring);
            return EntrarHospital(playerid);
        }
        else if(GetPVarInt(playerid, "PlayerMorto") >= 1)
        {
            SetPVarInt(playerid, "PlayerMorto", 0);
            PlayerInfo[playerid][pHospTime] = 80;
            PlayerInfo[playerid][pHosp] = 1;
            format(gstring,sizeof(gstring),"[Hospital] Recuperando, Aguarde...");
            SendClientMessage(playerid,0xFF8080FF,gstring);
            return EntrarHospital(playerid);
        }
		else if(PlayerInfo[playerid][pJailed] == 1)
		{
		    SetPlayerInterior(playerid, 6);
			rand = random(sizeof(gPresoPmSpawns));
			SetPlayerPos(playerid, gPresoPmSpawns[rand][0], gPresoPmSpawns[rand][1], gPresoPmSpawns[rand][2]); // Warp the player
			SetPlayerFacingAngle(playerid, gPresoPmSpawns[rand][3]);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "Sentenзa incompleta,Vocк voltou para Prisгo");
   return true;
		}
		else if(PlayerInfo[playerid][pJailed] == 2)
		{
		    SetPlayerInterior(playerid, 0);
            SetPlayerPos(playerid, 346.5848, 306.1026, 999.1484);
            SetPlayerInterior(playerid,6);
            SetPlayerVirtualWorld(playerid,random(20));
 	return true;
		}
		else if(PlayerInfo[playerid][pJailed] == 3)
		{
		    SetPlayerInterior(playerid, 10);
			rand = random(sizeof(gPresoROTASpawns));
			SetPlayerPos(playerid, gPresoROTASpawns[rand][0], gPresoROTASpawns[rand][1], gPresoROTASpawns[rand][2]); // Warp the player
			SetPlayerFacingAngle(playerid, gPresoROTASpawns[rand][3]);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "Sentenзa incompleta,Vocк voltou para Prisгo");
   return true;
		}
  		else if(PlayerInfo[playerid][pJailed] == 4)
		{
		    SetPlayerInterior(playerid, 18);
			rand = random(sizeof(gPresoPmSpawns));
			SetPlayerPos(playerid, gPresoPmSpawns[rand][0], gPresoPmSpawns[rand][1], gPresoPmSpawns[rand][2]); // Warp the player
			SetPlayerFacingAngle(playerid, gPresoPmSpawns[rand][3]);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "Sentenзa incompleta,Vocк voltou para Prisгo");
   return true;
		}
		else if(PlayerInfo[playerid][pJailed] == 5)
		{
		    SetPlayerInterior(playerid, 5);
			rand = random(sizeof(gPresoPfSpawns));
			SetPlayerPos(playerid, gPresoPfSpawns[rand][0], gPresoPfSpawns[rand][1], gPresoPfSpawns[rand][2]); // Warp the player
			SetPlayerFacingAngle(playerid, gPresoPfSpawns[rand][3]);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "Sentenзa incompleta,Vocк voltou para Prisгo");
   return true;
		}
		else if(PlayerInfo[playerid][pJailed] == 6)
		{
		    SetPlayerInterior(playerid, 0);
			SetPlayerPos(playerid,2695.6262,-2126.2393,13.5488);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "Sentenзa incompleta,Vocк voltou para Prisгo");
   return true;
		}
		else if(PlayerInfo[playerid][pJailed] == 7)
		{
		    SetPlayerInterior(playerid, 0);
			SetPlayerPos(playerid,-1293.2203,490.5885,11.1953);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "Sentenзa incompleta,Vocк voltou para Prisгo");
   return true;
		}
JA ARRUMEI O BUG OBRIADO A VCS
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)