[Ajuda] Se matar.
#1

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?
Reply
#2

Quote:

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

como assim
Reply
#3

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

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"
Reply
#5

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.
Reply
#6

Que eu saiba onplayerdeath ja tem killerid.
Reply
#7

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.!");
Reply
#8

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. :\
Reply
#9

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
Reply
#10

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);
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)