10.08.2011, 23:20
Someone give me the code or teach me how to make a basic /me command that goes with the Chat Radius
CMD:me(playerid, text[]) {
return true;
}
if(isnull(text) {
SendClientMessage(playerid, -1, "Usage: /me [text]");
return true;
}
new
Float: X,
Float: Y,
Float: Z;
GetPlayerPos(playerid, X, Y, Z);
for(new i; i != MAX_PLAYERS; ++i) {
if(IsPlayerInRangeOfPoint(i, 30.0, X, Y, Z)) {
SendPlayerMessageToPlayer(i, playerid, text);
}
}
if(!strcmp(cmdtext, "/me", true, 3))
{
if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [text]");
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "%s %s", str, cmdtext[4]);
SendClientMessageToAll(COLOR_YELLOW, str);
return 1;
}
COMMAND:me(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /me [text]");
{
new string[128], name[24];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s: %s", name, params);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}
return 1;
}
You must have the zcmd include
pawn Code:
|
stock SendLocalChat(playerid,color,msg[],Float:radius)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
for(new ply;ply<MAX_PLAYERS;ply++)
{
if(IsPlayerInRangeOfPoint(ply,radius,x,y,z))SendClientMessage(ply,color,msg);
}
return 1;
}
CMD:me(playerid, params[])
{
if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /me [text]");
new str[128], new PlayerName[24];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(str, sizeof(str), "* %s %s", PlayerName, params);
SendLocalChat(playerid,COLOR_PURPLE,str,30.0);
return 1;
}