Deluvas Posted July 3, 2009 Share Posted July 3, 2009 (edited) cl_init ---- function HUDPaint()(...) if MySelf:Alive() then local Timp = GetGlobalInt("ProtTime") - CurTime() if (ProtBool == true ) and ( math.Round(Timp) > 0 ) then for i=1,2 do draw.SimpleText("Protection: "..math.ceil(Timp).."", "FontHUD", w*0.4950+math.random(-1,1), h*0.8+math.random(-1,1), Color (0, 255, 0),TEXT_ALIGN_CENTER) end end if (ProtBool == true ) and ( math.Round(Timp) <= 0 ) then for i=1,2 do draw.SimpleText("Protection has faded!", "FontHUD", w*0.4950+math.random(-1,1), h*0.8+math.random(-1,1), Color (0, 255, 0),TEXT_ALIGN_CENTER) end end end(...)endfunction RecProtTime(um) ProtBool = um:ReadBool()endusermessage.Hook("RecProtTime", RecProtTime)obj_ply_extended.lua ------function meta:Redeem()(..) -- after self:Spawn() if math.Round(INFLICTION*10) > 0 and math.Round(INFLICTION*10) ~= 20 then ProtBool = true SetGlobalInt("ProtTime", math.Round((INFLICTION*20))+CurTime()) self:GodEnable() umsg.Start ("RecProtTime",self) umsg.Bool (ProtBool) umsg.End() timer.Create(self:UserID().."HumanSpawnProtection", math.Round((INFLICTION*20))+1, 1, function() if self:IsValid() and self:IsPlayer() then self:GodDisable() end ProtBool = false umsg.Start ("RecProtTime",self) umsg.Bool (ProtBool) umsg.End() end) endend Edited July 4, 2009 by -N7-BloodGuard Deluvas Quote Link to comment
Botervloot Posted July 4, 2009 Share Posted July 4, 2009 Human spawn protection?For ZS? I don't see the point. Maybe in last human, but in the beginning it's quite useless, tbh. Quote Link to comment
Clavus Posted July 4, 2009 Share Posted July 4, 2009 Don't set spawn protection in the GM:DoPlayerDeath, that's triggered when he dies. Set it in GM:PlayerSpawn. Quote Link to comment
Deluvas Posted July 4, 2009 Author Share Posted July 4, 2009 I don't mean putting spawn protection on initial spawn, but on Redeem. Quote Link to comment
Danni Posted July 4, 2009 Share Posted July 4, 2009 Don't spawnprotect when they spawn the first time, but when they redeem it's ok with spawnprotection Quote Link to comment
Deluvas Posted July 4, 2009 Author Share Posted July 4, 2009 Don't spawnprotect when they spawn the first time, but when they redeem it's ok with spawnprotectionMy thoughts exactly ! Quote Link to comment
Hundred2 Posted July 4, 2009 Share Posted July 4, 2009 Spawnprotection for humans when they redeem?Epic, now i wont get raped by 4 spawncamping chems when i redeem .Must, Get IMPLEMENTED NAOW.how long does it last tho? Quote Link to comment
Deluvas Posted July 4, 2009 Author Share Posted July 4, 2009 INFLICTION*20. If infliction is 50% (INFLICTION = 0.5) => Protection is 10 seconds. It would be nice indeed for Clavus to implement in the next update . (well, optimized code,ofc) Quote Link to comment
A Random Hobo Posted July 4, 2009 Share Posted July 4, 2009 //code //You really shouldn't use 'Time' as a variable. Besides from that, seems not too bad code. Havn't read it thourghly though. Quote Link to comment
Chikennugget1 Posted July 5, 2009 Share Posted July 5, 2009 Good idea,it's annoying when you redeem in a place blocked by zombies and being insta-killed. Quote Link to comment
RoboRobb Posted July 5, 2009 Share Posted July 5, 2009 This is awesome that Deluvas has attempted to create this code for spawn protection, and it really would be cool if we had this on the server. Quote Link to comment
Sneed Posted July 5, 2009 Share Posted July 5, 2009 (edited) Why not add something that you cannot get stuck into props while your are in this protection Edited July 5, 2009 by Sneedbeard Quote Link to comment
Chikennugget1 Posted July 5, 2009 Share Posted July 5, 2009 And a no-collision system for the redeemer Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.