[Ajuda] HS SNIPER
#1

bom galera,fiz esse sistema de hs e queria que quando o player atirar na cabeзa do outro criar uma explosao e matar o inimigo:
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
    {
        SetPlayerHealth(playerid, 0.0);
    }
    return 1;
}
Reply
#2

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
    {
        CreateExplosion(0.0, 0.0, -100.0, 0.0, 0.0, 0.0, 0.0, 12, 10.0);
        SetPlayerHealth(playerid, 0.0);
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by TR0J4N
Посмотреть сообщение
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
    {
        CreateExplosion(0.0, 0.0, -100.0, 0.0, 0.0, 0.0, 0.0, 12, 10.0);
        SetPlayerHealth(playerid, 0.0);
    }
    return 1;
}
E a posiзгo da explosгo, cade? ^^
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
    {
        new Float px, py, pz; GetPlayerPos(playerid, px, py, pz);
        CreateExplosion(px, py, pz, 12, 10.0);
        SetPlayerHealth(playerid, 0.0);
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by Kuddy
Посмотреть сообщение
E a posiзгo da explosгo, cade? ^^
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
    {
        new Float px, py, pz; GetPlayerPos(playerid, px, py, pz);
        CreateExplosion(px, py, pz, 12, 10.0);
        SetPlayerHealth(playerid, 0.0);
    }
    return 1;
}
Nгo explodiu. :/
Reply
#5

cara tem um soluзгo, pergunta para o dono do server csf (combate em san fierro)
que ele tem um igualzinho.
Reply
#6

Quote:
Originally Posted by caption
Посмотреть сообщение
cara tem um soluзгo, pergunta para o dono do server csf (combate em san fierro)
que ele tem um igualzinho.
Sу veio aqui pra ganhar post,menos pra ajudar.
Reply
#7

Quote:
Originally Posted by Devasting
Посмотреть сообщение
Sу veio aqui pra ganhar post,menos pra ajudar.
e pra plagiar tambйm nгo esquece disso em :P
Reply
#8

Quote:
Originally Posted by caption
Посмотреть сообщение
e pra plagiar tambйm nгo esquece disso em :P
Plagiar, й tambйm criar meu prуprio sistema? se estou pedindo ajuda no meu hs, deve ser por que, que estou criando do 0!
Reply
#9

Quote:
Originally Posted by Devasting
Посмотреть сообщение
Plagiar, й tambйm criar meu prуprio sistema? se estou pedindo ajuda no meu hs, deve ser por que, que estou criando do 0!
devasting, quando mata alguem de hs, quem explode foi o cara que tomou o tiro estou dizendo agora, porque eu entendi sua duvida, mas se estiver explodindo quem toma HS й sу adicionar uma new (nome que seja, mas representara o id de quem mata) .
new id;
ai na explosao em vez de ser playerid, voce muda para id.
Reply
#10

Quote:
Originally Posted by Devasting
Посмотреть сообщение
Plagiar, й tambйm criar meu prуprio sistema? se estou pedindo ajuda no meu hs, deve ser por que, que estou criando do 0!
Primeiramente que sim, de qualquer forma ou outra й um plбgio pois jб vi em outro servidor, inclusive vocк estб plagiando o nome do criador daquele servidor, segundo, vou te ajudar, postei este cуdigo ontem nos cуdigos ъteis.

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{


    if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9) //weaponid == 34 <- sniper , bodypart == 9 <- cabeзa
    {
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x, y, z);
        CreateExplosion(x, y, z, 12, 10.0);
        SetPlayerHealth(playerid, 0.0);
        GameTextForAll("~n~~n~~n~~n~~n~~n~~B~~H~HEAD ~W~~H~SHOT ~R~~H~BABY !", 5000, 3);
        SendClientMessage(playerid,-1, "{F55454}[INFO]: Vocк acaba de levar 1 HS , {7CF881}NOOB.");
    }


new Float:HP;
    GetPlayerHealth(playerid, HP);
    if(weaponid == 24)  SetPlayerHealth(playerid, HP-51);       //DesertEagle
    if(weaponid == 22)  SetPlayerHealth(playerid, HP-35);       //Colt45
    if(weaponid == 23)  SetPlayerHealth(playerid, HP-30);       //SilencedColt
    if(weaponid == 31)  SetPlayerHealth(playerid, HP-25);       //M4
    if(weaponid == 30)  SetPlayerHealth(playerid, HP-35);       //AK
    if(weaponid == 29)  SetPlayerHealth(playerid, HP-30);       //MP5
    if(weaponid == 34)  SetPlayerHealth(playerid, HP-49);       //SniperRifle
    if(weaponid == 33)  SetPlayerHealth(playerid, HP-50);       //CountryRifle
    if(weaponid == 25)  SetPlayerHealth(playerid, HP-40);       //PumpShotgun
    if(weaponid == 27)  SetPlayerHealth(playerid, HP-25);       //Spaz12
    //SOUND
    if(issuerid != INVALID_PLAYER_ID) PlayerPlaySound(issuerid,17802,0.0,0.0,0.0), PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
    //SOUND
    return 1;

}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)