English Lua Scripts/Questions/Help

6,770 replies
Goto Page
To the start Previous 1 2 ... 185 186 187 ... 338 339 Next To the start
06.04.10 07:46:29 pm
Up
TimeQuesT
User
Offline Off
don't use the always hook
this leads to X-Treme lag,because the lines are parse 50times the second!
Muh
06.04.10 08:48:28 pm
Up
Flacko
User
Offline Off
Use collect hook as Schinken said (I hope you can atleast do that by yourself) and for making it red you have to concatenate "©255000000" to asd as patasuss did.
Don't use always hook because concatenations are slow and what patasuss did would execute really slow.
06.04.10 09:10:34 pm
Up
DRoNe
User
Offline Off
Code:
1
2
3
4
5
6
7
function arr([b]s[/b],[b]v[/b])
     [b]t[/b] = {}
     for i=1, [b]s[/b] do
          [b]t[/b][i] = [b]v[/b]
     end
     return [b]t[/b]
end


or

Code:
1
2
3
4
5
6
7
function initArray([b]m[/b])
     local array = {}
     for i = 1, [b]m[/b] do
          array[i]=0
     end
     return array
end


What are that letters?
IMG:http://img39.imageshack.us/img39/567/drnatimg.png
06.04.10 10:43:13 pm
Up
YellowBanana
BANNED
Offline Off
DRoNe has written:
Code:
1
2
3
4
5
6
7
function arr([b]s[/b],[b]v[/b])
     [b]t[/b] = {}
     for i=1, [b]s[/b] do
          [b]t[/b][i] = [b]v[/b]
     end
     return [b]t[/b]
end


or

Code:
1
2
3
4
5
6
7
8
function initArray([b]m[/b]) --define a function that 
                                           --creates a table with m entries
     local array = {}          -- create an empty table
     for i = 1, [b]m[/b] do  -- fill m entries with 0
          array[i]=0
     end
     return array               -- return the table
end


What are that letters?


So basically what it returns is a table filled with m zero's,


array = {0,0,0......}
06.04.10 11:16:42 pm
Up
Flacko
User
Offline Off
The first function uses s for the size of the table and v for the value of each index

The second one just makes a table with the size given by m and fills it with 0 on each index.
06.04.10 11:49:05 pm
Up
Patasuss
User
Offline Off
and how about this?
Spoiler >
Portal
07.04.10 03:06:59 am
Up
siuL
User
Offline Off
Spoiler >

Some1 help i need to make it just for terrorists
07.04.10 09:17:33 am
Up
DRoNe
User
Offline Off
@Flacko and Yellowbanana

How many letters are ?
Where i find explanatories to all letters ?
IMG:http://img39.imageshack.us/img39/567/drnatimg.png
07.04.10 10:30:04 am
Up
Flacko
User
Offline Off
DRoNe has written:
@Flacko and Yellowbanana

How many letters are ?
Where i find explanatories to all letters ?


You have to download common_sense.exe from www.use_your_brain.com/
07.04.10 10:36:22 am
Up
Cure Pikachu
User
Offline Off
Khaleed has written:
Spoiler >

Some1 help i need to make it just for terrorists

Maybe this will help (I am a noob...)

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
--------------------------------------------------
-- Glowing Players Script by Unreal Software    --
-- 08.11.2009 - www.UnrealSoftware.de           --
--------------------------------------------------

if sample==nil then sample={} end
sample.glowing={}

-- I won't be using the samples table if I were you...

--------------------------------------
-- GLOW                             --
--------------------------------------

-- Glow Function
function sample.glowing.makeallglow()
     if (team==1) then
          for i=1,32,1 do
               id=image("gfx/sprites/flare2.bmp",0,0,100+i)     -- Create image @ Player
               imagecolor(id,255,255,0)                    -- Make image yellow
               imageblend(id,1)                              -- Make image glow
               imagealpha(id,0.5)                         -- Decrease Glow Strength
          end
     end
end

-- Make Glow instantly after starting server
sample.glowing.makeallglow()

-- Make Glow after roundstart (because images are deleted on roundstart!)
addhook("startround","sample.glowing.startround")
function sample.glowing.startround()
     sample.glowing.makeallglow()
end
IMG:https://i.imgur.com/uUrye71.png
IMG:https://i.imgur.com/xpsyQRX.png
07.04.10 11:48:53 am
Up
DRoNe
User
Offline Off
Flacko has written:
DRoNe has written:
@Flacko and Yellowbanana

How many letters are ?
Where i find explanatories to all letters ?


You have to download common_sense.exe from www.use_your_brain.com/


omg ...
you dont understand me ...
IMG:http://img39.imageshack.us/img39/567/drnatimg.png
07.04.10 12:13:09 pm
Up
TimeQuesT
User
Offline Off
i don't understand you 2,so pls explain better if you want help.
Muh
07.04.10 12:19:51 pm
Up
DRoNe
User
Offline Off
Code:
1
2
3
4
5
6
7
function arr(s,v)
t = {}
for i=1, s do
t[i] = v
end
return t
end


like 's' as Flacko sayd is size and 'v' is value ...
- is something else ?
- if is, then can you explain it ?
IMG:http://img39.imageshack.us/img39/567/drnatimg.png
07.04.10 12:37:58 pm
Up
YellowBanana
BANNED
Offline Off
Pikachu_Lv85 has written:
Khaleed has written:
Spoiler >

Some1 help i need to make it just for terrorists

Maybe this will help (I am a noob...)

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
--------------------------------------------------
-- Glowing Players Script by Unreal Software    --
-- 08.11.2009 - www.UnrealSoftware.de           --
--------------------------------------------------

if sample==nil then sample={} end
sample.glowing={}

-- I won't be using the samples table if I were you...

--------------------------------------
-- GLOW                             --
--------------------------------------

-- Glow Function
function sample.glowing.makeallglow()
     if (team==1) then
          for i=1,32,1 do
               id=image("gfx/sprites/flare2.bmp",0,0,100+i)     -- Create image @ Player
               imagecolor(id,255,255,0)                    -- Make image yellow
               imageblend(id,1)                              -- Make image glow
               imagealpha(id,0.5)                         -- Decrease Glow Strength
          end
     end
end

-- Make Glow instantly after starting server
sample.glowing.makeallglow()

-- Make Glow after roundstart (because images are deleted on roundstart!)
addhook("startround","sample.glowing.startround")
function sample.glowing.startround()
     sample.glowing.makeallglow()
end


seriously, learn to script..
What is "team" in your script?
This is how it should be.

Spoiler >
07.04.10 03:38:39 pm
Up
Fehu
User
Offline Off
Patasuss has written:
and how about this?
Spoiler >


"-hpdmg"a nil value. /error in console/

if enemy hit line [ | | | | | | | | | | ] dont move .... (sry for my english lol)
IMG:http://www.flashflashrevolution.com/profile/newsiggy/Fehu/stardust/0/0-1-2-3-4-5.png
07.04.10 03:59:25 pm
Up
DRoNe
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
math.randomseed(os.time())
addhook("movetile","zmfs")
function zmfs(id)
local fs = math.random(1,4)
     if player(id,"team") == 1 then
          if fs == 1 then
               img = image("gfx/...bmp",1.1,0)
               imagecolor(img,200,0,0)
               imageblend(img,3)
          end
          if fs == 2 then
               img = image("gfx/...bmp",1.1,0)
               imagecolor(img,200,0,0)
               imageblend(img,3)
          end     
          if fs == 3 then
               img = image("gfx/...bmp",1.1,0)
               imagecolor(img,200,0,0)
               imageblend(img,3)
          end
          if fs == 4 then
               img = image("gfx/...bmp",1.1,0)
               imagecolor(img,200,0,0)
               imageblend(img,3)
          end
end


How i make, that player will every tile drawing image ?
IMG:http://img39.imageshack.us/img39/567/drnatimg.png
07.04.10 05:18:49 pm
Up
siuL
User
Offline Off
YellowBanana has written:
Pikachu_Lv85 has written:
Khaleed has written:
Spoiler >

Some1 help i need to make it just for terrorists

