SA-MP Forums Archive
[Ajuda]BugZinho Chato - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda]BugZinho Chato (/showthread.php?tid=323199)



[Ajuda]BugZinho Chato - Geo1996 - 04.03.2012

Quando o Player Morre ele Ate e Internado Mas Ele Nao Sai Do Hospital, ele saiu mas volta logo!

pawn Код:
if(MedicBill[playerid] == 1 && PlayerInfo[playerid][pJailed] == 0 && PlayerPaintballing[playerid] == 0)
        {
            if(sincronizando[playerid] == 1)
            {
            return 1;
            }
            new string[256];
            new cut = deathcost; //PlayerInfo[playerid][pLevel]*deathcost;
            format(string, sizeof(string), "Hospital: Vocк foi recuperado.", cut);
            SendClientMessage(playerid, TEAM_CYAN_COLOR, string);
            MedicBill[playerid] = 0;
            MedicTime[playerid] = 0;
            NeedMedicTime[playerid] = 0;
            PlayerInfo[playerid][pDeaths] += 1;
            SetPlayerHealth(playerid, 100);
            SetPlayerInterior(playerid, 5);
            rand = random(sizeof(gMedicSpawns));
            SetPlayerPos(playerid, gMedicSpawns[rand][0], gMedicSpawns[rand][1], gMedicSpawns[rand][2]); // Warp the player
            SetPlayerFacingAngle(playerid, 270.0);
            TogglePlayerControllable(playerid, 0);
            GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~y~Voce Esta Sendo Reanimado~r~Aguarde~y~...", 35000, 3);
            MedicTime[playerid] = 1;
            if(PlayerInfo[playerid][pVIP] > 0)
            {
                NeedMedicTime[playerid] = 30;
            }
            else
            {
                NeedMedicTime[playerid] = 60;
            }
            PlayerPlaySound(playerid, 1062, 0.0, 0.0, 0.0);
            return 1;
        }



Re: [Ajuda]BugZinho Chato - Etton - 05.03.2012

Faзa o seguinte. Troque este codigo q vocк passou pelo de baixo

Код:
if(MedicBill[playerid] == 1 && PlayerInfo[playerid][pJailed] == 0 && PlayerPaintballing[playerid] == 0)
{
	if(sincronizando[playerid] == 1) return true;
    if(PlayerInfo[playerid][pVIP] > 0) NeedMedicTime[playerid] = 30;
    else NeedMedicTime[playerid] = 60;
    PlayerInfo[playerid][pDeaths] += 1;
    SetPlayerHealth(playerid, 100);
    SetPlayerInterior(playerid, 5);
    rand = random(sizeof(gMedicSpawns));
    SetPlayerPos(playerid, gMedicSpawns[rand][0], gMedicSpawns[rand][1], gMedicSpawns[rand][2]); // Warp the player
    SetPlayerFacingAngle(playerid, 270.0);
    TogglePlayerControllable(playerid, 0);
    GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~y~Voce Esta Sendo Reanimado~r~Aguarde~y~...", 35000, 3);
    MedicTime[playerid] = 1;
    PlayerPlaySound(playerid, 1062, 0.0, 0.0, 0.0);
    return 1;
}
Aqui como diz no // vocк coloquei no settimer q faz diminuir o tempo de internaзгo(pois nгo posso adivinhar qual timer й)
Код:
      
//COLOQUE ISTO EM SEU SETTIMER QUE FAZ DIMINUIR O TEMPO DE INTERNAЗГO
if(MedicBill[playerid] == 1 && NeedMedicTime[playerid] <= 0)
{
	new string[256];
    new cut = deathcost; //PlayerInfo[playerid][pLevel]*deathcost;
    format(string, sizeof(string), "Hospital: Vocк foi recuperado.", cut);
    SendClientMessage(playerid, TEAM_CYAN_COLOR, string);
    MedicBill[playerid] = 0;
    MedicTime[playerid] = 0;
    NeedMedicTime[playerid] = 0;
    SpawnPlayer(playerid);
}



Re: [Ajuda]BugZinho Chato - Geo1996 - 05.03.2012

axei (eu acho q a linha correta do problema)

pawn Код:
if(MedicTime[i] > 0)
            {
                if(MedicTime[i] == 3)
                {
                    SetPlayerInterior(i, 5);
                    new Float:X, Float:Y, Float:Z;
                    GetPlayerPos(i, X,Y,Z);
                    SetPlayerCameraPos(i, X + 3, Y, Z);
                    SetPlayerCameraLookAt(i,X,Y,Z);
                }
                MedicTime[i] ++;
                if(MedicTime[i] >= NeedMedicTime[i])
                {
                    new cut = deathcost; //PlayerInfo[playerid][pLevel]*deathcost;
                    format(string, sizeof(string), "Mйdico: Vocк se recuperou rбpido, e foi levado para sua HQ.", cut);
                    SendClientMessage(i, TEAM_CYAN_COLOR, string);
                    TogglePlayerControllable(i, 1);
                    MedicBill[i] = 0;
                    MedicTime[i] = 0;
                    NeedMedicTime[i] = 0;
                    //PlayerInfo[i][pDeaths] += 1;
                    PlayerFixRadio(i);
                    SpawnPlayer(i);
                }
            }
