!MineCraft! Cs2d Server

You are not connected. Please login or register

[Script] 10-second spawn protection

View previous topic View next topic Go down  Message [Page 1 of 1]

1 [Script] 10-second spawn protection on Sat Jan 18, 2014 10:38 am

Random

avatar
MC2D Admin
MC2D Admin
Here's (my) our (Random and Raining Mammoths!) 10-second spawn protection script, it works in my computer, i hope it doesn't have conflicts with the server's script.

There's no msg commands like "You have spawn protection" etcetc, just plain script.

Code (fixed)

Code:

-- 10-second spawn protection script
-- by Random Troll and Raining Mammoths

function getAmount(value)
      local amt = {}
          for x = 1, value do
                amt[x] = 0
          end
      return amt
end


state = getAmount(32)
protect = getAmount(32)

addhook("spawn","protect_exec")
function protect_exec(id)
      protect[id] = 10
      if (protect[id] > 0) then
          state[id] = 1
    end
end

addhook("ms100","protection_check")
function protection_check()
    for x = 1,32 do
          if (state[x] == 1) then
              if (protect[x] == 0) or (protect[x] <= 0) then
                    state[x] = 0
              end
          end
    end
end

addhook("second","protection_time")
function protection_time(id)
      for x = 1,32 do
          if (state[x] == 1) and (protect[x] > 0) then
                protect[x] = protect[x] - 1
          end
      end
end

addhook("hit","protection_do")
function protection_do(id,source)
      if (state[id] == 1) or (state[source] == 1) then
        return 1
      else
          return 0
      end
end



Last edited by Random Troll on Thu Jan 23, 2014 1:55 am; edited 3 times in total


[hr]
i'M TRYING
http://mc2d.forum2x2.net/

2 Re: [Script] 10-second spawn protection on Sat Jan 18, 2014 4:03 pm

pirates killer

avatar
MC2D Moderator
MC2D Moderator
Very good Wink , You are best scripter and player i know xd .

3 Re: [Script] 10-second spawn protection on Sat Jan 18, 2014 5:57 pm

Apfelbrot

avatar
Friend of Community
Apfelbrot likes this. Hopefully it will be added to teh server.


[hr]
Pierre Manulle Sanchez Neymar Junior Alavera recommends: Best CS2D Armor Pack

4 Re: [Script] 10-second spawn protection on Sun Jan 19, 2014 2:26 am

Tricky Fox

avatar
Friend of Community
Tricky Fox was there

P.S. You should probably PM the owner? Try your destiny Try to.


[hr]
And I'm still alive, uhuhu
http://mc2d.forum2x2.net

5 Re: [Script] 10-second spawn protection on Mon Jan 20, 2014 11:42 am

Random

avatar
MC2D Admin
MC2D Admin
Will update this in a few minutes.


[hr]
i'M TRYING
http://mc2d.forum2x2.net/

6 Re: [Script] 10-second spawn protection on Thu Jan 23, 2014 1:58 am

Random

avatar
MC2D Admin
MC2D Admin
updated, fixed, eh


[hr]
i'M TRYING
http://mc2d.forum2x2.net/

7 Re: [Script] 10-second spawn protection on Sat Feb 01, 2014 8:16 am

Random

avatar
MC2D Admin
MC2D Admin
meh, bump it


[hr]
i'M TRYING
http://mc2d.forum2x2.net/

8 Re: [Script] 10-second spawn protection on Sat Feb 01, 2014 9:39 am

Hitman-ps

avatar
Despised
What if someone go to teleport and the 10 second didn't finish yet?


[hr]


Eh , everybody changed .
http://Pul9.co

9 Re: [Script] 10-second spawn protection on Sat Feb 01, 2014 2:41 pm

Random

avatar
MC2D Admin
MC2D Admin
He can't attack and he can't be attacked, i'm no pro scriptor but i'm working on things, i'm currently upgrading the script, if you get any items (m4a1 super armor etc), the spawn protection will be disabled (that's what i'm working at)


[hr]
i'M TRYING
http://mc2d.forum2x2.net/

10 Re: [Script] 10-second spawn protection on Sat Feb 01, 2014 2:45 pm

Hitman-ps

avatar
Despised
If you upgrade it , it will be awesome .


[hr]


Eh , everybody changed .
http://Pul9.co

11 Re: [Script] 10-second spawn protection on Sat Feb 01, 2014 2:45 pm

Random

avatar
MC2D Admin
MC2D Admin
If and only if i can do it earlier.


[hr]
i'M TRYING
http://mc2d.forum2x2.net/

Sponsored content


View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum