Forum

> > CS2D > Scripts > SpecLock Script | Change ID to IP
Forums overviewCS2D overview Scripts overviewLog in to reply

English SpecLock Script | Change ID to IP

3 replies
To the start Previous 1 Next To the start

old SpecLock Script | Change ID to IP

KagamineLen
User Off Offline

Quote
can someone help me convert this script to IP because it only lock ID so if other player has this id cant join the team please help me, thanks.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
function initArray2(f,v)
     local cmd={}
     for c=1,f do
          cmd[c]=v
     end
     return cmd
end

isLockedInSpec=initArray2(32,false)
admin=70919

addhook("say","SpecLock")
function SpecLock(id,t)
     if (player(id,"usgn")==admin and t:sub(1,5)=="!lock") then
          local lockedID=tonumber(t:sub(6))
          if (lockedID>0 and lockedID<=32 and player(lockedID,"exists")) then
               isLockedInSpec[lockedID]=true
			   parse("makespec "..lockedID)
               msg(player(lockedID,"name").." Has been Locked in spectators!")
          end
     end
     if (player(id,"usgn")==admin and t:sub(1,7)=="!unlock") then
          local unlockID=tonumber(t:sub(8))
          if (unlockID>0 and unlockID<=32 and player(unlockID,"exists") and isLockedInSpec[unlockID]) then
               isLockedInSpec[unlockID]=false
               msg(player(id,"name").." has unlocked "..player(lockedID,"name").." from spectators!")
          end
     end
end

addhook("team","noRejoinWhenLocked")
function noRejoinWhenLocked(id,t)
     if (isLockedInSpec[id]) then
          if (t~=0) then
               msg2(id,"You are locked in spectators - you can't join any other team!")
               return 1
          end
     end
end

old Re: SpecLock Script | Change ID to IP

Phedixinormus
BANNED Off Offline

Quote
Textual Context has written
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
admins={}
lock={}

addhook("say","_say")
addhook("team","_team")

function _say(id,message)
     for _,id2 in ipairs(admins) do
          if player(id,"usgn")==id2 then
               if string.sub(message,1,6)=="!lock " then
                    lock[player(string.sub(message,7),"ip")]=true
                    msg("player locked")
               elseif string.sub(message,1,8)=="!unlock " then
                    lock[player(string.sub(message,9),"ip")]=nil
                    msg("player unlocked")
               end
          return 1
          end
     end
end

function _team(id)
     if lock[player(id,"ip")]==true then
          msg("you are locked")
          return 1
     end
end


Link:

old Re: SpecLock Script | Change ID to IP

sheeL
User Off Offline

Quote
user Phedixinormus has written
Textual Context has written
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
admins={}
lock={}

addhook("say","_say")
addhook("team","_team")

function _say(id,message)
     for _,id2 in ipairs(admins) do
          if player(id,"usgn")==id2 then
               if string.sub(message,1,6)=="!lock " then
                    lock[player(string.sub(message,7),"ip")]=true
                    msg("player locked")
               elseif string.sub(message,1,8)=="!unlock " then
                    lock[player(string.sub(message,9),"ip")]=nil
                    msg("player unlocked")
               end
          return 1
          end
     end
end

function _team(id)
     if lock[player(id,"ip")]==true then
          msg("you are locked")
          return 1
     end
end


Link:



Supply , This script does not work
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview