[Ajuda]Hospital Bugado
#1

Ae , tipo quando alguem morre , fica dando spawn milhares de vezes atй crashar , alguem sabe oq й ? S:'
Reply
#2

Posta a public OnPlayerDeath :]
Reply
#3

Grandinha , mais ta aew ,
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    static
		strimger[128],
        Float:zxyPos[3];
	SetPVarInt(playerid, "Morto", 2);
    if(GetPlayerState(killerid) == 2 && !IsPlayerInGuerra(playerid) && !IsPlayerInUsina(playerid) && !noteste[killerid])
    {
		GetPlayerPos(killerid, zxyPos[0], zxyPos[1], zxyPos[2]);
        if (IsPlayerInRangeOfPoint(playerid, 10.0, zxyPos[0], zxyPos[1], zxyPos[2]))
        {
            dbfez[killerid] = true;
            dbsofreu[playerid] = true;
            SendClientMessage(killerid, COLOR_YELLOW, "Vocк infringiu uma lei do servidor cometendo DRIVE-BY !");
            SendClientMessage(playerid, COLOR_YELLOW, "Este DB foi proposital? Caso tenha sido digite /db ");
            format(strimger, sizeof(strimger), "[BNS] %s (%i) fez drive-by em %s (%i)", killerid,ReturnPlayer(killerid),ReturnPlayer(playerid), playerid);
            SendClientMessageToAll(COLOR_REDEVAS, strimger);
        }
    }
    if(SpawnTime[playerid] < 5)
    {
    	Player[playerid][pMorto] = 1;
    	Player[killerid][pKills] ++;
	    Player[playerid][pDeaths] ++;
   	}

    GetPlayerPos(playerid, MortePos[playerid][0], MortePos[playerid][1], MortePos[playerid][2]);
    MorteInt[playerid] = GetPlayerInterior(playerid);
    if(Player[playerid][FirstSpawn] == true)
        return 1;

    WarCode_PlayerDeath(playerid, killerid, reason);

    new string[128];
    if(PlayerTied[playerid] > 0)
	{
	    format(string, sizeof(string), "BOPE fracassou no sequestro de %s. Refйm morto.",ReturnPlayer(playerid));
	    SendClientMessageToAll(COLOR_OOC, string);
	    PlayerTied[playerid] = 0;
	}
    for(new x=0; x<HighestID; x++)
 		if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && Player[x][gSpectateID] == playerid)
              AdvanceSpectate(x);

    //PAINT BALL
	if(PlayerPaintballing[playerid] != 0)
	{
	    new killer[MAX_PLAYER_NAME];
	    PlayerPaintballKills[killerid] ++;
	    format(string, sizeof(string), "Vocк matou %d pessoas nesta partida.",PlayerPaintballKills[killerid]);
	    SendClientMessage(killerid, COLOR_YELLOW, string);
	    if(PlayerPaintballKills[killerid] > PaintballWinnerKills)
	    {
	        PaintballWinner = killerid;
	        PaintballWinnerKills = PlayerPaintballKills[killerid];
	        GetPlayerName(killerid, killer, sizeof(killer));
	        for(new i = 0; i <= HighestID; i++)
	        {
	            if(IsPlayerConnected(i))
	            {
	                if(PlayerPaintballing[i] != 0)
	                {
	                    format(string, sizeof(string), "%s estб liderando o paintball com %d pontos.",ReturnPlayer(killerid),PaintballWinnerKills);
						SendClientMessage(i, COLOR_YELLOW, string);
						return 1;
	                }
	            }
	        }
	    }
	    return 1;
	}

	//MATAR EM LOCAL PROIBIDO
	if(PlayerToPoint(40.0, killerid, 245.9469,75.8629,1003.6406) || PlayerToPoint(40.0, killerid, 2003.3408,2288.0269,1011.1256))
	{
	    new penaantiga = Player[killerid][pJailTime]/60;
	    new penanova = penaantiga+20;

	    if(Player[killerid][pJailed] == 1 || Player[killerid][pJailed] == 2 && !IsACop(killerid))
			Bangu(killerid,playerid,penanova,"Local Proibido");
	    else if(!IsACop(killerid))
			Bangu(killerid,playerid,20,"Local Proibido");

		return 1;
	}

	//empresa
  	if(GetPlayerGP(playerid) > 99 && Player[playerid][pLevel] > 2)
  	{
		SBizzInfo[14][sbTill] += 75;
		ExtortionSBiz(14, 75);
	}
	if(SBizzInfo[14][sbProducts]>0)
		SBizzInfo[14][sbProducts]--;

	if(Player[playerid][pPlano] > 0)
	    Player[playerid][pPlano] -= 1;
	else
		GivePlayerGP(playerid, -100);

	if(IsPlayerInGuerra(playerid) || IsPlayerInUsina(playerid))
  		Hospital[playerid] = 2;
	else
	    Hospital[playerid] = 1;

    if(Player[playerid][pLeader] == TEAM_PREF)
	{
	    format(string, sizeof(string), "[Atenзгo] O Prefeito %s foi assassinado por %s!!!", ReturnPlayer(playerid) , ReturnPlayer(killerid));
		SendClientMessageToAll(COLOR_YELLOW, string);
	}

	//CONTRATO
	if(Player[playerid][pHeadValue] > 0)
	{
	    if(IsPlayerConnected(killerid))
	    {
		    if(Player[killerid][pMember] == TEAM_HITMAN)
		    {
		        if(Vitima[killerid] == playerid)
		        {
		            GivePlayerGP(killerid, Player[playerid][pHeadValue]);
					format(string,128,"O assassino %s cumpriu o contrato а cabeca de %s e adquiriu um valor de R$%d",ReturnPlayer(killerid),ReturnPlayer(playerid),Player[playerid][pHeadValue]);
					SendClientMessageToAll(COLOR_GROOVE, string);
					WantedPoints[killerid] += 1;
                    SetPlayerCriminal(killerid,255, "Homicнdio de primeiro grau");
					Player[playerid][pHeadValue] = 0;
					SendoProcurado[playerid] = false;
	                Procurando[killerid] = false;
	                return 1;
		        }
				else
				{
                    WantedPoints[killerid] += 1;
                    SetPlayerCriminal(killerid,255, "Homicнdio de primeiro grau");
                    SendClientMessage(killerid, COLOR_YELLOW, "[Info] Vocк matou uma pessoa sem contrato.");
                    return 1;
				}
			}
		}
	}

	if(CarShopping[playerid] == true)
	{
		CarShopping[playerid] = false;
		DestroyVehicle(ShopCar[playerid]);
	    carbrowse[playerid] = 0;
	    Kick(playerid);
 	}

  	DropWeapons(playerid);
    Conce[playerid] = 0;
	new Float:px,Float:py,Float:pz;
	GetPlayerPos(playerid, px, py, pz);
    burgerexit[playerid] = 0;
    storeexit[playerid] = 0;
    Player[playerid][pInvWeapon] = 0;
 	Player[playerid][pInvAmmo] = 0;
 	cherifeexit[playerid] = 0;
	Player[playerid][pLocal] = 255;
	Player[playerid][pSeatBelt] = 0;
	Player[playerid][pCapacete] = 0;
	nowh[playerid] = 0;

	if(fk)
    {
        new arma = GetPlayerWeapon(killerid);
   		format(string, sizeof(string), "%s[ID %d] matou %s com a arma %d.", ReturnPlayer(killerid), killerid, ReturnPlayer(playerid), arma);
		ABroadCast(COLOR_LIGHTRED,string,1);
    }
 	Player[playerid][Spawned] = false;
	if(SpawnTime[playerid] > 0 && killerid != 65535 && Player[playerid][pLevel] > 2 && PlayerPaintballing[playerid] != 0)
	{
	    format(string, sizeof(string), "%s[ID %d] cometeu SpawnKill em %s e foi kickado", ReturnPlayer(killerid), killerid, ReturnPlayer(playerid));
	    SendClientMessageToAll(COLOR_OOC,string);
		Kick(killerid);
		//return 1;
	}

	if(Player[killerid][pJailed] == 2 && Player[playerid][pJailed] == 2)
	{
	    SendClientMessage(killerid, COLOR_RED,"Vocк foi kickado por matar no bangu, nгo faзa mais isso.");
		Kick(killerid);
		//return 1;
    }

	if(gPlayerCheckpointStatus[playerid] > 4 && gPlayerCheckpointStatus[playerid] < 11)
	{
		DisablePlayerCheckpoint(playerid);
		gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
	}

	//TELEFONEMA
	new caller = Mobile[playerid];
	if(caller != 255)
	{
		if(caller < 255)
		{
			SendClientMessage(caller,  COLOR_YELLOW, " Ninguйm na linha...");
			CellTime[caller] = 0;
			CellTime[playerid] = 0;
			Mobile[caller] = 255;
		}
		Mobile[playerid] = 255;
		CellTime[playerid] = 0;
	}

	ClearCrime(playerid);

    if(IsPlayerConnected(killerid) && noevento[killerid] != true && Player[killerid][pMember] != TEAM_HITMAN)
    {
        if(IsACrime(killerid))
		{
			WantedPoints[killerid] += 1;
			SetPlayerCriminal(killerid,255, "Homicнdio de primeiro grau");
		}
    	else if(IsACivil(killerid))
		{
			WantedPoints[killerid] += 1;
			SetPlayerCriminal(killerid,255, "Homicнdio de primeiro grau");
        }
        else if(IsACop(killerid))
			WantedPoints[killerid] = 0;

    }
	return 1;
}
Reply
#4

