|
You last visited: Today at 02:32
Advertisement
[Release]Simple Status Checker
Discussion on [Release]Simple Status Checker within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.
12/29/2008, 18:29
|
#1
|
elite*gold: 0
Join Date: Dec 2008
Posts: 37
Received Thanks: 12
|
[Release]Simple Status Checker
Ok, today im releasing a Simple Status Checker! (Its my first code in C#)
In Client.cs find :
Quote:
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
|
|
|
12/29/2008, 18:33
|
#2
|
elite*gold: 0
Join Date: Dec 2008
Posts: 493
Received Thanks: 72
|
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
|
#3
|
elite*gold: 0
Join Date: Dec 2008
Posts: 37
Received Thanks: 12
|
Nice idea! I'll make one right now
|
|
|
12/29/2008, 20:35
|
#4
|
elite*gold: 0
Join Date: Dec 2006
Posts: 684
Received Thanks: 238
|
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
|
#5
|
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 506
|
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
Use else if.
|
True, but would be nice if you said "Nice, but you should use else if =)
|
|
|
12/29/2008, 20:39
|
#6
|
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,162
|
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
|
#7
|
elite*gold: 0
Join Date: Dec 2006
Posts: 684
Received Thanks: 238
|
Quote:
Originally Posted by EmmeTheCoder
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
|
#8
|
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
|
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
|
#9
|
elite*gold: 0
Join Date: Feb 2008
Posts: 1,590
Received Thanks: 154
|
Why even use if's?
Use switch? >_>
|
|
|
 |
Similar Threads
|
[Small Release] 5017 PHP Status Checker (LOTF)
12/01/2011 - CO2 PServer Guides & Releases - 11 Replies
THIS IS FOR LOTF!!
I Tested It And It Works!!
<?php
require ("connect.php");
$res = mysql_query("SELECT count(*) FROM accounts;");
$val = mysql_fetch_array($res);
echo "<div style='top'><font color='white'>Accounts Created: ".$val."</div>";
|
[Very-Simple-Release]How to create Status in 5165!
06/10/2010 - CO2 PServer Guides & Releases - 11 Replies
Ok so this might be a basic release lol but someday I decided to fiddle around wit da server since ma internet was down and I'm currently getting a new one... ANYWAYS, this might or might not work depending on the results u get...but it worked for me lol...and plz DON'T spam/flame me...as YES I am still a newbie coder and will keep learning!
Alright so here is how we create more status signs...i.e. "GM" "PM" etc...
go to "Main>GameClient.cs" and find there:
public bool GM;
under it...
|
[Release]Portable Server Status Checker
09/09/2009 - CO2 PServer Guides & Releases - 34 Replies
Reasons I released this:
1) I know there are lots of people who have their servers in beta testing ect, and maybe you might not have a website as yet, or a server status page.
2) I was bored.
So, by the Config.ini is set to:
IP=127.0.0.1
Port=80
|
I need a status Checker!
04/13/2009 - CO2 Private Server - 3 Replies
Ok this is kinda difficult but it can be done
i need a status checker to tell how many people are online
but the problem is our db is ini files not a mysql so if you could please help me that would be great!
thanks,
LeGend
andreaco.tk
|
[Release] Server Status Port Checker C# (Source)
04/12/2008 - CO2 Exploits, Hacks & Tools - 4 Replies
Nope.
|
All times are GMT +1. The time now is 02:33.
|
|