Esta Mensagem Apareece
Код:
Mйdico: Vocк se recuperou rбpido, e foi levado para Sua HQ
Mas Porem O Player Nao da spawn

a aзгo fica se repetindo


Re: [Ajuda]BugZinho Chato - Đeagle - 05.03.2012

Nгo sei se e isso, mais tenta assim

Troque
PHP код:
SpawnPlayer(i); 
Por
PHP код:
SpawnPlayer(playerid); 



Re: [Ajuda]BugZinho Chato - Geo1996 - 05.03.2012

Код:
error 017: undefined symbol "playerid"



Re: [Ajuda]BugZinho Chato - Đeagle - 05.03.2012

Verifica se tem playerid na public que o cуdigo atualmente estб.


Re: [Ajuda]BugZinho Chato - Geo1996 - 05.03.2012

no caso esta nesta public
Код:
public SetPlayerUnjail()
como seria ela corretamente?


Re: [Ajuda]BugZinho Chato - Đeagle - 05.03.2012

Tenta assim

PHP код:
public SetPlayerUnjail(playerid



Re: [Ajuda]BugZinho Chato - Geo1996 - 05.03.2012

ja havia tentado assim mas dai aparece este erro

Код:
error 025: function heading differs from prototype



Re: [Ajuda]BugZinho Chato - steeldark - 05.03.2012

Quote:
Originally Posted by Geo1996
Посмотреть сообщение
axei (eu acho q a linha correta do problema)

pawn Код:
if(MedicTime[i] > 0)
            {
                if(MedicTime[i] == 3)
                {
                    SetPlayerInterior(i, 5);
                    new Float:X, Float:Y, Float:Z;
                    GetPlayerPos(i, X,Y,Z);
                    SetPlayerCameraPos(i, X + 3, Y, Z);
                    SetPlayerCameraLookAt(i,X,Y,Z);
                }
                MedicTime[i] ++;
                if(MedicTime[i] >= NeedMedicTime[i])
                {
                    new cut = deathcost; //PlayerInfo[playerid][pLevel]*deathcost;
                    format(string, sizeof(string), "Mйdico: Vocк se recuperou rбpido, e foi levado para sua HQ.", cut);
                    SendClientMessage(i, TEAM_CYAN_COLOR, string);
                    TogglePlayerControllable(i, 1);
                    MedicBill[i] = 0;
                    MedicTime[i] = 0;
                    NeedMedicTime[i] = 0;
                    //PlayerInfo[i][pDeaths] += 1;
                    PlayerFixRadio(i);
                                // COLOCA AQUI A CORDENADA DE SPAWN DELE..
                                // no caso de varias hqs, faзa um spawhqs, e coloca um if(PlayerInfo[i][pTeam]) para checar de qual hq ele й.. depois usa um
                                SetSpawnInfo e um SpawnPlayer(i);
                             // ou usa a funзгo que coloquei logo abaixo.. ficando assim:
                             hqspaw(PlayerInfo[i][pTeam],i); // isso vai fazer o player dar spaw nas coordenadas que tiverem no stock. presumindo que as PlayerInfo[i][pTeam] sejam 0, 1, 2 ou nenhuma, o stock funciona perfeitamente.
                }
            }
exemplo:

Код:
stock hqspaw(num,i)
{
    new Float:xteam,Float:yteam,Float:zteam,Float:anglo;
    switch(num)
        {
            case 0: { xteam = COR X TEAM 1; yteam = COR Y TEAM 1; zteam = COR Z TEAM 1; anglo = ANGLO TEAM 1;}
            case 1: {  xteam = COR X TEAM 2; yteam = COR Y TEAM 2; zteam = COR Z TEAM 2; anglo = ANGLO TEAM 2;}
            case 2: {  xteam = COR X TEAM 3; yteam = COR Y TEAM 3; zteam = COR Z TEAM 3; anglo = ANGLO TEAM 3;}
            default: {  xteam = COR X DEFALT (ex: frente hosp); yteam = COR Y DEFALT (ex: frente hosp) ; zteam = COR Z DEFALT (ex: frente hosp); anglo = ANGLO DEFALT (ex: frente hosp);}
        }
    SetSpawnInfo( i,PlayerInfo[i][pTeam], PlayerInfo[i][pSkin], xteam, yteam, zteam,anglo, 0, 0, 0, 0, 0, 0 );
    SpawnPlayer(i);
}
espero ter ajudado.. se ajudei.. da rep ^^