English Lua Scripts/Questions/Help

6,770 replies
Goto Page
To the start Previous 1 2 ... 249 250 251 ... 338 339 Next To the start
02.09.10 04:48:40 pm
Up
Soja1997
User
Offline Off
thanks
but i need script friendly fire dmg 0
02.09.10 05:00:16 pm
Up
waguininho100
User
Offline Off
This script is not working. What's wrong with him?

Code:

!givelicense ID
!removelicense ID

--------------------------------------------
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end

license = initArray(32)
posy = initArray(32)
posx = initArray(32)
collect = initArray(32)

addhook("leave","license_leave")
function license_leave(id)
license[id]=0
collect[id]=0
posy[id]=0
posx[id]=0
end

addhook("serveraction","license_action")
function license_action(id,b)
if license[id]==1 and b==1 then
menu(id,"License Menu,Set Pos,Teleport,Collect")
elseif license[id]==0 and b==1 then
msg2(id,"You dont have license")
end
end

addhook("menu","license_menu")
function license_menu(id,title,button)
if title=="License Menu" then
if button==1 then
posx[id]=player(id,"x")
posy[id]=player(id,"y")
msg2(id,"Youve saved ur positon")
elseif button==2 and posy[id]==1 and posx[id]==1 then
parse ("setpos "..p.." "..posx[id].." "..posy[id])
msg2(id,"Youve teleported your self")
elseif button==2 and posy[id]==0 posx[id]==0 and
msg2(id,"You cant teleport your self, No position setted")
elseif button==3 collect[id]==0 then
msg2(id,"Collection ON")
collect[id]=1
elseif button==3 collect[id]==1 then
msg2(id,"Collection OFF")
collect[id]=0
end
end
end

addhook("collect","license_collect")
function license_collect(id)
if collect[id]==1 then
return 1
elseif collect[id]==0 then
return 0
end
end
02.09.10 07:20:31 pm
Up
Aqua-
User
Offline Off
Ruirize has written:
Stop copying the CC.

Really.

Use your imaginations, don't just steal ideas.

Woot? I stealed nothing; fail.
edit: If u ment me xP
IMG:http://i41.tinypic.com/wrf2q9.png
02.09.10 09:01:30 pm
Up
murilog
User
Offline Off
hi all i want one script like this : cts say !infoct <id> , and player go to jail and spawn on jail , if txt !free <id> the player is free thx , the jail Y : 100 X :100
02.09.10 11:05:50 pm
Up
Flacko
User
Offline Off
Balance has written:
Im trying to make a script for my server that heals you when you hit with a gutbomb, and yeah that doesnt have a return 1 yet but I dont think thats the problem.
Code:
1
2
3
4
5
6
7
addhook("hit","ham_hit")
function ham_hit(weapon, id, source)
     if(weapon>86) then
          parse("sethealth "..source.." "..player(source,"health")+math.random(10,20))
          msg2(source,"You have eaten a hamburger!")
     end
end

Good, but you're using the bigger than operator (>), when you should use the equal operator (==), also, your parameters' order is messed up. Just replace these lines:
Code:
1
2
function ham_hit(id,source,weapon)
if weapon == 86
03.09.10 12:56:43 am
Up
archmage
User
Offline Off
FN_Nemesis has written:
hello everyone i need a script that make only weapons to use flare 3!

I can not understand you. Explain (In a way that can be understood).
We must secure the existence of our people and a future for white children. 14/88
03.09.10 01:00:23 am
Up
J4x
User
Offline Off
@Darkbyte im trying to say that the weapons use flare3 like muzzleflash when u change it , it affects the ligths and every thing.
edited 1×, last 03.09.10 03:01:49 am
03.09.10 04:06:25 am
Up
Phenixtri
User
Offline Off
Ello chaps tis DJ Pheny here & im in dire need of help.

I want to use HaRes & vesa-omars dropknife lua (already asked for permission which is pending) for NTDs half life mod but i need to 1st modify it so that when u drop the knife a knife_d model actually appears like with other weapons.

the D model knife must also be capable of being picked up like with other weapons.

heres the DL link to the lua
http://www.unrealsoftware.de/files_show.php?file=1922

