[Ajuda] Contador de headShots
#1

Alguйm me ajuda? ta com os seguites bugs:

Nгo tб salvando
Tб marcando pra outro player tambйm
Queria que deixasse em "false" pra nгo dar headshot na arena
Code:

Код:
new ContarHeadShot[MAX_PLAYERS];
new PlayerText:HeadShot[MAX_PLAYERS];
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.");
        ContarHeadShot[issuerid] ++;
    }

    new Float:HP;
    GetPlayerHealth(playerid, HP);
    if(weaponid == 34)  SetPlayerHealth(playerid, HP-49);       //SniperRifle
    //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;

}
public OnPlayerConnect(playerid)
{
    SetTimerEx("VerificarHS", 1000, true, "i", playerid);
    HeadShot[playerid] = CreatePlayerTextDraw(playerid, 40.000000, 329.000000, "  ");
    PlayerTextDrawColor(playerid, HeadShot[playerid], 12582911);
    PlayerTextDrawFont(playerid, HeadShot[playerid], 3);
    PlayerTextDrawBackgroundColor(playerid, HeadShot[playerid], 255);
    PlayerTextDrawSetShadow(playerid, HeadShot[playerid], 1);
    PlayerTextDrawSetOutline(playerid, HeadShot[playerid], 1);
    return 1;
}
public VerificarHS(playerid)
{
    new string[20];
    format(string, sizeof(string), "Headshots: ~w~%i", ContarHeadShot[playerid]);
    PlayerTextDrawSetString(playerid, HeadShot[playerid], string);
}
Reply
#2

Cria uma variavel para cada player, aumente o valor dela a cada vez q um player der headshot e use TextDrawSetString...
Reply
#3

pawn Код:
new HS[MAX_PLAYERS]; // cria a variavel

HS[playerid]++; // a acada hs da add
Reply
#4

Nгo teste, qualquer erro deixa coment ai, com esse code ai vai aparecer uma textdraw em cima do radar informando o numero de headshots..

pawn Код:
new ContarHeadShot[MAX_PLAYERS];
new PlayerText:HeadShot[MAX_PLAYERS];
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.");
        ContarHeadShot[issuerid] ++;
    }

    new Float:HP;
    GetPlayerHealth(playerid, HP);
    if(weaponid == 34)  SetPlayerHealth(playerid, HP-49);       //SniperRifle
    //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;

}
public OnPlayerConnect(playerid)
{
    SetTimerEx("VerificarHS", 1000, true, "i", playerid);
    HeadShot[playerid] = CreatePlayerTextDraw(playerid, 40.000000, 329.000000, "  ");
    PlayerTextDrawColor(playerid, HeadShot[playerid], 12582911);
    PlayerTextDrawFont(playerid, HeadShot[playerid], 3);
    PlayerTextDrawBackgroundColor(playerid, HeadShot[playerid], 255);
    PlayerTextDrawSetShadow(playerid, HeadShot[playerid], 1);
    PlayerTextDrawSetOutline(playerid, HeadShot[playerid], 1);
    return 1;
}
public VerificarHS(playerid)
{
    new string[20];
    format(string, sizeof(string), "Headshots: ~w~%i", ContarHeadShot[playerid]);
    PlayerTextDrawSetString(playerid, HeadShot[playerid], string);
}
Reply
#5

-OFF- Й difнcil o cara saber escrever meu nick certo ? '-'
Reply
#6

KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK malz

Vou testar os code valeu \o/
Reply
#7

zqkRazer me passa um contato seu?
Reply
#8

********:guilherme.igoor.3_1 Skype
Reply
#9

VAAAAAAAAAALEU FUNCIONOU <3333333

1 Pergunta como faзo pra deixar em OFF no 1xWalk ?
Reply
#10

Ele ta meio bugado ta mostrando shots de outra pessoa tipo outra pessoa fez headshot й conta pra mim tambem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)