04.08.2011, 18:56
pawn Код:
#include <a_samp>
#include <ladmin>
forward null(playerid);
new Muted[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp("/lang", cmdtext))
{
if(IsPlayerVipType(playerid,3)) return SendClientMessage(playerid, 0xE60000FF, "ERROR: You can not language mute a player!");
{
new id[MAX_PLAYERS],str[128];
if(!strval(cmdtext)) return SendClientMessage(playerid,0xFF0000FF,"Usage: /lang [ID]");
if(Muted[playerid] == 1) return SendClientMessage(playerid,0xFF0000FF,"Player is already language muted!");
if(!IsPlayerConnected(id[playerid])) return SendClientMessage(playerid,0xFF0000FF,"Player is not Connected");
Muted[playerid] = 1;
format(str,sizeof(str),"You language muted %s, he will get auto unmuted in 3 minutes.",id);
SendClientMessage(playerid,0xFFFF00FF,str);
SetTimerEx("null", 180000, false, "i", playerid);
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s has been muted, he needs to wait 3 minutes to get unmuted or an Admin or VIP Member can unmute him.",name);
SendClientMessageToAll(0xFFFF00FF, string);
}
return 1;
}
if(!strcmp("/unlang", cmdtext))
{
if(IsPlayerVipType(playerid,3)) return SendClientMessage(playerid, 0xE60000FF, "ERROR: You can not language mute a player!");
{
new id[MAX_PLAYERS],str[128];
if(!strval(cmdtext)) return SendClientMessage(playerid,0xFF0000FF,"Usage: /unlang [ID]");
if(Muted[playerid] == 0) return SendClientMessage(playerid,0xFF0000FF,"Player isn't language muted!");
if(!IsPlayerConnected(id[playerid])) return SendClientMessage(playerid,0xFF0000FF,"Player is not Connected");
Muted[playerid] = 0;
format(str,sizeof(str),"You unmuted %s.",id);
SendClientMessage(playerid,0xFFFF00FF,str);
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s has been unmuted.",name);
SendClientMessageToAll(0xFFFF00FF, string);
}
return 1;
}
return 0;
}
public OnPlayerText(playerid, text[])
{
if(Muted[playerid] == 1) return SendClientMessage(playerid,0xFF0000FF,"ERROR: You are language muted and cannot talk.");
return 1;
}
public null(playerid)
{
Muted[playerid] = 0;
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s has been auto unmuted.",name);
SendClientMessageToAll(0xFFFF00FF, string);
return 1;
}