[Ajuda] Score ao matar
#4

pawn Код:
new CounterMortes[MAX_PLAYERS]; // Variбvel global

public OnPlayerDeath(playerid, killerid, reason)
{
    new namekillerid[32]; // variбvel para armazenar o nome do assasнno
    new nameplayerid[32]; // variбvel para armazenar o nome do morto
    new string[128]; // variбvel para armazenar a frase
   
    GetPlayerName(playerid, nameplayerid, sizeof(nameplayerid));
    GetPlayerName(playerid, namekillerid, sizeof(namekillerid));
   
    CounterMortes[killerid]++; // Se o jogador matar, aumenta 1 no contador
    CounterMortes[playerid]--; // Se morrer, perde 1
    if(CounterMortes[killerid] == 5) // Quando o contador for 5
    {
        SetPlayerScore(playerid, GetPlayerScore(playerid) +1); // Aumenta 1 no score
    }
   
    format(string, sizeof(string), "O jogador %s matou %s.", namekillerid, nameplayerid); // Frase
    SendClientMessageToAll(-1, string); // Envia a mensagem para todos

    return 1;
}
Reply


Messages In This Thread
Score ao matar - by MorreJaa - 21.08.2013, 10:19
Re: Score ao matar - by Don_Speed - 21.08.2013, 10:22
Re: Score ao matar - by MorreJaa - 21.08.2013, 10:25
Re: Score ao matar - by bruxo00 - 21.08.2013, 10:26
Re: Score ao matar - by MorreJaa - 21.08.2013, 10:28
Re: Score ao matar - by Don_Speed - 21.08.2013, 10:28
Re: Score ao matar - by bruxo00 - 21.08.2013, 10:32
Re: Score ao matar - by JackStenzel - 21.08.2013, 11:10
Re: Score ao matar - by Schocc - 21.08.2013, 11:51
Re: Score ao matar - by JackStenzel - 21.08.2013, 12:06

Forum Jump:


Users browsing this thread: 4 Guest(s)