[Ajuda] /kill nao aparece nos frags
#1

dEPOIS QUE ADICIONEI o comando abaixo no meu gm, quando o player usa /kill nao aparece nos frag que ele se matou...
codigo:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    DropWeapons(playerid);
    GivePlayerMoney(killerid, 20000);
    Roubando[playerid] = 0;
    static Matou[MAX_PLAYER_NAME], Morreu[MAX_PLAYER_NAME], sStr[90];
    GetPlayerName(killerid, Matou, sizeof(Matou));
    GetPlayerName(playerid, Morreu, sizeof(Morreu));
    format(sStr, sizeof(sStr), "[NOTНCIAS]: %s[%d] matou o ladrгo %s[%d].", Matou, killerid, Morreu, playerid);
    if(Roubando[playerid] == 1)
    {
        static Ladrao[MAX_PLAYER_NAME], sStrs[100];
        GetPlayerName(playerid, Ladrao, sizeof(Ladrao));
        format(sStrs, sizeof(sStrs), "[NOTНCIAS]: %s[%d] morreu e o roubo ao banco foi cancelado!", Ladrao, playerid);
        SendClientMessageToAll( COR_USOCORRETO, sStrs);
        Roubando[playerid] = 0;
        return 1;
    }
    if(Roubando[killerid] == 1)
    {
        SendClientMessage(playerid, COR_USOCORRETO, "[CB]: Vocк matou o ladrгo!");
        Roubando[killerid] = 0;
        return 1;
    }

    DropWeapons(playerid);
    GivePlayerMoney(killerid, 20000);
    Roubandosubway[playerid] = 0;
    format(sStr, sizeof(sStr), "[NOTНCIAS]: %s[%d] matou o ladrгo %s[%d].", Matou, killerid, Morreu, playerid);
    if(Roubandosubway[playerid] == 1)
    {
        static Ladraosubway[MAX_PLAYER_NAME], sStrs[100];
        GetPlayerName(playerid, Ladraosubway, sizeof(Ladraosubway));
        format(sStrs, sizeof(sStrs), "[NOTНCIAS]: %s[%d] morreu e o roubo a Subway foi cancelado!", Ladraosubway, playerid);
        SendClientMessageToAll( COR_USOCORRETO, sStrs);
        Roubandosubway[playerid] = 0;
        return 1;
    }
    if(Roubandosubway[killerid] == 1)
    {
        SendClientMessage(playerid, COR_USOCORRETO, "[CB]: Vocк matou o ladrгo!");
        Roubandosubway[killerid] = 0;
        return 1;
    }

    DropWeapons(playerid);
    GivePlayerMoney(killerid, 20000);
    Roubandomercado[playerid] = 0;
    format(sStr, sizeof(sStr), "[NOTНCIAS]: %s[%d] matou o ladrгo %s[%d].", Matou, killerid, Morreu, playerid);
    if(Roubandomercado[playerid] == 1)
    {
        static Ladraomercado[MAX_PLAYER_NAME], sStrs[100];
        GetPlayerName(playerid, Ladraomercado, sizeof(Ladraomercado));
        format(sStrs, sizeof(sStrs), "[NOTНCIAS]: %s[%d] morreu e o roubo ao Supermercado foi cancelado!", Ladraomercado, playerid);
        SendClientMessageToAll( COR_USOCORRETO, sStrs);
        Roubandomercado[playerid] = 0;
        return 1;
    }
    if(Roubandomercado[killerid] == 1)
    {
        SendClientMessage(playerid, COR_USOCORRETO, "[CB]: Vocк matou o ladrгo!");
        Roubandomercado[killerid] = 0;
        return 1;
    }
Reply
#2

