How to add a /me to a command
#5

You could use a function from the GF script which is the "ProxDetecor" or make a callback that sends the message to all the players around him/her.

Try this:

Код:
forward SlashMe(playerid, string[], Float:x, Float:y, Float:z);

public SlashMe(playerid, string[], Float:x, Float:y, Float:z)
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
	    if(IsPlayerInRangeOfPoint(i, 5.0, x, y, z))
	    {
	        SendClientMessage(i, 0xCE6FD9FF, string);
	    }
	}
}

if(strcmp(cmd, "/tazer", true) == 0)
{
	if(IsPlayerConnected(playerid))
	{
		new pos[3], text[64], playername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, playername, sizeof(playername)
		GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
	    // do something here
	    format(text, sizeof(text), "* %s unholsters their taze.", playername);
	    SlashMe(playerid, text, pos[0], pos[1], pos[2]);
	}
	return 1;
}
I didn't test the code though, hope it works.
Reply


Messages In This Thread
How to add a /me to a command - by BraynBoyj - 20.06.2011, 14:14
Re: How to add a /me to a command - by SpiderWalk - 20.06.2011, 14:32
Re: How to add a /me to a command - by Stigg - 20.06.2011, 14:33
Re: How to add a /me to a command - by Snipa - 20.06.2011, 14:37
Re: How to add a /me to a command - by Alvord - 20.06.2011, 14:43
Re: How to add a /me to a command - by BraynBoyj - 20.06.2011, 15:04
Re: How to add a /me to a command - by BraynBoyj - 20.06.2011, 15:18
Re: How to add a /me to a command - by Mean - 20.06.2011, 15:38
Re: How to add a /me to a command - by BraynBoyj - 20.06.2011, 15:41
Re: How to add a /me to a command - by Alvord - 20.06.2011, 15:43

Forum Jump:


Users browsing this thread: 2 Guest(s)