Weed system

Scripter or interested in scripting? This place just may fancy to your likings!

Moderators: Game Admins, FM, Lead Admins

Post Reply
User avatar
Private200
Silver Member
Silver Member
Posts: 117
Joined: Thu Feb 11, 2016 10:34 pm

Weed system

Post by Private200 » Mon May 22, 2017 10:32 pm

Screenshots gallery: show
Image

Image

Image

Image

Image

Image

Image

Image

Image
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)

Adding new type of seed

Line 51; 52, there's this variable:

Code: Select all

new SeedInformation[][seedpacks] =
{
    {0, "Albanian", 500, 3, 60},
    {1, "Jamaican", 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). ALSO, this script does not include saving system. Anyone with basic knowledge of MySQL is able to add one due to the simplicity of loading/saving system in this particular script.

Download: Pastebin

User avatar
danut
Gangster
Gangster
Posts: 105
Joined: Thu Jan 07, 2016 8:29 pm
Ingame name: Banks

Re: Weed system

Post by danut » Tue May 23, 2017 3:17 am

You made great use of iterators and y_timers. I must say that the code is as clean as it can be, but you could do some little modifications. Great job overall!
tu client, io-s patron

User avatar
FlowN
Almost Human
Almost Human
Posts: 1163
Joined: Fri Feb 12, 2016 6:56 pm
Ingame name: Daniel Holt
Location: Romania
Contact:

Re: Weed system

Post by FlowN » Tue May 23, 2017 8:12 am

Good job bro!
SENATOR DANIEL BRIAN HOLT - CREATING CHANGE | THE SAN ANDREAS REPUBLICAN PARTY
CHARACTER DEVELOPMENT | COMMUNITY THREAD

User avatar
Faledak
Wannabe Don
Wannabe Don
Posts: 2085
Joined: Thu May 17, 2012 10:37 pm

Re: Weed system

Post by Faledak » Tue May 23, 2017 8:53 am

"Albanian weed"
"Jamaican weed"

How about going for example indica, ruderalis and sativa?

User avatar
Mikee
Wannabe Mafia
Wannabe Mafia
Posts: 249
Joined: Tue Jan 06, 2015 4:57 pm
Location: Italy
Contact:

Re: Weed system

Post by Mikee » Tue May 23, 2017 9:14 am

That's not bat at all. Well done.
Mikee
Head of Mikee’s Mapping
Mapper
Junior Scripter
Designer

Support
Send a ticket
Questions / Technical Support
Contact Information
Telegram: @mikeejr
Discord: Mikee#5124
Skype: damiano.nenna1


If you are a mapper and you want to join the Mikee's Mapping Team contact me privately.

User avatar
Private200
Silver Member
Silver Member
Posts: 117
Joined: Thu Feb 11, 2016 10:34 pm

Re: Weed system

Post by Private200 » Tue May 23, 2017 1:53 pm

Faledak wrote:"Albanian weed"
"Jamaican weed"

How about going for example indica, ruderalis and sativa?
Names can be easily changed, they are just an example.

Code: Select all

new SeedInformation[][seedpacks] =
{
    {0, "Indica", 500, 3, 60},
    {1, "Sativa", 500, 1, 30}
    {2, "Ruderalis", 500, 1, 30}
};
And you are all set up. You might want to change couple of the texts and put "cannabis" behind of them instead of "weed" after the name itself.

hold my gat
Wannabe Don
Wannabe Don
Posts: 881
Joined: Sat Dec 12, 2015 11:30 pm
Ingame name: Rondell_Barklay

Re: Weed system

Post by hold my gat » Tue May 23, 2017 4:28 pm

Good job!

User avatar
justice96
Gangster
Gangster
Posts: 96
Joined: Tue Jun 30, 2015 8:45 pm
Location: Indonesia
Contact:

Re: Weed system

Post by justice96 » Sun May 28, 2017 6:56 pm

Finally, back at his best :P
Image
Add me to your server

User avatar
Private200
Silver Member
Silver Member
Posts: 117
Joined: Thu Feb 11, 2016 10:34 pm

Re: Weed system

Post by Private200 » Mon May 29, 2017 11:50 pm

Faledak wrote:
Tue May 23, 2017 8:53 am
"Albanian weed"
"Jamaican weed"

How about going for example indica, ruderalis and sativa?
Code has been updated and you can now use real names instead of nationalities. "Cannabis Sativa" and "Cannabis Indica" are currently the replacement of Jamaican and Albanian (that used to be). Pastebin link is the same; text has been updated.

https://pastebin.com/ZaXqCns0

User avatar
Private200
Silver Member
Silver Member
Posts: 117
Joined: Thu Feb 11, 2016 10:34 pm

Re: Weed system

Post by Private200 » Sun Jun 04, 2017 3:35 pm

Script has been updated again. Object is now different and changed to singular weed plant instead. The weed will also start from the ground and grow based on the percentage of its growth.

Image

Code has been updated, link found on the main thread can be used.

Post Reply

Return to “Scripting Section”

Who is online

Users browsing this forum: No registered users and 3 guests