22.09.2012, 10:29
I am making admin and vip chat. Everything seems perfect but I don't know but they are bugged. What actually happens is -
For example, If I do -
Here is my code -
I can't figure out the problem.
For example, If I do -
Код:
#AdminChatTest // So the text "AdminChatTest" should be send to all admins and not to the main chat. // But When I type any text with # it is send to both the admin chat and the main chat.
pawn Код:
public OnPlayerText(playerid, text[])
{
if ( Muted [ playerid ] == 1 )
{
format ( SStr , 128 , "You've been muted from the chat" ) ;
SendClientMessage ( playerid , -1 , SStr ) ;
return 0 ;
}
if ( ( text [ 0 ] == '*' ) && PlayerData [ playerid ] [ VIPLvl ] >= 1 && strlen(text) > 1 )
{
format ( SStr , sizeof ( SStr ) , "|ChatVip| %s(%d): %s" , pName ( playerid ) , playerid , text [ 1 ] ) ;
MessageToPlayerVIP ( -1 , SStr ) ;
SaveLog ( "VIPChatLog" , SStr ) ;
return 0 ;
}
if ( ( text [ 0 ] == '#' ) && PlayerData [ playerid ] [ AdmLvl ] >= 1 && strlen(text) > 1 )
{
format ( SStr , sizeof ( SStr ) , "Admin Chat: %s: %s" , pName ( playerid ) , text [ 1 ] ) ;
MessageToAdmins ( green , SStr ) ;
SaveLog ( "AdmChatLog" , SStr ) ;
return 0 ;
}
SaveChatLog ( playerid , "ChatLogs" , text ) ;
return 1 ;
}
![undecided](images/smilies/neutral.gif)