18.07.2012, 16:17
#includes:
Color:
Stocks:
Command:
pawn Код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
pawn Код:
#define COLOR_PURPLE 0xC2A2DAAA
pawn Код:
stock strreplace(string[], find, replace)
{
for(new i=0; string[i]; i++)
{
if(string[i] == find)
{
string[i] = replace;
}
}
}
stock ProxDetector(Float:radi, playerid, string[],color)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
foreach(Player,i)
{
if(IsPlayerInRangeOfPoint(i,radi,x,y,z))
{
SendClientMessage(i,color,string);
}
}
}
pawn Код:
CMD:me(playerid, params[])
{
new
string[128],
action[100];
if(sscanf(params, "s[100]", action))
{
SendClientMessage(playerid, -1, "USAGE: /me [action]");
return 1;
}
else
{
format(string, sizeof(string), "* %s %s.",(playerid), action);
ProxDetector(30, playerid, string, COLOR_PURPLE);
}
return 1;
}

