SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 06/08/2014, 03:37 PM   #1
Blademaster680
Gangsta
 
Blademaster680's Avatar
 
Join Date: Jul 2013
Location: On my Yamaha R6
Posts: 609
Reputation: 26
Default Pickup that doesnt disappear?

How can I make it so that when I enter a pickup it will send me the vehicle id the player is in. but the pickup must not disappear. it must always be there.
I am using createdynamicpickup.

I want it so when a player pickups the pickup it will display their vehicle id. but the pickup must not vanish. I have tried most pickup types but then the pickup doesn't even display. if the type is 0, it displays but cant view vehicle id.
__________________

Blademaster680 is offline   Reply With Quote
Old 06/08/2014, 03:45 PM   #2
VenomMancer
Gangsta
 
VenomMancer's Avatar
 
Join Date: May 2013
Location: Indonesia (Manado)
Posts: 637
Reputation: 31
Default Re: Pickup that doesnt disappear?

Try to use type 2
http://wiki.sa-mp.com/wiki/PickupTypes
VenomMancer is offline   Reply With Quote
Old 06/08/2014, 03:56 PM   #3
Blademaster680
Gangsta
 
Blademaster680's Avatar
 
Join Date: Jul 2013
Location: On my Yamaha R6
Posts: 609
Reputation: 26
Default Re: Pickup that doesnt disappear?

Type 2 would make it disappear for 30 seconds though... . Type 1 works because it does what I want. but it floods the chat.

Code:
FuelPickup[fid] = CreateDynamicPickup(1244, 1, fInfo[fid][fPos][0], fInfo[fid][fPos][1], fInfo[fid][fPos][2], 0);
Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	for(new i = 1; i < MAX_FSTATIONS; i++)
	{
		if(pickupid == FuelPickup[i])
		{
			new id = GetPlayerVehicleID(playerid);
			new str[128];
			format(str, sizeof(str), "Vehicle ID: %d", id);
			SendClientMessage(playerid, -1, str);
		}
	}
	return 1;
}
__________________

Blademaster680 is offline   Reply With Quote
Old 06/08/2014, 04:09 PM   #4
paulommu
Little Clucker
 
paulommu's Avatar
 
Join Date: Oct 2011
Location: Brazil
Posts: 30
Reputation: 7
Default Re: Pickup that doesnt disappear?

Well, if any of these pickup types are suitable for you, then you should think about other possibilities.

Think about using the areas functions from Incognito's Streamer. They are very flexible; you can 'draw' 2D or 3D areas on the map, and check when a player enter or leaves it. Check this out:

pawn Code:
#define FUEL_AREA_RADIUS 5.0

new FuelArea = -1;

public OnGameModeInit()
    FuelArea = CreateDynamicCircle(10.0, 20.0, FUEL_AREA_RADIUS);

public OnPlayerEnterDynamicArea(playerid, areaid)
{
    if(areaid == FuelArea)
        SendClientMessage(playerid, -1, "You are at the fuel area!");

    return true;
}

Also, you can create a pickup without effect at the same point, just to identify the area.
paulommu is offline   Reply With Quote
Old 06/08/2014, 04:26 PM   #5
Stanford
Gangsta
 
Stanford's Avatar
 
Join Date: Feb 2012
Posts: 983
Reputation: 84
Default Re: Pickup that doesnt disappear?

About pickups, I think type 23 will do the job and use CreateDynamicPickup as it is more advanced and technically unlimited.
__________________
******: "That code compiles perfectly, but I can tell you now it won't make me a cup of tea."

******: "I've said this before. People think that MySQL is some simple plug-and-play magic bullet that you can use to just make your mode instantly better. They don't realise that the "L" in "SQL" means "language". So instead of programming PAWN, and using a bit of this mystery thing, you are now programming in two languages at once. If you spend months learning PAWN, you should spend the same time learning SQL, if not more - it is probably the more complex of the two languages, and not something that just gets bolted on to the side."
Stanford is offline   Reply With Quote
Old 06/08/2014, 05:01 PM   #6
Blademaster680
Gangsta
 
Blademaster680's Avatar
 
Join Date: Jul 2013
Location: On my Yamaha R6
Posts: 609
Reputation: 26
Default Re: Pickup that doesnt disappear?

paulommu's method worked . Thanks.

Stanford What does pickup 23 do?
__________________

Blademaster680 is offline   Reply With Quote
Old 06/08/2014, 05:23 PM   #7
paulommu
Little Clucker
 
paulommu's Avatar
 
Join Date: Oct 2011
Location: Brazil
Posts: 30
Reputation: 7
Default Re: Pickup that doesnt disappear?

Pickup type 23 triggers OnPlayerPickUpPickup and never disappears, but as far as I know, it only works with the player on-foot (and not in a vehicle). I actually use it to make entrance/exit locations.
paulommu is offline   Reply With Quote
Old 06/08/2014, 05:46 PM   #8
dirigent00
Big Clucker
 
Join Date: Jul 2014
Posts: 72
Reputation: 1
Default Re: Pickup that doesnt disappear?

On top of script:
Code:
InPickup[MAX_PLAYERS];
OnPlayerConnect:
Code:
InPickup[playerid] = 0;
Create pickup:
Code:
FuelPickup[fid] = CreateDynamicPickup(1244, 1, fInfo[fid][fPos][0], fInfo[fid][fPos][1], fInfo[fid][fPos][2], 0);
Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	for(new i = 1; i < MAX_FSTATIONS; i++)
	{
		if(pickupid == FuelPickup[i])
		{
			if(InPickup[playerid] == 0)
			{
				new id = GetPlayerVehicleID(playerid);
				new str[128];
				format(str, sizeof(str), "Vehicle ID: %d", id);
				SendClientMessage(playerid, -1, str);
				InPickup[playerid] = 1;
				SetTimerEx("PickupStop", 5000, false, "i", playerid);//Every 5 sec you can pickup the pickup, it will send after 5 sec the message
			}
		}
	}
	return 1;
}
Code:
forward PickupStop(playerid);
public PickupStop(playerid)
{
InPickup[playerid] = 0;
return 1;
}
dirigent00 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
Pickup's Disappear out at sea Tom1412 Scripting Help 2 04/08/2014 05:10 PM
progress bar doesnt disappear iBots Scripting Help 3 14/05/2014 06:45 PM
Pickup that doesn't disappear when player goes into it PaulDinam Scripting Help 4 09/02/2013 08:35 AM
The txtdraw doesnt disappear Riddy Scripting Help 6 03/07/2012 08:17 PM
Pickup Don't Disappear misho1 Scripting Help 4 26/11/2011 09:26 PM


All times are GMT. The time now is 05:20 AM.


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