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 2335 336 337 338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

ULtiMa
User Off Offline

Zitieren
Guys i have a problem....with lua
Can someone help me??

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
addhook("join","exerciseJoin")
function exerciseJoin(id)
  msg("Player"..player(id,"name").."joined the server!")
end

addhook("ms100","ms_hud")
function ms_hud()
for id = 1,32 do
if (player(id,"exists")) then
parse('hudtxt2 '..id..' 44 "©000255000A simple script made by firez " 220 13')
		end
	end
end

addhook("serveraction","instamenu")
function instamenu(id,imenu)
     if imenu == 1 then
          menu(id,"Weapons,Grenader,Rocketeer,Miner,Shotguner,General")
     	end
end
addhook("menu","instaequipall")
function instaequipall(id,menuall,select)
if menu == "Weapons" then
    if select == 1 then
         menuall(id,"Grenader,Snowball,HE,Flashbang,Smoke,Gas Grenade,Molotov,Air Strike,Gut Bomb")
    	end
end

alt Re: Lua Scripts/Questions/Help

Rainoth
Moderator Off Offline

Zitieren
Adriene in your last hook you didnt write what is menu. I think it should be something like
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
addhook("join","exerciseJoin")
function exerciseJoin(id)
msg("Player"..player(id,"name").."joined the server!")
end

addhook("ms100","ms_hud")
function ms_hud()
for id = 1,32 do
if (player(id,"exists")) then
parse('hudtxt2 '..id..' 44 "©000255000A simple script made by firez " 220 13')
          end
     end
end

addhook("serveraction","instamenu")
function instamenu(id,imenu)
if imenu == 1 then
menu(id,"Weapons,Grenader,Rocketeer,Miner,Shotguner,General")
     end
end
addhook("menu","instaequipall")
function instaequipall(id,title,select)
if title == "Weapons" then
if select == 1 then
menu(id,"Grenader,Snowball,HE,Flashbang,Smoke,Gas Grenade,Molotov,Air Strike,Gut Bomb")
     end
end

------------------------------------------------------
Now my part :
can anybody write simple spawn object parameters ?
I mean like if server action (done) a building will appear (player TILEX +1 ,TILE Y+2)(another and so on...)
thanks

EDIT : Never Mind, found out...

alt Re: Lua Scripts/Questions/Help

DannyDeth
User Off Offline

Zitieren
AdrienneTheGreat213 hat geschrieben
Guys i have a problem....with lua
Can someone help me??

Spoiler >

( Added Spoiler to make it smaller... )

Could u please explain what is actually happening? You have a problem but what is it?

alt DaKnOb

sixpack
User Off Offline

Zitieren
Here's one for you:
Is there any way to bind buttons using LUA so if the player presses a button (lets say F12) it executes a function?
This is not about:
•F2
•F3
•F4
•E

alt Re: Lua Scripts/Questions/Help

MasterAsp
User Off Offline

Zitieren
No, you can't check whether F12 is executed, except if it's a default character that is used for something else, so you could set your lets say drop as F12 and then use the drop hook to record it, but besides that you can't(to my knowledge).

alt Re: Lua Scripts/Questions/Help

sixpack
User Off Offline

Zitieren
This mainly happens because someone may have Walk Forward on F12(example) and it will walk and buy things from shop at them same time!

alt Re: Lua Scripts/Questions/Help

JONY
User Off Offline

Zitieren
DaKnOb hat geschrieben
This mainly happens because someone may have Walk Forward on F12(example) and it will walk and buy things from shop at them same time!


The reason why you cant hook to keys (only to 'events') is that you can do crazy shit with players. For example, you can hook to Esc and "return 1" (do nothing) so he will never open main menu.

alt Re: Lua Scripts/Questions/Help

J4x
User Off Offline

Zitieren
try this
1
2
3
4
5
6
addhook("collect","no_wrench_pickup")
function no_wrench_pickup(iid)
if(iid==74) then
return 1
end
end

alt Re: Lua Scripts/Questions/Help

brk951753
User Off Offline

Zitieren
FN_Nemesis hat geschrieben
try this
1
2
3
4
5
6
addhook("collect","no_wrench_pickup")
function no_wrench_pickup(iid)
if(iid==74) then
return 1
end
end


its doesnt work...

alt :O

weed_muffin
User Off Offline

Zitieren
ohey guys

i have a RP server and it needs multiple things.

1st: i need help with arresting people. like, if you hit someone with a claw, it spawns them to jail? it'd be cool to have a f3 menu with instaequip, actions whitch includes teleport and set arrest point

2nd: i need admin gun mods, like sg552 giving you a shop license, claw arresting and so on.
please help me out?

alt Re: Lua Scripts/Questions/Help

MasterAsp
User Off Offline

Zitieren
You used your parameters wrong @brk
Lua allows to name your own local variables but you still have to get their places right.
1
2
3
4
5
6
7
8
9
addhook("collect","pickupevent")
function pickupevent(id, iid, type, ain, a, mode)
	if (iid == 74) then
		return 1
	else
		return 0
	end
return 0
end
That should probably work.
Zum Anfang Vorherige 1 2335 336 337 338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht