Ent:KINGS - DarkRP Entity - Quest NPC: Crackhead

Hello there, fellow Facepunchers and GMOD users, as we share a passion for Garry’s Mod: I will name you ‘friend’.
I would like to remind you that I’m releasing these for the simple reason my community has been disbanded. My server is offline, and I no longer have any affiliation with a DarkRP set-up. Therefore I’d like to share these with you, so others may have some fun with it. Who doesn’t like some free unique content on their gamemode?!

There is a catch in this story, because I am no longer actively developing these entities. I cannot offer you any support. If you reply describing a issue in a well-constructed and clear way, with the error messages included: I will try and find a solution. It may take time or I may not reply at all.

Naturally, positive or negative feedback even is appreciated.

http://i.imgur.com/XDqNQ49.png[/align]

**Information
**
This is James Thornwood. James has a problem. I won’t say it out loud… but… whispershe is a crack addictwhispers. He sleeps on the curfew. Gets batted away from people their lawn various times a day. Whenever someone attempts to talk to him, he desperately begs them for a bit of crack.

Technical functions

? Unique NPC dialog.
View the startscreen here.
Obtains playername, playermodel and job for a sense of realism.

? Dynamic & job dependent.
For RP reasons I’ve coded all dynamics to be dependent on the player his job. For example, a police officer, will not be able to interact with him. The only dialog choice for him is saying “Don’t make me arrest you!” and make you leave. Drug dealers however get a chance to sell drugs for a higher price (if you have this job in your DarkRP). This goes for every single job in standard DarkRP and has it’s own dialog/conversations/options.

? Game of chance.
Based on chance, the player approaching the crackhead NPC with the intent of selling him fake drugs, either earns an above average amount of money OR gets stabbed. For the precise chances you want to scope into the code. In general you have a 25% of selling fake drugs with a 20% of a critical sale giving you a lot of money. If gone wrong, 50% chance you get stabbed and 50% chance the stab misses. If the stab hits the player, it is subdivided in 4 classes. 0-25 damage, 25-50 damage, 50-75 damage and 75-100 damage. Each classed with their own dialogs.

? 5 minute rule.
You may only use this NPC once in 5 minutes. If done within, it will show a button ‘Crackhead is still high (5:00)’ instead of the ordinary dialog.

Role-play functions

? Attempt to sell fake drugs.
A player of which his job is in a criminal class is attempting to sell the crackhead some fake cocaine and such. Might go well, might go wrong. Read above for details.

? Sell drugs.
Drug dealer only - Sells drugs to the crackhead without the risk of getting stabbed. Also earns slightly more per dose than the fake drugs.

http://i.imgur.com/S73y98Y.png
WORKSHOP URL

This NPC has brought great fun to the server. Players regularly visit the NPC and sell some dope just for thrills. Not to mention the ‘wtf’-moments after getting stabbed. Please do not remove my name from the code; however I do state allowance for you to edit, upgrade or downgrade the code where needed. Please do not sell it. Ent:KINGS is releasing this on a non-commercial license.

WARNING - Recent testing has shown that sometimes the timer gets stuck at -300 and stops returning to normal dialog. I seem to have fixed this. But it might play up again. If so, please request your own coders or yourself to look into this. As the main introduction reads.

Read the documentation but don’t know how to spawn this entity? Read my full guide on spawning and adding it to the F4 menu:

Click to read guide!

>> FIXED N WORKSHOPPED <<

Are you fucking serious?

What’s wrong? Haha.

Do not use any of this he is a scammer who took $300 from the main owner
www.sdgaming.org

I have never scammed anyone. I am not going to go back into a big community history to settle my name. As it’s as simple as all the legals of the community being on my name, giving me full right to all its dependencies.

On a second note: these were all programmed to me and I have the right to re-claim these for my own use. The second owner whom I ran this community with has had no input in the codes released on this board, by this account.

I don’t see the relevance. But I will be reporting you to Facepunch.

As soon as you mention it, you probably will end up getting involved in some massive shit storm requiring you to actually explain all anyway… That is the Facepunch way.

Got enough threads yet?

They are all very nice releases so I don’t see what is wrong with it. Although a megathread would be cool.

I get an error,

After talking and selling him drugs, i get the 5 minutes timer.

and if i click on this timer, i get this :


[ERROR] gamemodes/darkrp/entities/entities/crackhead/cl_init.lua:66: Tried to use invalid object (type Panel) (Object was NULL or not of the right type)
  1. SetText - [C]:-1
   2. unknown - gamemodes/darkrp/entities/entities/crackhead/cl_init.lua:66

Timer Failed! [await][@gamemodes/darkrp/entities/entities/crackhead/cl_init.lua (line 61)]

The lines :


if gebruiken == 1 then
timer.Create("await", 1, 300, function() timen = timen -1 if timen == 0 or timen < 0 then
timer.Stop("await")
gebruiken = 0
DFrame2:Close() DFrame2:Remove()
timen = 10
end DButtonwo2:SetText("Too high, try again in: "..sec2Min(timen)) end)  ------ THE LINE 66 

