SA-MP Forums Archive
zgaming phone bug - 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: zgaming phone bug (/showthread.php?tid=417055)



zgaming phone bug - Chris_Morrison - 19.02.2013

Hello.
I really need help on the zgaming mode
First of all when you speak on the phone it's writes it twich
the code
pawn Код:
if(BeingCalled[playerid] == 2 || Calling[playerid] == 2  ||Call444[playerid] || Call911[playerid])
    {
        if(strlen(PlayerInfo[playerid][pAccent])) format(string, sizeof(string), "[Cellphone] %s: [%s Accent] %s", RPN(playerid), PlayerInfo[playerid][pAccent], text);
        else format(string, sizeof(string), "[Cellphone] %s: %s", RPN(playerid), text);
        if(!Call911[playerid])
        {
            if(BeingCalled[playerid] == 2) SendClientMessage(Caller[playerid], COLOR_YELLOW, string);
            else if(Calling[playerid] == 2) SendClientMessage(Called[playerid], COLOR_YELLOW, string);
        }
    }
    if(BeingCalled[playerid] == 2 || Calling[playerid] == 2  || Call444[playerid])
    {
        if(strlen(PlayerInfo[playerid][pAccent])) format(string, sizeof(string), "[Cellphone] %s: [%s Accent] %s", RPN(playerid), PlayerInfo[playerid][pAccent], text);
        else format(string, sizeof(string), "[Cellphone] %s: %s", RPN(playerid), text);
        if(!Call444[playerid])
        {
            if(BeingCalled[playerid] == 2) SendClientMessage(Caller[playerid], COLOR_YELLOW, string);
            else if(Calling[playerid] == 2) SendClientMessage(Called[playerid], COLOR_YELLOW, string);
        }
    }
And the hangup bug, the command works but i can still talk on the phone.
pawn Код:
CMD:hangup(playerid, params[])
{
    new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!PlayerInfo[playerid][pHasCellphone]) return SendClientMessage(playerid, COLOR_GREY, "You don't own a cellphone.");
    if(!BeingCalled[playerid] && !Calling[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on a call nor is anybody calling you.");
    format(string, sizeof(string), "* %s puts their cellphone away.", RPN(playerid));
    SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
    SendClientMessage(playerid, COLOR_ORANGE, " You have hungup the line.");
    if(BeingCalled[playerid]) SendClientMessage(Caller[playerid], COLOR_ORANGE, " They hungup the line.");
    else if(Calling[playerid]) SendClientMessage(Called[playerid], COLOR_ORANGE, " They hungup the line.");
    if(Call911[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You can't hangup on a 911 call.");
    //
    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
    if(Calling[playerid])
    {
        SetPlayerSpecialAction(Called[playerid], SPECIAL_ACTION_STOPUSECELLPHONE);
        format(string, sizeof(string), "[Cellphone] Phonecall lasted for %d seconds, price: $%d", CallTime[playerid], CallTime[playerid]*10/100);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        GiveZaiatMoney(playerid, -(CallTime[playerid]*10/100));
        TaxMoney += (CallTime[playerid]*10/100);
        Calling[playerid] = 0;
        BeingCalled[playerid] = 0;
        Caller[playerid] = -1;
        CallTime[playerid] = 0;
        Called[playerid] = -1;
        Call911[playerid] = 0;
        Call444[playerid] = 0;
    }
    else if(Calling[Caller[playerid]])
    {
        SetPlayerSpecialAction(Called[playerid], SPECIAL_ACTION_STOPUSECELLPHONE);
        format(string, sizeof(string), "[Cellphone] Phonecall lasted for %d seconds, price: $%d", CallTime[Caller[playerid]], CallTime[Caller[playerid]]*10/100);
        SendClientMessage(Caller[playerid], COLOR_YELLOW, string);
        GiveZaiatMoney(Caller[playerid], -(CallTime[Caller[playerid]]*10/100));
        TaxMoney += (CallTime[Caller[playerid]]*10/100);
        Calling[playerid] = 0;
        BeingCalled[playerid] = 0;
        Caller[playerid] = 0;
        CallTime[playerid] = 0;
        Called[playerid] = -1;
        Call911[playerid] = 0;
        Call444[playerid] = 0;
    }
    return 1;
}



Re: zgaming phone bug - Chris_Morrison - 21.02.2013

Please guys


Re: zgaming phone bug - Ayumi - 21.02.2013

Please elaborate on what you mean? "It writes it twich"?


Re: zgaming phone bug - Chris_Morrison - 22.02.2013

fixed


Re: zgaming phone bug - Miruclus - 19.04.2013

Mind sharing the fix? (also having issue with 911 if you have the fix for that as well).


Re: zgaming phone bug - Chris_Morrison - 19.04.2013

Quote:
Originally Posted by Miruclus
Посмотреть сообщение
Mind sharing the fix? (also having issue with 911 if you have the fix for that as well).
Well, i've scripted a new phone system from the beggining


Re: zgaming phone bug - Miruclus - 20.04.2013

Quote:
Originally Posted by Chris_Morrison
Посмотреть сообщение
Well, i've scripted a new phone system from the beggining
Ah. Was it hard to integrate a new system? I'm thinking about making a beeper system instead of a phone system.


Thanks.


Re: zgaming phone bug - Chris_Morrison - 20.04.2013

Quote:
Originally Posted by Miruclus
Посмотреть сообщение
Ah. Was it hard to integrate a new system? I'm thinking about making a beeper system instead of a phone system.


Thanks.
Not that hard