pickup entrance - 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: pickup entrance (
/showthread.php?tid=535299)
pickup entrance -
Manyula - 02.09.2014
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.
Re: pickup entrance -
JustinAn - 02.09.2014
Have you tried using the
CreatePickup function? If it works, then try updating your streamer plugin & recompile all your script.
Re: pickup entrance -
billy123321 - 02.09.2014
Haven't really looked into the code, but are you using the correct type of pickup? As in the one that doesn't disappear.
Re: pickup entrance -
Manyula - 03.09.2014
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...