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".Quote:
Change && to ||.
&& means and, || means or.
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.Quote:
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.
Honestly, i don't understand that breakpointing thing.. Have never used it before! I have it enabled on this line:Quote:
I'm pretty sure that the string array Cmd is empty, try breakpointing it to see the values inside.
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;
}
Ugh, have been trying out stuff now, can't figure it out..Quote:
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.
public static bool PmandGMCommand(Main.GameClient GC, string[] Cmd, string Message)
{
// string[] Cmd = Message.Split(' ');
if (GC.AuthInfo.Status != "[PM]") return false;