English Lua Scripts/Questions/Help

6,770 replies
Goto Page
To the start Previous 1 2 ... 281 282 283 ... 338 339 Next To the start
17.10.10 05:30:01 pm
Up
HaRe
User
Offline Off
maPmaKer has written:
@HaRe:

It is working now but how to add the bot immediatly in the spec mode?


Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
botishere=0
addhook("ms100","hook_ms100_botscript")
function hook_ms100_botscript()
     if (#player(0,"table")>=24) then
          if botishere==1 then
               for i=1,#player(0,"table") do
                    if (player(i,"bot")) then
                         parse("kick "..i)
                         botishere=0
                    end
               end
          end
     elseif #player(0,"table")<24 and botishere~=1 then
          bot = parse("bot_add")
          parse("makespec "..bot)
          botishere=1
     end
end
w0w im so eXotiK
17.10.10 05:36:11 pm
Up
Flacko
User
Offline Off
Code:
1
bot = parse("bot_add")

Dude, you know that parse doesn't return anything, right?
17.10.10 07:25:18 pm
Up
maPmaKer
User
Offline Off
HaRe has written:
maPmaKer has written:
@HaRe:

It is working now but how to add the bot immediatly in the spec mode?


Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
botishere=0
addhook("ms100","hook_ms100_botscript")
function hook_ms100_botscript()
     if (#player(0,"table")>=24) then
          if botishere==1 then
               for i=1,#player(0,"table") do
                    if (player(i,"bot")) then
                         parse("kick "..i)
                         botishere=0
                    end
               end
          end
     elseif #player(0,"table")<24 and botishere~=1 then
          bot = parse("bot_add")
          parse("makespec "..bot)
          botishere=1
     end
end


No, something is wrong. I mean I tryed the 24 players lua and it just added and kicked the bot every 100 ms.

Then I tryed the lua with the spec mode included. You won't imagine what happend It just added 23 bots and when I was kicking them it just added another bot to replace the kicked one. Omg please fix it so it can work please.

Thanks a lot
17.10.10 07:28:01 pm
Up
HaRe
User
Offline Off
@maPmaKer:

Just tell me what u want for script and ill script another one
w0w im so eXotiK
17.10.10 07:32:42 pm
Up
hyh2
COMMUNITY BANNED
Offline Off
GIVING MY CARMOD SCRIPT AWAY! PM ME.
Only for people who have "brains".

Ohh and who can code jail script?
!jail ID then x==1 y==3
IMG:http://www.graphicsgrotto.com/animatedgifs/comments/thankyou/images/agcthankyou4.gif
17.10.10 07:45:03 pm
Up
HaRe
User
Offline Off
hyh2 has written:
GIVING MY CARMOD SCRIPT AWAY! PM ME.
Only for people who have "brains".

Ohh and who can code jail script?
!jail ID then x==1 y==3


Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
jx = 1
jy = 1

addhook("say","jail") function jail(id,t)
     if (string.sub(t,1,1) == "!") then
          if (string.sub(t,3,4) == "jail") then
               local p = string.sub(t,9)
               if (player(p,"exists")) then
                    parse("setpos ".p.." "..jx.." "..jy)
               end
          end
     end
end
w0w im so eXotiK
17.10.10 08:09:01 pm
Up
TDShuft
User
Offline Off
Is There Possible To Find There Player Who Use The Trigger ?
using Hook : Trigger?
edited 3×, last 18.10.10 12:12:33 am
Sorry , I can't be Perfect !
18.10.10 01:23:06 am
Up
beckerchen
User
Offline Off
TDShuft has written:
Is There Possible To Find There Player Who Use The Trigger ?
using Hook : Trigger?

mabe if you check the current positions of all players.
like that:
Code:
1
2
3
4
for id = 1,32 do
     if player(id,"exist") then
          if player (id,"tilex") == X and player(id,"tiley") == Y then
.........

X and Y would be the tile-coordinates for the position from where a player can trigger.

The only problem would be that if there is another player which didn't triggered, the script would work for him too.

Sry for my terrible english
18.10.10 01:42:06 am
Up
CmDark
User
Offline Off
@beckerchen, you have a problem in that, which is why DC conveniently created the Use Hook and the UseButton Hook.

Code:
1
2
3
4
usebutton(id,x,y)                         on using a button
-id: player id
-x: button x (tiles)
-y: button y (tiles)



Code:
1
2
3
4
5
6
use(id,event,data,x,y)                         on use
-id: player id
-event: use event (1 h.follow,2 h.stop,3 defuse, 100 tr._use, 150 dyn obj.)
-data: additonal data
-x: use x (tiles) or hostage id
-y: use y (tiles)
IMG:http://i54.tinypic.com/auk478.png
18.10.10 02:07:09 am
Up
beckerchen
User
Offline Off
damn I forgot that
18.10.10 05:34:54 am
Up
Smuckie
User
Offline Off
@hyh2: Can you please download the new code and send me the download link? I cannot edit LUA AT ALL!
-
18.10.10 08:31:00 am
Up
ysjpn
User
Offline Off
Could anyone make me Warn lua script?
something like CT Players(for roleplay server) do !warn then say like "(Name) was Warned by Admin (Name)"
i tried to do but i cant make lua.
18.10.10 01:06:22 pm
Up
beckerchen
User
Offline Off
ysjpn has written:
Could anyone make me Warn lua script?
something like CT Players(for roleplay server) do !warn then say like "(Name) was Warned by Admin (Name)"
i tried to do but i cant make lua.

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
addhook("say","allsay")
function allsay(id,txt)
     if txt:sub(1,5)  == "!warn" then
          if player(id,"team") == 2 then
               local warned = tonumber(txt:sub(6,7))
               if player(warned,"exists") and id ~= warned then
                    msg("©255255255"..player(warned,"name").." was Warned by "..player(id,"name").."!@C")
               elseif id == warned then
                    msg2(id,"©255255255You cant warn yourself")
               else
                    msg2(id,"©255255255No player with the ID "..warned.." exists")
               end
          else
               msg2(id,"©255255255You are not allowed to warn")
          end
     return 1
     end
end
18.10.10 01:21:53 pm
Up
saladface27
User
Offline Off
i'm having trouble coming up with a script that chooses a random player on a certain team each round, but won't choose a player that has been already chosen on a previous round until all players on the team have been chosen.

eg player saladface (a ct) gets chosen in a round. now saladface won't be chosen again until all CTs get chosen.

could you help?
18.10.10 01:26:47 pm
Up
Triple H
User
Offline Off
Hi.
Is there any chance to make script like that: After CT or T win sound starts to play. It's will be very helpful for me cause I saw it at 1.6 and Source but I can't find it in 2d. If someone can do it for me I will be grateful.
18.10.10 01:35:02 pm
Up
Tajifun
User
Offline Off
Well, you could use an "endround" hook.
I guess you meant that..
Tajifun yay.
18.10.10 01:51:56 pm
Up
Triple H
User
Offline Off
yes I mean that but where I can find it. If this is in this topic can you tell me which page ??
18.10.10 05:08:48 pm
Up
Rainoth
Moderator
Offline Off
Triple H Look in thread you made...
18.10.10 06:44:01 pm
Up
Banaan
User
Offline Off
I tested the code and it works perfectly well.
18.10.10 06:56:44 pm
Up
Tajifun
User
Offline Off
eg:
Code:
1
2
3
4
addhook("endround","myfunctionname")
function myfunctionname(mode)
     msg("ENDROUND") -- change msg with anything you want to have. (sound)
end
Tajifun yay.
To the start Previous 1 2 ... 281 282 283 ... 338 339 Next To the start