- Home /
RPC calls with Photon Networking and 'Admin Commands'???
I understand RPC calls and sending them with photon networking 'over the network', but my question is, if I wanted to use 'admin commands' on a 'server', how would I separate the 'commands' from the name of the player/object/etc? Like if I use a command like '/kill Player123', how would I check first of all, is it a command (/)? Then, is it the kill command (kill)? Then, how would I 'fish out' the name from this string? Since it's a string, how would I basically 'remove' the '/kill' from the string? So if I typed '/kill Player123', how would I separate the 'Player123' from that to find that player and set a bool to kill, or even run a function in a code on that player? Thanks and I hope you understand.
Answer by Firedan1176 · May 29, 2014 at 02:39 AM
For others seeing this topic later on, you can use:
if (someString.StartsWith("/")) { //user is using a command
if (someString.Contains("kill")) { //user is using kill command }
}
Answer by GoGamingJoe · Apr 14, 2014 at 09:58 PM
Me be try and use the inbuilt chat into pun to say \die and the players name The pun also has a naming function in it I would watch some of quill18creates vids on youtube he his working with pun at the moment I hope this helps Sorry there is no code but I'm away from my pc and doing this from my phone
Thanks GoGa$$anonymous$$gJoe I actually am sort of following Quill's videos, but not with my project. I hope he gets the basis of a chat system built in, with even simple commands just to demonstrate the purpose of how it can work (but what will trigger?). Thanks
Your answer
![](https://koobas.hobune.stream/wayback/20220613142722im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to separate parts of a string? 1 Answer
What can I use to find part of a phrase in a string? 2 Answers
Client can't spawn GameObject's 0 Answers