if(!strcmp(cmdtext, "/b", true, 2)) { if(!cmdtext[2])return SendClientMessage(playerid, COLOR_GREY, "USAGE: /b [OOC CHAT]"); new str[128]; GetPlayerName(playerid,str, sizeof(str)); format(str, sizeof(str), "%s ((%s))", str, cmdtext[2]); SendClientMessageToAll (COLOR_WHITE, str); return 1; }
Hello guys, my /b command show the message global, how i can make it visible only for local chat? here is my current code:
Код:
if(!strcmp(cmdtext, "/b", true, 2)) { if(!cmdtext[2])return SendClientMessage(playerid, COLOR_GREY, "USAGE: /b [OOC CHAT]"); new str[128]; GetPlayerName(playerid,str, sizeof(str)); format(str, sizeof(str), "%s ((%s))", str, cmdtext[2]); SendClientMessageToAll (COLOR_WHITE, str); return 1; } |
if(!strcmp(cmdtext, "/b", true, 2))
{
if(!cmdtext[2])return SendClientMessage(playerid, COLOR_GREY, "USAGE: /b [OOC CHAT]");
new str[128];
GetPlayerName(playerid,str, sizeof(str));
format(str, sizeof(str), "%s ((%s))", str, cmdtext[2]);
ProxDetector(20.0, playerid, str,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY);
return 1;
}
forward ProxDetectorS(Float:radi, playerid, targetid);
public ProxDetectorS(Float:radi, playerid, targetid)
{
if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
{
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);
GetPlayerPos(targetid, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}
stock SendLocalMessage(playerid, color, string[], Float:radius)
{
new Float: X, Y, Z;
GetPlayerPos(playerid, X,Y,Z);
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerInRangeOfPoint(i, radius, X, Y, Z))
SendClientMessage(i,color,string);
return 1;
}
if(!strcmp(cmdtext, "/b", true, 2))
{
if(!cmdtext[2])return SendClientMessage(playerid, COLOR_GREY, "USAGE: /b [OOC CHAT]");
new str[128];
GetPlayerName(playerid,str, sizeof(str));
format(str, sizeof(str), "%s ((%s))", str, cmdtext[2]);
SendLocalMessage(playerid, COLOR_WHITE, str, 30.0);
return 1;
}
stock SendLocalMessage(playerid, color, string[], Float:radius)
{
new Float: X,Float: Y,Float:Z; <<<< You need to add all the Float: to Y and Z not only to X
GetPlayerPos(playerid, X,Y,Z);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, radius, X, Y, Z))
SendClientMessage(i,color,string);
} <<<<<<< You forgot this one
return 1;
}