Help . :D - 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: Help . :D (
/showthread.php?tid=545008)
Help . :D -
HY - 05.11.2014
How make, when you write something in chat, nobody can't see. They can see if that player, are next to you? Like in a Roleplay Server.
+Rep, ofcourse.
Re: Help . :D -
dusk - 05.11.2014
"Like a Roleplay Server" so why didn't you just find yourself a roleplay script and copy that code from it?
I'm sure this was already answered a million times... Even a tutorial exists for such a thing. You can find it
here
Re: Help . :D -
DavidBilla - 05.11.2014
It's a stock which goes by the name 'ProxDetector'. ****** it and you'll find more than what you needed.
Re: Help . :D -
HY - 05.11.2014
pawn Код:
ProxDetector(Float:radi, playerid, string[], col1, col2, col3, col4, col5)
{
new Float:pPositionX[3], Float:oPositionX[3];
GetPlayerPos(playerid, pPositionX[0], pPositionX[1], pPositionX[2]);
foreach(Player, i)
{
GetPlayerPos(i, oPositionX[0], oPositionX[1], oPositionX[2]);
if(IsPlayerInRangeOfPoint(i, radi / 16, pPositionX[0], pPositionX[1], pPositionX[2])) { SendClientMessage(i, col1, string); }
else if(IsPlayerInRangeOfPoint(i, radi / 8, pPositionX[0], pPositionX[1], pPositionX[2])) { SendClientMessage(i, col2, string); }
else if(IsPlayerInRangeOfPoint(i, radi / 4, pPositionX[0], pPositionX[1], pPositionX[2])) { SendClientMessage(i, col3, string); }
else if(IsPlayerInRangeOfPoint(i, radi / 2, pPositionX[0], pPositionX[1], pPositionX[2])) { SendClientMessage(i, col4, string); }
else if(IsPlayerInRangeOfPoint(i, radi, pPositionX[0], pPositionX[1], pPositionX[2])) { SendClientMessage(i, col5, string); }
}
return 1;
}
pawn Код:
C:\Users\USER\Desktop\Programe\TestServer\pawno\include\sscanf.inc(171) : error 017: undefined symbol "foreach"
C:\Users\USER\Desktop\Programe\TestServer\pawno\include\sscanf.inc(173) : error 017: undefined symbol "playerid"
C:\Users\USER\Desktop\Programe\TestServer\pawno\include\sscanf.inc(176) : error 017: undefined symbol "playerid"
C:\Users\USER\Desktop\LS-VR Tradus Romana\filterscripts\AdminSystem.pwn(2046) : warning 203: symbol is never used: "ProxDetector"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.
Ignore foreach.
Re: Help . :D -
Beckett - 05.11.2014
pawn Код:
stock ProxDetector(Float:radi, playerid, string[],color)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
foreach(Player,i)
{
if(IsPlayerInRangeOfPoint(i,radi,x,y,z))
{
MSG(i,color,string);
}
}
}
Give this one a go.