[Pedido] Ao matar sendmsgclient
#1

Gente alguem me ajuda queria fazer estilo um chat kill sу que pra server RPG, pros caras n voltar em combate e tal, ia aparecer lб no chat onde digita, ai toda vez que vc mata alguem ia aparecer uma msg assim: Vocк matou jogador Fulano_Silva

Jб tinha feito um parecido a um tempo atras, mas nenhum funcionou e eu o perdi
Reply
#2

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  new nomemorto[MAX_PLAYER_NAME];
  SendClientMessage(killerid, "Vocк matou %s", nomemorto);
  return 1;
}
Reply
#3

Quote:
Originally Posted by DannielCooper
Посмотреть сообщение
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  new nomemorto[MAX_PLAYER_NAME];
  SendClientMessage(killerid, "Vocк matou %s", nomemorto);
  return 1;
}
falta obter o nome

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new nomemorto[MAX_PLAYER_NAME];
    GetPlayerName(playerid, nomemorto, MAX_PLAYER_NAME);
    SendClientMessage(killerid, "Vocк matou %s", nomemorto);
    return 1;
}
Reply
#4

D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(17274) : error 035: argument type mismatch (argument 2)

SendClientMessage(killerid, "Vocк matou %s", nomemorto);


E o seu antigo assim
pawn Код:
new PT[70],
        killername[MAX_PLAYER_NAME],
        mortonome[MAX_PLAYER_NAME],
        armanome[32];
    GetWeaponName(reason, armanome, sizeof (armanome));
    GetPlayerName(playerid, mortonome, MAX_PLAYER_NAME);
    GetPlayerName(killerid, killername, MAX_PLAYER_NAME);
    format(PT,sizeof(PT), "%s foi morto por %s, com a arma %s", mortonome, killername, armanome);
    SendClientMessageToAll(COLOR_WHITE, PT);
Compilou sem erros, mas no jogo....

Qnd matei o Lucas apareceu isso:

Lucas foi morto por , com a arma
e quando eu morri apareceu
Pedro foi morto por , com a arma

Sу aparece qnd morreu pra fogo no caso molotov, pq com tiro n aparece, ta bugadгo com molotov funcionou, Pedro foi morto por Lucas, com a arma Flamethrower

@PT
Reply
#5

Quote:
Originally Posted by luccagomes15
Посмотреть сообщение
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(17274) : error 035: argument type mismatch (argument 2)

SendClientMessage(killerid, "Vocк matou %s", nomemorto);


E o seu antigo assim
pawn Код:
new PT[70],
        killername[MAX_PLAYER_NAME],
        mortonome[MAX_PLAYER_NAME],
        armanome[32];
    GetWeaponName(reason, armanome, sizeof (armanome));
    GetPlayerName(playerid, mortonome, MAX_PLAYER_NAME);
    GetPlayerName(killerid, killername, MAX_PLAYER_NAME);
    format(PT,sizeof(PT), "%s foi morto por %s, com a arma %s", mortonome, killername, armanome);
    SendClientMessageToAll(COLOR_WHITE, PT);
Compilou sem erros, mas no jogo....

Qnd matei o Lucas apareceu isso:

Lucas foi morto por , com a arma
e quando eu morri apareceu
Pedro foi morto por , com a arma

@PT
Mude o
Quote:

SendClientMessageToAll

Por
Quote:

SendClientMessage

Reply
#6

tenta assim:

pawn Код:
public OnPlayerDeath(playerid,killerid,reason)
{
    if(reason != 0 ||reason != 47 ||reason != 49 ||reason != 50 ||reason != 51 ||reason != 53 || reason != 54)
    {
        new gunname[32], string[64], fName[MAX_PLAYER_NAME], sName[MAX_PLAYER_NAME];
        GetWeaponName(reason,gunname,sizeof(gunname));
        GetPlayerName(playerid,fName,MAX_PLAYER_NAME);
        GetPlayerName(killerid,sName,MAX_PLAYER_NAME);
        format(string, sizeof(string), "%s matou %s com a %s.", sName, fName, gunname);
        SendClientMessageToAll(0xFFFFFFAA,string);
    }
    return 1;
}
quanto ao outro erros coloca:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new nomemorto[MAX_PLAYER_NAME], pt[74];
    GetPlayerName(playerid, nomemorto, MAX_PLAYER_NAME);
    format(pt, sizeof(pt), "Vocк matou %s", nomemorto);
    SendClientMessage(killerid, -1, pt);
    return 1;
}
Reply
#7

pawn Код:
public OnPlayerDeath(playerid,killerid,reason)
{
    if(reason != 0 ||reason != 47 ||reason != 49 ||reason != 50 ||reason != 51 ||reason != 53 || reason != 54)
    {
        new gunname[32], string[64], fName[MAX_PLAYER_NAME], sName[MAX_PLAYER_NAME];
        GetWeaponName(reason,gunname,sizeof(gunname));
        GetPlayerName(playerid,fName,MAX_PLAYER_NAME);
        GetPlayerName(killerid,sName,MAX_PLAYER_NAME);
        format(string, sizeof(string), "%s matou %s com a %s.", sName, fName, gunname);
        SendClientMessageToAll(0xFFFFFFAA,string);
    }
    return 1;
}
PT agora as veZES ta funfando as vezes nгo, a maioria das vezes continua o mesmo bug, mas as vezes sai lб qm matou e a arma certinho, pq isso?
Reply
#8

Quote:
Originally Posted by maikons
Посмотреть сообщение
PT agora as veZES ta funfando as vezes nгo, a maioria das vezes continua o mesmo bug, mas as vezes sai lб qm matou e a arma certinho, pq isso?
pawn Код:
public OnPlayerDeath(playerid,killerid,reason)
{
    switch(reason)
        case 47, 49, 50, 51, 53, 54: return 1;
    new gunname[32], string[64], fName[MAX_PLAYER_NAME], sName[MAX_PLAYER_NAME];
    GetWeaponName(reason,gunname,sizeof(gunname));
    GetPlayerName(playerid,fName,MAX_PLAYER_NAME);
    GetPlayerName(killerid,sName,MAX_PLAYER_NAME);
    format(string, sizeof(string), "%s matou %s com a %s.", sName, fName, gunname);
    SendClientMessageToAll(0xFFFFFFAA,string);
    return 1;
}
tenta
Reply
#9

Quote:
Originally Posted by PT
Посмотреть сообщение
falta obter o nome

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new nomemorto[MAX_PLAYER_NAME];
    GetPlayerName(playerid, nomemorto, MAX_PLAYER_NAME);
    SendClientMessage(killerid, "Vocк matou %s", nomemorto);
    return 1;
}
dб pra funfar...
Reply
#10

