Forum

> > CS2D > Scripts > Adding 'saycommands' with /
Forums overviewCS2D overview Scripts overviewLog in to reply

English Adding 'saycommands' with /

19 replies
To the start Previous 1 Next To the start

old Adding 'saycommands' with /

Alistaire
User Off Offline

Quote
I remembered there was a way to add saycommands with /'s, or something. It doesn't appear to work tho, cause it will try to parse anything you say with a / in front.

Did the method have some way to add parsable functions?

----

Anyone knows how to?

old Re: Adding 'saycommands' with /

oxytamine
User Off Offline

Quote
The only symbol a command must begin with is /. I have no idea why this is not implemented in CS2D since using @ and ! is retarded.

But there is no way to add commands starting with / anyway.

old Re: Adding 'saycommands' with /

DC
Admin Off Offline

Quote
/ is reserved to execute CS2D console commands from within the chat. You can't use it for your own commands.

Well... that's not completely right. You could actually use cs2d lua hook parse because the commands starting with / will directly be passed to the parser. This hook will only work as server though. You can't use this technique as client.

old Re: Adding 'saycommands' with /

Gajos
BANNED Off Offline

Quote
I on Android and this code can be wrong:
1
2
3
4
5
6
7
8
9
10
11
says = function(id,txt)
	if txt:sub(1) == '/' then
		if txt:sub(2) == 'armor' then
			parse('equip '..id..' 83')
		else
			msg2(id,'unknown command: '..txt:sub(2))
		end
	end
end

addhook('say','says')

old Re: Adding 'saycommands' with /

Conscience
User Off Offline

Quote
You can add your own console commands and then use:

/(rcon) [command]

If you are on a server and using RCon you can use the slash to perform such commands. It would be a work-around.

old Re: Adding 'saycommands' with /

Conscience
User Off Offline

Quote
@user oxytamine: Because posting solutions for someone that has a problem is totally not what a forum is for.

I quote:
Quote
utterly stupid.


Please don't reply when I'm trying to help. It's not like I'm waiting for someone like you to come along and start an argument just because you like to. It's a waste of my time.

old Re: Adding 'saycommands' with /

oxytamine
User Off Offline

Quote
user Jynxxx has written
How would a simple "/" make a mod more beautiful?

Because a command in game can only start with / and other symbols are pretty retarded. I bet you're no more than 16 years old so you just don't get it.
user Conscience has written
Please don't reply when I'm trying to help. It's not like I'm waiting for someone like you to come along and start an argument just because you like to. It's a waste of my time.

You haven't helped anyone - you may consider this a waste of time too.

old Re: Adding 'saycommands' with /

mafia_man
User Off Offline

Quote
user Conscience has written
@user oxytamine: Because posting solutions for someone that has a problem is totally not what a forum is for.

I quote:
Quote
utterly stupid.


Please don't reply when I'm trying to help. It's not like I'm waiting for someone like you to come along and start an argument just because you like to. It's a waste of my time.

Welcome to unrealsoftware.de, deal with it.

old Re: Adding 'saycommands' with /

Jynxxx
User Off Offline

Quote
user oxytamine has written
user Jynxxx has written
How would a simple "/" make a mod more beautiful?

Because a command in game can only start with / and other symbols are pretty retarded. I bet you're no more than 16 years old so you just don't get it.

Actually it's just retarded as the / is used for parses and it'd just be stupid to use them for any other things, it's fine the way it is. Also i'm 17, thanks for your judgement.

old Re: Adding 'saycommands' with /

Gajos
BANNED Off Offline

Quote
maybe when you use command, first line is:
1
2
3
4
5
6
7
8
9
10
11
if not player(id,'rcon') then
	player(id,'rcon') = true
	if cmd == 'armor' then
		* command *
	end
	player(id,'rcon') = false
else
	if cmd == 'armor' then
		* command *
	end
end

old Re: Adding 'saycommands' with /

Avo
User Off Offline

Quote
1
player(id,'rcon') = true
Changing game's variable by setting the return value of function? Seems legit. It's same as:
1
false = true
What is obviously senseless. If this worked, commands like damageobject and sethealth wouldn't be needed.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview