20.08.2011, 01:40
pawn Код:
dcmd_mute(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
new string[128], giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_SYN, "[Syntax:]{FFFFFF} /mute [playerid]");
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid == playerid)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "You can not use this command on yourself!");
return 1;
}
if(PlayerInfo[giveplayerid][pMuted] == 0)
{
if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin])
{
format(string, sizeof(string), "%s just tried to /mute you.",GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_YELLOW, string);
SendClientMessageEx(playerid, COLOR_WHITE, "You can't perform this action on an equal or higher level administrator.");
return 1;
}
PlayerInfo[giveplayerid][pMuted] = 1;
format(string, sizeof(string), "AdmCmd: %s was silenced by %s.",GetPlayerNameEx(giveplayerid),GetPlayerNameEx(playerid));
ABroadCast(COLOR_LIGHTRED,string,2);
}
else
{
PlayerInfo[giveplayerid][pMuted] = 0;
format(string, sizeof(string), "AdmCmd: %s was unsilenced by %s.",GetPlayerNameEx(giveplayerid),GetPlayerNameEx(playerid));
ABroadCast(COLOR_LIGHTRED,string,2);
}
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
return 1;
}
pawn Код:
dcmd_slap(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >=2)
{
new string[128], giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_SYN, "[Syntax:]{FFFFFF} /slap [playerid]");
new Float:shealth;
new Float:slx, Float:sly, Float:slz;
if(IsPlayerConnected(giveplayerid))
{
GetPlayerHealth(giveplayerid, shealth);
SetPlayerHealth(giveplayerid, shealth-5);
GetPlayerPos(giveplayerid, slx, sly, slz);
SetPlayerPos(giveplayerid, slx, sly, slz+5);
PlayerPlaySound(giveplayerid, 1130, slx, sly, slz+5);
format(string, sizeof(string), "AdmCmd: %s was slapped by %s",GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
ABroadCast(COLOR_LIGHTRED,string,2);
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
return 1;
}