CMD:mute(playerid,params[])
{
new razlog,vrijeme,ime[MAX_PLAYER_NAME],ime2[MAX_PLAYER_NAME],ID,poruka[128],poruka2[128],poruka3[128];
if(PlayerInfo[playerid][pAdministrator] < 1) return SendClientMessage(playerid, -1,"{F81414}Greska:{FFFFFF} Nemate dozvolu za tu komandu");
if(sscanf(params,"uds",ID,vrijeme,razlog)) return SendClientMessage(playerid, -1,"{FFFFFF}Koristenje:{FFF1AF} /mute (Ime/ID) (Vrijeme) (Razlog)");
if(ID == playerid) return SendClientMessage(playerid,-1,"{F81414}Greska:{FFFFFF} Nemozete muteovati sami sebe");
if(PlayerInfo[ID][pAdministrator]) return SendClientMessage(playerid,-1,"{F81414}Greska:{FFFFFF} Nemozete muteaovati ostale administratore");
else
{
GetPlayerName(ID,ime,sizeof(ime));
format(poruka,sizeof(poruka),"{00C0FF}WG:{FFFFFF} Muteali ste igraca{FFF1AF} %s[%d]{FFFFFF} na vrijeme od {FFF1AF}%d{FFFFFF} sekundi. Razlog: %s",ime,ID,vrijeme,razlog);
SendClientMessage(playerid,-1,poruka);
GetPlayerName(playerid,ime2,sizeof(ime2));
format(poruka2,sizeof(poruka2),"{00C0FF}WG: {FFFFFF}Muteani ste od strane{FFF1AF} %s[%d] na vrijeme od{FFF1AF} %d{FFFFFF} sekundi. Razlog: %s",ime2,playerid,vrijeme,razlog);
SendClientMessage(ID,-1,poruka2);
format(poruka3,sizeof(poruka3),"{C3C3C3}[A-Obavijest]:{FFF1AF} %s[%d]{FFFFFF} je muteovo igraca{FFF1AF} %s[%d].{FFFFFF} Razlog: %s",ime2,playerid,ime,ID,razlog);
SendAdminMessage(-1,poruka3);
{
PlayerInfo[ID][pMute] = vrijeme;
}
}
return 1;
}
CMD:mute(playerid,params[])
{
new razlog,vrijeme,ime[MAX_PLAYER_NAME],ime2[MAX_PLAYER_NAME],ID,poruka[128],poruka2[128],poruka3[128];
if(PlayerInfo[playerid][pAdministrator] < 1) return SendClientMessage(playerid, -1,"{F81414}Error:{FFFFFF} You don't have permissions");
if(sscanf(params,"uds",ID,vrijeme,razlog)) return SendClientMessage(playerid, -1,"{FFFFFF}Syntax:{FFF1AF} /mute (name/ID) (time) (Reason)");
if(ID == playerid) return SendClientMessage(playerid,-1,"{F81414}Error:{FFFFFF} You can't mute yourself");
if(PlayerInfo[ID][pAdministrator]) return SendClientMessage(playerid,-1,"{F81414}Greska:{FFFFFF} You can't mute other administrators");
else
{
GetPlayerName(ID,ime,sizeof(ime));
format(poruka,sizeof(poruka),"{00C0FF}WG:{FFFFFF} You have muted{FFF1AF} %s[%d]{FFFFFF} for the time of {FFF1AF}%d{FFFFFF} seconds. reason: %s",ime,ID,vrijeme,razlog);
SendClientMessage(playerid,-1,poruka);
GetPlayerName(playerid,ime2,sizeof(ime2));
format(poruka2,sizeof(poruka2),"{00C0FF}WG: {FFFFFF}You have been muted by{FFF1AF} %s[%d] for the time of{FFF1AF} %d{FFFFFF} seconds. reason: %s",ime2,playerid,vrijeme,razlog);
SendClientMessage(ID,-1,poruka2);
format(poruka3,sizeof(poruka3),"{C3C3C3}[A-Obavijest]:{FFF1AF} %s[%d]{FFFFFF} has just muted{FFF1AF} %s[%d].{FFFFFF} reason: %s",ime2,playerid,ime,ID,razlog);
SendAdminMessage(-1,poruka3);
{
PlayerInfo[ID][pMute] = vrijeme;
}
}
return 1;
}
CMD:mute(playerid,params[])
{
new razlog,vrijeme,ime[MAX_PLAYER_NAME],ime2[MAX_PLAYER_NAME],ID,poruka[128],poruka2[128],poruka3[128];
if(PlayerInfo[playerid][pAdministrator] < 1) return SendClientMessage(playerid, -1,"{F81414}Error:{FFFFFF} You don't have permissions");
if(sscanf(params,"uds",ID,vrijeme,razlog)) return SendClientMessage(playerid, -1,"{FFFFFF}Syntax:{FFF1AF} /mute (name/ID) (time) (Reason)");
if(ID == playerid) return SendClientMessage(playerid,-1,"{F81414}Error:{FFFFFF} You can't mute yourself");
if(PlayerInfo[ID][pAdministrator]) return SendClientMessage(playerid,-1,"{F81414}Greska:{FFFFFF} You can't mute other administrators");
else
{
GetPlayerName(ID,ime,sizeof(ime));
format(poruka,sizeof(poruka),"{00C0FF}WG:{FFFFFF} You have muted{FFF1AF} %s[%d]{FFFFFF} for the time of {FFF1AF}%d{FFFFFF} seconds. reason: %s",ime,ID,vrijeme,razlog);
SendClientMessage(playerid,-1,poruka);
GetPlayerName(playerid,ime2,sizeof(ime2));
format(poruka2,sizeof(poruka2),"{00C0FF}WG: {FFFFFF}You have been muted by{FFF1AF} %s[%d] for the time of{FFF1AF} %d{FFFFFF} seconds. reason: %s",ime2,playerid,vrijeme,razlog);
SendClientMessage(ID,-1,poruka2);
format(poruka3,sizeof(poruka3),"{C3C3C3}[A-Obavijest]:{FFF1AF} %s[%d]{FFFFFF} has just muted{FFF1AF} %s[%d].{FFFFFF} reason: %s",ime2,playerid,ime,ID,razlog);
SendAdminMessage(-1,poruka3);
PlayerInfo[ ID ][ pMute ] = gettime() + vrijeme;
}
return 1;
}
// ........
public OnPlayerText(playerid, text[])
{
if( PlayerInfo[ID][pMute] > gettime() )
{
// Player is not able to send any messages..
new String[64];
format( String,
sizeof( String ),
"You can not send any messages for %d more seconds.", PlayerInfo[ ID ][ pMute ] - gettime()
);
SendClientMessage( playerid,
-1,
String
);
return 0;
}
}
Hey this is working but when the mute is over i can talk but nothing shows in the chat.
|
public OnPlayerText(playerid, text[])
{
if( PlayerInfo[ID][pMute] > gettime() )
{
// Player is not able to send any messages..
new String[64];
format( String,
sizeof( String ),
"You can not send any messages for %d more seconds.", PlayerInfo[ ID ][ pMute ] - gettime()
);
SendClientMessage( playerid,
-1,
String
);
return 0;
}
return 1; // << - send message to the server
}