Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua Scripts/Questions/Help

6,770 replies
Page
To the start Previous 1 293 94 95338 339 Next To the start

old Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
addhook("hit","hitpowup") --adds hit hook

function hitpowup(id,src,wpn,dmg,apdmg) --function

     if (id==X and wpn==wpn) then
	dmg = dmg+X  		--x = you decide!
	apdmg = apdmg+X 	--x = your election!
     end
  end
end

somewhat fixed for you wups

Currently I am stopping making normal scripts(kinda)

I'm starting making AMX2D based commands for my server

AND

If anyone could teach me about the save and load function( still don't understand it) then i could make something i wanted a long time
edited 1×, last 17.11.09 04:29:46 am

old Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Quote
CmDark has written
1
2
3
4
5
6
7
8
9
10
addhook("hit","hitpowup") --adds hit hook

function hitpowup(id,src,wpn,dmg,apdmg) --function

     if (id==X and wpn==wpn) then
	dmg = dmg+X  		--x = you decide!
	apdmg = apdmg+X 	--x = your election!
     end
  end
end

somewhat fixed for you wups

Currently I am stopping making normal scripts(kinda)

I'm starting making AMX2D based commands for my server

AND

If anyone could teach me about the save and load function( still don't understand it) then i could make something i wanted a long time


1_i separeted the "IFs" because i dont know if he wants to modificate something.
2_in your "fixed" code, we doesnt need the last end.
3_i ll help u with our hudtxt2 question, i was doing a script when my brother took the pc xD.

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
@CmDark

you can try Blazzingxx save function, but I've try the save on dedicated server, if using dedicated server you can't load your save file

old Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Quote
I know Admirdee
Thats why i use amx2d for admin-use

and also i know how to get over that bug

you know

player(id,"usgn")

you can just do this,

usgn = X

when you say a certain thing or whatever

old Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Quote
@Admirdee:

This has to work:

Spoiler >


Edit:
Yes, i tried it and worked;
An example to understand better:

Spoiler >
edited 2×, last 17.11.09 05:05:35 am

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
hmm, it will works with math.random?
I mean like this

1
local powershot = math.random(0,4)

I want it only random, not every hit

old Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Quote
Admirdee has written
hmm, it will works with math.random?
I mean like this

1
local powershot = math.random(0,4)

I want it only random, not every hit


its to easy, just add:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
attacker = X --id of privilegiated guy

addhook("hit","hitpowup")
function hitpowup(id,source,weapon,hpdmg,apdmg)
local powershot = math.random(0,4) --ADDED
if (attacker==X) then
if (weapon==X) then
if (powershot==0) then  --ADDED
parse ("sethealth "..id.." "..player(id,"health")-X) --Additional hp
parse ("setarmor "..id.." "..player(id,"armor")-X) --Addiotional armor
end
end
end
end

old Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Quote
Admirdee has written
w00t, thanks guys
I'm gonna test it


Hey np.
You helped me so I hope have helped you. Tell me if its work for u...
Just one thing, if u want to kill the victim dont put:

parse ("sethealth "..id.." "..player(id,"health")-100)

directly use

parse ("killplayer "..id)

That's all, good luck!
edited 1×, last 17.11.09 05:24:09 am

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
You welcome :),

another question :S

what is this for? it will make lua menu bigger or invisible, I don't know how to use

Quote
ADDED
Lua menus can now be invisible and bigger (@i or @b in title string)

old Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Quote
Admirdee has written
You welcome :),

another question :S

what is this for? it will make lua menu bigger or invisible, I don't know how to use

Quote
ADDED
Lua menus can now be invisible and bigger (@i or @b in title string)


i never read it, but i understood this:

menu(id,"Example@b,Test1,Test2,Test3")

and it worked!

Example to try by yourself:

1
2
3
4
addhook("serveraction","totrymenu")
function totrymenu(id,action)
menu(id,"Example@b,Button1,Button2,Button3")
end

Press F2 and will see...

For invisible i think is the same, but changing b for i:

menu(id,"Example@i,Test1,Test2,Test3")

old closed Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Quote
I really need help. I can open a server and i can see it only in Lan, i cant see it in server list :(.
I know, i read FAQs and I changed the usgn.dat file, I opened my ports (router and firewall) and it doesn't work!

Whyyy!? :S


Good luck

old Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Quote
Help requested:
Blazzingx - Could you please explain the logic behind
the save and loading function to me? or anyone else that know how to use it

old Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Quote
I am getting this errors:
Spoiler >

Help me please

old Re: Lua Scripts/Questions/Help

CarbonLord
User Off Offline

Quote
Hey
It is possible to do, that sometimes (random) when you'll hit enemy it will be sound Crytical Hit or something? I have a sound.
I have done something like this:
1
2
3
4
5
6
7
8
9
addhook("hit","rdmhit")
function rdmhit(id,src,wpn,hpdmg,apdmg)

pname = player(id,"name")
if rdm == 0 then
          msg(Crytical Hit!)
parse ("sethealth "..id.." "..player(id,"health")-90)
     end
end

I am sure its wrong - and its havent got a sound...
edited 2×, last 18.11.09 09:55:53 am
To the start Previous 1 293 94 95338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview