SA-MP Forums Archive
[FilterScript] Yet Another Drug System - 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)
+--- Thread: [FilterScript] Yet Another Drug System (/showthread.php?tid=609790)

Pages: 1 2


Yet Another Drug System - rootcause - 16.06.2016




Information

You can buy seeds from drug dealers to grow drugs and sell them to drug dealers/other players.

Drug dealers can run out of drugs(they don't have infinite supply, only what players sell to them) so you can sell your harvested drugs to them for the price they decided (it's not that much but they always buy your product), or you can ignore the dealers and sell your drugs to others with your own price per gram using /selldrugs.

Or you can keep the drugs for your own use, they regenerate health after all.

Config

#define USE_DRUNKLEVEL - Remove this line if you don't want SetPlayerDrunkLevel to be used while being on drugs.
#define PLAYER_LIMIT - How many seeds can a player plant? (Default: 5)
#define PLANT_MAX_GROWTH - How many grams of drugs can a fully grown plant yield on harvesting? (Default: 75)
#define GROWTH_INTERVAL - Interval of plant growth event, plants will grow every X seconds. (Default: 45)
#define ROT_INTERVAL - Life time of a fully grown plant, after X seconds the plant will rot and get destroyed. In seconds. (Default: 300)
#define CARRY_LIMIT - How many grams of drugs a player can carry on themselves? (Default: 150)
#define SEED_LIMIT - How many drug plant seeds a player can carry on themselves? (Default: 25)
#define SEED_PRICE - Price of a drug plant seed. (Default: 50)
#define DRUG_BUY_PRICE - Buying price for a gram of drugs. Players'll pay "this price * grams" while buying drugs from dealers. (Default: 20)
#define DRUG_SELL_PRICE - Selling price for a gram of drugs. Players'll get paid "this price * grams" while selling drugs to dealers. (Default: 16)

Commands

/usedrugs [grams] - Consumes specified amount of drugs, will make your health regenerate depending on how many grams you consumed.
/givedrugs [player id] [grams] - Gives specified amount of drugs to specified player for free.
/selldrugs [player id] [gram price] - Sends an offer to the specified player, if the player decides to buy drugs from you because dealers don't have any, you get paid and they get their drugs. Pretty simple.
/drugstats - Shows your drug stats like consumed drugs, money sold on drugs, money earned selling drugs etc.
/dealer - Opens the drug dealer menu if you're near one.
/plant - Has 2 options which are place and harvest.
-> /plant place Places a drug plant on your location if you have a seed. Your plant will grow over time. You can buy seeds from drug dealers.
-> /plant harvest Harvests a drug plant if the nearest plant is ready to harvest. You can tell a drug plant is harvestable when it has leaves. If you harvest a plant that isn't yours, its owner will get notified.

RCON Only:

/createdealer [skin id] - Creates a drug dealer on your location.
/setdealerskin [dealer id] [skin id] - Changes the specified drug dealer's skin.
/setdealerpos [dealer id] - Moves the specified drug dealer to your position.
/removedealer [dealer id] - Removes the specified drug dealer.

Notes

* Drug plants doesn't get saved, I may add saving for them in the future but I don't see it being needed that much right now.
* If you're getting compile errors, make sure you're using the latest versions of everything.

Credits

Slice for SQLite Improved
Incognito for Streamer Plugin
Yashas for Improved ZCMD
****** & maddinat0r & Misiur for sscanf and YSI.

Downloads

Mediafire || Pastebin



Re: Yet Another Drug System - Deniz1467 - 16.06.2016

Dope shit bro


Re: Yet Another Drug System - yarakstyle91 - 16.06.2016

you work for CARTELLBEAN resources son well played keep it up THE CARTELLBEAN always pay their depts


Re: Yet Another Drug System - Fairuz - 17.06.2016

Yet another great system.
Good job!


Re: Yet Another Drug System - samp_boy - 17.06.2016

impressed very nice!!! i really like it!


Re: Yet Another Drug System - Ritzy2K - 17.06.2016

Suggestion : different type of drugs have different effects as well they regenerate health at different speed? But only were can be grown.


Re: Yet Another Drug System - RedRex - 17.06.2016

Wow nice