Heres the actual code. Could someone plz tell me what i would have to do in order to make this lua drop a usable knife_d model?

Code:
parse("mp_wpndmg claw 0")
function initArray(m)
     local array = {}
     for i = 1, m do
          array[i]=0
     end
     return array
end
knife = initArray(32)
addhook("walkover","dropknife_walkover")
function dropknife_walkover(id,iid,type,ain,a,mode)
     if type==50 then
          parse("strip "..id.." 78")
          knife[id]=1
     end
end
addhook("drop","dropknife_drop_claw")
function dropknife_drop_claw(id,iid,type,ain,a,mode,x,y)
     if type==78 then
          return 1
     end
end
addhook("die","dropknife_die_claw")
function dropknife_die_claw(victim,killer,weapon,x,y)
     if weapon==78 then
          return 1
     end
end
addhook("die","dropknife_die")
function dropknife_die()
     knife[id]=0
end
kniferemove=0
addhook("drop","dropknife_dropcheck")
function dropknife_dropcheck(id,iid,type,ain,a,mode,x,y)
     if knife[id]==1 then
          return 0
     elseif knife[id]==0 then
          parse("setweapon "..id.." 78")
          kniferemove=0
     end
end
addhook("ms100","dropknife_second")
function dropknife_second()
     for i = 1,32 do
          kniferemove=kniferemove+1
          if kniferemove==1 then

god damit how do i get this retarded code thing working >>
edited 3×, last 03.09.10 04:14:31 am
IMG:http://media.moddb.com/images/groups/1/5/4712/Valve2DUserbar.png
03.09.10 04:10:54 am
Up
archmage
User
Offline Off
Is it possible to read a files meta data?
We must secure the existence of our people and a future for white children. 14/88
03.09.10 11:37:45 am
Up
murilog
User
Offline Off
hi all i want one script like this : cts say !infoct <id> , and player go to jail and spawn on jail , if txt !free <id> the player is free thx , the jail Y : 100 X :100
03.09.10 03:24:59 pm
Up
Aqua-
User
Offline Off
Flacko has written:
Balance has written:
Im trying to make a script for my server that heals you when you hit with a gutbomb, and yeah that doesnt have a return 1 yet but I dont think thats the problem.
Code:
1
2
3
4
5
6
7
addhook("hit","ham_hit")
function ham_hit(weapon, id, source)
     if(weapon>86) then
          parse("sethealth "..source.." "..player(source,"health")+math.random(10,20))
          msg2(source,"You have eaten a hamburger!")
     end
end

Good, but you're using the bigger than operator (>), when you should use the equal operator (==), also, your parameters' order is messed up. Just replace these lines:
Code:
1
2
function ham_hit(id,source,weapon)
if weapon == 86

heyy thanks imma try it now.
EDIT: Didnt work all it does is just throw the gutbomb..?
EDIT2: Now I just understood that you actually gotta hit yourself :/, does any know a hook like on shoot?
edited 1×, last 03.09.10 03:55:24 pm
IMG:http://i41.tinypic.com/wrf2q9.png
03.09.10 04:06:57 pm
Up
HaRe
User
Offline Off
Balance has written:
Flacko has written:
Balance has written:
Im trying to make a script for my server that heals you when you hit with a gutbomb, and yeah that doesnt have a return 1 yet but I dont think thats the problem.
Code:
1
2
3
4
5
6
7
addhook("hit","ham_hit")
function ham_hit(weapon, id, source)
     if(weapon>86) then
          parse("sethealth "..source.." "..player(source,"health")+math.random(10,20))
          msg2(source,"You have eaten a hamburger!")
     end
end

Good, but you're using the bigger than operator (>), when you should use the equal operator (==), also, your parameters' order is messed up. Just replace these lines:
Code:
1
2
function ham_hit(id,source,weapon)
if weapon == 86

heyy thanks imma try it now.
EDIT: Didnt work all it does is just throw the gutbomb..?
EDIT2: Now I just understood that you actually gotta hit yourself :/, does any know a hook like on shoot?


Code:
1
2
3
addhook("attack","whatever")
function whatever(id)
     if (player(id,"weapontype") == ID) then
w0w im so eXotiK
03.09.10 04:36:39 pm
Up
Aqua-
User
Offline Off
Code:
1
2
3
4
5
6
7
addhook("attack","ham_eat")
function ham_eat(id)
     if (player(id,"weapontype") == 86) then
          parse("sethealth "..id.." "..player(id,"health")+math.random(10,20))
          msg2(id,"You have eaten a hamburger!")
     end
end


LUA ERROR: attempt to call a nil valve
Spoiler >
IMG:http://i41.tinypic.com/wrf2q9.png
03.09.10 05:05:02 pm
Up
FASTDIE
User
Offline Off
try this
in this u will eat hamburger on collectin and u cant drop hamburger and eat this again u must throw it

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("collect","hamburger")
function hamburger(id,iid,type,ain,a,mode)
     if type==86 then
          parse("sethealth "..id.." "..player(id,"health")+math.random(10,20))
          msg2(id,"You have eaten a hamburger!")
     end
end

addhook("drop","dropham")
function dropham(id,iid,type,ain,a,mode,x,y)
     if type==86 then
     return 1 
     end
return 0 
end


i hope it helped u
03.09.10 05:48:31 pm
Up
Phenixtri
User
Offline Off
wow >> so much for asking for help >> makes this thread kinda useless if no one actually responds to your question >>
IMG:http://media.moddb.com/images/groups/1/5/4712/Valve2DUserbar.png
03.09.10 05:54:19 pm
Up
CJ7
BANNED
Offline Off
Phenixtri has written:
wow >> so much for asking for help >> makes this thread kinda useless if no one actually responds to your question >>


Whenever you post a lua script, wrap it in the CODE tags, for readability's sake. Also, the script you posted isn't even complete, it's missing a few "end"s at the end.
http://uprate6.wordpress.com lua: It's not rocketscience.
03.09.10 06:04:56 pm
Up
Phenixtri
User
Offline Off
yea i couldnt get the damed code thing to work >> sry about that. Im talking with HaRe about the lua now so maybe he can help me as he partly made the original lua
IMG:http://media.moddb.com/images/groups/1/5/4712/Valve2DUserbar.png
03.09.10 08:31:18 pm
Up
Aqua-
User
Offline Off
So I want a command that when you say !give_ham, it gives the target a hamburger GutBomb ID = 86. But I have no idea what I'm supposed to do; help here?

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
addhook("hit","ham_hit")
function ham_hit(id,source,weapon)
if weapon == 86 then
        parse("sethealth "..source.." "..player(source,"health")+math.random(10,20))
        msg2(source,"You have eaten a hamburger!")
     return 1
    end
end

addhook("drop","ham_drop")
function dropham(id,iid,type,ain,a,mode,x,y)
     if type==86 then
     return 1 
     end
return 0 
end

addhook("say","ham_say")
function ham_say(p,txt,weapon)
     if (txt=="!give_ham") then
          else if weapon == 86 then
               parse("strip "..p.." 4")
          end
          return 1
     end
end
edited 1×, last 03.09.10 08:52:17 pm
IMG:http://i41.tinypic.com/wrf2q9.png
03.09.10 09:26:19 pm
Up
FASTDIE
User
Offline Off
I TESTED THIS! dont edit hooks and functions name cuz it result ERROR attempt to call nil value DONT EDIT


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
addhook("attack","hamthrow")
function hamthrow(id)
     if (player(id,"weapontype") == 86) then
parse("sethealth "..id.." "..player(id,"health")+math.random(10,20))
msg2(source,"You have eaten a hamburger!")
     return 1
end
end

addhook("drop","hamdrop")
function hamdrop(id,iid,type,ain,a,mode,x,y)
if type==86 then
return 1
end
return 0
end

addhook("say","getham")
function getham(p,txt,weapon)
     if (txt=="!give_ham") then
          parse("equip "..p.." 86")
          return 1
     end
end
04.09.10 01:59:32 am
Up
archmage
User
Offline Off
Is it possible to get all files and 'folders' in a specific directory?
We must secure the existence of our people and a future for white children. 14/88
To the start Previous 1 2 ... 249 250 251 ... 338 339 Next To the start