Issue with cellphones
#1

Hey guys,

I have an issue with the cellphone script in the Zgaming script. Does anyone have any experience with this script? I believe there's an issue with the hangup function, but after editing and trying I still haven't found any solution.


Here's the script:
http://pastebin.com/5408vTNG

Thanks for any help.


Also: search only contained questions, no answers.
Reply
#2

Bumping*
Reply
#3

48.CMD:call(playerid, params[]) remove that.(Try it)
Reply
#4

Quote:
Originally Posted by Vrag
Посмотреть сообщение
48.CMD:call(playerid, params[]) remove that.(Try it)
That would just remove the command
Reply
#5

What's the issue?
Reply
#6

pawn Код:
CMD:hangup(playerid, params[])
{
    new string[256];
    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 or is anybody calling you.");
    format(string, sizeof(string), "* %s puts his 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] && Calling[Caller[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);
        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(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;
        GiveZaiatMoney(Caller[playerid], -(CallTime[Caller[playerid]]*10/100));
        TaxMoney += (CallTime[Caller[playerid]]*10/100);
        Calling[Called[playerid]] = 0;
        BeingCalled[Called[playerid]] = 0;
        Caller[Called[playerid]] = -1;
        CallTime[Called[playerid]] = 0;
        Called[Called[playerid]] = -1;
    }
/*  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[Called[playerid]] = 0;
        BeingCalled[Called[playerid]] = 0;
        Caller[Called[playerid]] = -1;
        CallTime[Called[playerid]] = 0;
        Called[Called[playerid]] = -1;
    }*/

    return 1;
}
This is what I've used in the past, but, I haven't fully tested it, although, I haven't seen the bug happening or being announced from then.
Reply
#7

Quote:
Originally Posted by BigGroter
Посмотреть сообщение
What's the issue?
Wow holy hell. I forgot to post about the issue...Thank you^^


Well basically the person being called can't hang up and whenever they type, the caller receives the message. The hangup function or something is messed.



Код:
CMD:hangup(playerid, params[])
{
    new string[256];
    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 or is anybody calling you.");
    format(string, sizeof(string), "* %s puts his 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] && Calling[Caller[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);
        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(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;
        GiveZaiatMoney(Caller[playerid], -(CallTime[Caller[playerid]]*10/100));
        TaxMoney += (CallTime[Caller[playerid]]*10/100);
        Calling[Called[playerid]] = 0;
        BeingCalled[Called[playerid]] = 0;
        Caller[Called[playerid]] = -1;
        CallTime[Called[playerid]] = 0;
        Called[Called[playerid]] = -1;
    }
/*  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[Called[playerid]] = 0;
        BeingCalled[Called[playerid]] = 0;
        Caller[Called[playerid]] = -1;
        CallTime[Called[playerid]] = 0;
        Called[Called[playerid]] = -1;
    }*/
    return 1;
}
didn't give any errors, but didn't work either...Thanks anyways
Reply
#8

Bumping for the glory of ...Yeh, just bumping*
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)