SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 21/03/2017, 10:42 AM   #1
Pokemon64
Huge Clucker
 
Join Date: Nov 2016
Posts: 213
Reputation: 1
Default Two questions about pickups

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.
Pokemon64 is offline   Reply With Quote
Old 22/03/2017, 04:19 PM   #2
Pokemon64
Huge Clucker
 
Join Date: Nov 2016
Posts: 213
Reputation: 1
Default Re: Two questions about pickups

bump
Pokemon64 is offline   Reply With Quote
Old 22/03/2017, 05:37 PM   #3
RyderX
Banned
 
Join Date: Oct 2016
Location: Lebanon,Beirut Rank: SA-MP Scripter
Posts: 564
Reputation: 53
Default Re: Two questions about pickups

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;
}
RyderX is offline   Reply With Quote
Old 22/03/2017, 09:34 PM   #4
Pokemon64
Huge Clucker
 
Join Date: Nov 2016
Posts: 213
Reputation: 1
Default Re: Two questions about pickups

Quote:
Originally Posted by RyderX View Post
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.
Pokemon64 is offline   Reply With Quote
Old 22/03/2017, 09:52 PM   #5
ISmokezU
Gangsta
 
Join Date: Aug 2016
Posts: 543
Reputation: 73
Default Re: Two questions about pickups

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. http://wiki.sa-mp.com/wiki/DestroyPickup

The Variable you used to create the pickup is the same variable you use to destroy it.
ISmokezU is offline   Reply With Quote
Old 22/03/2017, 10:55 PM   #6
Pokemon64
Huge Clucker
 
Join Date: Nov 2016
Posts: 213
Reputation: 1
Default Re: Two questions about pickups

Quote:
Originally Posted by ISmokezU View Post
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. http://wiki.sa-mp.com/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
Pokemon64 is offline   Reply With Quote
Old 22/03/2017, 11:01 PM   #7
ISmokezU
Gangsta
 
Join Date: Aug 2016
Posts: 543
Reputation: 73
Default Re: Two questions about pickups

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 Code:
DestroyPickup(test[playerid]); 
if it's global then its:
PHP Code:
DestroyPickup(test); 
ISmokezU is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] [MySQL]Pickups Manager Module (Full Control on pickups) TitanX Filterscripts 5 13/03/2017 07:02 PM
Pickups acting as other pickups [HELP] ShawtyyMacJunior Scripting Help 2 12/08/2012 11:50 AM
Pickups/3DTexts don't show on house pickups - Help ! Edvin Scripting Help 1 21/06/2012 07:50 PM
[URGENT] I need a list of pickups with thier ids The new 0.3c pickups AMEENAMEEN Scripting Help 1 14/04/2012 05:12 PM
Questions On Pickups And Menus! Rokzlive Help Archive 2 20/11/2010 08:32 PM


All times are GMT. The time now is 09:30 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.