SA-MP Forums Archive
OnPlayerPickUpPickup wants to Pickup every 5 seconds :S - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OnPlayerPickUpPickup wants to Pickup every 5 seconds :S (/showthread.php?tid=66812)



OnPlayerPickUpPickup wants to Pickup every 5 seconds :S - DarkSnow - 24.02.2009

Hy Guys,
i have a problem when i enter the pickup from my housesystem it opens a menu. Now the menu all 5 seconds refresh because OnPlayerPickUpPickup sends every 5 seconds the message ShowMenuForPlayer...

Here the code:

Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
  if(GetHouseID(playerid) != -255)
  {
     TogglePlayerControllable(playerid, 0);
	ShowMenuForPlayer(EnterHousePickup, playerid);
	return 1;
  }
  return 1;
}



Re: OnPlayerPickUpPickup wants to Pickup every 5 seconds :S - [RP]Rav - 24.02.2009

do something like

pawn Code:
if (GetPlayerMenu(playerid) != EnterHousePickup)
  {
    TogglePlayerControllable(playerid, 0);
    ShowMenuForPlayer(EnterHousePickup, playerid);
    return 1;
  }



Re: OnPlayerPickUpPickup wants to Pickup every 5 seconds :S - DarkSnow - 24.02.2009

i dont understand but i need the

if(GetHouseID(playerid) != -255)
{




Re: OnPlayerPickUpPickup wants to Pickup every 5 seconds :S - [RP]Rav - 24.02.2009

pawn Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
  if(GetHouseID(playerid) != -255)
  {
    if (GetPlayerMenu(playerid) != EnterHousePickup)
    {
      TogglePlayerControllable(playerid, 0);
      ShowMenuForPlayer(EnterHousePickup, playerid);
      return 1;
    }
  }
  return 1;
}
and please learn the basics of scripting, or at least try to figure out what I'm telling you in my first post..


Re: OnPlayerPickUpPickup wants to Pickup every 5 seconds :S - DarkSnow - 24.02.2009

k thankx for your really fast help


Re: OnPlayerPickUpPickup wants to Pickup every 5 seconds :S - DarkSnow - 24.02.2009

tested but it doesnt work the menu now refresh all 5 seconds like before :S

HELP"!!!


Re: OnPlayerPickUpPickup wants to Pickup every 5 seconds :S - beckzy - 24.02.2009

http://forum.sa-mp.com/index.php?topic=82288.0


Re: OnPlayerPickUpPickup wants to Pickup every 5 seconds :S - ғαιιοцт - 24.02.2009

use checkpoints or playertopoint for this, no other option since there is no OnPlayerLeavePickup


Re: OnPlayerPickUpPickup wants to Pickup every 5 seconds :S - Norn - 24.02.2009

pawn Code:
//top of script
new HMenuStarted[MAX_PLAYERS];
//OnPlayerConnect
HMenuStarted[playerid] = 0;

public OnPlayerPickUpPickup(playerid, pickupid)
{
  if(GetHouseID(playerid) != -255)
  {
    if(HMenuStarted[playerid] == 0)
    {
        TogglePlayerControllable(playerid, 0);
        ShowMenuForPlayer(EnterHousePickup, playerid);
        HMenuStarted[playerid] = 1;
        return 1;
    }
  }
  return 1;
}
Make sure to set HMenuStarted[playerid] to 0 when the player exits the menu.


Re: OnPlayerPickUpPickup wants to Pickup every 5 seconds :S - ғαιιοцт - 25.02.2009

Quote:
Originally Posted by Norn
pawn Code:
//top of script
new HMenuStarted[MAX_PLAYERS];
//OnPlayerConnect
HMenuStarted[playerid] = 0;

public OnPlayerPickUpPickup(playerid, pickupid)
{
  if(GetHouseID(playerid) != -255)
  {
    if(HMenuStarted[playerid] == 0)
    {
        TogglePlayerControllable(playerid, 0);
        ShowMenuForPlayer(EnterHousePickup, playerid);
        HMenuStarted[playerid] = 1;
        return 1;
    }
  }
  return 1;
}
Make sure to set HMenuStarted[playerid] to 0 when the player exits the menu.
he can only enter the menu once now
that's why you'll need a 'OnPlayerLeavePickup', to set HMenuStarted[playerid] to 0 again when he leaves the pickup


Re: OnPlayerPickUpPickup wants to Pickup every 5 seconds :S - [RP]Rav - 25.02.2009

or use OnPlayerExitedMenu


Re: OnPlayerPickUpPickup wants to Pickup every 5 seconds :S - Norn - 25.02.2009

Quote:
Originally Posted by Rav
or use OnPlayerExitedMenu
Like i said, player will have 5 seconds to get the hell off the pickup. Seems like enough time for me.


Re: OnPlayerPickUpPickup wants to Pickup every 5 seconds :S - ғαιιοцт - 25.02.2009

Quote:
Originally Posted by Norn
Quote:
Originally Posted by Rav
or use OnPlayerExitedMenu
Like i said, player will have 5 seconds to get the hell off the pickup. Seems like enough time for me.
that's a good idea, but i fixed it using checkpoints



Re: OnPlayerPickUpPickup wants to Pickup every 5 seconds :S - DarkSnow - 25.02.2009

thx @ all first xD
@Fallout: I love your textdraw's xD
@Norn: THX to fix my problem
@Rav: Thanks to other help^^


Re: OnPlayerPickUpPickup wants to Pickup every 5 seconds :S - ғαιιοцт - 25.02.2009

Quote:
Originally Posted by DarkSnow
thx @ all first xD
@Fallout: I love your textdraw's xD
@Norn: THX to fix my problem
@Rav: Thanks to other help^^
what textdraws?


Re: OnPlayerPickUpPickup wants to Pickup every 5 seconds :S - DarkSnow - 25.02.2009

In Your scripts "Death Cam" "Speedo" xD


Re: OnPlayerPickUpPickup wants to Pickup every 5 seconds :S - ғαιιοцт - 25.02.2009

oh yes thanks