How to use custom functions inside custom functions.
#6

Quote:
Originally Posted by Stinged
View Post
They don't look like they have mistakes in them, but try these:
pawn Code:
SendLocalClientMessage(playerid, Float:range, color, str[])
{
    if (IsPlayerConnected(playerid))
    {
        new Float:ppos[3];
        GetPlayerPos(playerid, ppos[0], ppos[1], ppos[2]);
        foreach(Player, i)
        {
            if(IsPlayerInRangeOfPoint(i, range, ppos[0], ppos[1], ppos[2]))
            {
                SendClientMessage(i, color, str);
            }
        }
        return 1;
    }
    return 0;
}

SendClientMeMessage(playerid, astr[])
{
    if (IsPlayerConnected(playerid))
    {
        new name[MAX_PLAYER_NAME], string[144];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "* %s %s", name, astr);
        SendLocalClientMessage(playerid, 30.0, COLOR_RP, string);
        return 1;
    }
    return 0;
}
EDIT: The post above me only added a SendClientMessage, which would cause two messages for the playerid.
Nah, this ain't working.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)