OnRangePointOf Answer + REP - 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: OnRangePointOf Answer + REP (
/showthread.php?tid=597479)
OnRangePointOf Answer + REP -
Rodri99 - 31.12.2015
removed.
Re: OnRangePointOf Answer + REP -
Donboo - 31.12.2015
pawn Код:
foreach(Player, i)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(i, X, Y, Z);
if(IsPlayerInRangeOfPoint(playerid, 5.0, X, Y, Z))
{
// play your sound.
}
}
// Oh, you've removed the question. Too late..
Re: OnRangePointOf Answer + REP -
Rodri99 - 31.12.2015
And how to use this system only for an admin with a specified name like: Rodri and online?
If someone is near an admin with a specified name and not level, the audio starts.
Re: OnRangePointOf Answer + REP -
Donboo - 31.12.2015
Add this code to an one-second timer.
pawn Код:
foreach(Player, i)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(i, X, Y, Z);
if(IsPlayerInRangeOfPoint(playerid, 5.0, X, Y, Z))
{
if(PlayerInfo[i][Admin] > 0)
{
// play your sound for playerid.
}
}
}
- OR -
pawn Код:
foreach(Player, i)
{
new Float:X, Float:Y, Float:Z, playername[12];
GetPlayerName(i, playername, sizeof(playername));
GetPlayerPos(i, X, Y, Z);
if(IsPlayerInRangeOfPoint(playerid, 5.0, X, Y, Z))
{
if(!strcmp(playername, "Rodri99", true))
{
// play your sound for playerid.
}
}
}