p/s: did you say thanks who helped you?
Forum
 
 
Scripts 
 Lua Scripts/Questions/Helpp/s: did you say thanks who helped you?
It doesn't work why? please help
1
2
3
4
5
6
2
3
4
5
6
addhook("reload","player")
function player(id,mode)
	if (player(id,"reload") == 1) then
		parse('equip "..id.." 88')
end
end
The hit hook's parameters are as follows:
hit(id,source,weapon,hpdmg,apdmg)
Yours is the other way round, so the killer is actually the victim and vice versa.
Medikit|500$
Bandage|100$
Vodka|100$ parse("shake "..id.." 20000")
PrimaryAmmo|300$
SecondaryAmmo|300$
Snowball|3000$
Armor100|1000$
Armor200|3000$
Speed x5|1000$
Speedx10|3000$
 Editorman has written
Hi all, i tryied to do when i reload i getting a portal gun (for fun)
It doesn't work why? please help
 
It doesn't work why? please help
1
2
3
4
5
6
2
3
4
5
6
addhook("reload","player")
function player(id,mode)
	if (player(id,"reload") == 1) then
		parse('equip "..id.." 88')
end
end
Maybe something like this?
1
2
3
4
5
6
2
3
4
5
6
addhook("reload","player")
function player(id,mode)
	if mode == 1 then
		parse('equip "..id.." 88')
end
end
Doesn't work i dont getting the portal gun
 Edit:
THANKS
  edited 1×, last 05.04.10 09:09:39 am
Medikit|500$
Bandage|100$
Vodka|100$ parse("shake "..id.." 20000")
PrimaryAmmo|300$
SecondaryAmmo|300$
Snowball|3000$
Armor100|1000$
Armor200|3000$
Speed x5|1000$
Speedx10|3000$
 Editorman has written
Edit:
Doesn't work i dont getting the portal gun
Doesn't work i dont getting the portal gun

LOL.
you can get like this
1
2
3
4
5
6
2
3
4
5
6
addhook("reload","player")
function player(id,mode)
	if (mode == 1 or mode == 2) then
		parse("equip "..id.." 88")
	end
end
or
1
2
3
4
2
3
4
addhook("reload","player")
function player(id,mode)
	parse("equip "..id.." 88")
end
but you need to shot then reload, you can't by pressing R without any reload on weapon.
Medikit|500$
Bandage|100$
Vodka|100$ parse("shake "..id.." 20000")
PrimaryAmmo|300$
SecondaryAmmo|300$
Snowball|3000$
Armor100|1000$
Armor200|3000$
Speed x5|1000$
Speedx10|3000$
HEEELP MEE!
Why won't you learn Lua by yourself?
 Soja1997 has written
Somebody can make the Buy Menut for me because alone I am not able
Medikit|500$
Bandage|100$
Vodka|100$ parse("shake "..id.." 20000")
PrimaryAmmo|300$
SecondaryAmmo|300$
Snowball|3000$
Armor100|1000$
Armor200|3000$
Speed x5|1000$
Speedx10|3000$
HEEELP MEE!
Medikit|500$
Bandage|100$
Vodka|100$ parse("shake "..id.." 20000")
PrimaryAmmo|300$
SecondaryAmmo|300$
Snowball|3000$
Armor100|1000$
Armor200|3000$
Speed x5|1000$
Speedx10|3000$
HEEELP MEE!
Here you go
 And this one is even easier to edit:
use f2 to open the buymenu.
edited 2×, last 05.04.10 10:12:25 am
i was trying to make it but in vain
do you mean when for example:
player 1 kills player 2 -->
player 1 has more kills than player 2 -->
player 1 gets a message?
1
2
3
4
5
6
2
3
4
5
6
addhook ("kill","killen")
function killen(id,oper)
if(player(id,"score")>player(opfer,"score")) then
msg2 (id,"your kills are higher than you enemys one");
end
end
My script failes to change the imagealpha:
1
2
3
4
5
2
3
4
5
bgid=image("gfx/pgfx/whitepix.bmp",0,1,1)
imagepos(bgid,0,0,0)
imagescale(bgid,map("xsize")*32,map("ysize")*32)
imageblend(bgid,1)
imagealpha(bgid,0.5)
BTW: This script draws an image over the hole map, and whitepix.bmp is a 1x1 px image
 Schinken has written
pls explain better.
do you mean when for example:
player 1 kills player 2 -->
player 1 has more kills than player 2 -->
player 1 gets a message?
 
do you mean when for example:
player 1 kills player 2 -->
player 1 has more kills than player 2 -->
player 1 gets a message?
1
2
3
4
5
6
2
3
4
5
6
addhook ("kill","killen")
function killen(id,oper)
if(player(id,"score")>player(opfer,"score")) then
msg2 (id,"your kills are higher than you enemys one");
end
end
yes if player has more kills than all players on server -->
msg("Player name '..kills..'")
edited 2×, last 05.04.10 12:40:51 pm
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
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
edited 1×, last 05.04.10 07:54:32 pm
 Schinken has written
pls explain better.
do you mean when for example:
player 1 kills player 2 -->
player 1 has more kills than player 2 -->
player 1 gets a message?
 
do you mean when for example:
player 1 kills player 2 -->
player 1 has more kills than player 2 -->
player 1 gets a message?
1
2
3
4
5
6
2
3
4
5
6
addhook ("kill","killen")
function killen(id,oper)
if(player(id,"score")>player(opfer,"score")) then
msg2 (id,"your kills are higher than you enemys one");
end
end
yes if player has more kills than all players on server -->
msg("Player name '..kills..'")
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
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
I know there's a command, I just forgot it, >.<
 Lua Scripts/Questions/Help


 Offline