Quote:
Originally Posted by SeckSeck
Посмотреть сообщение
dEPOIS QUE ADICIONEI o comando abaixo no meu gm, quando o player usa /kill nao aparece nos frag que ele se matou...
codigo:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    DropWeapons(playerid);
    GivePlayerMoney(killerid, 20000);
    Roubando[playerid] = 0;
    static Matou[MAX_PLAYER_NAME], Morreu[MAX_PLAYER_NAME], sStr[90];
    GetPlayerName(killerid, Matou, sizeof(Matou));
    GetPlayerName(playerid, Morreu, sizeof(Morreu));
    format(sStr, sizeof(sStr), "[NOTНCIAS]: %s[%d] matou o ladrгo %s[%d].", Matou, killerid, Morreu, playerid);
    if(Roubando[playerid] == 1)
    {
        static Ladrao[MAX_PLAYER_NAME], sStrs[100];
        GetPlayerName(playerid, Ladrao, sizeof(Ladrao));
        format(sStrs, sizeof(sStrs), "[NOTНCIAS]: %s[%d] morreu e o roubo ao banco foi cancelado!", Ladrao, playerid);
        SendClientMessageToAll( COR_USOCORRETO, sStrs);
        Roubando[playerid] = 0;
        return 1;
    }
    if(Roubando[killerid] == 1)
    {
        SendClientMessage(playerid, COR_USOCORRETO, "[CB]: Vocк matou o ladrгo!");
        Roubando[killerid] = 0;
        return 1;
    }

    DropWeapons(playerid);
    GivePlayerMoney(killerid, 20000);
    Roubandosubway[playerid] = 0;
    format(sStr, sizeof(sStr), "[NOTНCIAS]: %s[%d] matou o ladrгo %s[%d].", Matou, killerid, Morreu, playerid);
    if(Roubandosubway[playerid] == 1)
    {
        static Ladraosubway[MAX_PLAYER_NAME], sStrs[100];
        GetPlayerName(playerid, Ladraosubway, sizeof(Ladraosubway));
        format(sStrs, sizeof(sStrs), "[NOTНCIAS]: %s[%d] morreu e o roubo a Subway foi cancelado!", Ladraosubway, playerid);
        SendClientMessageToAll( COR_USOCORRETO, sStrs);
        Roubandosubway[playerid] = 0;
        return 1;
    }
    if(Roubandosubway[killerid] == 1)
    {
        SendClientMessage(playerid, COR_USOCORRETO, "[CB]: Vocк matou o ladrгo!");
        Roubandosubway[killerid] = 0;
        return 1;
    }

    DropWeapons(playerid);
    GivePlayerMoney(killerid, 20000);
    Roubandomercado[playerid] = 0;
    format(sStr, sizeof(sStr), "[NOTНCIAS]: %s[%d] matou o ladrгo %s[%d].", Matou, killerid, Morreu, playerid);
    if(Roubandomercado[playerid] == 1)
    {
        static Ladraomercado[MAX_PLAYER_NAME], sStrs[100];
        GetPlayerName(playerid, Ladraomercado, sizeof(Ladraomercado));
        format(sStrs, sizeof(sStrs), "[NOTНCIAS]: %s[%d] morreu e o roubo ao Supermercado foi cancelado!", Ladraomercado, playerid);
        SendClientMessageToAll( COR_USOCORRETO, sStrs);
        Roubandomercado[playerid] = 0;
        return 1;
    }
    if(Roubandomercado[killerid] == 1)
    {
        SendClientMessage(playerid, COR_USOCORRETO, "[CB]: Vocк matou o ladrгo!");
        Roubandomercado[killerid] = 0;
        return 1;
    }
Explique melhor.
Reply
#3

Quote:
Originally Posted by TenhoUmaDuvida
Посмотреть сообщение
Explique melhor.
Assim mano, se eu matar voce aparece normal naquele bgl q se apertar f9 ele some... mais se o cara pular de lugar alto e se matar nao aparece O nick do player e o simbolo dele caindo ou o simbolo dele morto sabe...
Reply
#4

Tente assim:
PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    
SendDeathMessage(killeridplayeridreason);
    
DropWeapons(playerid);
    
GivePlayerMoney(killerid20000);
    
Roubando[playerid] = 0;
    static 
Matou[MAX_PLAYER_NAME], Morreu[MAX_PLAYER_NAME], sStr[90];
    
GetPlayerName(killeridMatousizeof(Matou));
    
GetPlayerName(playeridMorreusizeof(Morreu));
    
