[Release]Simple Status Checker

12/29/2008 18:29 Kokuna4#1
Ok, today im releasing a Simple Status Checker! (Its my first code in C#)

In Client.cs find :
Quote:
if (CurrentNPC == 390)
above add :
Quote:
if (CurrentNPC == 9999)
{
SendPacket(General.MyPackets.NPCSay("Hello, Im checking your Status"));
SendPacket(General.MyPackets.NPCLink("OK, check my Status please", 1));
SendPacket(General.MyPackets.NPCLink("No, thanks", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
then search for a second time 390 and add above :
Quote:
if (CurrentNPC == 9999)
{
if (Control == 1)
{
if (Status == 8)
{
SendPacket(General.MyPackets.NPCSay("You are a GM!"));
SendPacket(General.MyPackets.NPCLink("OK",255)); SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
if (Status == 7)
{
SendPacket(General.MyPackets.NPCSay("You are a PM!"));
SendPacket(General.MyPackets.NPCLink("OK",255)); SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
if (Status == 2)
{
SendPacket(General.MyPackets.NPCSay("You are a Normal Player!"));
SendPacket(General.MyPackets.NPCLink("OK",255)); SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
}
Press thanks if u like it :)

Oh I forgot ... Of course you have to add the NPC with ID 9999 to the MySQL database :D
12/29/2008 18:33 Beta Limit#2
Nice - you could also add this as a command for all users like /status and get message you are pm/gm/normal player
12/29/2008 18:35 Kokuna4#3
Nice idea! I'll make one right now :D
12/29/2008 20:35 scottdavey#4
Code:
if (CurrentNPC == 9999)
{
	if (Control == 1)
	{
		if (Status == 8)
		{
			SendPacket(General.MyPackets.NPCSay("You are a GM!"));
			SendPacket(General.MyPackets.NPCLink("OK",255)); SendPacket(General.MyPackets.NPCSetFace(30));
			SendPacket(General.MyPackets.NPCFinish());
		}
		else if (Status == 7)
		{
			SendPacket(General.MyPackets.NPCSay("You are a PM!"));
			SendPacket(General.MyPackets.NPCLink("OK",255)); SendPacket(General.MyPackets.NPCSetFace(30));
			SendPacket(General.MyPackets.NPCFinish());
		}
		else if (Status == 2)
		{
			SendPacket(General.MyPackets.NPCSay("You are a Normal Player!"));
			SendPacket(General.MyPackets.NPCLink("OK",255)); SendPacket(General.MyPackets.NPCSetFace(30));
			SendPacket(General.MyPackets.NPCFinish());
		}
	}
}
Learn to indent.
12/29/2008 20:36 Basser#5
I wont use this because its useless. (Not ment rude)
Anyways, I think its good that ur releasing what u coded.
Its a nice script for a first script, probably did take u pretty long before u fixed all those tiny mistakes =).
I can help you code, im not good either, but anyways, pm me if u like me =)

Quote:
Originally Posted by scottdavey View Post
Use else if.
True, but would be nice if you said "Nice, but you should use else if =)
12/29/2008 20:39 _Emme_#6
Heres a rewritten one by me ( hey, coded it here on e*pvp so it might be buggy,lol ):

Quote:
if (CurrentNPC == 9999)
{
SendPacket(General.MyPackets.NPCSay("Want to check your playerflag?"));
SendPacket(General.MyPackets.NPCLink("Sure", 1));
SendPacket(General.MyPackets.NPCLink("No, thanks", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
Quote:
if (CurrentNPC == 9999)
{
if (Control == 1)
{
string PlayerFlag = "";
if (Status == 8)
PlayerFlag = "GM";
else if (Status == 7)
PlayerFlag = "PM";
else
PlayerFlag = "Normal Player";


SendPacket(General.MyPackets.NPCSay("You are a " + PlayerFlag + "!"));
SendPacket(General.MyPackets.NPCLink("Thanks",255) );
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}


Works the same but looks better and probably are better.

Emme
12/29/2008 20:42 scottdavey#7
Quote:
Originally Posted by EmmeTheCoder View Post
Heres a rewritten one by me ( hey, coded it here on e*pvp so it might be buggy,lol ):







Works the same but looks better and probably are better.

Emme
Saves alot of space :)
12/29/2008 21:03 KraHen#8
What`s the point? XD

I mean that a GM or PM should have [GM] or [PM] after their names. Maybe a VIP status checker would be useful, one which checks when your VIP subscriptions ends.
12/29/2008 21:13 tao4229#9
Why even use if's?

Use switch? >_>