Re: Yet Another Drug System - Fairuz - 17.06.2016

I'm using your filterscripts,you have Player_Init functions on Lumberjack system and this filterscript.
would that be a bug or glitch if I'm using twice at the same time?


Re: Yet Another Drug System - BrainDamaged - 17.06.2016

Nice work (ellerinize sağlık hocam)


Respuesta: Yet Another Drug System - Whyd - 17.06.2016

Another nice job!


Re: Yet Another Drug System - Max_Andolini - 17.06.2016

Good job (Eline sağlık krdş)


Re: Yet Another Drug System - Private200 - 18.06.2016

Quote:
Originally Posted by Bradley7
Посмотреть сообщение
I'm using your filterscripts,you have Player_Init functions on Lumberjack system and this filterscript.
would that be a bug or glitch if I'm using twice at the same time?
As far as they are not in the same script, no. If you got them in the same script, make sure you will not overwrite the same functions (if any).


Re: Yet Another Drug System - rootcause - 19.06.2016

Thanks guys.

Quote:
Originally Posted by [ND]xXZeusXx.
Посмотреть сообщение
Suggestion : different type of drugs have different effects as well they regenerate health at different speed? But only were can be grown.
Maybe in the future with an addiction feature? idk, depends on how bored I get honestly

Quote:
Originally Posted by Bradley7
Посмотреть сообщение
I'm using your filterscripts,you have Player_Init functions on Lumberjack system and this filterscript.
would that be a bug or glitch if I'm using twice at the same time?
There shouldn't be any issues as Private200 said.

If you plan to merge said scripts into your gamemode or something just make sure you rename one of those functions.


Re: Yet Another Drug System - iKevin - 19.06.2016

Quote:
Originally Posted by Bradley7
Посмотреть сообщение
I'm using your filterscripts,you have Player_Init functions on Lumberjack system and this filterscript.
would that be a bug or glitch if I'm using twice at the same time?
Yep you have to hook it if it's a callback, otherwise there should not be any issues if they're different filterscripts.


Re: Yet Another Drug System - Ritzy2K - 23.06.2016

Quote:
Originally Posted by rootcause
Посмотреть сообщение
Thanks guys.



Maybe in the future with an addiction feature? idk, depends on how bored I get honestly



There shouldn't be any issues as Private200 said.

If you plan to merge said scripts into your gamemode or something just make sure you rename one of those functions.
Alright good luck, i meant weed not were before though.


Re: Yet Another Drug System - Druddd - 15.07.2016

Can you make /plant harvest is only allowed for your plant?


Re: Yet Another Drug System - Roldan123 - 29.10.2016

sir can you give me one this pwn or amx


Re: Yet Another Drug System - KnowNN - 30.10.2016

Very nice man.
P.S. What mod do you use for dialog transparency?


Re: Yet Another Drug System - Amoeba - 30.10.2016

Код:
C:\Documents and Settings\Jonas\Desktop\samp037_svr_R2-1-1_win32\pawno\include\izcmd.inc(49) : error 004: function "OnPlayerCommandReceived" is not implemented
C:\Documents and Settings\Jonas\Desktop\samp037_svr_R2-1-1_win32\pawno\include\izcmd.inc(106) : error 004: function "OnPlayerCommandPerformed" is not implemented
C:\Documents and Settings\Jonas\Desktop\samp037_svr_R2-1-1_win32\pawno\include\izcmd.inc(114) : error 004: function "OnPlayerCommandPerformed" is not implemented
C:\Documents and Settings\Jonas\Desktop\samp037_svr_R2-1-1_win32\pawno\include\sqlitei.inc(1) : error 010: invalid function or declaration
C:\Documents and Settings\Jonas\Desktop\yads.pwn(1081) : error 084: state conflict: one of the states is already assigned to another implementation (symbol "ScriptInit_OnFilterScriptInit")
C:\Documents and Settings\Jonas\Desktop\yads.pwn(1120) : error 021: symbol already defined: "OnPlayerCommandText"
help?


Re: Yet Another Drug System - Roldan123 - 31.10.2016

NICE FILESCRIPT BUT HAVE A ERROR CAN YOU GIVE ME ONE THIS PWN AND AMX