pawn Код:
/*--Comandos de Rol--*/
CMD:me(playerid, params[])
{
new string[124], nameplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, nameplayer, MAX_PLAYER_NAME);
if(isnull(params)) return SendClientMessage(playerid, Gris,"USA: /me [TEXTO]");
format(string, sizeof(string), "* %s %s", nameplayer, params);
NearMsg(playerid, 0xC2A2DAFF, string, 15.0);
return 1;
}
CMD:b(playerid,params[])
{
new string[124], nameplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, nameplayer, MAX_PLAYER_NAME);
if(isnull(params)) return SendClientMessage(playerid, Gris,"USA: /b [TEXTO OOC]");
format(string, sizeof(string), "(( %s dice: %s ))", nameplayer, params);
NearMsg(playerid, 0xE6E6E6E6, string, 15.0);
return 1;
}
CMD:do(playerid, params[])
{
new string[124], nameplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, nameplayer, MAX_PLAYER_NAME);
if(isnull(params)) return SendClientMessage(playerid, Gris,"USA: /do [TEXTO]");
format(string, sizeof(string), "* %s (( %s ))", params, nameplayer);
NearMsg(playerid, 0x9EC73DAA, string, 15.0);
return 1;
}
zcmd(s, playerid, params[])
{
new string[124], nameplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, nameplayer, MAX_PLAYER_NAME);
if(!isnull(params))
{
format(string, sizeof(string), "%s susurra: %s", nameplayer, params);
NearMsg(playerid, COLOR_WHITE, string, 5.0);
format(string, sizeof(string), "susurro: %s", params);
return SetPlayerChatBubble(playerid,string,-1,5.0,5000);
}
else SendClientMessage(playerid, Gris, "* /s <Texto>");
return 1;
}
zcmd(g, playerid, params[])
{
new string[124], nameplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, nameplayer, MAX_PLAYER_NAME);
if(!isnull(params))
{
format(string, sizeof(string), "%s grita: Ў%s!", nameplayer, params);
NearMsg(playerid, COLOR_WHITE, string, 40.0);
format(string, sizeof(string), "grito: Ў%s!", params);
return SetPlayerChatBubble(playerid,string,-1,60.0,5000);
}
else SendClientMessage(playerid, Gris, "* /g <Texto>");
return 1;
}
Creo que te hace falta una funciуn quй manda un mensaje a ciertos jugadores a una cierta distancia, puedes intentar con esto o de donde tomaste esos comandos buscalo.
pawn Код:
stock NearMsg(playerid, color, string[], Float:distancia)
{
new Float:cord[3];
GetPlayerPos(playerid, cord[0], cord[1], cord[2]);
for(new x = 0; x < MAX_PLAYERS; x++)
{
if(IsPlayerInRangeOfPoint(x, distancia, cord[0], cord[1], cord[2]))
{
SendClientMessage(x, color, string);
}
}
return true;
}
Aca tenes otro mйtodo, estб basado en el "ProxDetector" de ZenonCity:
Код:
forward NearMsg(playerid, color, string[], Float:distancia);
public NearMsg(playerid, color, string[], Float:distancia)
{
if(IsPlayerConnected(playerid))
{
new BigEar[MAX_PLAYERS];
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
{
if(!BigEar[i])
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < distancia/16) && (tempposx > -distancia/16)) && ((tempposy < distancia/16) && (tempposy > -distancia/16)) && ((tempposz < distancia/16) && (tempposz > -distancia/16)))
{
SendClientMessage(i, color, string);
}
else if (((tempposx < distancia/8) && (tempposx > -distancia/8)) && ((tempposy < distancia/8) && (tempposy > -distancia/8)) && ((tempposz < distancia/8) && (tempposz > -distancia/8)))
{
SendClientMessage(i, color, string);
}
else if (((tempposx < distancia/4) && (tempposx > -distancia/4)) && ((tempposy < distancia/4) && (tempposy > -distancia/4)) && ((tempposz < distancia/4) && (tempposz > -distancia/4)))
{
SendClientMessage(i, color, string);
}
else if (((tempposx < distancia/2) && (tempposx > -distancia/2)) && ((tempposy < distancia/2) && (tempposy > -distancia/2)) && ((tempposz < distancia/2) && (tempposz > -distancia/2)))
{
SendClientMessage(i, color, string);
}
else if (((tempposx < distancia) && (tempposx > -distancia)) && ((tempposy < distancia) && (tempposy > -distancia)) && ((tempposz < distancia) && (tempposz > -distancia)))
{
SendClientMessage(i, color, string);
}
}
else
{
SendClientMessage(i, color, string);
}
}
}
}
return 1;
}