Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Lua Scripts/Questions/Help

6.770 Antworten
Seite
Zum Anfang Vorherige 1 293 94 95338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Zitieren
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× editiert, zuletzt 17.11.09 04:29:46

alt Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Zitieren
CmDark hat geschrieben
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.

alt Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Zitieren
@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

alt Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Zitieren
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

alt Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Zitieren
@Admirdee:

This has to work:

Spoiler >


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

Spoiler >
2× editiert, zuletzt 17.11.09 05:05:35

alt Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Zitieren
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

alt Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Zitieren
Admirdee hat geschrieben
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

alt Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Zitieren
Admirdee hat geschrieben
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!
1× editiert, zuletzt 17.11.09 05:24:09

alt Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Zitieren
You welcome :),

another question :S

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

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

alt Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Zitieren
Admirdee hat geschrieben
You welcome :),

another question :S

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

Zitat
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")

alt geschlossen Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Zitieren
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

alt Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Zitieren
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

alt Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Zitieren
I am getting this errors:
Spoiler >

Help me please

alt Re: Lua Scripts/Questions/Help

CarbonLord
User Off Offline

Zitieren
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...
2× editiert, zuletzt 18.11.09 09:55:53
Zum Anfang Vorherige 1 293 94 95338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht