Код:
format(msg, sizeof(msg), "[LIVE-NEWS] %s: %s", GetName(playerid), params);
NEWSMSG(COLOR_ORANGE,msg);
Код:
CMD:live(playerid, params[])
{
new string[128], playerb, vehicle = GetPlayerVehicleID(playerid);
if(PlayerInfo[playerid][pFaction] != NEWS) return SCM(playerid, COLOR_GREY,"You are not a news reporter.");
if(!PlayerInCar(playerid)) return NotInNewsCarMSG(playerid);
if(!IsANEWSCar(vehicle)) return SCM(playerid, COLOR_INFO, "You are not in a News vehicle");
if(Live[playerid])
{
foreach(Player, i)
{
if(Live[i] && i != playerid) playerb = i;
}
Live[playerid] = 0;
Live[playerb] = 0;
LiveConference = 0;
SendClientMessage(playerid, COLOR_LIGHTRED, "You have ended the live news conference.");
SendClientMessage(playerb, COLOR_LIGHTRED, "The live news conference has ended.");
}
else
{
if(LiveRequest[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You have already offered someone a live news conference.");
if(LiveConference) return SendClientMessage(playerid, COLOR_GREY, "Another live news conference is already being held.");
if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /live [playerid]");
if(playerb == playerid) return SendClientMessage(playerid, COLOR_GREY, "You can't offer yourself to a live news conference.");
if(LiveBy[playerb] != -1) return SendClientMessage(playerid, COLOR_GREY, "Player has been already offered a live news conference.");
LiveBy[playerb] = playerid;
LiveRequest[playerid] = 1;
format(string, sizeof(string), " You have offered %s a live news conference.", RPN(playerb));
SendClientMessage(playerid, COLOR_LIME, string);
format(string, sizeof(string), " News Reporter %s has offered you a live news conference. (/accept live) (/cancel live)", RPN(playerid));
SendClientMessage(playerb, COLOR_LIME, string);
}
return 1;
}
Код:
if(CompareStrings(option, "live"))
{
new playerb = LiveBy[playerid];
if(playerb == -1) return SendClientMessage(playerid, COLOR_GREY, "Nobody has offered you a live news conference.");
LiveBy[playerid] = -1;
LiveRequest[playerb] = 0;
Live[playerid] = 1;
Live[playerb] = 1;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are now on air, you can speak on live news using your normal chat.");
SendClientMessage(playerb, COLOR_LIGHTBLUE, "You are now on air, you can speak on live news using your normal chat. (/live to end the conference)");
return 1;
}