What's wrong with this function? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: What's wrong with this function? (
/showthread.php?tid=143759)
What's wrong with this function? -
sean5874 - 24.04.2010
Hello,
I've made a function to send /me messages simply to that are in your sight. The problem is it doesen't work. The player who types the /me command receive it, but the other players doesent get it. Here's my code:
Код:
// the /me command
if(strcmp("/me", cmd, true) == 0)
{
new str3[128];
format(str3, 128, "%s %s",pname,cmdtext[3]);
SendMeMessage(str3);
return 1;
}
Код:
// the function
public SendMeMessage(const msgstring[])
{
new playerid;
new Float:myX, Float:myY, Float:myZ;
GetPlayerPos(playerid, myX, myY, myZ);
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 7.0, myX, myY, myZ))
{
SendClientMessage(i, 0xEE66EEFF, msgstring);
return 1;
}
}
}
Who can help me to fix this?
Greetz,
Sean5874
Re: What's wrong with this function? -
cloud9 - 24.04.2010
Remove that Return 1; under SendClientMessage.