zgaming phone bug
#1

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;
}
Reply
#2

Please guys
Reply
#3

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

fixed
Reply
#5

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

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
Reply
#7

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.
Reply
#8

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)