[Include] [INC] eRP Pickup Streamer NOW VERSION 3!
#1

INFO

Hello!
I didn't see any (standalone) Pickup Streamers so I made one for Estonian RolePlay server and decided to release it.
Hopefully it will be helpful for someone. It has been tested with 32 000 pickups and it worked just fine.
This is perfect for RP servers, so there can be pretty much unlimited houses, "info spots", businesses, entrances.. whatever you choose to mark with a pickup.
However the normal 300 pickup limit applies. There cant be more than 300 pickups visible at one time. If you notice pickups not appearing then you need to decrease streaming range.. or increase limit if that's the case.

*NOTE*: Do not set the MAX_PICKUPS too high. Only set it to what you need. This way you will save some server resources.

*TIP*To avoid trouble of changing all the ranges for StreamPickups later on you could define the value, and then use it in adding the StreamPickups. Just add "#define PICKUP_RANGE 50" to the top-part of your GM and create pickups like this: CreateStreamPickup(1273, 1, X, Y, Z ,PICKUP_RANGE);.


It has 6 functions and 1 callback (v2):
  • CreateStreamPickup(model,type,Float,Float:y,Floa t:z,range);
    This is very much like your regular CreatePickup function. Except it also has range which sets the distance how near the player needs to be to the pickup for it to show.
    Returns StreamPickup ID if pickup was succesfully created, or -1 if limit has been reached. Default limit is 10 000.
  • DestroyStreamPickup(ID);
    Destroys a StreamPickup. Duh!
  • ChangeStreamPickupModel(ID,newmodel); - v2
    Changes the model of the StreamPickup. ID = StreamPickup ID (returned by CreateStreamPickup() ) and newmodel= New StreamPickup model.
  • ChangeStreamPickupType(ID,newtype); - v2
    Changes the type of the StreamPickup. ID = StreamPickup ID (returned by CreateStreamPickup() ) and newtype= New StreamPickup type.
  • IsStreamPickup(ID); - v2
    Checks if Pickup is StreamPickup. ID = Pickup ID (not StreamPickup ID), returns StreamPickupID if pickup is StreamPickup and -1 if it isn't.
  • ValidStreamPickupPickUp(playerid, pickupid)(ID); - v3
    Used in OnPlayerPickUpStreamPickup callback. Fix for SA-MP pickup ID bug.


  • OnPlayerPickUpStreamPickup(playerid,pickupid); - v2
    Gets called when player picks up a StreamPickup.
Credit to Denver/Astro - For the PlayerToPoint function.

"Installing"
First you have to get the include. There is a link at the bottom of this thread to PasteBin. Copy what you see there to a new text file and save it as "erpPickupStreamer.inc" (make sure that extension is .inc) and save it to "pawno/include"
After that you need to make some modifications to the GameMode you are installing it to also.

Installing version 3:
Код:
// Add to the top of the gamemode
#include <erpPickupStreamer>
forward OnPlayerPickupStreamPickup(playerid,pickupid);
////////////////////////////////


public OnGameModeInit()
{
  // Add to OnGameModeInit callback
  SetTimer("StreamPickups",1000,1);
  /////////////////////////////////
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
  // Add to OnPlayerPickUpPickup callback
  new streampickupID;
  streampickupID = IsStreamPickup(pickupid);
  if( streampickupID >= 0 )
  {
    if( ValidStreamPickupPickUp(playerid, streampickupID) )
    {
      OnPlayerPickUpStreamPickup(playerid,streampickupID);
      return 1;
    }
    return 0;
  }
  ////////////////////////////////////////

  return 1;
}

// Add new OnPlayerPickUpStreamPickup to your gamemode,
// no matter where as long as it ain't inside any other function or callback.
public OnPlayerPickUpStreamPickup(playerid,pickupid)
{

  // Add whatever you want.
	  
  return 1;
}
////////////////////////////////////////////////////////
Installing version 2:
Код:
#include <erpPickupStreamer>
forward OnPlayerPickupStreamPickup(playerid,pickupid);

public OnGameModeInit()
{
	SetTimer("StreamPickups",1000,1);
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
	new streampickupID;
	streampickupID = IsStreamPickup(pickupid);
	if( streampickupID >= 0 )
	{
		OnPlayerPickUpStreamPickup(playerid,streampickupID);
		return 1;
	}	
	return 1;
}
public OnPlayerPickUpStreamPickup(playerid,pickupid)
{
	return 1;
}
Installing version 1:
Код:
#include <erpPickupStreamer>

