Forum

> > CS2D > Scripts > Adding 'saycommands' with /
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Adding 'saycommands' with /

19 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Adding 'saycommands' with /

Alistaire
User Off Offline

Zitieren
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?

alt Re: Adding 'saycommands' with /

oxytamine
User Off Offline

Zitieren
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.

alt Re: Adding 'saycommands' with /

DC
Admin Off Offline

Zitieren
/ 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.

alt Re: Adding 'saycommands' with /

Gajos
BANNED Off Offline

Zitieren
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')

alt Re: Adding 'saycommands' with /

Conscience
User Off Offline

Zitieren
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.

alt Re: Adding 'saycommands' with /

Conscience
User Off Offline

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

I quote:
Zitat
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.

alt Re: Adding 'saycommands' with /

oxytamine
User Off Offline

Zitieren
user Jynxxx hat geschrieben
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 hat geschrieben
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.

alt Re: Adding 'saycommands' with /

mafia_man
User Off Offline

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

I quote:
Zitat
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.

alt Re: Adding 'saycommands' with /

Jynxxx
User Off Offline

Zitieren
user oxytamine hat geschrieben
user Jynxxx hat geschrieben
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.

alt Re: Adding 'saycommands' with /

Gajos
BANNED Off Offline

Zitieren
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

alt Re: Adding 'saycommands' with /

Avo
User Off Offline

Zitieren
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.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht