SA-MP Forums Archive
onplayertext callback - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: onplayertext callback (/showthread.php?tid=650458)



onplayertext callback - wallen - 28.02.2018

PHP код:
    new text[128];
    
format(text, sizeof (text), "%s ( %d ) %s", PlayerName[playerid], playerid, text);
    
SendPlayerMessageToAll(playerid, text); 
Why it still shows me the old nickname? like "Wallen: Wallen ( 2 ) hello"


Re: onplayertext callback - jasperschellekens - 28.02.2018

Quote:
Originally Posted by wallen
Посмотреть сообщение
PHP код:
    new text[128];
    
format(text, sizeof (text), "%s ( %d ) %s", PlayerName[playerid], playerid, text);
    
SendPlayerMessageToAll(playerid, text); 
Why it still shows me the old nickname? like "Wallen: Wallen ( 2 ) hello"
Have you added return 0; below?


Re: onplayertext callback - wallen - 28.02.2018

PHP код:
public OnPlayerText(playerid, text[])
{
    if(
connected[playerid] == true)
    {
        
SendClientMessage(playerid, -1 , "{c3c3c3}(INFO) You can't talk, you need to spawn first...");
        return 
0;
    }
    
    if(
Mute[playerid] == 1) 
    {
        
SendClientMessage(playerid, -1, "{c3c3c3}(INFO) You're muted therefore you can't type anything.");
        return 
0;
    }
    
    new 
text2[128];
    
format(text2, sizeof (text), "%s ( %d ) %s", PlayerName[playerid], playerid, text2);
    
SendPlayerMessageToAll(playerid, text);
    return 
0;
} 
yeah


Re: onplayertext callback - RogueDrifter - 28.02.2018

Quote:
Originally Posted by wallen
Посмотреть сообщение
PHP код:
public OnPlayerText(playerid, text[])
{
    if(
connected[playerid] == true)
    {
        
SendClientMessage(playerid, -1 , "{c3c3c3}(INFO) You can't talk, you need to spawn first...");
        return 
0;
    }
    
    if(
Mute[playerid] == 1) 
    {
        
SendClientMessage(playerid, -1, "{c3c3c3}(INFO) You're muted therefore you can't type anything.");
        return 
0;
    }
    
    new 
text2[128];
    
format(text2, sizeof (text), "%s ( %d ) %s", PlayerName[playerid], playerid, text2);
    
SendPlayerMessageToAll(playerid, text);
    return 
0;
} 
yeah
Show the SendPlayerMessageToAll callback
EDIT: moreover you can just use SendClientMessageToAll :/


Re: onplayertext callback - PepsiCola23 - 28.02.2018

try this

PHP код:
    new text[128]; 
    
format(text, sizeof (text),  "(%d) %s", playerid, text); 
    
SendPlayerMessageToAll(playerid, text); 



Re: onplayertext callback - wallen - 28.02.2018

just solved


Re: onplayertext callback - RogueDrifter - 28.02.2018

Quote:
Originally Posted by wallen
Посмотреть сообщение
just solved
Care to share? lol