A RP command only possible in a radius? - 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: A RP command only possible in a radius? (
/showthread.php?tid=259639)
A RP command only possible in a radius? -
justsomeguy - 05.06.2011
Hello i need help with commands like /s(shout).
I need something like /s You are ugly! with this result
0-25 meters: Justsomeguy shouts: You are ugly!
I got an proxdetector wont i be able to use that? if sow how?
Thanks in advance!
Re: A RP command only possible in a radius? -
Calgon - 05.06.2011
pawn Код:
stock MessageToClientsInRadius(playerid, iColor, szString[], Float: fRadius = 5.0) {
if(!IsPlayerConnected(playerid))
return 1;
new
l_iLocation[2],
Float: l_fPosition[3];
GetPlayerPos(playerid, l_fPosition[0], l_fPosition[1], l_fPosition[2]);
l_iLocation[0] = GetPlayerInterior(playerid);
l_iLocation[1] = GetPlayerVirtualWorld(playerid);
foreach(Player, i) {
if(IsPlayerInRangeOfPoint(i, fRadius, l_fPosition[0], l_fPosition[1], l_fPosition[2])) {
if(GetPlayerVirtualWorld(i) == l_iLocation[1] && GetPlayerInterior(i) == l_iLocation[0]) {
SendClientMessage(i, iColor, szString);
}
}
}
return 1;
}
CMD:shout(playerid, params[]) {
if(isnull(params))
return SendClientMessage(playerid, 0, "Syntax: /shout [message]");
MessageToClientsInRadius(playerid, 0, params, 25);
return 1;
}
ProxDetector is slow and outdated.
Try this, I haven't tested it though.
You'll need foreach & zcmd.
Re: A RP command only possible in a radius? -
Famalamalam - 05.06.2011
You don't need old ancient proxdetector.
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
EDIT: Dang, beat me.
Re: A RP command only possible in a radius? -
justsomeguy - 05.06.2011
Thanks! But what do i do if i want like an /b with this usage?:
/b omg your ugly!
((justsomeguy: omg your ugly!))