I am using zGaming Roleplay Gamemode for my own server but seems that there is a problem with /hangup. When I do /hangup it doesn't hang up at all. You still speak on the phone + you can still press /hangup and it keep saying that you hangup the phone and it doesn't. If can someone check out the Gamemode and find the bug for me please because I tried everything and I still didn't found the issue. Thank you very much.
Код:
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] = 0;
CallTime[playerid] = 1;
Called[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[Called[playerid]] = 0;
BeingCalled[Called[playerid]] = 0;
Caller[Called[playerid]] = 0;
CallTime[Called[playerid]] = -1;
Called[Called[playerid]] = 0;
}
return 1;
}