Ao matar sendmsgclient -
luccagomes15 - 21.11.2013
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
Re: Ao matar sendmsgclient -
DannielCooper - 21.11.2013
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new nomemorto[MAX_PLAYER_NAME];
SendClientMessage(killerid, "Vocк matou %s", nomemorto);
return 1;
}
Re: Ao matar sendmsgclient -
PT - 21.11.2013
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;
}
Re: Ao matar sendmsgclient -
luccagomes15 - 21.11.2013
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
Re: Ao matar sendmsgclient -
Catchorro - 21.11.2013
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
Por
Re: Ao matar sendmsgclient -
PT - 21.11.2013
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;
}
Re: Ao matar sendmsgclient -
maikons - 22.11.2013
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?
Re: Ao matar sendmsgclient -
PT - 22.11.2013
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
Re: Ao matar sendmsgclient -
DannielCooper - 22.11.2013
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...
Re: Ao matar sendmsgclient -
luccagomes15 - 22.11.2013
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);