English SpecLock Script | Change ID to IP

3 replies
Goto Page
To the start Previous 1 Next To the start
Up
KagamineLen
User
Offline Off
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.

Code:
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
20.11.11 07:26:02 pm
Up
Phedixinormus
BANNED
Offline Off
Textual Context has written:
Code:
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:
20.11.11 08:49:12 pm
Up
sheeL
User
Offline Off
user Phedixinormus has written:
Textual Context has written:
Code:
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
21.11.11 12:26:25 am
Up
KagamineLen
User
Offline Off
i tested those script but that doesn't work
To the start Previous 1 Next To the start