I'm trying to figure out why most of my NPC's I have are getting this and not opening:
Warning: Unhandled usermessage 'HeliShop_BMSellShowMenu'
Here's the actual file for it.
ENT.Base = "base_ai"
ENT.Type = "ai"
if( CLIENT ) then
ENT.RenderGroup = RENDERGROUP_BOTH
function ENT:Draw()
self.Entity:DrawModel()
end
elseif( SERVER ) then
local schdStay = ai_schedule.New( "BMShop NPC Stay" )
local NewTask = ai_task.New()
NewTask:InitEngine("TASK_WAIT_INDEFINITE", 0) NewTask.TaskID = 1
schdStay.TaskCount = table.insert(schdStay.Tasks, NewTask)
function ENT:Initialize()
self:SetModel( helishop.BMshops[self.Entity.BMshop]["model"] )
self:SetHullType( HULL_HUMAN );
self:SetHullSizeNormal();
self:SetSolid( SOLID_BBOX )
self:SetMoveType( MOVETYPE_STEP )
self:SetCustomCollisionCheck(true)
self:CapabilitiesAdd( bit.bor(CAP_MOVE_GROUND, CAP_OPEN_DOORS, CAP_ANIMATEDFACE, CAP_TURN_HEAD, CAP_USE_SHOT_REGULATOR, CAP_AIM_GUN) )
self:SetMaxYawSpeed( 5000 )
self:SetUseType(SIMPLE_USE)
end
function ENT:SelectSchedule()
self:StartSchedule( schdStay )
end
function ENT:AcceptInput( name, activator, caller )
if( !caller:IsValid() || !caller:IsPlayer() || name != "Use" ) then return end
if (caller:Team() != TEAM_CITIZEN) then
Notify(caller, 0, 9, "You must be a citizen to use this NPC!")
self.LastUse = CurTime() + 1
if (self.LastUse > CurTime()) then
return
end
end
umsg.Start( "HeliShop_BMShowMenu", activator )
umsg.Long( caller.LastPackage1 )
umsg.Long( caller.LastPackage2 )
umsg.Long( caller.LastPackage3 )
umsg.Bool( caller.VehicleData["H500WeaponPack"] )
umsg.Bool( caller.VehicleData["LittleBirdWeaponPack"] )
umsg.Char( caller.HasPackage )
umsg.Entity( self )
umsg.End()
end
end
Any help would be appreciated!
Maybe you need to use umsg.PoolString? it's better to use net messages though.
You should use net messages, BUT this means that the following code is missing from your clientside files:
usermessage.Hook("HeliShop_BMShowMenu", function(umsg)
umsg:ReadLong()
umsg:ReadLong()
umsg:ReadLong()
umsg:ReadBool()
umsg:ReadBool()
umsg:ReadChar()
umsg:ReadEntity()
end)
This isn't the exact code but it's something like this. You might be missing an addon file that goes with those NPC's
Sorry, you need to Log In to post a reply to this thread.