format(sStrsizeof(sStr), "[NOTНCIAS]: %s[%d] matou o ladrгo %s[%d]."MatoukilleridMorreuplayerid);
    if(
Roubando[playerid] == 1)
    {
        static 
Ladrao[MAX_PLAYER_NAME], sStrs[100];
        
GetPlayerName(playeridLadraosizeof(Ladrao));
        
format(sStrssizeof(sStrs), "[NOTНCIAS]: %s[%d] morreu e o roubo ao banco foi cancelado!"Ladraoplayerid);
        
SendClientMessageToAllCOR_USOCORRETOsStrs);
        
Roubando[playerid] = 0;
        return 
1;
    }
    if(
Roubando[killerid] == 1)
    {
        
SendClientMessage(playeridCOR_USOCORRETO"[CB]: Vocк matou o ladrгo!");
        
Roubando[killerid] = 0;
        return 
1;
    }

    
DropWeapons(playerid);
    
GivePlayerMoney(killerid20000);
    
Roubandosubway[playerid] = 0;
    
format(sStrsizeof(sStr), "[NOTНCIAS]: %s[%d] matou o ladrгo %s[%d]."MatoukilleridMorreuplayerid);
    if(
Roubandosubway[playerid] == 1)
    {
        static 
Ladraosubway[MAX_PLAYER_NAME], sStrs[100];
        
GetPlayerName(playeridLadraosubwaysizeof(Ladraosubway));
        
format(sStrssizeof(sStrs), "[NOTНCIAS]: %s[%d] morreu e o roubo a Subway foi cancelado!"Ladraosubwayplayerid);
        
SendClientMessageToAllCOR_USOCORRETOsStrs);
        
Roubandosubway[playerid] = 0;
        return 
1;
    }
    if(
Roubandosubway[killerid] == 1)
    {
        
SendClientMessage(playeridCOR_USOCORRETO"[CB]: Vocк matou o ladrгo!");
        
Roubandosubway[killerid] = 0;
        return 
1;
    }

    
DropWeapons(playerid);
    
GivePlayerMoney(killerid20000);
    
Roubandomercado[playerid] = 0;
    
format(sStrsizeof(sStr), "[NOTНCIAS]: %s[%d] matou o ladrгo %s[%d]."MatoukilleridMorreuplayerid);
    if(
Roubandomercado[playerid] == 1)
    {
        static 
Ladraomercado[MAX_PLAYER_NAME], sStrs[100];
        
GetPlayerName(playeridLadraomercadosizeof(Ladraomercado));
        
format(sStrssizeof(sStrs), "[NOTНCIAS]: %s[%d] morreu e o roubo ao Supermercado foi cancelado!"Ladraomercadoplayerid);
        
SendClientMessageToAllCOR_USOCORRETOsStrs);
        
Roubandomercado[playerid] = 0;
        return 
1;
    }
    if(
Roubandomercado[killerid] == 1)
    {
        
SendClientMessage(playeridCOR_USOCORRETO"[CB]: Vocк matou o ladrгo!");
        
Roubandomercado[killerid] = 0;
        return 
1;
    } 
Lembrando que falta vocк fechar chave no final do cуdigo.
Reply
#5

vou testar aqui pera !
Reply
#6

Bom mano, agora apareceu e pah, so que quando mata ta aparecendo duas vezes dnv ...
Reply
#7

ALGUEM?
Reply
#8

Vocк denovo cara ? usando gm dos outros ? conexгo brasil nunca vai crescer assim...
pare de falar que criou, pois foi o ferb
Reply
#9

Quote:
Originally Posted by Caiton
Посмотреть сообщение
Vocк denovo cara ? usando gm dos outros ? conexгo brasil nunca vai crescer assim...
pare de falar que criou, pois foi o ferb
Quem falou que criei? sobe o topico e ve la em cima "ADICIONEI"
Reply
#10

Seu OnPlayerDeath nгo funciona por completo quando vocк se mata. Pois quando vocк se mata nгo tem killerid. Й difнcil de explicar pelo celular o motivo disso, mas, a soluзгo й adicionar o cуdigo abaixo quando vocк utilizar ele.

Adicione isso:
pawn Код:
if (killerid != INVALID_PLAYER_ID)
{
     // ...
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)