Local chat Radius problem.
#1

Hey guys, i've been through a couple of tutorials in here, i did basic RP servers commands such as /b /do me and they would show only to player in approximate place.
But how to do this for normal chat, without a command.
I tried out this by myself.
PHP код:
public OnPlayerText(playeridtext[])
{   
//disablelocal
    
new ptext[100], string[124];
//    sscanf(params, "s[100]", ptext)
//    sscanf(input, "s[100]",ptext);
    
format(string,sizeof(string),"%s says: %s",GetName(playerid),ptext);
    
ProxDetector(30.0,playerid,ptext,WHITE);
    return 
1;

Which doesnt work of course that's what i get


What i need is a way with which i can store text that have been entered from the player through normal chat, in a variable i tried with sccanf but nothing ..
Reply
#2

pawn Код:
format(string,sizeof(string),"%s says: %s",GetName(playerid),text);
    ProxDetector(30.0,playerid,string,WHITE);
return 0;
Reply
#3

That's what i get now ..
Reply
#4

pawn Код:
new string[128];
format(string,sizeof(string),"%s says: %s",GetName(playerid),text);
ProxDetector(30.0, playerid, string, WHITE);
return 0;
That's all you need under OnPlayerText.
If that doesn't work, then your ProxDetector isn't doing it's job
Reply
#5

PHP код:
public OnPlayerText(playeridtext[])
{  
    new 
string[124];
    
format(string,sizeof(string),"%s says: %s",GetName(playerid),text);
    
ProxDetector(30.0,playerid,string,WHITE);
    return 
0;

I'm so dumb, in this callback, what you enter in the chat is saved in the text[] array .. so no need to create a new array ( ptext ) which in any case will be empty ..
Thank you anyway
Reply
#6

No problem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)