SA-MP Forums Archive
[Pedido] ChatKill - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Pedido] ChatKill (/showthread.php?tid=463243)



ChatKill - gmstrikker - 11.09.2013

Queria um chat kill que mostra-se quem matou e quem morreu no chat pro cara que matou e pro que morreu, assim, Lucas_Vieira matou Junior_Luiz

Lucas_Vieira matou Junior_Luiz (desert eagle).

mas sу pra eles dois...


Re: ChatKill - danielcantiliano - 11.09.2013

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
    new Morreu[MAX_PLAYER_NAME], Matou[MAX_PLAYER_NAME], string[115];
    new arma;
    arma = GetPlayerWeapon(playerid);
    GetPlayerName(playerid, Morreu, sizeof(Morreu));
    GetPlayerName(killerid, Matou, sizeof(Matou));
    format(string, sizeof(string), "[ INFO ] %s matou o jogador %s com um(a) %s", Matou, Morreu, arma);
    SendClientMessageToAll(0xE31919FF, string);
    return 1;
}
Nem sei se funciona tenta ai


Re: ChatKill - PT - 11.09.2013

danielcantiliano le o que ele pediu

@ topic

aqui tem

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
   
    new Morreu[MAX_PLAYER_NAME], Matou[MAX_PLAYER_NAME], string[115], arma;
    arma = GetPlayerWeapon(playerid);
    GetPlayerName(playerid, Morreu, sizeof(Morreu));
    GetPlayerName(killerid, Matou, sizeof(Matou));
    format(string, sizeof(string), "[ INFO ] O jogador %s te matou com com um(a) %s", Matou, arma);
    SendClientMessage(playerid, -1, string);
    format(string, sizeof(string), "[ INFO ] Voce matou o jogador %s com um(a) %s", Morreu, arma);
    SendClientMessage(killerid, -1, string);
    return 1;
}



Re: ChatKill - gmstrikker - 11.09.2013

Compilou, mas deu warnings nos strings
pawn Код:
D:\Documents and Settings\PC\Desktop\RPPG\pawno\ULTRA2.pwn(17591) : warning 219: local variable "string" shadows a variable at a preceding level
D:\Documents and Settings\PC\Desktop\RPPG\pawno\ULTRA2.pwn(17604) : warning 219: local variable "string" shadows a variable at a preceding level
D:\Documents and Settings\PC\Desktop\RPPG\pawno\ULTRA2.pwn(17612) : warning 219: local variable "string" shadows a variable at a preceding level
D:\Documents and Settings\PC\Desktop\RPPG\pawno\ULTRA2.pwn(17620) : warning 219: local variable "string" shadows a variable at a preceding level
D:\Documents and Settings\PC\Desktop\RPPG\pawno\ULTRA2.pwn(17628) : warning 219: local variable "string" shadows a variable at a preceding level



Re: ChatKill - Lуs - 11.09.2013

Quote:
Originally Posted by PT
Посмотреть сообщение
danielcantiliano le o que ele pediu

@ topic

aqui tem

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
   
    new Morreu[MAX_PLAYER_NAME], Matou[MAX_PLAYER_NAME], string[115], arma;
    arma = GetPlayerWeapon(playerid);
    GetPlayerName(playerid, Morreu, sizeof(Morreu));
    GetPlayerName(killerid, Matou, sizeof(Matou));
    format(string, sizeof(string), "[ INFO ] O jogador %s te matou com com um(a) %s", Matou, arma);
    SendClientMessage(playerid, -1, string);
    format(string, sizeof(string), "[ INFO ] Voce matou o jogador %s com um(a) %s", Morreu, arma);
    SendClientMessage(killerid, -1, string);
    return 1;
}
GetPlayerWeapon nгo retorna o nome da arma. O certo seria GetWeaponName.

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
   
    new
        playerDied[MAX_PLAYER_NAME],
        playerKiller[MAX_PLAYER_NAME],
        deathMessage[115],
        weapon[32];

    GetPlayerName(playerid, playerDied, sizeof playerDied);
    GetPlayerName(killerid, playerKiller, sizeof playerKiller);
    GetPlayerWeaponName(reason, weapon, 32);

    format(deathMessage, sizeof(deathMessage), "[ INFO ] O jogador %s te matou com com um(a) %s", playerKiller, weapon);
    SendClientMessage(playerid, -1, deathMessage);

    format(deathMessage, sizeof(deathMessage), "[ INFO ] Voce matou o jogador %s com um(a) %s", playerDied, weapon);
    SendClientMessage(killerid, -1, deathMessage);

    return 1;
}



Re: ChatKill - PT - 11.09.2013

Quote:
Originally Posted by Lуs
Посмотреть сообщение
GetPlayerWeapon nгo retorna o nome da arma. O certo seria GetWeaponName.

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
   
    new
        playerDied[MAX_PLAYER_NAME],
        playerKiller[MAX_PLAYER_NAME],
        deathMessage[115],
        weapon[32];

    GetPlayerName(playerid, playerDied, sizeof playerDied);
    GetPlayerName(killerid, playerKiller, sizeof playerKiller);
    GetPlayerWeaponName(reason, weapon, 32);

    format(deathMessage, sizeof(deathMessage), "[ INFO ] O jogador %s te matou com com um(a) %s", playerKiller, weapon);
    SendClientMessage(playerid, -1, deathMessage);

    format(deathMessage, sizeof(deathMessage), "[ INFO ] Voce matou o jogador %s com um(a) %s", playerDied, weapon);
    SendClientMessage(killerid, -1, deathMessage);

    return 1;
}
Eu troco essas 2 funcoes rs, vlw ae Los


Re: ChatKill - gmstrikker - 14.09.2013

error 017: undefined symbol "GetPlayerWeaponName"


Re: ChatKill - Coe1 - 14.09.2013

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
   
    new
        playerDied[MAX_PLAYER_NAME],
        playerKiller[MAX_PLAYER_NAME],
        deathMessage[115],
        weapon[32];

    GetPlayerName(playerid, playerDied, sizeof playerDied);
    GetPlayerName(killerid, playerKiller, sizeof playerKiller);
    GetWeaponName(reason, weapon, 32);

    format(deathMessage, sizeof(deathMessage), "[ INFO ] O jogador %s te matou com com um(a) %s", playerKiller, weapon);
    SendClientMessage(playerid, -1, deathMessage);

    format(deathMessage, sizeof(deathMessage), "[ INFO ] Voce matou o jogador %s com um(a) %s", playerDied, weapon);
    SendClientMessage(killerid, -1, deathMessage);

    return 1;
}