Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua Scripts/Questions/Help

6,770 replies
Page
To the start Previous 1 2197 198 199338 339 Next To the start

old Re: Lua Scripts/Questions/Help

gabpro
User Off Offline

Quote
@Soja1997
It's here!

Spoiler >


Command :
!joboffer <Work Number> <Quantity Available>

<Work Number> : 0~7
<Quantity Available> :
0 : No available
1 or more : Quantity Available
inf : Infinite

Enjoy

Spoiler >

old Re: Lua Scripts/Questions/Help

Soja1997
User Off Offline

Quote
O thank you very much. Now I'll be testing
@Edit :
Gapro it does not work. Could you fix it and next time test your scripts
edited 1×, last 03.05.10 08:09:34 am

old Hello?

craza424
User Off Offline

Quote
Can anyone make me a admin colour script for more then 1 person, don't matter what colour but blue would be nice. It's for a dedicated server.... BTW I've asked this once and got ignored

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
@craza424,I remember making that script a while ago...
1
2
3
4
5
6
7
addhook("say","adminsay")
function adminsay(id,txt)
	if player(id,"usgn") == YOUR USGN
	msg("©000000255"..player(id,"name").." (Admin): "..txt)
	return 1
	end
end

old Re: Lua Scripts/Questions/Help

Patasuss
User Off Offline

Quote
He wants that there can be multiple guys which can speak in color.
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
admins={}

function inTable(tble,val)
	for i=1,#tble do
		if(tble[i]==val) then
			return true
		end
	end
return false
end


function add_admin(uid)
	if(inTable(admins,uid)==false) then
		table.insert(admins,uid)
	end
        print("Admin added")
end

addhook("say","asay")
function asay(id,txt)
	local usgn=player(id,"usgn")
        if(inTable(admins,usgn)==true) then
               msg("©000000255"..(player(id,"name"))..":"..txt)
               return 1
        end
end
Not tested.
To add a admin,
call add_admin(<USGN-ID>)
Replace <USGN-ID> with the usgn-id of the admin.

old Re: Lua Scripts/Questions/Help

YellowBanana
BANNED Off Offline

Quote
I made a little mod that everyone can talk in different colors

Press f2 to select a color, or type !color xxxxxxxxx, and u will talk in that color.

Spoiler >

old Re: Lua Scripts/Questions/Help

craza424
User Off Offline

Quote
Patasuss has written
He wants that there can be multiple guys which can speak in color.
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
admins={}

function inTable(tble,val)
	for i=1,#tble do
		if(tble[i]==val) then
			return true
		end
	end
return false
end


function add_admin(uid)
	if(inTable(admins,uid)==false) then
		table.insert(admins,uid)
	end
        print("Admin added")
end

addhook("say","asay")
function asay(id,txt)
	local usgn=player(id,"usgn")
        if(inTable(admins,usgn)==true) then
               msg("©000000255"..(player(id,"name"))..":"..txt)
               return 1
        end
end
Not tested.
To add a admin,
call add_admin(<USGN-ID>)
Replace <USGN-ID> with the usgn-id of the admin.


It doesnt work.........

old Re: Lua Scripts/Questions/Help

Kostyan1996
User Off Offline

Quote
Hello All, I need a mod (1gmod.lua 2gmod.lua 3gmod.lua-http://letitbit.net/download/24533.244e9ee789495277fdbf791e7/new_gmod.zip.html) select "items" (press F2). That is to say that when you press F2 to me shows a list of guns, and when you press F3 and F4-nothing.

old Re: Lua Scripts/Questions/Help

Amidan
User Off Offline

Quote
Can anyone help me with my first script? It's about regaining HE grenades after a period of time. But it doesn't give me them, idk why . I checked console, it didin't find any bugs, everything seemed to work. Spoiler:

More >


Can you tell me why it doesn't work? I'd be thankful.

old Re: Lua Scripts/Questions/Help

craza424
User Off Offline

Quote
Amidan has written
Can anyone help me with my first script? It's about regaining HE grenades after a period of time. But it doesn't give me them, idk why . I checked console, it didin't find any bugs, everything seemed to work.


Here. I have a grenade script! (This is no reload too if your good try to get rid of that if u don't want it)

(Sorry it looks wierd I'm not perfect on forums >.>)

EDIT: This is for EVERY grenade not just HE I suppose if you deleted the grenade ID's on that line and just left the HE ID that MIGHT just make it HE, I havn't tryed it but have a go!

More >

old Re: Lua Scripts/Questions/Help

Patasuss
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- No Reload and Unlimited Ammo
--
-- By wUps
--
-- # Creds:
-- 
-- Schinken - For the ground of the first No-reload code.
-- LinuxGuy - For the projecttile code, that got my head to think about grenades.
-- And all that i have forgot.
-- 


wat = "51 52 53 54 72 73 75 76 77 86" -- Grenades

addhook("projectile","noreload1")
function noreload1(p,w)
if (string.find(wat,w)~=nil) then
     parse("equip "..p.." "..w) 
     parse("setweapon "..p.." "..w)
end
end
That's better and works for all on the server

old Re: Lua Scripts/Questions/Help

craza424
User Off Offline

Quote
Patasuss has written
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- No Reload and Unlimited Ammo
--
-- By wUps
--
-- # Creds:
-- 
-- Schinken - For the ground of the first No-reload code.
-- LinuxGuy - For the projecttile code, that got my head to think about grenades.
-- And all that i have forgot.
-- 


wat = "51 52 53 54 72 73 75 76 77 86" -- Grenades

addhook("projectile","noreload1")
function noreload1(p,w)
if (string.find(wat,w)~=nil) then
     parse("equip "..p.." "..w) 
     parse("setweapon "..p.." "..w)
end
end
That's better and works for all on the server


Lolol we linked the same script!

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
Hello,I'm having trouble with this code,it's job is to make the member's message in white color.
It does that but it doubles the message.
Example:
Spoiler >

I returned the hook and it isn't working.
1
2
3
4
5
6
7
8
9
10
11
member_usgn = {41794}

addhook("say","membersay")
function membersay(id,txt)
          for index,USGN in ipairs(member_usgn) do
               if player(id,"usgn") == 41794 then
                 msg("©255255255"..player(id,"name").." [Member]: "..txt)
		 return 1
               end
          end
end
Any help?

old Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Quote
redefinder has written
Hello,I'm having trouble with this code,it's job is to make the member's message in white color.
It does that but it doubles the message.
Example:
Spoiler >

I returned the hook and it isn't working.
1
2
3
4
5
6
7
8
9
10
11
member_usgn = {41794}

addhook("say","membersay")
function membersay(id,txt)
          for index,USGN in ipairs(member_usgn) do
               if player(id,"usgn") == 41794 then
                 msg("©255255255"..player(id,"name").." [Member]: "..txt)
		 return 1
               end
          end
end
Any help?


The part of code that you gave us works perfect, you should give us the complete code.

old Re: Lua Scripts/Questions/Help

gabpro
User Off Offline

Quote
In "say" the return didn't works for me too...

When I "return 1" in the say hook of my scripts,the message appears =x

What's wrong?It's a error?
edited 1×, last 05.05.10 06:26:03 pm
To the start Previous 1 2197 198 199338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview