16.09.2011, 17:12
PHP код:
CMD:live(playerid, o[])
{
new giveplayerid;
if(PlayerInfo[playerid][pMember] != 9 || PlayerInfo[playerid][pLeader] != 9) return SendClientMessage(playerid, COLOR_GREY, "You are not News Reporter");
if(PlayerInfo[playerid][pNewsSkill] < 50) return SendClientMessage(playerid, COLOR_GREY, "Your News Reporter Skill is to low to talk Live with people !");
if(sscanf(o,"u", giveplayerid)) return SendClientMessage(playerid, COLOR_GREY,"USAGE: /live [playerid/PartOfName]");
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY," Invalid ID/Name");
if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_GREY, "You cannot Talk Live with yourself!");
if(TalkingLive[playerid] != 255)
{
SendClientMessage(playerid, COLOR_WHITE, "* Live Conversation ended.");
SendClientMessage(TalkingLive[playerid], COLOR_WHITE, "* Live Conversation ended.");
TogglePlayerControllable(playerid, 1);
TogglePlayerControllable(TalkingLive[playerid], 1);
TalkingLive[TalkingLive[playerid]] = 255;
TalkingLive[playerid] = 255;
return 1;
}
if(!ProxDetectorS(5.0, playerid, giveplayerid)) return SendClientMessage(playerid, COLOR_GREY,"You are too far away from that player");
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You offered %s to have a Live Conversation.", giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* %s offered you to have a Live Conversation, type (/accept live) to accept.", sendername);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
LiveOffer[giveplayerid] = playerid;
return 1;
}