/bigears?
#1

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!
Reply
#2

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;
Reply
#3

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)