Admin Chat problem
#1

Hello guys,

I have a problem with my script, i have created an admin chat but the message is send to all players,

In OnPlayerText callback

pawn Код:
if(AccInfo[playerid][Admin] >= 1)
                {
                     if(text[0] == '!')
                     {
                          new string[128];
                          GetPlayerName(playerid, string, sizeof(string));
                          format(string, sizeof(string), "[Admin Chat]: %s: %s", string, text[1]);
                          SendClientMessage(playerid, red, string);
                     }
                }
                else
                {
                return 0;
                }
+ 1 rep for helping

(PS: sorry for my bad english )
Reply
#2

PHP код:

if(AccInfo[playerid][Admin] >= 1)
                {
                     if(
text[0] == '!')
                     {
                          new 
string[128];
                          
GetPlayerName(playeridstringsizeof(string));
                          
format(stringsizeof(string), "[Admin Chat]: %s: %s"stringtext[1]);
                          foreach(
Playeri) if(AccInfo[i][Admin] >= 1SendClientMessage(i,red,string);
 
                     }
                }
                else
                {
                return 
0;
                } 
Reply
#3

Thanks that work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)