SA-MP Forums Archive
[Include] [INC] eRP Pickup Streamer NOW VERSION 3! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] [INC] eRP Pickup Streamer NOW VERSION 3! (/showthread.php?tid=57076)

Pages: 1 2 3


[INC] eRP Pickup Streamer NOW VERSION 3! - 13th - 03.12.2008

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): 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);
}
eRP Pickup Streamer v3
eRP Pickup Streamer v2
eRP Pickup Streamer v1



Re: [INC] eRP Pickup Streamer - 56avenue - 03.12.2008

Nice work


Re: [INC] eRP Pickup Streamer - Pixels^ - 04.12.2008

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


Re: [INC] eRP Pickup Streamer - ToMmY1547 - 04.12.2008

what is range?


Re: [INC] eRP Pickup Streamer - 13th - 04.12.2008

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.


Re: [INC] eRP Pickup Streamer - Norn - 05.12.2008

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


Re: [INC] eRP Pickup Streamer - 13th - 06.12.2008

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.


Re: [INC] eRP Pickup Streamer - Tez2k7 - 06.12.2008

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


Re: [INC] eRP Pickup Streamer - Zoopaman - 07.12.2008

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


Re: [INC] eRP Pickup Streamer - 13th - 07.12.2008

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)



Re: [INC] eRP Pickup Streamer NOW VERSION 2! - LightFight™ - 07.12.2008

Nice Work !


Re: [INC] eRP Pickup Streamer - Tez2k7 - 07.12.2008

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.


Re: [INC] eRP Pickup Streamer NOW VERSION 2! - Lewwy - 07.12.2008

Cool!
Lovin' the update.


Re: [INC] eRP Pickup Streamer NOW VERSION 2! - 13th - 09.12.2008

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.


Re: [INC] eRP Pickup Streamer NOW VERSION 2! - eddd3 - 21.12.2008

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

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



Re: [INC] eRP Pickup Streamer NOW VERSION 2! - eddd3 - 21.12.2008

oh nvm found a way around


Re: [INC] eRP Pickup Streamer NOW VERSION 2! - 13th - 30.12.2008

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.


Re: [INC] eRP Pickup Streamer NOW VERSION 2! - [NL]Bank - 09.01.2009

nice script.


Re: [INC] eRP Pickup Streamer NOW VERSION 2! - notec100 - 11.01.2009

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.


Re: [INC] eRP Pickup Streamer NOW VERSION 2! - PlayboyX - 30.01.2009

yes