SA-MP Forums Archive
Always "Talking Live" - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Always "Talking Live" (/showthread.php?tid=462790)



Always "Talking Live" - Grooty - 08.09.2013

I'm always talking live...



Then when I join SANews and type /live the "Live Conversation Ends".
So pretty much by default all players are talking live, help please!

pawn Код:
CMD:live(playerid, params[]) {
    if(AdminDuty[playerid] == 1 && PlayerInfo[playerid][pAdmin] < 4)
        return SendClientMessage(playerid,COLOR_WHITE, "You can't use this command while on-duty as admin.");

    if(PlayerInfo[playerid][pFaction] == 9 || PlayerInfo[playerid][pLeader] == 9) {
        if(shutdown == 1) return SendClientMessage(playerid, COLOR_WHITE, "The news system is currently shut down." );
        if(TalkingLive[playerid] != INVALID_PLAYER_ID) {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Live conversation ended.");
            SendClientMessage(TalkingLive[playerid], COLOR_LIGHTBLUE, "* Live conversation ended.");
            TogglePlayerControllable(playerid, 1);
            TogglePlayerControllable(TalkingLive[playerid], 1);
            TalkingLive[TalkingLive[playerid]] = INVALID_PLAYER_ID;
            TalkingLive[playerid] = INVALID_PLAYER_ID;
            return 1;
        }

        new string[128], giveplayerid;
        if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /live [player]");

        if (IsPlayerConnected(giveplayerid)) {
            if (ProxDetectorS(5.0, playerid, giveplayerid)) {
                if(PlayerInfo[giveplayerid][pLiveBanned] == 1) return SendClientMessage(playerid, COLOR_GREY, "That player is interview banned.");
                if(PlayerCuffed[giveplayerid] >= 1 || PlayerCuffed[playerid] >= 1) {
                    SendClientMessage(playerid, COLOR_GRAD2, "You are unable to do this right now.");
                } else {
                    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot talk live with yourself!"); return 1; }
                    format(string, sizeof(string), "* You offered %s to have a live conversation.", GetPlayerNameEx(giveplayerid));
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    format(string, sizeof(string), "* %s offered you to have a live conversation, type /accept live to accept.", GetPlayerNameEx(playerid));
                    SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
                    LiveOffer[giveplayerid] = playerid;
                }
            } else return SendClientMessage(playerid, COLOR_GREY, "That player isn't near you.");
        } else return SendClientMessage(playerid, COLOR_GREY, "Invalid player specified.");
    } else SendClientMessage(playerid, COLOR_GREY, "   You are not a News Reporter!");
    return 1;
}
pawn Код:
if(TalkingLive[playerid] != INVALID_PLAYER_ID) {
        if(PlayerInfo[playerid][pFaction] == 9 || PlayerInfo[playerid][pLeader] == 9) {
            format(string, sizeof(string), "Live News Reporter %s: %s", GetPlayerNameEx(playerid), text);
            ICNews(COLOR_LIGHTGREEN,string);
        } else {
            format(string, sizeof(string), "Live Interview Guest %s: %s", GetPlayerNameEx(playerid), text);
            ICNews(COLOR_LIGHTGREEN,string);
        }
        return 0;
    }



Re: Always "Talking Live" - Jstylezzz - 08.09.2013

Try adding this under OnPlayerConnect:
pawn Код:
TalkingLive[playerid] = 0;



Re: Always "Talking Live" - Grooty - 08.09.2013

Quote:
Originally Posted by Jstylezzz
Посмотреть сообщение
Try adding this under OnPlayerConnect:
pawn Код:
TalkingLive[playerid] = 0;
It's not fixed :\
Thanks for replying!


Re: Always "Talking Live" - Luis- - 08.09.2013

Try this;
pawn Код:
TalkingLive[playerid] = INVALID_PLAYER_ID;
On OnPlayerConnect.


Re: Always "Talking Live" - Grooty - 08.09.2013

Quote:
Originally Posted by Luis-
Посмотреть сообщение
Try this;
pawn Код:
TalkingLive[playerid] = INVALID_PLAYER_ID;
On OnPlayerConnect.
Fixed, thanks!!