Problema con OnPlayerText -
jwalker - 17.04.2013
Bueno, resulta que yo cuando hablo en el chat normal sale esto:
jwalker: Hola.
jwalker dice: Hola.
El primero es el que viene por defecto en SA-MP, y el segundo el que yo puse en OnPlayerText como todos los RP. El problema es que salen los dos, y yo solo quiero que salga el segundo (el del GM). Acб les dejo el cуdigo:
PHP код:
new chatreal = 1;
Y puse esto en OnPlayerSpawn:
PHP код:
public OnPlayerText(playerid, text[])
{
//ChatLog(playerid, text);
if(chatreal)
{
//Habla de los PJ's
new string[128];
format(string, sizeof(string), "%s dijo: %s", NombrePlayer(playerid), text);
ProxDetector(30.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
}
}
return 1;
}
Respuesta: Problema con OnPlayerText -
OTACON - 17.04.2013
es por el return 1; coloca
return 0;
OnPlayerText
return 0; // ignore the default text and send the custom one
Respuesta: Problema con OnPlayerText -
Host - 17.04.2013
Pon return 0 PAra que devuelva el valor en falso
Edi: bytytus me ganaste ¬¬
PD: Otacon me importa un Culo la -rep
![Cheesy](images/smilies/biggrin.png)
Solo metetela por el culo vale
Respuesta: Problema con OnPlayerText -
Pedro_Acid - 17.04.2013
pawn Код:
public OnPlayerText(playerid, text[])
{
//ChatLog(playerid, text);
if(chatreal)
{
//Habla de los PJ's
new string[128];
format(string, sizeof(string), "%s dijo: %s", NombrePlayer(playerid), text);
ProxDetector(30.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
}
}
return 0;
}
їCierto?
Respuesta: Problema con OnPlayerText -
Host - 17.04.2013
Quote:
Originally Posted by Pedro_Acid
pawn Код:
public OnPlayerText(playerid, text[]) { //ChatLog(playerid, text); if(chatreal) { //Habla de los PJ's new string[128]; format(string, sizeof(string), "%s dijo: %s", NombrePlayer(playerid), text); ProxDetector(30.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5); } } return 0; }
їCierto?
|
pawn Код:
public OnPlayerText(playerid, text[])
{
//ChatLog(playerid, text);
if(chatreal)
{
//Habla de los PJ's
new string[128];
format(string, sizeof(string), "%s dijo: %s", NombrePlayer(playerid), text);
ProxDetector(30.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
}
return 0;
}
Respuesta: Problema con OnPlayerText -
jwalker - 17.04.2013
Me sivio,gracias
Respuesta: Problema con OnPlayerText -
DesingMyCry - 17.04.2013
No es necesario esa variable a menos que quieras hacer que mientras no haya spawneado no pueda hablar.
Respuesta: Problema con OnPlayerText -
JordanR - 17.04.2013
El lo hizo para que cuando este no haya spawneado no podrб hablar, y tienes que retornar a 0, aquн te dejo el cуdigo:
Код:
public OnPlayerText(playerid, text[])
{
if(chatreal)
{
new string[128];
format(string, sizeof(string), "%s dijo: %s", NombrePlayer(playerid), text);
ProxDetector(30.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
}
return 0; // Aquн tiene que estar retornando en 0, de lo contrario no aparecerб el mensaje que escribiste.
}