SA-MP Forums Archive
Two questions about pickups - 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: Two questions about pickups (/showthread.php?tid=630994)



Two questions about pickups - Pokemon64 - 21.03.2017

Hi
I have two question about pickups.

1.What the different if i make pickup with new test[MAX_PLAYERS]; not new test;

2.Last question why pickups didn't destroyed in interior if i take themes.


Re: Two questions about pickups - Pokemon64 - 22.03.2017

bump


Re: Two questions about pickups - RyderX - 22.03.2017

Answers:

1.There isn't any difference between pickup; and pickup[MAX_PLAYERS];.
2.Just under public OnPlayerPickupPickUp(playerid, pickupid), add this function DestroyPickup(pickup);

For example:

public OnPlayerPickupPickUp(playerid, pickupid)
{
if(pickupid == pickup)
{
SendClientMessage(playerid, -1, "JAJA ITS A PICKUP");
DestroyPickup(pickup);
}
return 1;
}



Re: Two questions about pickups - Pokemon64 - 22.03.2017

Quote:
Originally Posted by RyderX
Посмотреть сообщение
Answers:

1.There isn't any difference between pickup; and pickup[MAX_PLAYERS];.
2.Just under public OnPlayerPickupPickUp(playerid, pickupid), add this function DestroyPickup(pickup);

For example:

public OnPlayerPickupPickUp(playerid, pickupid)
{
if(pickupid == pickup)
{
SendClientMessage(playerid, -1, "JAJA ITS A PICKUP");
DestroyPickup(pickup);
}
return 1;
}
Thats the problem i did that already bat pickup didn't destroyed.


Re: Two questions about pickups - ISmokezU - 22.03.2017

First,

1. If you do that new test[MAX_PLAYERS];, you're creating it per player. if you only did new test; you're creating it globally.

2. https://sampwiki.blast.hk/wiki/DestroyPickup

The Variable you used to create the pickup is the same variable you use to destroy it.


Re: Two questions about pickups - Pokemon64 - 22.03.2017

Quote:
Originally Posted by ISmokezU
Посмотреть сообщение
First,

1. If you do that new test[MAX_PLAYERS];, you're creating it per player. if you only did new test; you're creating it globally.

2. https://sampwiki.blast.hk/wiki/DestroyPickup

The Variable you used to create the pickup is the same variable you use to destroy it.
Is it better make with MAX_PLAYERS or without it? I create and destroy with the same variable bat some times pickup doesn't destroyed. Thats the problem guys. P.S my pickups with MAX_PLAYERS


Re: Two questions about pickups - ISmokezU - 22.03.2017

Well it's your choice, but make it global and if that is the case, that u used MAX_PLAYERS, your destroy pickup should look like this:

PHP код:
DestroyPickup(test[playerid]); 
if it's global then its:
PHP код:
DestroyPickup(test);