Adding 'saycommands' with /
19 replies



03.04.13 10:00:50 pm
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?
Did the method have some way to add parsable functions?
----
Anyone knows how to?
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.
But there is no way to add commands starting with / anyway.
/ 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
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.
Well... that's not completely right. You could actually use

I on Android and this code can be wrong:
Code:
1
2
3
4
5
6
7
8
9
10
11
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')
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')
Banned for Hacking/Cheating in CS2D /DC
@
Gajos: It's already been said that it's impossible to use them for chat commands.

I code, therefore I exist.
@
EngiN33R
That's the problem. If a command could start with slash it would get many people to make beautiful mods for CS2D.

That's the problem. If a command could start with slash it would get many people to make beautiful mods for CS2D.
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.
/(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.
Remember to learn to forget. Whiskey shots and cheap cigarettes.
You got to be fucking kidding me, my friend. Fast, tell me it's just a joke and you're not serious about this shit.
Why would I not be serious? Please don't waste my time by asking questions you know the answer to over a forum.
Remember to learn to forget. Whiskey shots and cheap cigarettes.
@
oxytamine: Because posting solutions for someone that has a problem is totally not what a forum is for.
I quote:
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.

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.
Remember to learn to forget. Whiskey shots and cheap cigarettes.

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.

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.

@
oxytamine: Because posting solutions for someone that has a problem is totally not what a forum is for.
I quote:
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.

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.


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.
maybe when you use command, first line is:
Code:
1
2
3
4
5
6
7
8
9
10
11
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
player(id,'rcon') = true
if cmd == 'armor' then
* command *
end
player(id,'rcon') = false
else
if cmd == 'armor' then
* command *
end
end
Banned for Hacking/Cheating in CS2D /DC
Code:
1
player(id,'rcon') = true
Changing game's variable by setting the return value of function? Seems legit. It's same as:
Code:
What is obviously senseless. If this worked, commands like damageobject and sethealth wouldn't be needed. 1
false = true
Trust me, I'm an engineer |
DC approved
Super extra mod for CS2D (64), yeah!



Everybody - get in the car! We need a modified client now. Sir
mafia_man, you're lead developer.




