Originally Posted by Cxnnor
#includes:
pawn Код:
#include <a_samp> #include <zcmd> #include <sscanf2>
Color:
pawn Код:
#define COLOR_PURPLE 0xC2A2DAAA
Stocks:
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); } } }
Command:
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; }
|