Plss help Near by msg +REP
#6

Try this. Also get sscanf from the link inside of the code.
What this code basically does is checks if the player is connected, if the player is in range of the other player, etc.
pawn Код:
#include <a_samp>
//Included In Main Server Includes
#include <sscanf>
//https://sampforum.blast.hk/showthread.php?tid=120356 - sscanf



public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/me", cmdtext, true, 3) == 0)
    {
        new chat[256],str1[128],Float:X,Float:Y,Float:Z,playername[MAX_PLAYER_NAME];
        if(sscanf(cmdtext, "s[128]", chat)) return SendClientMessage(playerid, -1, "USAGE: /me [text]");
        else
        {
            GetPlayerPos(playerid,X,Y,Z);
            GetPlayerName(playerid,playername,sizeof(playername));
            format(str1,sizeof(str1),"%s (%d): %s",playername,playerid,chat);
            for(new i; i<MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(IsPlayerInRangeOfPoint(i,15,X,Y,Z))
                    {
                        SendClientMessage(i,-1,str1);
                    }
                }
            }
        }
        return 1;
    }
    return 0;
}
Reply


Messages In This Thread
Plss help Near by msg +REP - by C0olp1x - 13.11.2014, 08:07
Re: Plss help Near by msg +REP - by LaPiMoNsTeR - 13.11.2014, 08:15
Re: Plss help Near by msg +REP - by C0olp1x - 13.11.2014, 08:18
Re: Plss help Near by msg +REP - by LaPiMoNsTeR - 13.11.2014, 08:30
Re: Plss help Near by msg +REP - by C0olp1x - 13.11.2014, 08:32
Re: Plss help Near by msg +REP - by Banana_Ghost - 13.11.2014, 08:40
Re: Plss help Near by msg +REP - by LaPiMoNsTeR - 13.11.2014, 08:45

Forum Jump:


Users browsing this thread: 1 Guest(s)