Pickup that doesnt disappear?
#1

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

Try to use type 2
https://sampwiki.blast.hk/wiki/PickupTypes
Reply
#3

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

Код:
FuelPickup[fid] = CreateDynamicPickup(1244, 1, fInfo[fid][fPos][0], fInfo[fid][fPos][1], fInfo[fid][fPos][2], 0);
Код:
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;
}
Reply
#4

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 Код:
#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.
Reply
#5

About pickups, I think type 23 will do the job and use CreateDynamicPickup as it is more advanced and technically unlimited.
Reply
#6

paulommu's method worked . Thanks.

Stanford What does pickup 23 do?
Reply
#7

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

On top of script:
Код:
InPickup[MAX_PLAYERS];
OnPlayerConnect:
Код:
InPickup[playerid] = 0;
Create pickup:
Код:
FuelPickup[fid] = CreateDynamicPickup(1244, 1, fInfo[fid][fPos][0], fInfo[fid][fPos][1], fInfo[fid][fPos][2], 0);
Код:
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;
}
Код:
forward PickupStop(playerid);
public PickupStop(playerid)
{
InPickup[playerid] = 0;
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)