public OnGameModeInit()
{
	SetTimer("StreamPickups",1000,1);
}
Reply
#2

Nice work
Reply
#3

You might want to give credit to Denver/Astro for the actual workings of the PlayerToPoint function.
Reply
#4

what is range?
Reply
#5

Quote:
Originally Posted by Pixels^
You might want to give credit to Denver/Astro for the actual workings of the PlayerToPoint function.
I will do that.
Quote:
Originally Posted by ToMmY1547
what is range?
Range is the maximum distance from the pickup location where player needs to be for the pickup to be created.
For example if range = 10 then the pickup wont be visible unless some player is 10 coordinates or less away from it.
Reply
#6

Quote:
Originally Posted by 13th
INFO

Hello!
I didn't see any (standalone) Pickup Streamers so I made one for Estonian RolePlay server and decided to release it.
Hopefully it will be helpful for someone. It has been tested with 32 000 pickups and it worked just fine.
This is perfect for RP servers, so there can be pretty much unlimited houses, "info spots", businesses, entrances.. whatever you choose to mark with a pickup.
However the normal 300 pickup limit applies. There cant be more than 300 pickups visible at one time. If you notice pickups not appearing then you need to decrease streaming range.. or increase limit if that's the case.

It has 2 functions:
  • CreateStreamPickup(model,type,Float,Float:y,Floa t:z,range);
    This is very much like your regular CreatePickup function. Except it also has range which sets the distance how near the player needs to be to the pickup for it to show.
    Returns StreamPickup ID if pickup was succesfully created, or -1 if limit has been reached. Default limit is 10 000.
  • DestroyStreamPickup(ID);
    Destroys a StreamPickup. Duh!
Credit to Denver/Astro - For the PlayerToPoint function.

"Installing"
You need to include the include.. which is kinda logical.
You also need to add timer to your OnGameModeInit() callback. Like this:
Код:
#include <erpPickupStreamer>

public OnGameModeInit()
{
	SetTimer("StreamPickups",1000,1);
}
PASTEBIN
DOWNLOAD-FileDropper
MIRROR-MediaFire
Suggestion, OnPlayerPickupStreamPickup
Reply
#7

Quote:
Originally Posted by Norn
Suggestion, OnPlayerPickupStreamPickup
Hmm.. then I would probably have to make it as filterscript. But I will think about it.. and probably do it sometime Thanks for the suggestion.
Reply
#8

Nice release.
I'm currently about 20 pickups under the limit so maybe I'll have to use this. xD
Reply
#9

It's nice, but could you make a ChangePickupType function pls?
Reply
#10

New release!
And since there is not much to change or add to pickup streamer I might as well call it "version 2".

New:
ChangeStreamPickupModel(ID,newmodel)
ChangeStreamPickupType(ID,newtype)
IsStreamPickup(ID)
OnPlayerPickUpStreamPickup(playerid,pickupid)
Reply
#11

Nice Work !
Reply
#12

Quote:
Originally Posted by 13th
New release!
And since there is not much to change or add to pickup streamer I might as well call it "version 2".

New:
ChangeStreamPickupModel(ID,newmodel)
ChangeStreamPickupType(ID,newtype)
IsStreamPickup(ID)
OnPlayerPickUpStreamPickup(playerid,pickupid)
Nice updated release.
Reply
#13

Cool!
Lovin' the update.
Reply
#14

Thanks everyone

Can someone confirm the new version 2 stuff is working like it should?

EDIT:
I just noticed that the link to v2 was actually pointing to v1. I don't know.. should I be happy or sad because no one noticed?
Anyway. It's fixed now.
Reply
#15

hm could somebody tell me what 'could' be wrong?

erpPickupStreamer.inc(131) : warning 211: possibly unintended assignment
Reply
#16

oh nvm found a way around
Reply
#17

Yeah, there was 2 warnings in there. One was because I forgot on‌e = in IF statment, just make "=" into "==". And the other one I don't remember.
Reply
#18

nice script.
Reply
#19

Ok so I am using version 2 and I have followed all install instructions and everything works correctly, except when I enter into and interior, you either enter into the correct one and then become stuck or you'll enter one point and end up at another. Why does this keep happening? Is there a certain way other than example:
variable = CreateStreamPickup(model, type, x, y, z, range) to define the stream pickup id? Help is greatly appreciated as I don't want to wait forever to get scripting.. Thank you.
Reply
#20

yes
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)