• Problems That Don't Need Their Own Thread v5
    4,111 replies, posted
Firstly I put original .tff files. Console sad that it couldn't find them Them I use bzip, no errors. But no fonts
Added you
I mean why does :LastHitGroup() only work for Players and not for NPC's?
I think maybe because there’s no standard NPC skeleton, and LastHitGroup only returns a certain couple values. Could be wrong.
Having an issue using ents.FindInSphere in a SWEP, section of code: hook.Add( "EntityTakeDamage", "ReduceFallDamage", function( target, dmginfo ) --every time damage is taken checks to see  if target:IsPlayer() and target.reduceDamage and dmginfo:IsFallDamage() and target.hasshot then --if it is fall damage, if the user has the weapon, dmginfo:SetDamage( 0 ) print(target) --if the weapon has been fired etc.. if so then negate fall damage  timer.Simple(0.002, function() shock(target) end) --and initiate shock function end end ) function shock(owner) --shock function that produces sound, effects and damage to players in radius print(owner) local zaptable = { "ambient/energy/zap1.wav",--generate table of shock sounds "ambient/energy/zap2.wav", "ambient/energy/zap3.wav" } for _,ply in pairs( ents.FindInSphere(  owner:GetPos(), 350  ) ) do --find players in a sphere or size 350 if ply:IsPlayer() then print(ply) When my friend uses the SWEP the variable target prints his username and id. the variable owner prints his username and id. and the variable ply prints both me and him as i am standing next to him. When i use the SWEP. the variable target prints my username and id. the variable owner prints my username and id. but the variable ply prints only me and not him despite it being under the same circumstances. This flips depending on who hosts the server and even when tried on a 3rd party hosted server it only when he uses the SWEP is both our names printed. This is a super strange bug that i cant see why it occurs so any help would be greatly appreciated. If you need the full SWEP code i can post it as well but this seems to be the part that is causing the issues. Thanks
Don't understand what u are saying, but use ipairs instead of pairs. Small performance difference, apparently.
I used ipairs recently in a for loop regarding different classes of NPC's and different effects respectively. I'm mostly doing this to occupy my time, but I'm creating shields for NPC's by class. local shieldEnemies = {"npc_clawscanner","monster_alien_grunt","monster_houndeye","monster_alien_controller","npc_combine_s","monster_alien_slave"} local shieldDefault = {"20","100","20","50","100","40 "} I'm wondering if I could do it only using one table though. But this is not the reason I'm posting here tonight. EntityTakeDamage is called on the server but I want to draw an effect around the NPC's related to their shields, which I believe would require me to render a duplicate of the NPC clientside. I'm not entirely sure how to do this. My first thought is using a networked float for last hit time on each NPC but that seems excessive to me. Could anyone offer me some pointers?
As for the table, you can use the npc class as an index, like this: local shieldTable = { ["npc_clawscanner"] = 20, ["monster_alien_grunt"] = 50 } And then call it by shieldTable[npc:GetClass()] Writing code on phone realy sux
The issue is that using entire.findinsphere is only finding all players when a specific user is using it and I cannot see why it would exclude the other user when they use it. I've done the diagnosis through printing the variables I use to the console. I don't think I was particularly clear when I made post.
If user subscribe to addon with these fonts, it will work
*I bump this thread because older version of this thread was bumped by someone*
Found this in last crash. Is there a way to clear cache? Warning:  Table modelprecache is full, can't add models/cheeze/buttons2/coolant_small.mdl Host_Error: CVEngineServer::PrecacheModel: 'models/cheeze/buttons2/coolant_small.mdl' overflow, too many models Host_Error: CVEngineServer::PrecacheModel: 'models/cheeze/buttons2/coolant_small.mdl' overflow, too many models ./srcds_run: line 355: 13650 Segmentation fault      $HL_CMD Add "-debug" to the ./srcds_run command line to generate a debug.log to help with solving this problem
Nope: https://github.com/Facepunch/garrysmod-issues/issues/56
Anyone know by chance how the Half Life 2 turret model rotates it’s head as an NPC? Is there some kind of way to target that part of the model?
It uses a pose parameter: https://github.com/VSES/SourceEngine2007/blob/master/se2007/game/server/hl2/npc_turret.cpp#L817-L873
You are beyond helpful!
Been working on a character system alone on a listen server, it uses SQLite for saving persistent data. When I transfer my script (working 100% perfectly fine, no errors) to a dedicated server it suddenly just doesn't load. At all. Adding Filesystem Addon 'c:\gmodserver\garrysmod\addons\character-script-master' This is the only footprint of the addon loading in the console script. This is my Initialize hook. hook.Add("Initialize", "CS_Initialize.Hook", function() if sql.TableExists("character_list") then Msg("[CSCRIPT] Custom Character Tables Exist\n") else if (!sql.TableExists("character_list")) then Msg("[CSCRIPT] Table character_list created successfully\n") local query = sql.Query("CREATE TABLE `character_list` (`unique_id` INTEGER PRIMARY KEY AUTOINCREMENT, `slot` INTEGER, `steamid` TEXT, `firstname` TEXT, `lastname` TEXT, `money` TEXT, `model` TEXT, `job` INT, `banned` TEXT, `pocket` NVARCHAR);") else Msg( sql.LastError(query) .. "\n" ) end end  end) Like previously mentioned. When I run this locally on my machine it works perfectly fine. However, I've tried it on two separate dedicated server hosts and it's not working. I'm running the DarkRP gamemode. Server up to date. Unfortunately no errors to report. I found this git issue that seemed relevant: https://github.com/FPtje/DarkRP/pull/924 but it appears FPtje has already committed a fix. Any help would be greatly appreciated.
What realm are you running that script in? Does the hook run?
It's located in "/addon/player-script/lua/server/sv_ccmessages.lua" I'm not using any "if SERVER then end" method to run it on the server. I assumed the directory was enough?
The file directory should work, but if it doesn't, I would use a if SERVER then
It should be lua/autorun/server.
@code_gs So what you think about it? Is it real issue or I missed something? I want to solve this till end and make a verdict
I will have to wait to test on a dedi this next week for further testing.
What's the best approach to resolving a player getting stuck in a physics object, so that the player is 'pushed' out to empty space that's closest to his original position?
Could always use COLLISION_GROUP_PUSHAWAY
Doesn't seem to have any effect for me
Need some help, networking a ragdoll made on server with ents.Create to the client makes it invalid.
When I was executing a function like SomeGlobalTable.TableOfFunctions[key](args) For some reason, I get 'attempt to index local 'args' (a nil value)' inside the function I called. Whats the deal?
Could you show an exact example?
Object_AmmoDispenser = {}; Object_AmmoDispenser.__index = Object_AmmoDispenser; GameObject:Register( "Object_AmmoDispenser", Object_AmmoDispenser) local Object = Object_AmmoDispenser; function Object:ScanPlayer(args) end . . . . function RecieveTriggerEvent() local entIndex = net.ReadUInt(32);  local gamedata = net.ReadTable(); local eventName = net.ReadString(); local args = net.ReadTable(); local ent = ents.GetByIndex(entIndex); -- If the entity doesn't exist for the client yet, we need to put it in the queue to load it. --if (!ent:IsValid() || ent.gamedata == nil) then --table.insert(GameObject.unloadedents, {entIndex = entIndex, gamedata = gamedata}) --else table.Merge(ent.gamedata, gamedata); ent.gamedata[eventName](ent.gamedata, args); // <----------------THE FUNCTION IN QUESTION --end end  net.Receive( "GameObject_SendTriggerEvent", RecieveTriggerEvent) ent.gamedata is a Object_AmmoDispenser object, so I pass it through as the first argument? I don't understand why this works but it does.
Sorry, you need to Log In to post a reply to this thread.