Weed system [v1.2] [UPDATED] -
Private200 - 22.05.2017
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", 500, 3, 60},
{1, "Cannabis Sativa", 500, 1, 30}
};
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)
Re: Weed system (Grow, plant, give, drop, different type of seeds, different type of weeds, customizable) - Astralis - 22.05.2017
That's pretty cool!
Re: Weed system (Grow, plant, give, drop, different type of seeds, different type of weeds, customizable) -
LazzyBoy - 22.05.2017
Nice one mate , keep it up.
Also check the title "Dynamic Faction System" xD.
Re: Weed system (Grow, plant, give, drop, different type of seeds, different type of weeds, customizable) -
Fairuz - 22.05.2017
Good job
Why is this 'dynamic faction system'? lol
Re: Weed system (Grow, plant, give, drop, different type of seeds, different type of weeds, customizable) -
fatlirmorina - 22.05.2017
"albanian weed" heh.
Re: Weed system (Grow, plant, give, drop, different type of seeds, different type of weeds, customizable) -
Kimsa - 23.05.2017
Awesome!
Re: Weed system (Grow, plant, give, drop, different type of seeds, different type of weeds, customizable) -
RxErT - 23.05.2017
Creative nice i like it
Re: Weed system (Grow, plant, give, drop, different type of seeds, different type of weeds, customizable) -
SyS - 23.05.2017
nice
Re: Weed system (Grow, plant, give, drop, different type of seeds, different type of weeds, customizable) -
Bolex_ - 23.05.2017
Look nice and decent, but the script could have been written better!
Re: Weed system (Grow, plant, give, drop, different type of seeds, different type of weeds, customizable) -
Private200 - 23.05.2017
Quote:
Originally Posted by Bolex_
Look nice and decent, but the script could have been written better!
|
I would love to know how.
Re: Weed system (Grow, plant, give, drop, different type of seeds, different type of weeds, customizable) -
Azhar - 23.05.2017
That's pretty cool, keep it up.!

Good Job
Re: Weed system (Grow, plant, give, drop, different type of seeds, different type of weeds, customizable) -
Logic_ - 23.05.2017
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;
Re: Weed system (Grow, plant, give, drop, different type of seeds, different type of weeds, customizable) -
DRP - 23.05.2017
Albanian weed be great for a guy like, in game and of course irl
Re: Weed system (Grow, plant, give, drop, different type of seeds, different type of weeds, customizable) -
Spydah - 27.05.2017
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.
Re: Weed system (Grow, plant, give, drop, different type of seeds, different type of weeds, customizable) -
NaS - 28.05.2017
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.
Re: Weed system (Grow, plant, give, drop, different type of seeds, different type of weeds, customizable) -
AlexMSK - 29.05.2017
Nice brother, repped

<3 shqipe <3
Re: Weed system (Grow, plant, give, drop, different type of seeds, different type of weeds, customizable) - KinG7 - 29.05.2017
nice
Re: Weed system (Grow, plant, give, drop, different type of seeds, different type of weeds, customizable) -
Private200 - 29.05.2017
Quote:
Originally Posted by Spydah
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
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
Re: Weed system (Grow, plant, give, drop, different type of seeds, different type of weeds, customizable) -
Cyboorg - 02.06.2017
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.
Re: Weed system (Grow, plant, give, drop, different type of seeds, different type of weeds, customizable) -
rawenCB - 02.06.2017
Look nice, GJ.