SA-MP Forums Archive
Problem with OnPlayerText - 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: Problem with OnPlayerText (/showthread.php?tid=404259)



Problem with OnPlayerText - Oscii - 02.01.2013

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;
}



Re: Problem with OnPlayerText - RedCrossER - 02.01.2013

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.


Re: Problem with OnPlayerText - Oscii - 02.01.2013

@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 >_>