SA-MP Forums Archive
Problema con OnPlayerText - 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: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Problema con OnPlayerText (/showthread.php?tid=431310)



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 код:
chatreal 1
PHP код:
public OnPlayerText(playeridtext[])
{
        
//ChatLog(playerid, text);
        
if(chatreal)
        {
        
//Habla de los PJ's
        
new string[128];
        
format(stringsizeof(string), "%s dijo: %s"NombrePlayer(playerid), text);
          
ProxDetector(30.0playeridstring,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 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.
}