Quote:
Originally Posted by PT
Посмотреть сообщение
pawn Код:
public OnPlayerDeath(playerid,killerid,reason)
{
    switch(reason)
        case 47, 49, 50, 51, 53, 54: return 1;
    new gunname[32], string[64], fName[MAX_PLAYER_NAME], sName[MAX_PLAYER_NAME];
    GetWeaponName(reason,gunname,sizeof(gunname));
    GetPlayerName(playerid,fName,MAX_PLAYER_NAME);
    GetPlayerName(killerid,sName,MAX_PLAYER_NAME);
    format(string, sizeof(string), "%s matou %s com a %s.", sName, fName, gunname);
    SendClientMessageToAll(0xFFFFFFAA,string);
    return 1;
}
tenta
D:\Documents and Settings\Administrator\Desktop\RPG\pawno\include\s scanf2.inc(71) : warning 235: public function lacks forward declaration (symbol "OnNPCModeInit")
D:\Documents and Settings\Administrator\Desktop\RPG\pawno\include\s scanf2.inc(307) : warning 219: local variable "string" shadows a variable at a preceding level
D:\Documents and Settings\Administrator\Desktop\RPG\pawno\include\s scanf2.inc(307) : warning 219: local variable "string" shadows a variable at a preceding level
D:\Documents and Settings\Administrator\Desktop\RPG\pawno\include\s scanf2.inc(367) : warning 219: local variable "string" shadows a variable at a preceding level
D:\Documents and Settings\Administrator\Desktop\RPG\pawno\include\s scanf2.inc(367) : warning 219: local variable "string" shadows a variable at a preceding level
D:\Documents and Settings\Administrator\Desktop\RPG\pawno\include\a lss.inc(89) : warning 201: redefinition of constant/macro (symbol "OnGameModeInit")
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(1996) : warning 219: local variable "string" shadows a variable at a preceding level
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(3837) : warning 219: local variable "string" shadows a variable at a preceding level
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(4254) : warning 219: local variable "string" shadows a variable at a preceding level
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(4474) : warning 219: local variable "string" shadows a variable at a preceding level
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(458 : warning 219: local variable "string" shadows a variable at a preceding level
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(13054) : warning 219: local variable "price" shadows a variable at a preceding level
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(13096) : warning 219: local variable "price" shadows a variable at a preceding level
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(1313 : warning 219: local variable "price" shadows a variable at a preceding level
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(13460) : warning 219: local variable "price" shadows a variable at a preceding level
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(15160) : warning 219: local variable "string" shadows a variable at a preceding level
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(1610 : warning 219: local variable "string" shadows a variable at a preceding level
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(16203) : warning 219: local variable "string" shadows a variable at a preceding level
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(1621 : warning 219: local variable "string" shadows a variable at a preceding level
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(16265) : warning 219: local variable "string" shadows a variable at a preceding level
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(16280) : warning 219: local variable "string" shadows a variable at a preceding level
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(16405) : warning 219: local variable "string" shadows a variable at a preceding level
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(16410) : warning 219: local variable "caller" shadows a variable at a preceding level
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(17275) : error 002: only a single statement (or expression) can follow each "case"
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(17275) : error 017: undefined symbol "gunname"
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(17275) : warning 215: expression has no effect
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(17275) : error 001: expected token: ";", but found "]"
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(17275) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInfo[playerid][pMats] = 0;
    PlayerInfo[playerid][pDrogas] = 0;

    switch(reason) {
        case 47, 49, 50, 51, 53, 54: return 1;
    new gunname[32], string[64], fName[MAX_PLAYER_NAME], sName[MAX_PLAYER_NAME];
    GetWeaponName(reason,gunname,sizeof(gunname));
    GetPlayerName(playerid,fName,MAX_PLAYER_NAME);
    GetPlayerName(killerid,sName,MAX_PLAYER_NAME);
    format(string, sizeof(string), "(( %s matou %s com a %s. ))", sName, fName, gunname);
    SendClientMessageToAll(0xFFFFFFAA,string);
    return 1;
}

// morrer pm ser preso
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(17274) : error 001: expected token: "{", but found "case"
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(17275) : error 002: only a single statement (or expression) can follow each "case"
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(17275) : error 017: undefined symbol "gunname"
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(17275) : warning 215: expression has no effect
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(17275) : error 001: expected token: ";", but found "]"
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(17275) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.

pawn Код:
PlayerInfo[playerid][pMats] = 0;
    PlayerInfo[playerid][pDrogas] = 0;

    switch(reason)
        case 47, 49, 50, 51, 53, 54: return 1;
    new gunname[32], string[64], fName[MAX_PLAYER_NAME], sName[MAX_PLAYER_NAME];
    GetWeaponName(reason,gunname,sizeof(gunname));
    GetPlayerName(playerid,fName,MAX_PLAYER_NAME);
    GetPlayerName(killerid,sName,MAX_PLAYER_NAME);
    format(string, sizeof(string), "(( %s matou %s com a %s. ))", sName, fName, gunname);
    SendClientMessageToAll(0xFFFFFFAA,string);
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)