• Default entities source code
    11 replies, posted
Hi. I want to look at the source code of the some default entites like item_healthcharger. How I can do this? Thx
[QUOTE=_AMD_;48453056]Hi. I want to look at the source code of the some default entites like item_healthcharger. How I can do this? Thx[/QUOTE] You can see SOME of them here: [url]https://github.com/ValveSoftware/source-sdk-2013[/url] Not not all of them. You can find source of all Lua entities here: [url]https://github.com/garrynewman/garrysmod/tree/master/garrysmod[/url]
-snip f you robot for ninjaing jk bby-
[QUOTE=Robotboy655;48453069] You can find source of all Lua entities here: [url]https://github.com/garrynewman/garrysmod/tree/master/garrysmod[/url][/QUOTE] Ok. Where is item_healthcharger?
Is it too hard to use search? Edit: fucked up the line number, updated. [URL]https://github.com/ValveSoftware/source-sdk-2013/blob/55ed12f8d1eb6887d348be03aee5573d44177ffb/mp/src/game/server/hl2/item_healthkit.cpp#L420[/URL]
[QUOTE=mijyuoon;48453123]Is it too hard to use search? Edit: fucked up the line number, updated. [URL]https://github.com/ValveSoftware/source-sdk-2013/blob/55ed12f8d1eb6887d348be03aee5573d44177ffb/mp/src/game/server/hl2/item_healthkit.cpp#L420[/URL][/QUOTE] Я использовал поиск. И это не исходник чарджера. Так или иначе я не вижу по этому исходнику как он работает
[QUOTE=_AMD_;48453148]Я использовал поиск. И это не исходник чарджера[/QUOTE] [code] class CNewWallHealth : public CBaseAnimating ... LINK_ENTITY_TO_CLASS( item_healthcharger, CNewWallHealth); [/code] А это что тогда? [code] // charge the player if ( pActivator->TakeHealth( 1, DMG_GENERIC ) ) { m_iJuice--; } [/code]
Ninja'd [code]LINK_ENTITY_TO_CLASS( item_healthcharger, CNewWallHealth);[/code] Yes it is
[QUOTE=mijyuoon;48453159][code] class CNewWallHealth : public CBaseAnimating ... LINK_ENTITY_TO_CLASS( item_healthcharger, CNewWallHealth); [/code] &#1040; &#1101;&#1090;&#1086; &#1095;&#1090;&#1086; &#1090;&#1086;&#1075;&#1076;&#1072;? [code] // charge the player if ( pActivator->TakeHealth( 1, DMG_GENERIC ) ) { m_iJuice--; } [/code][/QUOTE] &#1061;&#1088;&#1077;&#1085; &#1077;&#1075;&#1086; &#1079;&#1085;&#1072;&#1077;&#1090;. &#1053;&#1072; Lua &#1082;&#1072;&#1082; &#1079;&#1072;&#1087;&#1080;&#1083;&#1080;&#1090;&#1100;, &#1095;&#1090;&#1086;&#1073;&#1099; &#1093;&#1087; &#1074;&#1099;&#1076;&#1072;&#1074;&#1072;&#1083;&#1086;&#1089;&#1100; &#1084;&#1077;&#1076;&#1083;&#1077;&#1085;&#1085;&#1077;&#1077;? [code] function ENT:Use(activator) local maxhealth = activator:GetMaxHealth() or 100 if activator:Health() < maxhealth then activator:SetHealth(activator:Health() + 1) self:EmitSound("hl1/fvox/boop.wav", 150, activator:Health() / maxhealth * 100, 1, CHAN_AUTO) end end [/code]
[code] function ENT:Initialize() self.LastFired = 0 self.Delay = 0.1 end function ENT:Use(act) if self.LastFired <= CurTime() then self.LastFired = CurTime() + self.Delay -- code here end end [/code]
please use english on an english forum [editline]a[/editline] i just want to stalk this thread in english
[QUOTE=mijyuoon;48453224][code] function ENT:Initialize() self.LastFired = 0 self.Delay = 0.1 end function ENT:Use(act) if self.LastFired <= CurTime() then self.LastFired = CurTime() + self.Delay -- code here end end [/code][/QUOTE] &#1057;&#1087;&#1072;&#1089;&#1080;&#1073;&#1086;. &#1059; &#1084;&#1077;&#1085;&#1103; &#1077;&#1097;&#1077; &#1090;&#1072;&#1082;&#1086;&#1081; &#1089;&#1087;&#1086;&#1089;&#1086;&#1073; &#1089;&#1088;&#1072;&#1073;&#1086;&#1090;&#1072;&#1083;, &#1085;&#1086; &#1082;&#1072;&#1078;&#1077;&#1090;&#1089;&#1103;, &#1090;&#1072;&#1082; &#1085;&#1077; &#1087;&#1088;&#1072;&#1074;&#1080;&#1083;&#1100;&#1085;&#1086; &#1076;&#1077;&#1083;&#1072;&#1090;&#1100; :) [code] local LastUse = CurTime() - 1 function ENT:Use(activator) if LastUse < CurTime() then -- code LastUse = CurTime() + 0.15 end end [/code] [QUOTE=MeepDarknessM;48453281]please use english on an english forum[/QUOTE] Solved :)
Sorry, you need to Log In to post a reply to this thread.