Deluvas Posted July 3, 2009 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
Botervloot Posted July 4, 2009 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
Clavus Posted July 4, 2009 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
Deluvas Posted July 4, 2009 Author Posted July 4, 2009 I don't mean putting spawn protection on initial spawn, but on Redeem. Quote
Danni Posted July 4, 2009 Posted July 4, 2009 Don't spawnprotect when they spawn the first time, but when they redeem it's ok with spawnprotection Quote
Deluvas Posted July 4, 2009 Author 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
Hundred2 Posted July 4, 2009 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
Deluvas Posted July 4, 2009 Author 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
A Random Hobo Posted July 4, 2009 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
Chikennugget1 Posted July 5, 2009 Posted July 5, 2009 Good idea,it's annoying when you redeem in a place blocked by zombies and being insta-killed. Quote
RoboRobb Posted July 5, 2009 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
Sneed Posted July 5, 2009 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
Chikennugget1 Posted July 5, 2009 Posted July 5, 2009 And a no-collision system for the redeemer Quote
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.