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 258 59 60338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

KimKat
GAME BANNED Off Offline

Zitieren
playa slaya hat geschrieben
well i still have not fixed it and do not see the problem please help

i also need to know how to make a dir
to make multiple scripts work together
That's easy just put this in your actual script:

1
dofile("sys/lua/<your folder for example "My Script">/<your lua script>.lua")
It works, with a little bit of logic of course.
I hope this was what you ment. Otherwise I'm sorry. (EDIT)
1× editiert, zuletzt 26.09.09 23:09:11

alt Re: Lua Scripts/Questions/Help

playa slaya
COMMUNITY BANNED Off Offline

Zitieren
The save feature works perfect but the load does not work what is the problem
the script saves data to 'sys/lua/RPG_data/'

Spoiler >

alt Re: Lua Scripts/Questions/Help

Newgen
User Off Offline

Zitieren
How can I get the ID for the current weapon a player is using?

1
2
3
4
5
6
7
addhook("attack", "noreload")

function noreload(id, weapon)
	wpn[id] = WEAPON
	parse("equip "..id.." "..wpn[id])
	parse("setweapon "..id.." "..wpn[id])
end

alt Re: Lua Scripts/Questions/Help

TimeQuesT
User Off Offline

Zitieren
so you can get the weapon.
1
2
3
4
5
addhook ("attack","an")
function an(id)
wpn = player(id,"weapontype");
parse ("equip "..id.." "..wpn)
end

ahh no reload

alt WTF...

mafia_man
User Off Offline

Zitieren
1
i finded

LUA ERROR: attempt to call a nil value

Can someones help me ?
1× editiert, zuletzt 27.09.09 16:58:36

alt Re: Lua Scripts/Questions/Help

mafia_man
User Off Offline

Zitieren
you want to everyone players have weapon on spawn

if true :
1
2
3
4
5
6
7
8
9
10
function equip(id,wpn)
	parse('equip '..id..' '..wpn)
end

addhook("spawn","myspawn")
function myspawn(id)
	if (id>0) then
		equip(id,45)
	end
end

player start with laser and knife

alt Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Zitieren
redefinder hat geschrieben
can anyone tell me how to make unlimited weapons spawn on players for example to have unlimited he grenades?


1
2
3
4
5
6
7
8
addhook ("second", "he_gren")
function he_gren()
	for i = 1, 32 do
		if (player(i,"exists")) then
			parse('equip '..i..' 51')
		end
	end
end

alt Re: Lua Scripts/Questions/Help

mafia_man
User Off Offline

Zitieren
Blazzingxx hat geschrieben
redefinder has written:
can anyone tell me how to make unlimited weapons spawn on players for example to have unlimited he grenades?


Code:
addhook ("second", "he_gren")
function he_gren()
for i = 1, 32 do
if (player(i,"exists")) then
parse('equip '..i..' 51')
end
end
end


not better always ?

alt Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Zitieren
yes but i need to make he to spawn unlimited only on a special class for example only he man class has he grenade.And can you tell me how to make unlimited snowball for ice man,and unlimited mine for mine man class?

alt Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Zitieren
mafia_man hat geschrieben
not better always ?

No, better second.

@redifinder, I know that you learnt lua. So you can make it self.

alt Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Zitieren
redefinder hat geschrieben
yeah but pls help about unlimited weapons spawn on classes

Why unlimited weapons instead infinitive ammo?
Or you mean mines? It same code as I write before 20 minutes.

alt Re: Lua Scripts/Questions/Help

mafia_man
User Off Offline

Zitieren
nobody write for you 100% script because when he make it for you he is a owner of script not you
1× editiert, zuletzt 27.09.09 18:29:26

alt Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Zitieren
redefinder hat geschrieben
i only asked for help....if you don`t like to help don`t insult people....NOOB

Be carefull with "noob" becouse you can get violation...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
-- This is idea how it should work
addhook ("second", "he_gren")
function he_gren()
	for i = 1, 32 do
		if (player(i,"exists")) then
			if (playerclass[id] = 1) then
				parse('equip '..i..' 51')
			end
			if (playerclass[id] = 2) then
				parse('equip '..i..' 77')
			end
		end
	end
end
Zum Anfang Vorherige 1 258 59 60338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht