[FilterScript] Weed system (Grow, plant, give, drop, different type of seeds, different type of weeds, customizable)
#1

Weed system
_________________________________________________

I started working on this weed system two days ago since I felt that I had left Pawno behind,I thought I had to make something just so I would not forget this as a language. A lot of ideas crossed my mind however, weed system seemed like one which has not been published that many times in the past and that always holds a spot for improvements and new ideas. This drug system is not that advanced and there are certainly way better options than this out there (rootcause's drug system for example). I did not progress this system into personal use like smoking, selling, statistics etcetera however, it is limited to the script variables. There is also no saving system and whoever who has the the basic knowledge of MySQL/INI will be able to properly insert saving system into this script.

Credits:
- ******, even if not part of these forums anymore, his foreach, y_timer and y_iterate have been used in this script and therefore, it wouldn't be the same without them (not to mention the amount of coding lines those includes have saved me)

However, lets jump straight onto the screenshots of this project:



















UPDATED
Commands

/buyseeds - Allows you to buy seeds of your choice
/myseeds - shows you the seeds you got on you
/mydrugs - shows you the drugs you got on you, also lets you manage them
/pickpackup - picks up the dropped package (if near any)
/collectweed - collects the weed plant you are next to
/plantseed - plants a seed of a specific type (slots can be taken from /myseeds)


Limitations

- You can only plant a maximum of 1'000 weed seeds at a time (that would be almost 1'000 timers running at once)
- There can only be a maximum of 1'000 drug bags dropped at a time (script is using streamer to create the object, therefore more can be created)
- There can only be 5 type of seeds as of now. You are able to change this amount as you wish, though you are required to make changes in the script (might be changed in the future)

Adding new type of seed

Line 51; 52, there's this variable:

PHP Code:
new SeedInformation[][seedpacks] =
{
    {
0"Cannabis Indica"500360},
    {
1"Cannabis Sativa"500130}
}; 
To add a new one, you just add a new line which goes like:
{id, "name", price, grams_per_seed, time_in_seconds}
- You can only add a maximum of five drugs/seeds and ID's MUST be increasing regularly (0 -> 1 -> 2 -> 3 -> 4)

Download: Pastebin (Last updated: 12/06/2017)
Reply
#2

That's pretty cool!
Reply
#3

Nice one mate , keep it up.

Also check the title "Dynamic Faction System" xD.
Reply
#4

Good job
Why is this 'dynamic faction system'? lol
Reply
#5

"albanian weed" heh.
Reply
#6

Awesome!
Reply
#7

Creative nice i like it
Reply
#8

nice
Reply
#9

Look nice and decent, but the script could have been written better!
Reply
#10

Quote:
Originally Posted by Bolex_
View Post
Look nice and decent, but the script could have been written better!
I would love to know how.
Reply
#11

That's pretty cool, keep it up.!
Good Job
Reply
#12

It's pretty good to see the usage of Iterator in such cases. Some tips that you can follow that's easier to read/ write:
  • Instead of using 'var == 0' just use '!var'.
  • Use switch instead of if statements
  • Maybe replace IsPlayerInRangeOfPoint with streamer's circle dyn. area?
  • Using a variable that stores the player name on connect rather than using a function to fetch player name again and again.
Amazing release, you just earned yourself REP += 2;
Reply
#13

Albanian weed be great for a guy like, in game and of course irl
Reply
#14

Would've been nicer if you finished this for our newbies who don't understand pawno so much, and maybe a tip if you further develop this or anyone, instead of Jamaican / Albanian weed use real names. Kush, Strawberry Haze, euhh White Widow, go on.
Reply
#15

Pretty simple but well done.

There are also single weed plants as Objects, the ones you used are dynamic and destroyable which may be not so nice (unless you add a feature to actually destroy them). The Model ID of the single Weed Plant is 19473 if you care.

What I did on my server was not displaying the Weed plant instantly after planting. Instead, I use some thin bush-like object coming out of the ground which some time later (few hours) grows to an actual weed plant. That's a bit more realistic and a nice mechanic imo.
Reply
#16

Nice brother, repped
<3 shqipe <3
Reply
#17

nice
Reply
#18

Quote:
Originally Posted by Spydah
View Post
Would've been nicer if you finished this for our newbies who don't understand pawno so much, and maybe a tip if you further develop this or anyone, instead of Jamaican / Albanian weed use real names. Kush, Strawberry Haze, euhh White Widow, go on.
Script has been updated and you can now use real names instead of nationalities. Jamaican and Albanian have been replaced with Cannabis Sativa and Cannabis Indica, while more can be added easily. This is now no longer limited to weed, but anything that can be planted.

Quote:
Originally Posted by NaS
View Post
Pretty simple but well done.

There are also single weed plants as Objects, the ones you used are dynamic and destroyable which may be not so nice (unless you add a feature to actually destroy them). The Model ID of the single Weed Plant is 19473 if you care.

What I did on my server was not displaying the Weed plant instantly after planting. Instead, I use some thin bush-like object coming out of the ground which some time later (few hours) grows to an actual weed plant. That's a bit more realistic and a nice mechanic imo.
I did check out the object here and it says the object does not break on hit, nor that it has got collision. I was thinking of making the weed grow, however it would not look good due to the simple fact that the object does make it look bad (especially if planted in hills or such). I will try out this object tomorrow or something and get back to you. If the object looks good and does not disappear once hit, I will certainly update the script and add the growing functionality.

Pastebin link is the same: https://pastebin.com/ZaXqCns0
Reply
#19

Quote:

C:\Users\SERVER\pawno\include\sscanf2.inc(227) : warning 202: number of arguments does not match definition
C:\Users\SERVER\pawno\include\sscanf2.inc(240) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Got this.
Reply
#20

Look nice, GJ.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)