SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 31/08/2016, 08:44 AM   #1
rootcause
Big Clucker
 
rootcause's Avatar
 
Join Date: Feb 2015
Location: /
Posts: 114
Reputation: 197
Default Singleplayer Collectibles






Information

This filterscript allows players to collect oysters and horseshoes just like in singleplayer. Players can track and reset their progress using /collectibles menu.

Since oyster and horseshoe positions are taken from GTA files, I'm pretty sure every collectible is added by default.

And this script is not limited to just oysters and horseshoes, you can create your own types of collectibles such as briefcases. (tutorial below)

Config

#define COLLECTIBLE_REWARD - Amount of money given on collecting a collectible. (Default: 250)
#define COMPLETION_REWARD - Amount of money given on collecting every collectible of one type. (Default: 15000)

Adding New Collectibles

You can add more collectible types if you want to, just follow these steps:

Step 1) Add your type to the types array

Code:
new
	CollectibleTypes[][E_COLLECTIBLE_TYPE] = {
	        {"Oyster", 953},    // index 0
		{"Horseshoe", 954},  // index 1
		{"Briefcase", 1210} // index 2 - new type
	};
Step 2) Create a reference

Code:
enum    _:E_COLLECTIBLE_TYPE_REF
{
	TYPE_OYSTER,    // reference to CollectibleTypes index 0
	TYPE_HORSESHOE, // reference to CollectibleTypes index 1
	TYPE_BRIEFCASE // reference to CollectibleTypes index 2 - new type
}
Step 3) Add locations to the CollectibleData array

New collectibles always must be added to the end!

Code:
new
	CollectibleData[][E_COLLECTIBLE] = {
	        {TYPE_HORSESHOE, 1224.0, 2617.0, 11.0},
		...
		{TYPE_HORSESHOE, 1526.22, 751.0, 29.04},
		{TYPE_OYSTER, 979.0, -2210.0, -3.0},
		...
		{TYPE_OYSTER, 2179.0, 235.0, -5.0},
		{TYPE_BRIEFCASE, 123.4, 567.8, 1.618} // new briefcase collectible
	};
And that's pretty much it, you just created a Briefcase collectible type with 1 collectible in the GTA world.

Credits

Slice for SQLite Improved
Yashas for Improved ZCMD
****** & Misiur for YSI.

Notes

* Don't forget to create a directory named collectibles on your scriptfiles. (If you're not using SQLite version.)

Downloads

__________________
All Releases | YouTube

Last edited by rootcause; 03/09/2016 at 01:25 PM. Reason: sqlite version
rootcause is offline   Reply With Quote
Old 31/08/2016, 08:47 AM   #2
Max_Andolini
Huge Clucker
 
Max_Andolini's Avatar
 
Join Date: Oct 2013
Posts: 315
Reputation: 37
Default Re: Singleplayer Collectibles

Incredible, you are amazing
Max_Andolini is offline   Reply With Quote
Old 31/08/2016, 03:05 PM   #3
tysanio
Big Clucker
 
tysanio's Avatar
 
Join Date: May 2012
Location: At my House Duh..
Posts: 127
Reputation: 17
Default Re: Singleplayer Collectibles

that is cool
__________________

Did i ever tell you the définitions of insanity?
tysanio is offline   Reply With Quote
Old 31/08/2016, 03:33 PM   #4
Whyd
Huge Clucker
 
Whyd's Avatar
 
Join Date: Sep 2012
Location: /
Posts: 415
Reputation: 30
Default Respuesta: Singleplayer Collectibles

Another amazing job!
Whyd is offline   Reply With Quote
Old 31/08/2016, 05:29 PM   #5
Hunud
Gangsta
 
Hunud's Avatar
 
Join Date: Jun 2016
Location: Right here.
Posts: 596
Reputation: 57
Default Re: Singleplayer Collectibles

OMFG! You are god,amazing work

+REP
Hunud is offline   Reply With Quote
Old 31/08/2016, 06:33 PM   #6
Florin48
Huge Clucker
 
Join Date: Nov 2015
Location: Romania
Posts: 265
Reputation: 5
Default Re: Singleplayer Collectibles

Nice man!
Florin48 is offline   Reply With Quote
Old 01/09/2016, 01:28 PM   #7
BMiller
Little Clucker
 
BMiller's Avatar
 
Join Date: May 2016
Posts: 6
Reputation: 0
Default Re: Singleplayer Collectibles

Yeah, nice one uncle.
BMiller is offline   Reply With Quote
Old 01/09/2016, 11:12 PM   #8
Dice_
Huge Clucker
 
Dice_'s Avatar
 
Join Date: Sep 2015
Location: Indonesia
Posts: 451
Reputation: 57
Default Re: Singleplayer Collectibles