Entгo, faзa o seguinte > Primeiro deixe a OnPlayerDeath como comentбrio para saber se o problema realmente estб nela, adicione /* no comeзo da public e */ no final. Ficando:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    /*static
        strimger[128],
        Float:zxyPos[3];
    SetPVarInt(playerid, "Morto", 2);
    if(GetPlayerState(killerid) == 2 && !IsPlayerInGuerra(playerid) && !IsPlayerInUsina(playerid) && !noteste[killerid])
    {
        GetPlayerPos(killerid, zxyPos[0], zxyPos[1], zxyPos[2]);
        if (IsPlayerInRangeOfPoint(playerid, 10.0, zxyPos[0], zxyPos[1], zxyPos[2]))
        {
            dbfez[killerid] = true;
            dbsofreu[playerid] = true;
            SendClientMessage(killerid, COLOR_YELLOW, "Vocк infringiu uma lei do servidor cometendo DRIVE-BY !");
            SendClientMessage(playerid, COLOR_YELLOW, "Este DB foi proposital? Caso tenha sido digite /db ");
            format(strimger, sizeof(strimger), "[BNS] %s (%i) fez drive-by em %s (%i)", killerid,ReturnPlayer(killerid),ReturnPlayer(playerid), playerid);
            SendClientMessageToAll(COLOR_REDEVAS, strimger);
        }
    }
    if(SpawnTime[playerid] < 5)
    {
        Player[playerid][pMorto] = 1;
        Player[killerid][pKills] ++;
        Player[playerid][pDeaths] ++;
    }

    GetPlayerPos(playerid, MortePos[playerid][0], MortePos[playerid][1], MortePos[playerid][2]);
    MorteInt[playerid] = GetPlayerInterior(playerid);
    if(Player[playerid][FirstSpawn] == true)
        return 1;

    WarCode_PlayerDeath(playerid, killerid, reason);

    new string[128];
    if(PlayerTied[playerid] > 0)
    {
        format(string, sizeof(string), "BOPE fracassou no sequestro de %s. Refйm morto.",ReturnPlayer(playerid));
        SendClientMessageToAll(COLOR_OOC, string);
        PlayerTied[playerid] = 0;
    }
    for(new x=0; x<HighestID; x++)
        if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && Player[x][gSpectateID] == playerid)
              AdvanceSpectate(x);

    //PAINT BALL
    if(PlayerPaintballing[playerid] != 0)
    {
        new killer[MAX_PLAYER_NAME];
        PlayerPaintballKills[killerid] ++;
        format(string, sizeof(string), "Vocк matou %d pessoas nesta partida.",PlayerPaintballKills[killerid]);
        SendClientMessage(killerid, COLOR_YELLOW, string);
        if(PlayerPaintballKills[killerid] > PaintballWinnerKills)
        {
            PaintballWinner = killerid;
            PaintballWinnerKills = PlayerPaintballKills[killerid];
            GetPlayerName(killerid, killer, sizeof(killer));
            for(new i = 0; i <= HighestID; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(PlayerPaintballing[i] != 0)
                    {
                        format(string, sizeof(string), "%s estб liderando o paintball com %d pontos.",ReturnPlayer(killerid),PaintballWinnerKills);
                        SendClientMessage(i, COLOR_YELLOW, string);
                        return 1;
                    }
                }
            }
        }
        return 1;
    }

    //MATAR EM LOCAL PROIBIDO
    if(PlayerToPoint(40.0, killerid, 245.9469,75.8629,1003.6406) || PlayerToPoint(40.0, killerid, 2003.3408,2288.0269,1011.1256))
    {
        new penaantiga = Player[killerid][pJailTime]/60;
        new penanova = penaantiga+20;

        if(Player[killerid][pJailed] == 1 || Player[killerid][pJailed] == 2 && !IsACop(killerid))
            Bangu(killerid,playerid,penanova,"Local Proibido");
        else if(!IsACop(killerid))
            Bangu(killerid,playerid,20,"Local Proibido");

        return 1;
    }

    //empresa
    if(GetPlayerGP(playerid) > 99 && Player[playerid][pLevel] > 2)
    {
        SBizzInfo[14][sbTill] += 75;
        ExtortionSBiz(14, 75);
    }
    if(SBizzInfo[14][sbProducts]>0)
        SBizzInfo[14][sbProducts]--;

    if(Player[playerid][pPlano] > 0)
        Player[playerid][pPlano] -= 1;
    else
        GivePlayerGP(playerid, -100);

    if(IsPlayerInGuerra(playerid) || IsPlayerInUsina(playerid))
        Hospital[playerid] = 2;
    else
        Hospital[playerid] = 1;

    if(Player[playerid][pLeader] == TEAM_PREF)
    {
        format(string, sizeof(string), "[Atenзгo] O Prefeito %s foi assassinado por %s!!!", ReturnPlayer(playerid) , ReturnPlayer(killerid));
        SendClientMessageToAll(COLOR_YELLOW, string);
    }

    //CONTRATO
    if(Player[playerid][pHeadValue] > 0)
    {
        if(IsPlayerConnected(killerid))
        {
            if(Player[killerid][pMember] == TEAM_HITMAN)
            {
                if(Vitima[killerid] == playerid)
                {
                    GivePlayerGP(killerid, Player[playerid][pHeadValue]);
                    format(string,128,"O assassino %s cumpriu o contrato а cabeca de %s e adquiriu um valor de R$%d",ReturnPlayer(killerid),ReturnPlayer(playerid),Player[playerid][pHeadValue]);
                    SendClientMessageToAll(COLOR_GROOVE, string);
                    WantedPoints[killerid] += 1;
                    SetPlayerCriminal(killerid,255, "Homicнdio de primeiro grau");
                    Player[playerid][pHeadValue] = 0;
                    SendoProcurado[playerid] = false;
                    Procurando[killerid] = false;
                    return 1;
                }
                else
                {
                    WantedPoints[killerid] += 1;
                    SetPlayerCriminal(killerid,255, "Homicнdio de primeiro grau");
                    SendClientMessage(killerid, COLOR_YELLOW, "[Info] Vocк matou uma pessoa sem contrato.");
                    return 1;
                }
            }
        }
    }

    if(CarShopping[playerid] == true)
    {
        CarShopping[playerid] = false;
        DestroyVehicle(ShopCar[playerid]);
        carbrowse[playerid] = 0;
        Kick(playerid);
    }

    DropWeapons(playerid);
    Conce[playerid] = 0;
    new Float:px,Float:py,Float:pz;
    GetPlayerPos(playerid, px, py, pz);
    burgerexit[playerid] = 0;
    storeexit[playerid] = 0;
    Player[playerid][pInvWeapon] = 0;
    Player[playerid][pInvAmmo] = 0;
    cherifeexit[playerid] = 0;
    Player[playerid][pLocal] = 255;
    Player[playerid][pSeatBelt] = 0;
    Player[playerid][pCapacete] = 0;
    nowh[playerid] = 0;

    if(fk)
    {
        new arma = GetPlayerWeapon(killerid);
        format(string, sizeof(string), "%s[ID %d] matou %s com a arma %d.", ReturnPlayer(killerid), killerid, ReturnPlayer(playerid), arma);
        ABroadCast(COLOR_LIGHTRED,string,1);
    }
    Player[playerid][Spawned] = false;
    if(SpawnTime[playerid] > 0 && killerid != 65535 && Player[playerid][pLevel] > 2 && PlayerPaintballing[playerid] != 0)
    {
        format(string, sizeof(string), "%s[ID %d] cometeu SpawnKill em %s e foi kickado", ReturnPlayer(killerid), killerid, ReturnPlayer(playerid));
        SendClientMessageToAll(COLOR_OOC,string);
        Kick(killerid);
        //return 1;
    }

    if(Player[killerid][pJailed] == 2 && Player[playerid][pJailed] == 2)
    {
        SendClientMessage(killerid, COLOR_RED,"Vocк foi kickado por matar no bangu, nгo faзa mais isso.");
        Kick(killerid);
        //return 1;
    }

    if(gPlayerCheckpointStatus[playerid] > 4 && gPlayerCheckpointStatus[playerid] < 11)
    {
        DisablePlayerCheckpoint(playerid);
        gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
    }

    //TELEFONEMA
    new caller = Mobile[playerid];
    if(caller != 255)
    {
        if(caller < 255)
        {
            SendClientMessage(caller,  COLOR_YELLOW, " Ninguйm na linha...");
            CellTime[caller] = 0;
            CellTime[playerid] = 0;
            Mobile[caller] = 255;
        }
        Mobile[playerid] = 255;
        CellTime[playerid] = 0;
    }

    ClearCrime(playerid);

    if(IsPlayerConnected(killerid) && noevento[killerid] != true && Player[killerid][pMember] != TEAM_HITMAN)
    {
        if(IsACrime(killerid))
        {
            WantedPoints[killerid] += 1;
            SetPlayerCriminal(killerid,255, "Homicнdio de primeiro grau");
        }
        else if(IsACivil(killerid))
        {
            WantedPoints[killerid] += 1;
            SetPlayerCriminal(killerid,255, "Homicнdio de primeiro grau");
        }
        else if(IsACop(killerid))
            WantedPoints[killerid] = 0;

    }*/

    return 1;
}
Se o problema estiver nela, vai comentando por partes atй descobrir onde realmente estб o problema, entгo a gente procura uma soluзгo
Reply
#5

