SA-MP Forums Archive
zGaming roleplay /hangup - 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 roleplay /hangup (/showthread.php?tid=424825)



zGaming roleplay /hangup - RickDB - 23.03.2013

Hi,

Can someone fix /hangup for zgaming roleplay?

Thanks!


Re: zGaming roleplay /hangup - reckst4r - 23.03.2013

It's very hard to help you when you don't provide anything. You should start by providing us the code & telling us what the problem is


Re: zGaming roleplay /hangup - RickDB - 23.03.2013

Код:
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 nor 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])
	{
	    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;
	}
	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;
}
It doesn't hangup, and the other can hear you on the cellphone.


Re: zGaming roleplay /hangup - RickDB - 24.03.2013

bump


Re: zGaming roleplay /hangup - Denying - 24.03.2013

Show me your /answer or whatnot and OnPlayerText callback.


Re: zGaming roleplay /hangup - RickDB - 24.03.2013

/pickup
Код:
CMD:pickup(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]) return SendClientMessage(playerid, COLOR_GREY, "Nobody is caling you.");
	format(string, sizeof(string), "* %s answers his cellphone.", RPN(playerid));
	SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
	SendClientMessage(playerid, COLOR_ORANGE, " You have picked up the line.");
	SendClientMessage(Caller[playerid], COLOR_ORANGE, " They pickedup the line.");
	Calling[Caller[playerid]] = 2;
	BeingCalled[playerid] = 2;
	SetTimerEx("PhoneCall", 1000, false, "d", Caller[playerid]);
	return 1;
}



Re: zGaming roleplay /hangup - RickDB - 24.03.2013

bump


Re: zGaming roleplay /hangup - RickDB - 25.03.2013

bump


Re: zGaming roleplay /hangup - Denying - 25.03.2013

What seems to be the problem?


Re: zGaming roleplay /hangup - RickDB - 25.03.2013

Quote:
Originally Posted by Denying
Посмотреть сообщение
What seems to be the problem?
The problem is that sometimes the phone is not hanged up. You can still see in chat [CELLHPONE] USER says: