OnPlayerCommandText :( -
ChristianIvann09 - 24.03.2014
How to do i put an BigEar here?
What is an BigEar? Basically BigEar is an if you are too far from players you can still hear it.. but if you disable it only the "near" person can hear what players saying.
At this code how do i put/format a bigears here:
Код:
sendername = GetPlayerNameEx(playerid);
switch(PlayerInfo[playerid][pAccent])
{
case 0, 1:
{
if(AdminDuty[playerid] == 1)
{
format(string, sizeof(string), "%s says: (( %s )) ", sendername, text);
}
else
{
format(string, sizeof(string), "%s says: %s", sendername, text);
}
ProxDetector(20.0, playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
}
Some BigEars Variables and Formats:
Код:
new BigEar[MAX_PLAYERS];
Код:
CMD:bigears(playerid, params[])
{
if( PlayerInfo[playerid][pAdmin] >= 3) {
if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 5)
return SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
if (!BigEar[playerid]) {
BigEar[playerid] = 1;
SendClientMessageEx(playerid, COLOR_GRAD2, "Your ears have grown to gargantuan proportions!");
}
else if (BigEar[playerid]) {
(BigEar[playerid] = 0);
SendClientMessageEx(playerid, COLOR_GRAD2, "Your ears have shrunk.");
}
}
return 1;
}
THANK YOU VERY MUCH!
I will rep you if you will help me :P
Re: OnPlayerCommandText :( -
Aerotactics - 24.03.2014
https://sampforum.blast.hk/showthread.php?tid=124428
I think this will help, instead of rewriting the process.
Re: OnPlayerCommandText :( -
ChristianIvann09 - 24.03.2014
Quote:
Originally Posted by Aerotactics
|
Its hard to set the BigEars of it
If will type
Код:
If(BigEars)[playerid] == 1)
SendLocalMessage(playerid, COLOR_WHITE, 999999, str);
Then is that mean if you toggle your BigEars then your Message that you send will sent to 99999 Radius?
Is there any solution?
I want:
if i toggle my BigEar then i can hear what players saying if he sends a message even if im far
Re: OnPlayerCommandText :( -
Aerotactics - 24.03.2014
Ok, I think I understand. That's going to require more script.
Try something like:
pawn Код:
public OnPlayerText(playerid) // or whatever
{
for (new i=0;i<MAX_PLAYERS;i++)
{
If(BigEars)[i] == 1)
{
SendClientMessage(...); // replace with message data of course
}
else
{
SendLocalMessage(...);
}
}
return 0; //don't want to send the message twice.
}
I don't know, I'm getting tired.
Re: OnPlayerCommandText :( -
ChristianIvann09 - 24.03.2014
Quote:
Originally Posted by Aerotactics
Ok, I think I understand. That's going to require more script.
Try something like:
pawn Код:
public OnPlayerText(playerid) // or whatever { for (new i=0;i<MAX_PLAYERS;i++) { If(BigEars)[i] == 1) { SendClientMessage(...); // replace with message data of course } else { SendLocalMessage(...); } } return 0; //don't want to send the message twice. }
I don't know, I'm getting tired.
|
Thank you very much mate!!
But what is
Код:
for (new i=0;i<MAX_PLAYERS;i++)
What is the "i" ? what is mean of it?
Re: OnPlayerCommandText :( -
Aerotactics - 24.03.2014
This is a "For" loop, and "i" is simply a variable. We set i = 0, then set how high "i" can go with MAX_PLAYERS, and finally, "i++" means add 1 each time. Together, this checks through each and every playerid.