The code is a mess.

Also, when we are supposed to lose(life) or win(money) it does nothing.

here is the command which is supposed to modify life or monney ; RunConsoleCommand(“darkrp_c_h_g_p”, amount)

What is “darkrp_c_h_g_p” ?

Just because I posted them within the same amount of time? They will obviously scatted over time based on popularity. You would know this if you actually contributed something to the FP community yourself. Use your common sense.

[editline]18th May 2013[/editline]

Get a paid coder to sort it out for you then. It’s a freebie, what did you expect? It works. Nothing else.

[editline]18th May 2013[/editline]


if gebruiken == 1 then
timer.Create("await", 1, 300, function() timen = timen -1 if timen == 0 or timen < 0 then
timer.Stop("await")
gebruiken = 0
DFrame2:Close() DFrame2:Remove()
timen = 10
end DButtonwo2:SetText("Too high, try again in: "..sec2Min(timen)) end)  ------ THE LINE 66


if gebruiken == 1 then
timer.Create("await", 1, 300, function() timen = timen -1 if timen == 0 or timen < 0 then
timer.Stop("await")
gebruiken = 0
DFrame2:Close() DFrame2:Remove()
timen = 10
end DButtonwo2:SetText("Too high, try again in: "..sec2Min(timen)) end)  ------ THE LINE 66

Replace it with this:


if gebruiken == 1 then
timer.Create("await", 1, 300, function() timen = timen -1 if timen == 0 or timen < 0 then
timer.Stop("await")
gebruiken = 0
DFrame2:Close() DFrame2:Remove()
timen = 10
end)
DButtonwo2:SetText("Crackhead is high. Try again in: "..sec2Min(timen)) end

And move it bellow this part:


local reso
DFrame2 = vgui.Create('DFrame')
DFrame2:SetSize(280, 314)
DFrame2:Center()
DFrame2:SetTitle('Encounter: Desperate Crackhead')
DFrame2:SetSizable(true)
DFrame2:SetDeleteOnClose(false)
DFrame2:MakePopup()
DFrame2:SetSkin("DarkRP")

You’re right. I’m no where near the caliber of coder you are. Hell, you’ve been part of facepunch for a month and have released more poorly coded addons than I ever could. I’ll be sure to learn my place next time.

Something is always better than nothing in my books. I’ve never acclaimed myself to be a great caliber coder neither have I said my addons are great. There is a reason my descriptions say no support and released purely for those whom know how to use them.

It’s in one of the first paragraphs of my posts, unless you don’t know how to read English, you should have closed it there.

Why not make 1 thread called ent:KINGS DarkRP Specials with all the stuff instead of packing it into like 4 different bloody threads? Wanting some post count are we?

First of all, didn’t really intend to release this many. I was planning to stick by the originals and not code any others. Second of all, Facepunch has set-up such a brilliant and feature incompetent board that I cannot merge threads in a later stage. Third of all, don’t you have more useful things to do than to browse the board in hunt for new forum members whom have commited a (harmless, extremely mild) mistake. Last time I checked, you weren’t part of the moderation team. And despite your hunks and dunks for the status of a staff-member which is obviously not granted nor received; please take proper use of the report function as it’s meant. PM the moderators as a last resort. You can find them on the bottom of the screen.

Apart from that, your message has already been posted few times, once in this particular thread. Which in my book still goes as free posting. Not so perfect yourself, are you?

I’d appreciate you tuning in your ears to this reply and using some common sense. If-not immediately stop posting messages that were already made up by other users.

Thanks.

By replying to him asking wanting some post count your asking for him to take more post count.

I did what you said here.

It Didn’t work, i get this error :




[ERROR] gamemodes/darkrp/entities/entities/crackhead/cl_init.lua:80: unexpected symbol near ')'
  1. unknown - gamemodes/darkrp/entities/entities/crackhead/cl_init.lua:0



the lines are :


if gebruiken == 1 then
timer.Create("await", 1, 300, function() timen = timen -1 if timen == 0 or timen < 0 then
timer.Stop("await")
gebruiken = 0
DFrame2:Close() DFrame2:Remove()
timen = 10
end)   ---- Line 80
DButtonwo2:SetText("Crackhead is high. Try again in: "..sec2Min(timen)) end

I don’t know why you people ar tearing this guy a new one for posting some free content that actually does work.
When it doesn’t work, it’s usually because you did someone wrong. PEBCAC (Problem Exists Between Chair And Computer).
You’ll learn more from making it work too so I really have no idea why you all are complaining.

Yea, the content is in different threads. He’s also providing support even though he said he wouldn’t. Honestly, this is a godsend for all beginner coders out there that are interesting in DarkRP.

@OP - Thanks for the releases and time spent making them.

I couldn’t have said it better myself.