[QUOTE=mijyuoon;48443480]Same way you would kill a player:
[code]
x:Kill()
[/code][/QUOTE]
Kill is a Player function, you should probably do
[code]NPC:TakeDamage(NPC:Health()+1) -- plus 1 because why not be extra sure they die[/code]
[QUOTE=Z0mb1n3;48443523]Kill is a Player function, you should probably do
[code]NPC:TakeDamage(NPC:Health()+1) -- plus 1 because why not be extra sure they die[/code][/QUOTE]
Wat. Then why [I]:Kill()[/I] works for me? Damn, I think it may be my custom extension library bullshit that adds it.
[QUOTE=krekeris;48442815]Seems like you are calling this function without arguments.
[CODE]Derma_DrawBackgroundBlur(YourPanel, 0)[/CODE][/QUOTE]
Still doesnt work with Derma_DrawBackgroundColor(self, 1) in PANEL:Paint()
[QUOTE=bran92don;48443445]Why not? I could have sworn I read in the update thread that he made them just as efficient as nets in one of the past updates?
Plus I am only using that to load one simple function on the client.[/QUOTE]
No, user messages are old and should not be used. Never were they changed, and never will they. Use the net library for anything involving sending data between client and server.
What is the model for the 357 ammo?
[QUOTE=P4sca1;48445164]What is the model for the 357 ammo?[/QUOTE]
How hard is it to open you Spawnmenu in game and spawn the 357 ammo and look its model up via console or Entity Inspector Tool or Right click and "Copy to Clipboard" the spawnicon in Half-Life 2 > Items?
[QUOTE=Robotboy655;48445196]How hard is it to open you Spawnmenu in game and spawn the 357 ammo and look its model up via console or Entity Inspector Tool or Right click and "Copy to Clipboard" the spawnicon in Half-Life 2 > Items?[/QUOTE]
How can I check the model via console?
If I would know how I can do this, I won't ask here :3
[QUOTE=P4sca1;48445245]How can I check the model via console?
If I would know how I can do this, I won't ask here :3[/QUOTE]
In your game console on singleplayer you can invoke
[quote]lua_run MsgN(player.GetAll()[1]:GetEyeTrace().Entity:GetModel())[/quote]
[QUOTE=FireArrow133;48445255]In your game console on singleplayer you can invoke[/QUOTE]
Thank you! :)
[QUOTE]local timeUntilTired = 10 --In Seconds
local timeToFill = 60 --In Seconds
for k, v in pairs(player.GetAll()) do
timeUntilTired = 10 + ( v:Stamina() * 0.5 ) --In Seconds
timeToFill = 60 - ( v:Stamina() * 0.5 ) --In Seconds
end[/QUOTE]
I getting the same like the local
timeUntilTired = 10
timeToFill = 60
Instead of (if the Stamina Variable = 100)
timeUntilTired = 60
timeToFill = 10
Hi,
I've been having issues with people sending my server source query attacks that end up with SRCDS just being hung, the application itself is responding but the server just disconnects all people and sorta just freezes. I'm trying to find a solution and so far I've tried [URL="http://ashersoftware.com/seDirector/download/"]seDirector[/URL] and [URL="http://www.serverdoc.com/"]ServerDoc[/URL] while they're both nifty programs that help out via auto restarting when there is a crash unrelated to these sorts of attacks neither seem to restart the server if its hung so uhhh anything I can do about this besides having to hop on every time my server mucks up.
[QUOTE=Johnny Guitar;48446086]Hi,
I've been having issues with people sending my server source query attacks that end up with SRCDS just being hung, the application itself is responding but the server just disconnects all people and sorta just freezes. I'm trying to find a solution and so far I've tried [URL="http://ashersoftware.com/seDirector/download/"]seDirector[/URL] and [URL="http://www.serverdoc.com/"]ServerDoc[/URL] while they're both nifty programs that help out via auto restarting when there is a crash unrelated to these sorts of attacks neither seem to restart the server if its hung so uhhh anything I can do about this besides having to hop on every time my server mucks up.[/QUOTE]
I'm pretty sure all you can do is rate limit queries.
[QUOTE=StonedPenguin;48446423]I'm pretty sure all you can do is rate limit queries.[/QUOTE]
I'm not worried about the attacks themself, I'm concerned about getting the server to restart after SRCDS has been hung for a while.
Can someone explains me why render view modifies renderscreenspace?
For a DModelPanel, how would I change the gross rounded blue rectangle that appears on items when the mouse hovers over it?
Or should I override the paint hook, force the model to draw (:DrawModel()?), then use the OnCursorEntered/Exited functions?
[QUOTE=bran92don;48443445]Why not? I could have sworn I read in the update thread that he made them just as efficient as nets in one of the past updates?
Plus I am only using that to load one simple function on the client.[/QUOTE]
It's not that, it's that it's going to be removed soon. Just avoids fixing things that could have been prevented.
Attempting to make a convenience function to fetch a player's name from their steam profile.
[code]
local name = ""
function fetchName(steamid)
http.Fetch(Format("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=%s&steamids=%s", key, util.SteamIDTo64(steamid)),
function(body, length, header, code)
local body = util.JSONToTable(body)
if !body then
PrintConsole("Unable to fetch username for "..steamid.."\n")
return
end
name = body.response.players[1].personaname
end,
function(error)
PrintConsole("HTTP error in fetching username for "..steamid..", HTTP error: "..tostring(error).."\n")
end)
end
[/code]
This obviously doesn't work, because http.Fetch interrupts whatever it wants and makes my function return nil.
Is there absolutely no way to accomplish this? Must I have a prebuilt function ready to do something with the response, rather than store it and return it?
[QUOTE=Z0mb1n3;48452594]Attempting to make a convenience function to fetch a player's name from their steam profile.
This obviously doesn't work, because http.Fetch inetrrupts whatever it wants and makes my function return nil.
Is there absolutely no way to accomplish this? Must I have a prebuilt function ready to do something with the response, rather than store it and return it?[/QUOTE]
Yes, this is called asynchronous programming.
Does anyone know if I can calculate the number of bits needed to send a number in net.WriteInt with Lua?
[QUOTE=Mooda Looda;48452758]Does anyone know if I can calculate the number of bits needed to send a number in net.WriteInt with Lua?[/QUOTE]
[code]
bits = 0
for i = 0, 31 do
if num < -( 2 ^ i ) or num > ( 2 ^ i ) then
bits = bits + 1
end
end[/code]
Something like that I guess.
[QUOTE=Mooda Looda;48452758]Does anyone know if I can calculate the number of bits needed to send a number in net.WriteInt with Lua?[/QUOTE]
Yes. [B]EDIT:[/B][I] I fucked up, updated with fixed version.[/I]
[code]
math.floor(math.log(yourNumber)/math.log(2)+1)
[/code]
[img]http://i.imgur.com/Yqfu8WU.png[/img]
And there goes the motivation out the window. Great job Source.
What really causes this? Too many net messages?
D'oh, I've found a new problem.
So, thanks mijyuoon, that code is useful. But I've run into a problem...
So, this is my serverside code:
[code]function RoundMsg( colour, num )
net.Start( "RoundIntMessage" )
net.WriteInt( num, math.floor(math.log(num)/math.log(2)+1) )
net.Broadcast()
end[/code]
But, what about net.ReadInt()? You need the bitcount as an argument, but what about retrieving the number so we can perform that calculation to get the appropriate bitcount to read? If you don't know what I mean than this might help:
[code]net.Receive( "RoundIntMessage", function()
chat.AddText( "The remaining round time is " net.ReadInt( math.floor(math.log(num)/math.log(2)+1) ) )
end)[/code]
Umm.... what do I do?
[editline]13th August 2015[/editline]
"num" is undefined, but I don't really know how we'd get the number to define, is what I'm saying.
I'd pass the bitcount as a string then parse it back to a number, but that's what I'd do. Or I'd write it as a float.
[QUOTE=FireArrow133;48453049]I'd pass the bitcount as a string then parse it back to a number, but that's what I'd do. Or I'd write it as a float.[/QUOTE]
Hmm, that's what I was thinking. I might try that
If you're using ints, your max is +/-2^31, so 32 bits is the largest it will ever be. Save yourself a headache and just write a 32bit value ( 4 bytes )
[QUOTE=Kogitsune;48453116]If you're using ints, your max is +/-2^31, so 32 bits is the largest it will ever be. Save yourself a headache and just write a 32bit value ( 4 bytes )[/QUOTE]
As in, just write 4 bits no matter what number I'm using?
[QUOTE=Mooda Looda;48453178]As in, just write 4 bits no matter what number I'm using?[/QUOTE]
32 bits, not 4. And regardless of this I'm pretty sure Source operates on chunks of 8 bits (aka bytes), not on bits, so stuff like 5 bits will still send 8 and 11 will send 16 and so on.
[QUOTE=Johnny Guitar;48447406]I'm not worried about the attacks themself, I'm concerned about getting the server to restart after SRCDS has been hung for a while.[/QUOTE]
Try mine [url]http://facepunch.com/showthread.php?t=1418230[/url]
[QUOTE=FireArrow133;48453049]I'd pass the bitcount as a string then parse it back to a number, but that's what I'd do. Or I'd write it as a float.[/QUOTE]
doing that is way more than just sending 32 bits to be safe
Sorry, you need to Log In to post a reply to this thread.