Stock - 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)
+--- Thread: Stock (
/showthread.php?tid=279704)
Stock -
Kingunit - 28.08.2011
Does anyone is having a stock for something like: SendMessageAround or something like that?
I wanna send messages around the player (roleplay) in a radius people need to hear it but other peoples won't.
Re: Stock -
Kaperstone - 28.08.2011
here:(try)
pawn Код:
stock SendClientMessageInRadius(playerid,Float:Radius,Float:X, Float:Y, Float:Z, string[], COLOR)
{
if(IsPlayerInRangeOfPoint(playerid,Radius,X ,Y ,Z))SendClientMessage(playerid,COLOR,string);
return 1;
}
Re: Stock -
Cameltoe - 28.08.2011
Quote:
Originally Posted by xkirill
here  try)
pawn Код:
stock SendClientMessageInRadius(playerid,Float:Radius,Float:X, Float:Y, Float:Z, string[], COLOR) { if(IsPlayerInRangeOfPoint(playerid,Radius,X ,Y ,Z))SendClientMessage(playerid,COLOR,string); return 1; }
|
You have to loop it as-well so every player around receives the message and not only "playerid".
pawn Код:
stock SendClientMessageInRadius(playerid,Float:Radius,Float:X, Float:Y, Float:Z, string[], COLOR)
{
for(new i; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i,Radius,X ,Y ,Z))
{
SendClientMessage(i,COLOR,string);
}
}
return 1;
}
Re: Stock -
Kingunit - 28.08.2011
Both thanks. I will test it when I have my buddy online. I will keep this updated.