Maybe this will help (I am a noob...)

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
--------------------------------------------------
-- Glowing Players Script by Unreal Software    --
-- 08.11.2009 - www.UnrealSoftware.de           --
--------------------------------------------------

if sample==nil then sample={} end
sample.glowing={}

-- I won't be using the samples table if I were you...

--------------------------------------
-- GLOW                             --
--------------------------------------

-- Glow Function
function sample.glowing.makeallglow()
     if (team==1) then
          for i=1,32,1 do
               id=image("gfx/sprites/flare2.bmp",0,0,100+i)     -- Create image @ Player
               imagecolor(id,255,255,0)                    -- Make image yellow
               imageblend(id,1)                              -- Make image glow
               imagealpha(id,0.5)                         -- Decrease Glow Strength
          end
     end
end

-- Make Glow instantly after starting server
sample.glowing.makeallglow()

-- Make Glow after roundstart (because images are deleted on roundstart!)
addhook("startround","sample.glowing.startround")
function sample.glowing.startround()
     sample.glowing.makeallglow()
end


seriously, learn to script..
What is "team" in your script?
This is how it should be.

Spoiler >

it dont says it have error but isnt workin
07.04.10 05:29:57 pm
Up
DRoNe
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
math.randomseed(os.time())
addhook("movetile","zmfs")
function zmfs(id)
local fs = math.random(1,4)
     if player(id,"team") == 1 then
          if fs == 1 then
               img = image("gfx/...bmp",1.1,0)
               imagecolor(img,200,0,0)
               imageblend(img,3)
          end
          if fs == 2 then
               img = image("gfx/...bmp",1.1,0)
               imagecolor(img,200,0,0)
               imageblend(img,3)
          end     
          if fs == 3 then
               img = image("gfx/...bmp",1.1,0)
               imagecolor(img,200,0,0)
               imageblend(img,3)
          end
          if fs == 4 then
               img = image("gfx/...bmp",1.1,0)
               imagecolor(img,200,0,0)
               imageblend(img,3)
          end
end


How i make, that player will every tile drawing image ?
IMG:http://img39.imageshack.us/img39/567/drnatimg.png
07.04.10 07:59:37 pm
Up
Soja1997
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
items = {
{title ="Medikit",price = 500,cmd = "equip",param=64},
{title ="Bandage",price = 100,cmd = "equip",param=65},
{title = "Vodka",price=100,cmd = "shake",param=20000},
{title = "PrimaryAmmo",price=300,cmd = "equip",param=61},
{title = "SecondaryAmmo",price=300,cmd = "equip",param=62},
{title = "Snowball",price=3000,cmd = "equip",param=75},
{title = "Armor100",price=1000,cmd = "setarmor",param=100},
{title = "Armor200",price=3000,cmd = "setarmor",param=200},
{title = "Speed x5",price=1000,cmd = "speedmod",param=25},
{title = "Speed x10",price=3000,cmd = "speedmod",param=50},
{title = "MAC10",price=16000,cmd = "equip",param=23}
}

function createMenu(header, matrix)
local menuString = header;
menuString = menuString..", "
for key, value in ipairs(matrix) do
menuString = menuString..value.title.." | $"..tostring(value.price).. ","
end
return menuString
end


addhook("serveraction","my_serveraction")
function my_serveraction(id,action)
if(action == 1) then
menu(id,createMenu("Items",items))
end
end

addhook("menu","my_menu")
function my_menu(id,title,button)
if(button == 0) then
return
end

if(title == "Items") then
if(player(id,"money") > items[button].price) then
parse("setmoney "..id.." "..(player(id,"money") - items[button].price))
cmd = string.format("%s %i %i",items[button].cmd,id,items[button].param)
parse(cmd)
else
msg2(id,"©255000000 You have insufficient funds!")
end
end
end


Who Can Make Next Page
08.04.10 12:06:25 am
Up
YellowBanana
BANNED
Offline Off
here it is,

but seriously this menu system is gonna suck if you wanna have more pages...

Spoiler >


you should ask leegao to help you create a better menu system. I really suck at lua..
To the start Previous 1 2 ... 185 186 187 ... 338 339 Next To the start