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 292 93 94338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
-WiLSoN- hat geschrieben
LUA ERROR: dir:19: 'do' expected near 'unlocked_classes'

line 19
1
for i,v in ipairs unlocked_classes do
wtf :S

Recopy the script from the above post and try again or just add the parenthesis that i forgot
1
for i,v in ipairs(unlocked_classes) do
I forgot it twice so you better recopy the script

alt Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Zitieren
-WiLSoN- hat geschrieben
LUA ERROR: dir:47: attempt to index global 'player_deaths'(a nil value)
sorry for all this :S


isnt the same put player(v,"deaths")? (and its player_deathst no player_deaths xD)

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
-WiLSoN- hat geschrieben
uhm but where's the code ??

As always, it's in my other post
I spotted some bugs and fixed them, tell me if you find more

alt Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Zitieren
yay it worked
i love u flacko *-*
but what do i need to replace to unlock the classes (on another script )
i need to add something else or just replace a name with another ?

alt Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Zitieren
-WiLSoN- hat geschrieben
yay it worked
i love u flacko *-*
but what do i need to replace to unlock the classes (on another script )
i need to add something else or just replace a name with another ?


Please dont do love declarations here

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
-WiLSoN- hat geschrieben
yay it worked
i love u flacko *-*
but what do i need to replace to unlock the classes (on another script )
i need to add something else or just replace a name with another ?


Ok, let's say that you have a function to let the zombies choose their class:

1
2
3
4
5
6
7
8
9
function openzmenu(id)
	local menu_buttons = "Regular Zombie" --Regular zombie unlocked by default
	if(unlocked_classes[1]==true) then --if 1st class unlocked
		menu_buttons = menu_buttons..",Fast Zombie"
		if(unlocked_classes[2]==true) then
			menu_buttons = menu_buttons..",Über Zombie"
		end
	end
end

And so on

alt Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Zitieren
ok thanks but i need this to all the T team
i mean when every T goes to spect after a minute then every zombie goes to zm again and with the new class unlocked

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
-WiLSoN- hat geschrieben
ok thanks but i need this to all the T team
i mean when every T goes to spect after a minute then every zombie goes to zm again and with the new class unlocked

You mean, with the new class selected?
And they can't open a menu to change their class?

alt Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Zitieren
i mean that when every T dies,after that happens the timer begins to run until they all can respawn again
that's what i need
thanks

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
-WiLSoN- hat geschrieben
i mean that when every T dies,after that happens the timer begins to run until they all can respawn again
that's what i need
thanks


Well, isn't that what I did in the big script?
When a T dies 5 times, the script switches every zombie to spectator and will change them back to T when a timer counts down (1 minute)

alt Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Zitieren
i want it to do when EVERY T dies, when there's no one else on terrorist team then the timer starts but it don't know how to "refer"(referirme) to a team that has no players :S

alt Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Zitieren
-WiLSoN- hat geschrieben
i want it to do when EVERY T dies, when there's no one else on terrorist team then the timer starts but it don't know how to "refer"(referirme) to a team that has no players :S


use it to "set" how many players has a team got:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
totalt = 0
totalct = 0
totalspec = 0

	for i=1,32,1 do
		if (player(i,"exists")==true) then
			if (player(i,"team")==1) then
 totalt = totalt+1
  else
	  	if (player(i,"team")==2) then
 totalct = totalct+1
  else
	  	if (player(i,"team")==0) then
 totalspec = totalspec+1

Then, to do something when there is not any player into terrorists team:

1
2
3
if (totalt==0) then
XXXXXXXXX
end

i made this but i dont know just one thing, if "exists" value returns 0/1 or true/false, just try both "ways".
1× editiert, zuletzt 17.11.09 03:37:11

alt Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Zitieren
Is there possible to change someone weapon damage? not all of the player, only 1.. I try search at info.txt but I can't found anything about it

alt Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Zitieren
Zitat
Is there possible to change someone weapon damage? not all of the player, only 1.. I try search at info.txt but I can't found anything about it


1
2
3
4
5
6
7
8
9
addhook("hit","hitpowup")
function hitpowup(id,source,weapon,hpdmg,apdmg)
	if (id==X) then
	if (weapon==WEAPONID) then
 hpdmg = hpdmg+X  --x = you decide!
 apdmg = apdmg+X  --x = your election!
	end
	end
		end


could be?
Just try it
1× editiert, zuletzt 17.11.09 03:54:52
Zum Anfang Vorherige 1 292 93 94338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht