08.09.2012, 13:29
How can i make a /moviestyle command, that the top and bottom black bars come and it looks like a movie? And a /mute and /unmute Command, i had so a Command, but it was bugged.
new muted[MAX_PLAYERS];
CMD:mute(playerid, params[])
{
if(sscanf(params,"u")) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /mute [userid]
Muted[params] = 1;
return 1;
}
CMD:unmute(playerid, params[])
{
if(sscanf(params,"u")) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /mute [userid]
Muted[params] = 1;
return 1;
}
OnPlayerText(playerid, text[])
{
if(Muted[playerid] == 1) { return 0; }
return 1;
}
new Muted[MAX_PLAYERS];
CMD:mute(playerid,params[])
{
new id, reason[60];
if(pInfo[playerid][AdminVariable] < 2) return SendClientMessage(playerid, 0xFF0000FF, "You Must Be An Administrator To Use This Command!");
//Obviously replace pInfo[playerid][AdminVariable] with your own admin variable, does not have to be 2, change at will.
if(sscanf(params, "us(No Reason)", id, reason)) return SendClientMessage(playerid, 0xFF0000FF, "SYNTAX ERROR: {00FF00}/MUTE {FFFF00}<PlayerID> <Optional: Reason>");
if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000FF, "This Player Is Not Connected.");
if(Muted[id] == 1) return SendClientMessage(playerid, 0xFF0000FF, "This Player Is Already Muted. Use {00FF00}/UNMUTE{FF0000}.");
Muted[id] = 1;
new string[150];
new TargetName[MAX_PLAYER_NAME], AdminName[MAX_PLAYER_NAME];
GetPlayerName(id, TargetName, MAX_PLAYER_NAME);
GetPlayerName(playerid, AdminName, MAX_PLAYER_NAME);
format(string,sizeof(string),"You Have Been Muted By Administrator %s | Reason: %s", AdminName, reason);
SendClientMessage(id, 0xFF0000FF, string);
format(string,sizeof(string),"You Have Muted %s | Reason: %s", TargetName, reason);
SendClientMessage(playerid, 0xFFFF00FF, string);
format(string,sizeof(string),"%s Has Been Muted By Administrator %s | Reason: %s", TargetName, AdminName, reason);
SendClientMessageToAll(0xFF0000FF, string);
return 1;
}
CMD:unmute(playerid,params[])
{
new id;
if(pInfo[playerid][AdminVariable] < 2) return SendClientMessage(playerid, 0xFF0000FF, "You Must Be An Administrator To Use This Command!");
//Same rules apply here as above.
if(sscanf(params, "u", id)) return SendClientMessage(playerid, 0xFF0000FF, "SYNTAX ERROR: {00FF00}/UNMUTE {FFFF00}<PlayerID>");
if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000FF, "This Player Is Not Connected.");
if(Muted[id] == 0) return SendClientMessage(playerid, 0xFF0000FF, "This Player Is Already Unmuted. Use {00FF00}/MUTE{FF0000}.");
Muted[id] = 0;
new string[150];
new TargetName[MAX_PLAYER_NAME], AdminName[MAX_PLAYER_NAME];
GetPlayerName(id, TargetName, MAX_PLAYER_NAME);
GetPlayerName(playerid, AdminName, MAX_PLAYER_NAME);
format(string,sizeof(string),"You Have Been Unmuted By Administrator %s.",AdminName);
SendClientMessage(id, 0xFFFF00FF, string);
format(string,sizeof(string),"You Have Unmuted %s.",TargetName);
SendClientMessage(playerid, 0xFFFF00FF, string);
format(string,sizeof(string),"%s Has Been Unmuted By %s.",TargetName,AdminName);
SendClientMessageToAll(0xFFFF00FF, string);
return 1;
}
public OnPlayerText(playerid, text[])
{
if(Muted[playerid] == 1) return SendClientMessage(playerid, 0xFF0000FF, "You Have Been Muted And Cannot Speak!");
//Code continues...
return 0;
}