Portal SAMP
[Ajuda] Base Samu sistema - Versão de Impressão

+- Portal SAMP (https://portalsamp.com)
+-- Fórum: SA-MP (https://portalsamp.com/forumdisplay.php?fid=5)
+--- Fórum: Área de suporte (https://portalsamp.com/forumdisplay.php?fid=6)
+--- Tópico: [Ajuda] Base Samu sistema (/showthread.php?tid=782)



Base Samu sistema - Smith - 15/02/2021

Galera alguem pode me passar uma base de um sistema de samu tipo quaando a pessoa morrer ao em vés de ele morrer ele fica caido no chao ate samu chegar e curar ele

[Imagem: 87962-1318022297-gta-sa-2011-11-03-23-56-37-32.jpg]


RE: Base Samu sistema - xbruno1000x - 16/02/2021

Basta utilizar a OnPlayerTakeDamage. Quando o player levar dano e estiver com vida menor ou igual a 10, você coloca a animação de ficar no chão e seta o jogador não controlável.


RE: Base Samu sistema - Smith - 18/02/2021

nao tenho essa call em minha gm pode me passar por favor


RE: Base Samu sistema - xbruno1000x - 18/02/2021

Código:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)


É uma callback nativa, basta procurar na documentação do SA-MP.
link: https://open.mp/pt/docs/scripting/callbacks/OnPlayerTakeDamage


RE: Base Samu sistema - Smith - 19/02/2021

tentei isso
Código:
if(GetPlayerHealth(playerid)<= 5)
{
ApplyAnimation(playerid, "CRACK", "crckdeth1", 4.1, 0, 1, 1, 0, 10000, 0);
}

Nao vai


RE: Base Samu sistema - xbruno1000x - 19/02/2021

(19/02/2021 23:00)Smith Escreveu: tentei isso
Código:
if(GetPlayerHealth(playerid)<= 5)
{
ApplyAnimation(playerid, "CRACK", "crckdeth1", 4.1, 0, 1, 1, 0, 10000, 0);
}

Nao vai

GetPlayerHealth retorna a vida anterior ao player receber dano. Está escrito na documentação...sendo assim, provavelmente o player morre antes de aplicar a animação.
tente da seguinte forma:

Código:
if(GetPlayerHealth(playerid)<= 12) return ApplyAnimation(playerid, "CRACK", "crckdeth1", 4.1, 0, 1, 1, 0, 10000, 0);



RE: Base Samu sistema - Smith - 20/02/2021

: warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.


RE: Base Samu sistema - xbruno1000x - 20/02/2021

Use assim então:
Código:
if(GetPlayerHealth(playerid)<= 12) ApplyAnimation(playerid, "CRACK", "crckdeth1", 4.1, 0, 1, 1, 0, 10000, 0);



RE: Base Samu sistema - Smith - 21/02/2021

(20/02/2021 02:58)xbruno1000x Escreveu: Use assim então:
Código:
if(GetPlayerHealth(playerid)<= 12) ApplyAnimation(playerid, "CRACK", "crckdeth1", 4.1, 0, 1, 1, 0, 10000, 0);
Código:
.pwn(2612) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
tentei de varia forma nao vai ja tentei ate assim nao vai 

Código:
new VIDA;
VIDA = GetPlayerHealth(playerid);
if(VIDA<= 12){
ApplyAnimation(playerid, "CRACK", "crckdeth1", 4.1, 0, 1, 1, 0, 10000, 0);
}
da o mesmo warnning e na funciona


RE: Base Samu sistema - OTAKEIRO - 23/06/2021

Apesar de ser um tópico antigo, muitos visitam para obter um exemplo, entao espero que voce que tenha vindo buscar algo nao tenha que retornar com a mão vazia...

Código:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
    new Float:health;
    GetPlayerHealth(playerid, health);

    if(health <= 15.0) // mals ae mas prefiro um valor mais seguro
    {
        ApplyAnimation(playerid, "CRACK", "crckdeth1", 4.1, 0, 1, 1, 0, 10000, 1);
    }
    return 1;
}