Command issue
#4

This looks better?
foreach, zcmd and sscanf
pawn Код:
stock ProxDetector(Float:radi, playerid, string[], color)
{
    new Float:posx, Float:posy, Float:posz;
    GetPlayerPos(playerid, posx, posy, posz);
    foreach (Player, i)
    {
        if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
        {
            if(IsPlayerInRangeOfPoint(i,radi,posx, posy, posz))
            {
                SendClientMessage(i, color, string);
            }
        }
    }
}
stock SendDoingMessage(playerid, doing[])
{
    new Float: emoteX, Float: emoteY, Float: emoteZ, playerName[MAX_PLAYER_NAME], msg[128];
    GetPlayerPos(playerid, emoteX, emoteY, emoteZ);
    GetPlayerName(playerid, playerName, sizeof(playerName));
   
    format(msg, sizeof(msg), "* %s %s", playerName, doing);
    ProxDetector(30.0, playerid, msg, COLOR_PURPLE);
    return 1;
}

CMD:me(playerid, params[])
{
    new result[128];
    if(sscanf(params, "s[128]", result)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /me [text]");
    return SendDoingMessage(playerid, result);
}
Reply


Messages In This Thread
Command issue - by Scriptissue - 28.09.2010, 11:57
Re: Command issue - by Voldemort - 28.09.2010, 12:02
Re: Command issue - by DarkPower - 28.09.2010, 12:11
Re: Command issue - by mmrk - 28.09.2010, 12:16
Re: Command issue - by Scriptissue - 28.09.2010, 13:17
Re: Command issue - by <Weponz> - 28.09.2010, 13:42
Re: Command issue - by Scriptissue - 28.09.2010, 15:39
Re: Command issue - by Scenario - 28.09.2010, 16:01
Re: Command issue - by Scriptissue - 29.09.2010, 07:35
Re: Command issue - by samgreen - 29.09.2010, 07:42

Forum Jump:


Users browsing this thread: 2 Guest(s)