English Lua Scripts/Questions/Help

6,770 replies
Goto Page
To the start Previous 1 2 ... 321 322 323 ... 338 339 Next To the start
05.12.10 12:16:29 pm
Up
CmDark
User
Offline Off
@GeNeSiS_MaSoN

1. Impossible.
2. Also Impossible unless if you put your own image on top of where it shows (needs to be transparent).
3. Easily done.

Code:
1
2
3
4
5
6
7
8
addhook('second','smallhealth');
function smallhealth()
     for p=1,32 do --Players 1-32
          if player(p,"exists") and player(p,"health")<45 then
          parse('sv_sound2 '..p..' 'cod_breathing.ogg')
          end
     end
end


Btw, maybe you could try to learn some lua scripting?
just a suggestion.
-CmDark
IMG:http://i54.tinypic.com/auk478.png
05.12.10 02:20:21 pm
Up
Jake-rus
User
Offline Off
whats wrong ???

Code:
1
2
3
parse("hudtxt 9 "'..name..'" 260 5")
parse("hudtxt 8 "©000200200VERSION:'..ver_update..'" 260 10")
parse("hudtxt 7 "©000200000CREATOR AND MAIN IDEA: JaKe" 260 15")
IMG:http://i064.radikal.ru/1006/ef/a7ea290dc94d.gif
05.12.10 05:24:06 pm
Up
wjcf1290
User
Offline Off
Jake-rus has written:
whats wrong ???

Code:
1
2
3
parse("hudtxt 9 "'..name..'" 260 5")
parse("hudtxt 8 "©000200200VERSION:'..ver_update..'" 260 10")
parse("hudtxt 7 "©000200000CREATOR AND MAIN IDEA: JaKe" 260 15")


hudtxt <hudid> <"text"> <x> <y> <align>

align.
05.12.10 05:25:19 pm
Up
Kurumi
User
Offline Off
CmDark has written:
@GeNeSiS_MaSoN

1. Impossible.
2. Also Impossible unless if you put your own image on top of where it shows (needs to be transparent).
3. Easily done.

Code:
1
2
3
4
5
6
7
8
addhook('second','smallhealth');
function smallhealth()
     for p=1,32 do --Players 1-32
          if player(p,"exists") and player(p,"health")<45 then
          parse('sv_sound2 '..p..' 'cod_breathing.ogg')
          end
     end
end


Btw, maybe you could try to learn some lua scripting?
just a suggestion.
-CmDark
dont work
Uhm... Hello
05.12.10 05:27:00 pm
Up
Fasttt
User
Offline Off
parse('hudtxt 9 '..name..' 260 5')
parse('hudtxt 8 "©000200200VERSION:'..ver_update..'" 260 10')
parse('hudtxt 7 "©000200000CREATOR AND MAIN IDEA: JaKe" 260 15')
05.12.10 10:05:46 pm
Up
CmDark
User
Offline Off
@GeNeSiS MaSoN There is no reason that that script shouldn't work unless if you did not have the cod_breathing.ogg file in your sfx folder.
IMG:http://i54.tinypic.com/auk478.png
06.12.10 01:07:00 pm
Up
Jake-rus
User
Offline Off
@FastLine
i have already done this
IMG:http://i064.radikal.ru/1006/ef/a7ea290dc94d.gif
06.12.10 01:10:50 pm
Up
Fasttt
User
Offline Off
GeNeSiS_MaSoN has written:
CmDark has written:
@GeNeSiS_MaSoN

1. Impossible.
2. Also Impossible unless if you put your own image on top of where it shows (needs to be transparent).
3. Easily done.

Code:
1
2
3
4
5
6
7
8
addhook('second','smallhealth');
function smallhealth()
     for p=1,32 do --Players 1-32
          if player(p,"exists") and player(p,"health")<45 then
          parse('sv_sound2 '..p..' 'cod_breathing.ogg')
          end
     end
end


Btw, maybe you could try to learn some lua scripting?
just a suggestion.
-CmDark
dont work

parse('sv_sound2 '..p..' cod_breathing.ogg')
06.12.10 05:58:13 pm
Up
Marcell
Super User
Offline Off
Hi,
Can run program with lua?
So can i do thats in the lua when i press f3 serveraction start program in C:/ so
pl:. When i press f3 start the mediaplayer!
CS2DArchive - Version Database www.CS2DArchive.com - WebHosting: www.BroHosting.eu
06.12.10 07:48:57 pm
Up
Loooser
User
Offline Off
i want to script something with effects can somebody list me the effects that are existing
i mean this
effect <effect> <x> <y> <p1> <p2> <r> <g> <b>
IMG:http://i45.tinypic.com/saus1e.jpg
06.12.10 07:57:26 pm
Up
Fehu
User
Offline Off
I know only 2: smoke and colorsmoke
IMG:http://www.flashflashrevolution.com/profile/newsiggy/Fehu/stardust/0/0-1-2-3-4-5.png
06.12.10 08:36:14 pm
Up
RAVENOUS
BANNED
Offline Off
loooser has written:
i want to script something with effects can somebody list me the effects that are existing
i mean this
effect <effect> <x> <y> <p1> <p2> <r> <g> <b>


- smoke
- fire
- steam
- colorsmoke
- waves (?)
"A work of art is the unique result of a unique temperament." - Oscar Wilde
06.12.10 08:41:28 pm
Up
Rainoth
Moderator
Offline Off
I tried to fix the code :
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
40
41
42
43
44
45
46
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
level=initArray(32)
exp=initArray(32)
credits=initArray(32)
points=initArray(32)
streak=initArray(32)
hacker=initArray(32)
medikit=initArray(32)

function string.split(text,b)
local cmd = {}
if b then
b = b
else
b = "%s"
end
b = "[^"..b.."]+"
for o in string.gmatch(text,b) do
table.insert(cmd,o)
end
return cmd
end

if hacker==nil then hacker={} end
hacker={}

addhook("second","hack")
function hack()
for p = 1,32 do
if (hacker[p]==1) then
credits[id]=credits[id]+15
     end
end
end

addhook("spawn","class")
function class(id)
parse("equip "..id.." 56") -- Equips Ct's with defuse kit.
hacker[id] = 1 -- The Hacker Special is on
     parse("strip "..id)


But i get error every second and when i press "Buy Credits"
Screenshots



Question : Could i make something like

Code:
1
2
3
4
function bla(id)
menu("lol",stuff,stuff,bla,bla...")
addhook server action bla bla...
function ye ye

lol(id)
07.12.10 07:50:18 am
Up
zygint
User
Offline Off
can any one help my i need to make a script from exaples to make more then 9 classes but i need the next and back can anyone help my with that?
07.12.10 09:12:05 am
Up
EngiN33R
Moderator
Offline Off
@batlaizys

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
40
41
42
43
44
45
46
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
level=initArray(32)
exp=initArray(32)
credits=initArray(32)
points=initArray(32)
streak=initArray(32)
hacker=initArray(32)
medikit=initArray(32)

function string.split(text,b)
local cmd = {}
if b then
b = b
else
b = "%s"
end
b = "[^"..b.."]+"
for o in string.gmatch(text,b) do
table.insert(cmd,o)
end
return cmd
end

if hacker==nil then hacker={} end
hacker={}

addhook("second","hack")
function hack()
for p = 1,32 do
if (hacker[p]==1) then
credits[p]=credits[p]+15
     end
end
end

addhook("spawn","class")
function class(id)
parse("equip "..id.." 56") -- Equips Ct's with defuse kit.
hacker[id] = 1 -- The Hacker Special is on
     parse("strip "..id)


The problem was here
Code:
1
2
3
4
for p = 1,32 do
if (hacker[p]==1) then
     credits[id]=credits[id]+15
end

You made p=1,32, but then tried to define credits[id], and id variable didn't exist.

@zygintas
Try to make two separate menu functions - like that
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
function menu1(id)
     menu(id,"Class Menu 1,Class 1, Class 2,...,Class 8,Next")
end
function menu2(id)
     menu(id,"Class Menu 2,Class 1, Class 2,...,Class 8,Back")
end

addhook("menu","twomenus")
function twomenus(id,menu,sel)
     if (menu=="Class Menu 1") then
          if (sel==1) then
               ...
          ...
          if (sel==9) then
               menu2(id)
          end
     end
     if (menu=="Class Menu 2") then
          if (sel==1) then
               ...
          ...
          if (sel==9) then
               menu1(id)
          end
     end
end

Insert the needed code parts in the gaps.
I code, therefore I exist.
07.12.10 10:49:07 am
Up
zygint
User
Offline Off
thanks alot

Admin/mod comment:

Don't quote posts when they're directly above yours. /TheKilledDeath
07.12.10 01:42:37 pm
Up
Loooser
User
Offline Off
hi guys i wonder how to find out with the object function wether the object is a snark and not a zombie or a headkrap.
im talking about

object(id,"value")

and i tried it with

object(id,"type")

i know how to find out that it is a npc.
IMG:http://i45.tinypic.com/saus1e.jpg
08.12.10 03:54:45 pm
Up
Vetle
BANNED
Offline Off
Can someone make me a script when i kill a zombie npc i get +200$
There will always be someone better than you.
08.12.10 07:42:43 pm
Up
Yates
Reviewer
Offline Off
Anyone have a car buy menu where i can change the car pics and name maybe money dont know..
But i saw one on this site not so long ago..
but it's gone i think..
I searched car and buy but couldnt find anything
Anyone know where some sort of script is..?
08.12.10 08:24:29 pm
Up
JONY
User
Offline Off
Is it possible to make so that a turret attacks everyone except the player who created it? It can be effectively used with Deathmatch mod

I assume that currently, that as soon as the turret sees a player it checks whether he is T or CT and decides to shoot or not, but it would be cool to make so that it checks player's id and decides to kill this player or not.

Regards,
J.
To the start Previous 1 2 ... 321 322 323 ... 338 339 Next To the start