English Simple script needed

9 replies
Goto Page
To the start Previous 1 Next To the start
03.05.11 10:10:41 pm
Up
Jaso
BANNED
Offline Off
Only one player can join the t.
The t has to be random selected.
So if there is already a terrorist than no one else can join at t.
03.05.11 10:38:58 pm
Up
Bowlinghead
User
Offline Off
You mean, all are CT and than 1 Player is randomly selected and go to Terrorist, and no one can join the Terrorists?

I cant help .
I only can say, look in other Scripts.
In the Script Zombie Plague there is also a randomly System (After 10 Seconds, 1 Player go Zombies)
I only know, for randomly things use "math.randomseed" but its no real help...
Share time limited free games here
03.05.11 10:56:26 pm
Up
Jaso
BANNED
Offline Off
Yeah like that but please give me then that piece of the code
03.05.11 11:10:31 pm
Up
Blacko
User
Offline Off
Hi !

I think you want this :
http://www.unrealsoftware.de/files_show.php?file=4181
Remember, Script of Factis699, not your

iDios
IMG:http://www.web-modules.net/upload/cache/userbar/123/452.gif
IMG:http://www.web-modules.net/upload/cache/userbar/124/277.gif
03.05.11 11:33:30 pm
Up
archmage
User
Offline Off
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
math.randomseed(os.time())
addhook("startround", "select_t")
addhook("team", "check_team")

function select_t()
     local t = player(0, "team1")
     local ct = player(0, "team2")

     for _, v in pairs(t) do
          parse("makect "..v)
     end

     local random_id = ct[math.random(1, #ct)]
     
     parse("maket "..random_id)

     msg(player(random_id, "name").." was selected as the terrorist.@C")
end

function check_team(id, t)
     if ( t == 1 ) then     -- if the player attempts to join the terrorists
          if ( #player(0, "team1") > 1 ) then
               parse("makect "..id)
               msg2(id, "©255000000You cannot join the terrorists at this time.@C")
          end
     end
end
We must secure the existence of our people and a future for white children. 14/88
04.05.11 12:19:07 am
Up
Jaso
BANNED
Offline Off
Edit: It goes in a loop the script doesnt stop....
edited 1×, last 04.05.11 10:05:18 am
04.05.11 11:39:27 pm
Up
archmage
User
Offline Off
When does it go into a loop? What where you doing when it happened?
We must secure the existence of our people and a future for white children. 14/88
04.05.11 11:43:52 pm
Up
Jaso
BANNED
Offline Off
It just goes like this:
Terrorists win
Counter terrorist win
Round draw

And its keeps happening just when you join ct or t it just happends
And it doesnt stop.

I use it with standart mode try it by yourself..
04.05.11 11:54:35 pm
Up
archmage
User
Offline Off
Try this:
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
math.randomseed(os.time())
addhook("startround", "select_t")
addhook("team", "check_team")

function select_t()
     local t = player(0, "team1")
     local ct = player(0, "team2")

     while (#t > 1) do
          parse("makect "..t[1])
          table.remove(t, 1)
     end

     ct = player(0, "team2")

     local random_id = ct[math.random(1, #ct)]
     
     parse("maket "..random_id)
     parse("makect "..t[1])

     msg(player(random_id, "name").." was selected as the terrorist.@C")
end

function check_team(id, t)
     if ( t == 1 ) then     -- if the player attempts to join the terrorists
          if ( #player(0, "team1") > 1 ) then
               parse("makect "..id)
               msg2(id, "©255000000You cannot join the terrorists at this time.@C")
          end
     end
end
We must secure the existence of our people and a future for white children. 14/88
05.05.11 11:19:54 am
Up
Jaso
BANNED
Offline Off
•This message i get random
LUA ERROR: sys/lua/Select.lua:19: attempt to concatenate field '?' (a nil value)

LUA ERROR: sys/lua/Select.lua:16: bad argument #2 to 'random' (interval is empty) •this happend when i am alone in the server.

•If i add a bot the script creates a loop again and it keep saying terrorist win and if i add another bot it starts to say counter terrorists win in a loop.
To the start Previous 1 Next To the start