That would not fix his problem. If you reverse that statement (the one you just suggested that he used), that would be "If the user is a GM and a PM". It should be kept as an AND in his statement so that it reads "If the user is not a GM and not a PM, then return false".
Going back to the command, what exactly are you expecting this command to do? What exactly is the problem? What's the context of the command? Have you tried debugging it? Either white box or black box testing would work. My signature contains good white box testing techniques. Black box testing is just putting some write lines to the console in places you expect it to run by.
I also would suggest adding a system to where it reads the account type from a row in the database and use that to check what type of account you have. This can be handy for a system I did to where when some one is logging in if they are not a staff member they will be closed and the custom server message will come up but if they are staff it will pass them into the server.
I also would suggest adding a system to where it reads the account type from a row in the database and use that to check what type of account you have. This can be handy for a system I did to where when some one is logging in if they are not a staff member they will be closed and the custom server message will come up but if they are staff it will pass them into the server.
He already has that, it's just with strings instead of a numerical / enumerated values. He doesn't need to do any work on that part of his project. It's also not very polite to bring up whatever irrelevant work you've done before making an attempt to solve his problem. It's kinda like saying "Oh, you have a broken knee? Why don't you try my new bike?" Gotta fix the problem he's experiencing first before introducing new problems.
I'm pretty sure that the string array Cmd is empty, try breakpointing it to see the values inside.
Honestly, i don't understand that breakpointing thing.. Have never used it before! I have it enabled on this line:
The line with red color is where my breakpointing is:
Code:
case "/life":
{
GC.MyChar.CurMP = (ushort)GC.MyChar.MaxMP; //<-- This is where i used the breakpoint.
GC.MyChar.CurHP = (ushort)GC.MyChar.MaxHP;
return true;
}
And i debug, and play game.. And i try the command, still not working.. And still no errors showing.
Or, you could use my tutorial in my signature, but back to the code... As I said, Super Aids was wrong. The line where you have "if (GC.AuthInfo.Status != "[GM]" || GC.AuthInfo.Status != "[PM]") return false;" shouldn't have been changed. Think about it, it currently reads "If the game client's auth info status is not a Gm or not a Pm, return false." That's not right at all. It should be if the player isn't a GM and isn't a PM. That would mean the player isn't staff and shouldn't access the codes. Right now it will always be true, and the function will always return false.
Or, you could use my tutorial in my signature, but back to the code... As I said, Super Aids was wrong. The line where you have "if (GC.AuthInfo.Status != "[GM]" || GC.AuthInfo.Status != "[PM]") return false;" shouldn't have been changed. Think about it, it currently reads "If the game client's auth info status is not a Gm or not a Pm, return false." That's not right at all. It should be if the player isn't a GM and isn't a PM. That would mean the player isn't staff and shouldn't access the codes. Right now it will always be true, and the function will always return false.
Ugh, have been trying out stuff now, can't figure it out..
I've already given you the answer in detail. I really have absolutely no idea what more you could want when the code has been posted for you. If you're still struggling, then what do you expect from us? You will not be able to make a respectable server without knowing how to program, and something so basic as to changing a very simple selection statement... it makes me wonder how you've made it this far to begin with.
I really recommend you do something about your programming incapability. Online tutorials, classes at your local community college, what not - you have a lot of resources available to you. You're not going to be able to progress very quickly ignoring your problems with programming.
some Gm commands 12/22/2010 - Dekaron Private Server - 4 Replies here is some
i,M a GM on SPECTRUS DEKARON so tha r a little old but tha can help some ppl out
my fav is 3728 gives coppers silver and golds lol fun fun
[Key Commands] Default Key Commands for the beginners 10/01/2008 - General Gaming Releases - 0 Replies Default keybindings:
Abilities Window V
Backpack Window: B
Career Window: K
Character Window: C
Battlegroup Window: Left Alt + R
Developer Window: ;
Guild Window: G
Help Window: H