[HELP] Hang up isn't working - 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: [HELP] Hang up isn't working (
/showthread.php?tid=299513)
[HELP] Hang up isn't working -
LiamM - 26.11.2011
Hey guys! Well yesterday I opened my server to a small amount to make sure everything worked well with more than 1 or 2 people on... everything went well apart from when a player was trying to make a phonecall to someone...
/call worked
They could speak to each other
but for /hangup it didn't really work... if the person who MADE the phonecall hungup.. it would work.. but the person who answered it, it didn't exactly work the way it should of done. If the person called hungup. He would put his phone away but after typing a message the call would still be on between the people... it was left to the person who made the call to fix that bug... I CAN'T fix it! Anyone please help? Thanks
Heres my code, it's no doubt wrong.. but why is the question. Thanks
pawn Код:
COMMAND:hangup(playerid, params[])
{
if(PlayerInfo[playerid][Phone] == 0) return SCM(playerid, COLOR_RED, "You do not have a phone!");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerOnline(i))
{
if(incall[i] == 1 && incall[playerid] == 1)
{
called[i] = 0;
caller[i] = 0;
incall[i] = 0;
called[playerid] = 0;
caller[playerid] = 0;
incall[playerid] = 0;
SendClientMessage(i, COLOR_YELLOW,"The call has ended");
SetPlayerSpecialAction(incall[i], SPECIAL_ACTION_STOPUSECELLPHONE);
return 1;
}
}
}
return 1;
}
Re: [HELP] Hang up isn't working -
Vince - 26.11.2011
First of all, indent your code! Second, I think you need to have the playerid of whom the other player is calling stored somewhere, so use that.
Re: [HELP] Hang up isn't working -
LiamM - 26.11.2011
Quote:
Originally Posted by Vince
First of all, indent your code! Second, I think you need to have the playerid of whom the other player is calling stored somewhere, so use that.
|
I normally do indent my code, this is one of the only CMD's that I haven't done so.