Forum

> > CS2D > Scripts > Some trouble with "Classes.lua" !
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Some trouble with "Classes.lua" !

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Some trouble with "Classes.lua" !

phihung940
User Off Offline

Zitieren
I'm working with "Classes.lua" - The basic (original) .lua file. Then I got the problems. I realy need help with this
1) I want each class are carry only 1 melee only !
2) After I add some new class (9 playable class - the origin is 6), the BOT are only play with first class. Why ?
3) How to make Medic class healing the other class/player ?

Thank you, hope you guys help me!

alt Re: Some trouble with "Classes.lua" !

phihung940
User Off Offline

Zitieren
Spoiler >

alt Re: Some trouble with "Classes.lua" !

Parallel_Man
BANNED Off Offline

Zitieren
user phihung940 hat geschrieben
1) I want each class are carry only 1 melee only !
!

That's easy. You need to change the weapon IDs in the place I quoted below, although I'm not sure.
user phihung940 hat geschrieben
     -- SOLDIER
     if (sample.classes.class[id]==2) then
          parse ("setmaxhealth "..id.." 200")
          parse ("setarmor "..id.." 50")
          parse ("speedmod "..id.." -3")
          return "11,47,51";
     end

user phihung940 hat geschrieben
          return "11,47,51";

These are weapon IDs. But I may be wrong.

alt Re: Some trouble with "Classes.lua" !

EngiN33R
Moderator Off Offline

Zitieren
1) Add
1
parse("strip "..id.." 50")
at the very end of the spawn hook:
1
2
3
4
5
6
7
-- SPY
     if (sample.classes.class[id]==9) then
          parse ("setmaxhealth "..id.." 150")
          return "84,3,69,52";
     end
     parse("strip "..id.." 50")
end

2) The bots aren't that intelligent to select classes from the menu themselves. Add this at the end of the script before the line where we strip knives:
1
2
3
4
if (player(id,"bot")) then
	sample.classes.class[id]=math.random(1,9) --select random class
	parse("killplayer "..id) --kill bot to change class
end

3)
1
2
3
4
5
6
addhook("hit","hitcomp")
function hitcomp(id,src,w)
	if (w==22 and player(id,"team")==player(src,"team")) then
		parse("sethealth "..src.." "..(player(src,"health")+1)) --change the amount of health healed if you want
	end
end

All of the above should work.

@Parallel_Man
Why are you writing here if you're so not sure?
1× editiert, zuletzt 13.08.11 12:06:48

alt Re: Some trouble with "Classes.lua" !

phihung940
User Off Offline

Zitieren
@EngiN33R: BIG THANKS FOR YOU DUDE !!! ok... 1 and 2 are done, but the number 3. I can't understand how the healing works @-). Can you make the Medic healing AoE (96 x96 Pixel) ?
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht