Problem with OnPlayerText
#1

Hello.

I've got a problem with my onplayertext, when someone types in something without any / as for a cmd

It would just result in it being local chat, but for some reason it just returns a blank line, abit like a clearchat cmd but only one line.

This is my onplayertext

pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[128];
    if(sscanf(text, "s[128]", text)) return
    format(string, sizeof(string), "%s: %s", RPN(playerid), text);
    SendNearbyMessage(playerid, 15, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    return 0;
}
Reply
#2

pawn Код:
public OnPlayerText(playerid, text[])
{
new string[128];
 format(string, sizeof(string), "%s: %s", RPN(playerid), text);
SendNearbyMessage(playerid, 15, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
 return 0;
}
Check with this code.
Reply
#3

@redcrossER,thank you so much it worked!

@******, Uhm.. What do you mean by your first point? and it was the sscanf line that caused the problem as it seems >_>
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)