OnPlayerText question
#8

Then you would use this stock, like so:
pawn Code:
stock localMessage(playerid,  colour, string[], Float: Distance)
{
    new Float:PosFloats[3];
    GetPlayerPos(playerid, PosFloats[0], PosFloats[1], PosFloats[2]);
    foreach(Player, i)
    {
        if(IsPlayerInRangeOfPoint(i, Distance, PosFloats[0], PosFloats[1], PosFloats[2])
        {
            SendClientMessage(i, colour, string);
        }
    }
    return 1;
}
pawn Code:
public OnPlayerText(playerid, text[])
{
    new
        string[128], // 56 cells isn't going to get you very far when the text I/O is 128.
        PlayerName[MAX_PLAYER_NAME];

    GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
    format(string, sizeof(string), "%s says: %s",PlayerName,text);
    localMessage(playerid, 0xFF0000AA, string, 15.0); // Distance you want to send it to
   
    return 1;
}
Excuse me if I missed something, it's 3.19 AM here. Yawn.
Reply


Messages In This Thread
OnPlayerText question - by Pawno_Master - 04.09.2010, 10:15
Re: OnPlayerText question - by iggy1 - 04.09.2010, 10:20
Re: OnPlayerText question - by Pawno_Master - 04.09.2010, 10:28
Re: OnPlayerText question - by iggy1 - 04.09.2010, 10:29
Re: OnPlayerText question - by General Abe - 04.09.2010, 10:30
Re: OnPlayerText question - by iggy1 - 04.09.2010, 10:37
Re: OnPlayerText question - by Pawno_Master - 04.09.2010, 15:33
Re: OnPlayerText question - by General Abe - 04.09.2010, 17:45

Forum Jump:


Users browsing this thread: 1 Guest(s)