Creating Job NPC's - XxLMM13xXgaming/drp GitHub Wiki
To add a job NPC this is what you need to do...
Getting started
First off you will need to set up a file in the autorun (server)
addonname/lua/autorun/sv_filename.lua
you will need to use this format..
DRPJobNPCs.PO = {
pos = Vector(-8732.911133, -5573.004395, 72.031250),
ang = Angle(-4.619998, -90.660179, 0.000000),
name = "Police Officer",
model = "models/player/santosrp/male_04_santosrp.mdl",
description = [[So you want to be a police officer huh..
Well let me tell you something not just anyone can be a police officer!
It takes LOTS of experience and courage! Do you have what it takes?
You will need to be known in the city and follow the laws!
We thank you for your service!]],
usefunction = [[
function DRPJobFunction(ply, name, description)
net.Start("DRPJobNPCPressed")
net.WriteString(name)
net.WriteString(description)
net.Send(ply)
end
]]
}
Now this can get complicated... So pay attention the .PO
is the job's ID (not number the text id) pos
and ang
are the pos and ang... name
is the display name model
is the model description
is the text on the NPC... watch out because the text is weird (pos of the text) and usefunction
is the function to use when NPC is pressed! (suggested to use the template or not change at all)