/bigears? - 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: /bigears? (
/showthread.php?tid=290888)
/bigears? -
Gramercy Riffs - 17.10.2011
Hey everybody, just had a question to ask:
Basically, I'm making a script where if you type in a certain command, you can hear everything around you. I'm not talking about everything on the server, but like... an extra 20/30 radius of OnPlayerText.
Is there a way how to do this? I have the commands and everything set up, I just need the actual function or the actual "thing" to do it.
Thanks!
Re: /bigears? -
AeroBlast - 17.10.2011
pawn Код:
new bool:BigEars[MAX_PLAYERS]; //At the top of your script
//The command
if(strcmp("/bigears",cmdtext,true,8) == 0)
{
if(BigEars[playerid] == false) return BigEars[playerid] = true;
if(BigEars[playerid] == true) return BigEars[playerid] = false;
}
//Under OnPlayerText
new Float:pX,Float:pY,Float:pZ;
GetPlayerPos(playerid,pX,pY,pZ);
format(string,MAX_STRING,"%s: %s",n,text);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(BigEars[i] == true)
{
if(IsPlayerInRangeOfPoint(i,30,pX,pY,pZ))
{
SendClientMessage(i,COLOR_GRAD1,string);
return 0;
}
}
else
{
if(IsPlayerInRangeOfPoint(i,5,pX,pY,pZ))
{
SendClientMessage(i,COLOR_GRAD1,string);
return 0;
}
}
}
}
return 0;
Re: /bigears? -
Gramercy Riffs - 17.10.2011
Ok, two things:
First: Thank you for helping me!
Second: Out of the script you just gave me, which is the actual line that allows you to hear everything? Like, the actual thing which allows you to do it?