Showing @goto command in console

Posted: 08 Feb 2021 18:54
by juan.delcastillo

I'm coverting Nani commands to strings via ToString() and printing them in console. I've noticed that some of this commands are not converted or do not show in console. In my case, I tried to convert @goto and it showed nothing. I want to use ToString() as an if condition. Is there something I'm missing?


Re: Showing @goto command in console

Posted: 08 Feb 2021 19:26
by juan.delcastillo

I thought I could use the alias instead of the class


Re: Showing @goto command in console

Posted: 08 Feb 2021 19:37
by Elringus

Using a tostring of a type in conditionals is not a good idea. Consider using type checking instead: https://docs.microsoft.com/en-us/dotnet ... g-and-cast


Re: Showing @goto command in console

Posted: 08 Feb 2021 20:01
by juan.delcastillo
Elringus wrote: 08 Feb 2021 19:37

Using a tostring of a type in conditionals is not a good idea. Consider using type checking instead: https://docs.microsoft.com/en-us/dotnet ... g-and-cast

I did but it doesn't work, @goto is never read by IScriptPlayer.PlayedCommand, for some reason


Re: Showing @goto command in console

Posted: 08 Feb 2021 20:13
by Elringus

I guess you're looking to check which command is being executed? In this case, use OnCommand event in the player service.