Your releases is the best so far,imo.
Dice_ is offline   Reply With Quote
Old 01/09/2016, 11:38 PM   #9
oMa37
Gangsta
 
Join Date: Feb 2016
Posts: 968
Reputation: 155
Default Re: Singleplayer Collectibles

Quote:
Originally Posted by rootcause View Post
Since oyster and horseshoe positions are taken from GTA files, I'm pretty sure every collectible is added by default
Is it possible to get the hidden packages positions? And where?
oMa37 is offline   Reply With Quote
Old 01/09/2016, 11:57 PM   #10
SickAttack
High-roller
 
Join Date: Dec 2013
Posts: 4,769
Reputation: 754
Default Re: Singleplayer Collectibles

Quote:
Originally Posted by oMa37 View Post
Is it possible to get the hidden packages positions? And where?
pawn Code:
new
    CollectibleData[][E_COLLECTIBLE] = {
    //  {type, pos x, pos y, pos z}
        {TYPE_HORSESHOE, 1224.0, 2617.0, 11.0},
        {TYPE_HORSESHOE, 2323.0, 1284.0, 97.0},
        {TYPE_HORSESHOE, 2035.0, 2305.0, 18.0},
        {TYPE_HORSESHOE, 2491.0, 2263.0, 15.0},
        {TYPE_HORSESHOE, 1433.0, 2796.0, 20.0},
        {TYPE_HORSESHOE, 2071.0, 712.0, 11.0},
        {TYPE_HORSESHOE, 2239.0, 1839.0, 18.0},
        {TYPE_HORSESHOE, 2583.0, 2387.0, 16.0},
        {TYPE_HORSESHOE, 2864.0, 857.0, 13.0},
        {TYPE_HORSESHOE, 2612.0, 2200.0, -1.0},
        {TYPE_HORSESHOE, 2274.0, 1507.0, 24.0},
        {TYPE_HORSESHOE, 2184.0, 2529.0, 11.0},
        {TYPE_HORSESHOE, 1863.0, 2314.0, 15.0},
        {TYPE_HORSESHOE, 2054.0, 2434.0, 166.0},
        {TYPE_HORSESHOE, 1603.0, 1435.0, 11.0},
        {TYPE_HORSESHOE, 1362.92, 1015.24, 11.0},
        {TYPE_HORSESHOE, 2058.7, 2159.1, 16.0},
        {TYPE_HORSESHOE, 2003.0, 1672.0, 12.0},
        {TYPE_HORSESHOE, 2238.0, 1135.0, 49.0},
        {TYPE_HORSESHOE, 1934.06, 988.79, 22.0},
        {TYPE_HORSESHOE, 1768.0, 2847.0, 9.0},
        {TYPE_HORSESHOE, 1084.0, 1076.0, 11.0},
        {TYPE_HORSESHOE, 2879.0, 2522.0, 11.0},
        {TYPE_HORSESHOE, 2371.0, 2009.0, 15.0},
        {TYPE_HORSESHOE, 1521.0, 1690.0, 10.6},
        {TYPE_HORSESHOE, 2417.0, 1281.0, 21.0},
        {TYPE_HORSESHOE, 1376.0, 2304.0, 15.0},
        {TYPE_HORSESHOE, 1393.0, 1832.0, 12.34},
        {TYPE_HORSESHOE, 984.0, 2563.0, 12.0},
        {TYPE_HORSESHOE, 1767.0, 601.0, 13.0},
        {TYPE_HORSESHOE, 2108.0, 1003.0, 46.0},
        {TYPE_HORSESHOE, 2705.98, 1862.52, 24.41},
        {TYPE_HORSESHOE, 2493.0, 922.0, 16.0},
        {TYPE_HORSESHOE, 1881.0, 2846.0, 11.0},
        {TYPE_HORSESHOE, 2020.0, 2352.0, 11.0},
        {TYPE_HORSESHOE, 1680.3, 2226.86, 16.11},
        {TYPE_HORSESHOE, 1462.0, 936.0, 10.0},
        {TYPE_HORSESHOE, 2125.5, 789.23, 11.45},
        {TYPE_HORSESHOE, 2588.0, 1902.0, 15.0},
        {TYPE_HORSESHOE, 919.0, 2070.0, 11.0},
        {TYPE_HORSESHOE, 2173.0, 2465.0, 11.0},
        {TYPE_HORSESHOE, 2031.25, 2207.33, 11.0},
        {TYPE_HORSESHOE, 2509.0, 1144.0, 19.0},
        {TYPE_HORSESHOE, 2215.0, 1968.0, 11.0},
        {TYPE_HORSESHOE, 2626.0, 2841.0, 11.0},
        {TYPE_HORSESHOE, 2440.08, 2161.07, 20.0},
        {TYPE_HORSESHOE, 1582.0, 2401.0, 19.0},
        {TYPE_HORSESHOE, 2077.0, 1912.0, 14.0},
        {TYPE_HORSESHOE, 970.0, 1787.0, 11.0},
        {TYPE_HORSESHOE, 1526.22, 751.0, 29.04},
        {TYPE_OYSTER, 979.0, -2210.0, -3.0},
        {TYPE_OYSTER, 2750.0, -2584.0, -5.0},
        {TYPE_OYSTER, 1279.0, -806.0, 85.0},
        {TYPE_OYSTER, 2945.13, -2051.93, -3.0},
        {TYPE_OYSTER, 67.0, -1018.0, -5.0},
        {TYPE_OYSTER, 2327.0, -2662.0, -5.0},
        {TYPE_OYSTER, 2621.0, -2506.0, -5.0},
        {TYPE_OYSTER, 1249.0, -2687.0, -1.0},
        {TYPE_OYSTER, 725.0, -1849.0, -5.0},
        {TYPE_OYSTER, 723.0, -1586.0, -3.0},
        {TYPE_OYSTER, 155.0, -1975.0, -8.0},
        {TYPE_OYSTER, 1968.0, -1203.0, 17.0},
        {TYPE_OYSTER, -2657.0, 1564.0, -6.0},
        {TYPE_OYSTER, -1252.0, 501.0, -8.0},
        {TYPE_OYSTER, -1625.0, 4.0, -10.0},
        {TYPE_OYSTER, -1484.0, 1489.0, -10.0},
        {TYPE_OYSTER, -2505.406, 1543.724, -22.5553},
        {TYPE_OYSTER, -2727.0, -469.0, -5.0},
        {TYPE_OYSTER, -1266.0, 966.0, -10.0},
        {TYPE_OYSTER, -1013.0, 478.0, -7.0},
        {TYPE_OYSTER, -1364.0, 390.0, -5.0},
        {TYPE_OYSTER, 2578.0, 2382.0, 16.0},
        {TYPE_OYSTER, 2090.0, 1898.0, 8.0},
        {TYPE_OYSTER, 2130.0, 1152.0, 7.0},
        {TYPE_OYSTER, 2013.0, 1670.0, 7.0},
        {TYPE_OYSTER, 2531.0, 1569.0, 9.0},
        {TYPE_OYSTER, 2998.0, 2998.0, -10.0},
        {TYPE_OYSTER, -832.0, 925.0, -2.0},
        {TYPE_OYSTER, 486.0, -253.0, -4.0},
        {TYPE_OYSTER, -90.0, -910.0, -5.0},
        {TYPE_OYSTER, 26.43, -1320.94, -10.04},
        {TYPE_OYSTER, -207.0, -1682.0, -8.0},
        {TYPE_OYSTER, -1672.0, -1641.0, -2.0},
        {TYPE_OYSTER, -1175.0, -2639.0, -2.5},
        {TYPE_OYSTER, -1097.0, -2858.0, -8.0},
        {TYPE_OYSTER, -2889.0, -1042.0, -9.0},
        {TYPE_OYSTER, -659.0, 874.0, -2.0},
        {TYPE_OYSTER, -955.0, 2628.0, 35.0},
        {TYPE_OYSTER, -1066.0, 2197.0, 32.0},
        {TYPE_OYSTER, 40.0, -531.0, -8.0},
        {TYPE_OYSTER, -765.0, 247.0, -8.0},
        {TYPE_OYSTER, 2098.0, -108.0, -2.0},
        {TYPE_OYSTER, 2767.0, 470.0, -8.0},
        {TYPE_OYSTER, -783.0, 2116.0, 35.0},
        {TYPE_OYSTER, -821.0, 1374.0, -8.0},
        {TYPE_OYSTER, -2110.5, 2329.72, -7.5},
        {TYPE_OYSTER, -1538.0, 1708.0, -3.27},
        {TYPE_OYSTER, -2685.0, 2153.0, -5.0},
        {TYPE_OYSTER, 796.0, 2939.0, -5.0},
        {TYPE_OYSTER, 2179.0, 235.0, -5.0}
    };

---------------------------------------------------------------------------

Look nice, good job!
SickAttack 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
gta SinglePlayer BoU3A Scripting Help 2 30/09/2013 06:49 AM
Singleplayer help? Janek17 Everything and Nothing 12 12/02/2011 07:41 AM
Why it goes to singleplayer? jimmykojootti Client Support 1 10/04/2010 01:26 PM
Singleplayer?? Fishcik Client Support 1 03/01/2010 10:23 AM
SA:MP -> SinglePlayer Ritchie999 Client Support 2 20/10/2009 06:23 PM


All times are GMT. The time now is 06:19 AM.


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