SA-MP Forums Archive
[Ajuda] Se matar. - 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: [Ajuda] Se matar. (/showthread.php?tid=350763)



[Ajuda] Se matar. - xPaulistaa - 13.06.2012

Estou com essa funзao em OnPlayerDeath :
pawn Код:
new Nome1[MAX_PLAYER_NAME],string[128],Nome2[MAX_PLAYER_NAME];
GetPlayerName(playerid,Nome1,MAX_PLAYER_NAME);
GetPlayerName(killerid,Nome2,MAX_PLAYER_NAME);
format(string, sizeof(string), "Noob %s levou pipoco de %s ate a morte",Nome1,Nome2);
SendClientMessageToAll(0xFFFFFFAA,string);
Oq eu quero e o seguinte, o codigo ta funзionando normal.
So que quando o jogador se mata(se afoga,pula da ponte) E outros.
A mensagem buga.
COmo faзo para quando ele se matar,apareзe outra msgn?


Re: [Ajuda] Se matar. - Crueliz0n - 13.06.2012

Quote:

COmo faзo para quando ele se matar,apareзe outra msgn?

como assim


Re: [Ajuda] Se matar. - ViniBorn - 13.06.2012

Adiciona isto
pawn Код:
if(killerid == INVALID_PLAYERID)
    //Outra mensagem



Re: [Ajuda] Se matar. - xPaulistaa - 13.06.2012

Quote:
Originally Posted by BlackDonelly
Посмотреть сообщение
como assim
Tipo.. Quando alguem matar ele,apareзe esta mensagem que mandei.
Mas,quando ele se matar(se afogar,pular de pontes,etcs..) Apareзe uma tipo : Xuxa se jogo da ponte
Nao precisa ser do local que e se mato,so apareзe uma mensagem de q ele se matou sozinho '-

@ViniBorn
Olha como ficou :
pawn Код:
// Assim
if(killerid == INVALID_PLAYERID)
{
new Nome1[MAX_PLAYER_NAME],string[128],Nome2[MAX_PLAYER_NAME];
GetPlayerName(playerid,Nome1,MAX_PLAYER_NAME);
GetPlayerName(killerid,Nome2,MAX_PLAYER_NAME);
format(string, sizeof(string), "Noob %s levou pipoco de %s ate a morte",Nome1,Nome2);
SendClientMessageToAll(0xFFFFFFAA,string);
return 1;
}
// Fiz Assim

if(killerid == INVALID_PLAYERID)
{
SendClientMessage(playerid,-1,"    Voce e retardado? Se matou,seu burro.!");
return 1;
}
// ERRO :
undefined symbol "INVALID_PLAYERID"


Re: [Ajuda] Se matar. - F_Cinco - 13.06.2012

Quote:
Originally Posted by xPaulistaa
Посмотреть сообщение
Estou com essa funзao em OnPlayerDeath :
pawn Код:
new Nome1[MAX_PLAYER_NAME],string[128],Nome2[MAX_PLAYER_NAME];
GetPlayerName(playerid,Nome1,MAX_PLAYER_NAME);
GetPlayerName(killerid,Nome2,MAX_PLAYER_NAME);
format(string, sizeof(string), "Noob %s levou pipoco de %s ate a morte",Nome1,Nome2);
SendClientMessageToAll(0xFFFFFFAA,string);
Vocк poderia usar isso como comando, n?
Estб bugando, pq o code estб na callback OnPlayerDeath.


Re: [Ajuda] Se matar. - ViictorDaay- - 13.06.2012

Que eu saiba onplayerdeath ja tem killerid.


Re: [Ajuda] Se matar. - ViniBorn - 13.06.2012

pawn Код:
if(killerid != INVALID_PLAYER_ID)
{
    new Nome1[MAX_PLAYER_NAME],string[80],Nome2[MAX_PLAYER_NAME];
    GetPlayerName(playerid,Nome1,MAX_PLAYER_NAME);
    GetPlayerName(killerid,Nome2,MAX_PLAYER_NAME);
    format(string, sizeof(string), "Noob %s levou pipoco de %s ate a morte",Nome1,Nome2);
    SendClientMessageToAll(0xFFFFFFAA,string);
}
else
    SendClientMessage(playerid,-1,"    Voce e retardado? Se matou,seu burro.!");



Re: [Ajuda] Se matar. - xPaulistaa - 13.06.2012

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
pawn Код:
if(killerid != INVALID_PLAYERID)
{
    new Nome1[MAX_PLAYER_NAME],string[80],Nome2[MAX_PLAYER_NAME];
    GetPlayerName(playerid,Nome1,MAX_PLAYER_NAME);
    GetPlayerName(killerid,Nome2,MAX_PLAYER_NAME);
    format(string, sizeof(string), "Noob %s levou pipoco de %s ate a morte",Nome1,Nome2);
    SendClientMessageToAll(0xFFFFFFAA,string);
}
else
    SendClientMessage(playerid,-1,"    Voce e retardado? Se matou,seu burro.!");
Mesmo erro. :\


Re: [Ajuda] Se matar. - ViictorDaay- - 13.06.2012

pawn Код:
if(giveid != INVALID_PLAYER_ID)
            {
                if(ProxDetectorS(8.0, playerid, giveid))
                {
                    new length = strlen(params);
                    while ((idx < length) && (params[idx] <= ' '))
                        idx++;

                    new offset = idx;
                    new result[64];
                    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                    {
                        result[idx - offset] = params[idx];
                        idx++;
                    }
                    result[idx - offset] = EOS;
                    if(!strlen(result))
{
    new Nome1[MAX_PLAYER_NAME],string[80],Nome2[MAX_PLAYER_NAME];
    GetPlayerName(playerid,Nome1,MAX_PLAYER_NAME);
    GetPlayerName(giveid,Nome2,MAX_PLAYER_NAME);
    format(string, sizeof(string), "Noob %s levou pipoco de %s ate a morte",Nome1,Nome2);
    SendClientMessageToAll(0xFFFFFFAA,string);
}
else
    SendClientMessage(playerid,-1,"    Voce e retardado? Se matou,seu burro.!");
Espero ter ajudado


Re: [Ajuda] Se matar. - F_Cinco - 13.06.2012

Quote:
Originally Posted by xPaulistaa
Посмотреть сообщение
Mesmo erro. :\
pawn Код:
if(strcmp(cmdtext,"/kill",true, 5)==0) {
        new Nome1[MAX_PLAYER_NAME],string[80],Nome2[MAX_PLAYER_NAME];
        GetPlayerName(playerid,Nome1,MAX_PLAYER_NAME);
        GetPlayerName(killerid,Nome2,MAX_PLAYER_NAME);
        format(string, sizeof(string), "Noob %s levou pipoco de %s ate a morte",Nome1,Nome2);
        SendClientMessageToAll(0xFFFFFFAA,string);
    }