Two questions about pickups
#1

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.
Reply
#2

bump
Reply
#3

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;
}
Reply
#4

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.
Reply
#5

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.
Reply
#6

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
Reply
#7

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); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)