Pawn Compiler library paroude funcionar :S'
Reply
#6

Comentou corretamente?
Reply
#7

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    /*static
		strimger[128],
        Float:zxyPos[3];
	SetPVarInt(playerid, "Morto", 2);
    if(GetPlayerState(killerid) == 2 && !IsPlayerInGuerra(playerid) && !IsPlayerInUsina(playerid) && !noteste[killerid])
    {
		GetPlayerPos(killerid, zxyPos[0], zxyPos[1], zxyPos[2]);
        if (IsPlayerInRangeOfPoint(playerid, 10.0, zxyPos[0], zxyPos[1], zxyPos[2]))
        {
            dbfez[killerid] = true;
            dbsofreu[playerid] = true;
            SendClientMessage(killerid, COLOR_YELLOW, "Vocк infringiu uma lei do servidor cometendo DRIVE-BY !");
            SendClientMessage(playerid, COLOR_YELLOW, "Este DB foi proposital? Caso tenha sido digite /db ");
            format(strimger, sizeof(strimger), "[BNS] %s (%i) fez drive-by em %s (%i)", killerid,ReturnPlayer(killerid),ReturnPlayer(playerid), playerid);
            SendClientMessageToAll(COLOR_REDEVAS, strimger);
        }
    }
    if(SpawnTime[playerid] < 5)
    {
    	Player[playerid][pMorto] = 1;
    	Player[killerid][pKills] ++;
	    Player[playerid][pDeaths] ++;
   	}

    GetPlayerPos(playerid, MortePos[playerid][0], MortePos[playerid][1], MortePos[playerid][2]);
    MorteInt[playerid] = GetPlayerInterior(playerid);
    if(Player[playerid][FirstSpawn] == true)
        return 1;

    WarCode_PlayerDeath(playerid, killerid, reason);

    new string[128];
    if(PlayerTied[playerid] > 0)
	{
	    format(string, sizeof(string), "BOPE fracassou no sequestro de %s. Refйm morto.",ReturnPlayer(playerid));
	    SendClientMessageToAll(COLOR_OOC, string);
	    PlayerTied[playerid] = 0;
	}
    for(new x=0; x<HighestID; x++)
 		if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && Player[x][gSpectateID] == playerid)
              AdvanceSpectate(x);

    //PAINT BALL
	if(PlayerPaintballing[playerid] != 0)
	{
	    new killer[MAX_PLAYER_NAME];
	    PlayerPaintballKills[killerid] ++;
	    format(string, sizeof(string), "Vocк matou %d pessoas nesta partida.",PlayerPaintballKills[killerid]);
	    SendClientMessage(killerid, COLOR_YELLOW, string);
	    if(PlayerPaintballKills[killerid] > PaintballWinnerKills)
	    {
	        PaintballWinner = killerid;
	        PaintballWinnerKills = PlayerPaintballKills[killerid];
	        GetPlayerName(killerid, killer, sizeof(killer));
	        for(new i = 0; i <= HighestID; i++)
	        {
	            if(IsPlayerConnected(i))
	            {
	                if(PlayerPaintballing[i] != 0)
	                {
	                    format(string, sizeof(string), "%s estб liderando o paintball com %d pontos.",ReturnPlayer(killerid),PaintballWinnerKills);
						SendClientMessage(i, COLOR_YELLOW, string);
						return 1;
	                }
	            }
	        }
	    }*/
	    return 1;
	}
