Chat commands?

Just started using Construct 2? Post your questions here

Post » Sun Aug 30, 2015 4:37 am

is it possible to do chat commands
specificly a kick command

something like
if chat.text = "/kick"&str(USER_NAME)
kick peer with UserName

but how would I get the ID from their name
I know there is a PeerAliasFromID(peerid)
but wouldn't I need PeerIDFromAlias(Alias)
to do something like this?
B
13
S
6
G
1
Posts: 149
Reputation: 1,960

Post » Sun Aug 30, 2015 8:06 am

https://www.scirra.com/manual/174/multiplayer
In part 2 you will get sufficient idea to make pm possible with chat commands.
I think it is possible to convert it to a kick command. I'm still learning though.
It's time for me to return the favor :)
B
32
S
9
G
9
Posts: 132
Reputation: 5,370

Post » Sun Aug 30, 2015 9:06 pm

I don't understand
it doesn't go into any details
I need the ID to kick someone I can't do it with just the alias
B
13
S
6
G
1
Posts: 149
Reputation: 1,960

Post » Sun Aug 30, 2015 9:26 pm

I guess you should first make sure that there can't be multiple peers with the same alias.
Then you can juste create an array or a dictionnary to create associations between peers ID and alias.
So you can know the ID from alias.
B
12
S
7
G
7
Posts: 450
Reputation: 4,276

Post » Sun Aug 30, 2015 10:33 pm

is there a tutorial on this?
I am trying to code this fairly blind
B
13
S
6
G
1
Posts: 149
Reputation: 1,960

Post » Mon Aug 31, 2015 8:40 am

;_;
Read the tutorial I have suggested. I have referred to a manual, where it has lined up 4 multiplayer tutorials links. One can't do this blindly...

https://www.scirra.com/tutorials/906/mu ... oom/page-1
On page 4 it states no player will have the same alias. Quote from age 4 of the tutorial:
[Note that if the requested alias is already in use on the signalling server, it may simply assign you a new alias. For example if two people login as "Joe", the second person actually gets the alias "Joe2". ]

I recommend to start from here https://www.scirra.com/tutorials/892/mu ... 1-concepts
It's time for me to return the favor :)
B
32
S
9
G
9
Posts: 132
Reputation: 5,370

Post » Tue Sep 01, 2015 12:19 am

Yes I know I have read these tutorials.
I meant a tutorial on commands which this does not cover.
this is only a tutorial on adding a chat system not commands.
it only references you can add commands in the conclusion.
but it doesn't go into any detail

I already have a multiplayer chat program set up.
I just need to know how to add these command

I know how to detect a string for the command just not execute it via their nickname

Let me clarify
I'm basically trying to use player aliases to kick them
B
13
S
6
G
1
Posts: 149
Reputation: 1,960


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests