[Pedido] Verificar kills
#7

PHP код:
#include <a_samp>
new
    
Team[2],
    
kills_Team[2]
;
public 
OnFilterScriptExit()
{
    for(new 
02n++) {
        
kills_Team[n] = 0;
        
Team[n] = 0;
    }
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    
SetPlayerTeam(playerid0);
    return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
    
SendDeathMessage(killeridplayeridreason);
    new 
str[45];
    if(
GetPlayerTeam(playerid) > && GetPlayerTeam(playerid) != GetPlayerTeam(killerid))
    {
        switch(
GetPlayerTeam(killerid)) {
            case 
1:kills_Team[0]++, format(str45"~b~Time 1 ~w~] ~r~Time 2~n~~b~%i ~w~X ~r~%i"kills_Team[0], kills_Team[1]), GameTextForAll(str10004);
            case 
2:kills_Team[1]++, format(str45"~b~Time 1 ~w~] ~r~Time 2~n~~b~%i ~w~X ~r~%i"kills_Team[0], kills_Team[1]), GameTextForAll(str10004);
        }
    }
    if(
kills_Team[0] > 19 || kills_Team[1] > 19)
    {
        new 
strWin[65];
        
format(strWin65"O Time %i fez 20 assassinatos e venceu a guerra contra o Time %i."GetPlayerTeam(killerid), GetPlayerTeam(playerid));
        
SendClientMessageToAll(-1strWin);
        for(new 
02n++) {
            
kills_Team[n] = 0;
            
Team[n] = 0;
        }
        for(new 
0GetPlayerPoolSize(); <= ji++) {
            if(
GetPlayerTeam(i) == GetPlayerTeam(killerid)) {
                
GivePlayerMoney(i5000);
            }
            
SetPlayerTeam(i0);
        }
    }
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp("/time"cmdtexttrue5) == 0)
    {
        if(
GetPlayerTeam(playerid) > 0) return SendClientMessage(playerid, -1"Vocк jб entrou em um time!");
        if(
Team[1] < Team[0]) {
            
SetPlayerTeam(playerid2), SendClientMessage(playerid, -1"Vocк entrou no time 2!"), Team[1]++;
        }
        else 
SetPlayerTeam(playerid1), SendClientMessage(playerid, -1"Vocк entrou no time 1!"), Team[0]++;
        return 
1;
    }
    return 
0;

Reply


Messages In This Thread
Verificar kills - by cristiannh2 - 05.08.2018, 23:49
Re: Verificar kills - by cristiannh2 - 06.08.2018, 22:28
Re: Verificar kills - by Santso - 06.08.2018, 23:15
Re: Verificar kills - by cristiannh2 - 06.08.2018, 23:52
Re: Verificar kills - by Felipealves - 07.08.2018, 00:14
Re: Verificar kills - by cristiannh2 - 07.08.2018, 00:25
Re: Verificar kills - by InsaneBR - 07.08.2018, 00:32

Forum Jump:


Users browsing this thread: 1 Guest(s)