26.07.2011, 10:30
Example code:
I think you can figure the rest yourself. You haven't provided any code, therefore we can't help you.
pawn Код:
new muted[ MAX_PLAYERS ];
CMD:mutemeforaminute( playerid, params[ ] ) {
SetTimerEx( "unmute", 60000, 0, "i", playerid );
muted[ playerid ] = 1;
return SendClientMessage( playerid, -1, "You have muted yourself for a minute. " );
}
public OnPlayerText( playerid, text[ ] ) {
if( muted[ playerid ] == 1 ) {
SendClientMessage( playerid, -1, "Can't talk while muted! " );
return 0;
}
return 1;
}
forward unmute( playerid );
public unmute( playerid ) {
SendClientMessage( playerid, -1, "A minute has passed, you have been unmuted. " );
muted[ playerid ] = 0;
return 1;
}
public OnPlayerDisconnect( playerid, reason ) {
muted[ playerid ] = 0;
return 1;
}