fiz assim direto , '
Reply
#8

ooq pode ser ? :S , tooo ficando doooido ja '-'
Reply
#9

Posta a public SetMorto.
Reply
#10

Код:
public SetMorto(playerid)
{
	if(GetPVarInt(playerid, "Morto") != 2) return 0;
	if(GetPVarInt(playerid, "Hospital")) return 0;
    if(Player[playerid][pJailed] == 0)
	{
	    SetPVarInt(playerid, "Hospital", 1);
		NoHospital[playerid] = 30;
        SetPlayerFacingAngle(playerid, 90);

        new rand = random(sizeof(MacaSpawns));
  	    SafeSetPlayerPos(playerid, MacaSpawns[rand][0], MacaSpawns[rand][1], MacaSpawns[rand][2]);
		ApplyAnimation(playerid,"CRACK", "crckdeth2", 4.0, 1, 1, 1, 0, 45000);
		SetPlayerCameraPos(playerid, MacaSpawns[rand][0]+3, MacaSpawns[rand][1]-5, MacaSpawns[rand][2]+3);
		SetPlayerCameraLookAt(playerid, MacaSpawns[rand][0], MacaSpawns[rand][1], MacaSpawns[rand][2]);

		if(Player[playerid][pPlano])
		{
            SendClientMessage(playerid, 0xFF9680FF, "[MЙDICO] Vocк estava ferido e foi levado ao hospital. Custo pago pelo plano de saъde.");
		}
		else
		{
            SendClientMessage(playerid, 0xFF9680FF, "[MЙDICO] Vocк estava ferido e foi levado ao hospital. Os custos ficaram em R$500,00");
		    GivePlayerGP(playerid,-500);
		}
	}
	DeletePVar(playerid, "Morto");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)