pickup entrance
#1

Hello folks,

Код:
new BankEntrance;

//OnGameModeInit()
BankEntrance = CreateDynamicPickup(1559, 1, -1897.6725, 487.1822, 35.1719, 0, -1, -1, 50.0);

//OnPlayerPickUpDynamicPickup(playerid, pickupid)
if(pickupid == BankEntrance)
{
	SetPlayerInterior(playerid, 0);
	SetPlayerPos(playerid, 2315.952880, -1.618174, 26.742187);
}
I can't find any mistake in the given code. I am creating an entrance pickup that ports the player to the interior ID 0. However, when I get back out by using a teleport, the pickup is gone. It doesn't have anything to do with the setting of a wrong interior or virtual world.

Does anybody know how to solve this? This seems to be a streamer issue.
Reply
#2

Have you tried using the CreatePickup function? If it works, then try updating your streamer plugin & recompile all your script.
Reply
#3

Haven't really looked into the code, but are you using the correct type of pickup? As in the one that doesn't disappear.
Reply
#4

Yes, I am using the right pickup ID, namely ID 1. In fact, this code is written under a hooked OnPlayerPickUpDynamicPickup callback. All in all, I have two hooked callbacks of this type of which one works and the other surprisingly doesn't.

The first one being this here, which works perfectly fine...
Код:
public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
	if(pickupid == BF_WEAPON[0] || pickupid == BF_WEAPON[1] || pickupid == BF_WEAPON[2]) GivePlayerWeapon(playerid, GRENADE, 5);
	else if(pickupid == BF_WEAPON[3] || pickupid == BF_WEAPON[4] || pickupid == BF_WEAPON[5] || pickupid == BF_WEAPON[6] || pickupid == BF_WEAPON[7] || pickupid == BF_WEAPON[8] || pickupid == BF_WEAPON[9]) GivePlayerWeapon(playerid, HEAT_SEEKER, 5);
	DestroyDynamicPickup(pickupid);

	for(new i; i < 9; i++) if(pickupid == BF_WEAPON[i]) SetTimerEx("PickupRespawn", 45000, false, "i", i);
	return _OnPlayerPickUpDynamicPickup(playerid, pickupid);
}

forward _OnPlayerPickUpDynamicPickup(playerid, pickupid);
#if defined ALS_OnPlayerPickUpDynamicPickup
    #undef OnPlayerPickUpDynamicPickup
#else
    #define ALS_OnPlayerPickUpDynamicPickup
#endif
#define OnPlayerPickUpDynamicPickup _OnPlayerPickUpDynamicPickup
... and secondly this one, that doesn't work properly...
Код:
public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
	if(pickupid == BankEntrance)
	{
	    SetPlayerInterior(playerid, 0);
		SetPlayerPos(playerid, 2315.952880, -1.618174, 26.742187);
	}
	return BOnPlayerPickUpDynamicPickup(playerid, pickupid);
}

forward BOnPlayerPickUpDynamicPickup(playerid, pickupid);
#if defined ALS_OnPlayerPickUpDynamicPickup
    #undef OnPlayerPickUpDynamicPickup
#else
    #define ALS_OnPlayerPickUpDynamicPickup
#endif
#define OnPlayerPickUpDynamicPickup BOnPlayerPickUpDynamicPickup
-------------------------------------------------------------------------------------------------------------

EDIT: CreatePickup works! I updated the streamer, but it still doesn't work...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)