[RP] 911 CFH System [SLEDMORE]
Hey,
Well, I was due to release this, But Harsh said not to, then he goes to release his? Wdf?
Credits:
Me: 50%
Swimo: 50%
Anyways, here is the release;
911 command:
Code:
#region :911 <message>
case "911":
{
if (copCdLooper != null)
{
sendData("BK" + "Sorry, but you have to wait to send another 911 call.");
}
else
{
int isArrested;
int isDead;
int copID;
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
isArrested = dbClient.getInt("SELECT arrested FROM users WHERE name = '" + _Username + "'");
isDead = dbClient.getInt("SELECT dead FROM users WHERE name = '" + _Username + "'");
copID = dbClient.getInt("SELECT id FROM police_call");
}
if (isArrested == 0 && isDead == 0)
{
string Message = Text.Substring(3);
Room.sendSaying(roomUser, "*calls the police for help*");
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
dbClient.runQuery("UPDATE policecall SET message = '[911]" + Message + "' WHERE id = '1'"); ;
dbClient.runQuery("UPDATE policecall SET room = '" + roomUser.roomID + "' WHERE id = '1'"); ;
dbClient.runQuery("UPDATE policecall SET user = '" + _Username + "' WHERE id = '1'"); ;
}
userManager.sendToCop(1, false, "" + "");
ThreadStart copCdStarter = new ThreadStart(copCoolDown);
copCdLooper = new Thread(copCdStarter);
copCdLooper.Priority = ThreadPriority.Lowest;
copCdLooper.Start();
}
else
{
sendData("You cannot be arrested or dead to ring 911!");
}
}
break;
}
#endregion
Usermanager.cs send data!
Code:
public static void sendToCop(int getCorp, bool includeHigher, string Data)
{
try
{
{
foreach (virtualUser User in _Users.Values)
{
int getWorking;
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
getCorp = dbClient.getInt("SELECT corp_id FROM users WHERE name = '" + User._Username + "'");
getWorking = dbClient.getInt("SELECT working FROM users WHERE name = '" + User._Username + "'");
}
if (getCorp == 1 && getWorking == 1)
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
string msg;
int room;
string user;
msg = dbClient.getString("SELECT Message FROM policecall WHERE id = '1'");
room = dbClient.getInt("SELECT room FROM policecall WHERE id = '1'");
user = dbClient.getString("SELECT user FROM policecall WHERE id = '1'");
User.sendData(Data);
int cfhID;
cfhID = dbClient.getInt("SELECT id FROM policecalldb WHERE username = '" + user + "' AND used = '0'");
string roomName;
roomName = dbClient.getString("SELECT name FROM rooms WHERE id = '" + room + "'");
dbClient.runQuery("UPDATE policecalldb SET used = '1' WHERE username = '" + user + "' AND used = '0' LIMIT 1");
dbClient.runQuery("INSERT INTO policecalldb (username,message,date,used,subject,roomid) VALUES ('" + user + "','" + msg + "','" + DateTime.Now + "','0','911','" + room + "')");
User.sendData("BT" + Encoding.encodeVL64(cfhID) + Convert.ToChar(2) + "I" + "Sent: " + DateTime.Now + Convert.ToChar(2) + user + Convert.ToChar(2) + msg + Convert.ToChar(2) + Encoding.encodeVL64(room) + Convert.ToChar(2) + roomName + Convert.ToChar(2) + "I" + Convert.ToChar(2) + Encoding.encodeVL64(room));
}
}
}
}
}
catch { }
}
Database tables:
Policecall:
Code:
CREATE TABLE IF NOT EXISTS `policecall` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`message` varchar(200) NOT NULL,
`user` varchar(15) NOT NULL,
`room` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Dumping data for table `policecall`
--
INSERT INTO `policecall` (`id`, `message`, `user`, `room`) VALUES
(1, '[911] Keep this here as default!', 'Craig-Martin', 7);
Policecalldb:
Code:
CREATE TABLE IF NOT EXISTS `policecalldb` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`username` varchar(25) NOT NULL,
`message` mediumtext CHARACTER SET utf8 NOT NULL,
`date` varchar(50) CHARACTER SET utf8 NOT NULL,
`used` enum('0','1') CHARACTER SET utf8 NOT NULL,
`subject` varchar(50) CHARACTER SET utf8 NOT NULL,
`roomid` int(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
IF YOU LIKE THIS SHOW YOUR APPRECIATION AND CLICK THE THANKS BUTTON!
Re: [RP] 911 CFH System [SLEDMORE]
Nice release SM,
Sure some RP Hote Owners was looking for this.
Re: [RP] 911 CFH System [SLEDMORE]
lolz it does look like mine xD
Re: [RP] 911 CFH System [SLEDMORE]
Quote:
Originally Posted by
Shacobesaurus
lolz it does look like mine xD
Nuh uh, I coded this way back long ago with Swimo, Then made it into thingy, I Already discussed this on MSN with you, I changed this, I don't know how you got it like that..
Quote:
Originally Posted by
vLife
Nice release SM,
Sure some RP Hote Owners was looking for this.
Cheers buddy (;
Re: [RP] 911 CFH System [SLEDMORE]
Quote:
Originally Posted by
sledmore
hey,
well, i was due to release this, but harsh said not to, then he goes to release his? Wdf?
credits:
me: 50%
swimo: 50%
anyways, here is the release;
911 command:
Code:
#region :911 <message>
case "911":
{
if (copcdlooper != null)
{
senddata("bk" + "sorry, but you have to wait to send another 911 call.");
}
else
{
int isarrested;
int isdead;
int copid;
using (databaseclient dbclient = eucalypt.dbmanager.getclient())
{
isarrested = dbclient.getint("select arrested from users where name = '" + _username + "'");
isdead = dbclient.getint("select dead from users where name = '" + _username + "'");
copid = dbclient.getint("select id from police_call");
}
if (isarrested == 0 && isdead == 0)
{
string message = text.substring(3);
room.sendsaying(roomuser, "*calls the police for help*");
using (databaseclient dbclient = eucalypt.dbmanager.getclient())
{
dbclient.runquery("update policecall set message = '[911]" + message + "' where id = '1'"); ;
dbclient.runquery("update policecall set room = '" + roomuser.roomid + "' where id = '1'"); ;
dbclient.runquery("update policecall set user = '" + _username + "' where id = '1'"); ;
}
usermanager.sendtocop(1, false, "" + "");
threadstart copcdstarter = new threadstart(copcooldown);
copcdlooper = new thread(copcdstarter);
copcdlooper.priority = threadpriority.lowest;
copcdlooper.start();
}
else
{
senddata("you cannot be arrested or dead to ring 911!");
}
}
break;
}
#endregion
usermanager.cs send data!
Code:
public static void sendtocop(int getcorp, bool includehigher, string data)
{
try
{
{
foreach (virtualuser user in _users.values)
{
int getworking;
using (databaseclient dbclient = eucalypt.dbmanager.getclient())
{
getcorp = dbclient.getint("select corp_id from users where name = '" + user._username + "'");
getworking = dbclient.getint("select working from users where name = '" + user._username + "'");
}
if (getcorp == 1 && getworking == 1)
{
using (databaseclient dbclient = eucalypt.dbmanager.getclient())
{
string msg;
int room;
string user;
msg = dbclient.getstring("select message from policecall where id = '1'");
room = dbclient.getint("select room from policecall where id = '1'");
user = dbclient.getstring("select user from policecall where id = '1'");
user.senddata(data);
int cfhid;
cfhid = dbclient.getint("select id from policecalldb where username = '" + user + "' and used = '0'");
string roomname;
roomname = dbclient.getstring("select name from rooms where id = '" + room + "'");
dbclient.runquery("update policecalldb set used = '1' where username = '" + user + "' and used = '0' limit 1");
dbclient.runquery("insert into policecalldb (username,message,date,used,subject,roomid) values ('" + user + "','" + msg + "','" + datetime.now + "','0','911','" + room + "')");
user.senddata("bt" + encoding.encodevl64(cfhid) + convert.tochar(2) + "i" + "sent: " + datetime.now + convert.tochar(2) + user + convert.tochar(2) + msg + convert.tochar(2) + encoding.encodevl64(room) + convert.tochar(2) + roomname + convert.tochar(2) + "i" + convert.tochar(2) + encoding.encodevl64(room));
}
}
}
}
}
catch { }
}
database tables:
policecall:
Code:
create table if not exists `policecall` (
`id` int(11) not null auto_increment,
`message` varchar(200) not null,
`user` varchar(15) not null,
`room` int(11) not null,
primary key (`id`)
) engine=myisam default charset=latin1 auto_increment=2 ;
--
-- dumping data for table `policecall`
--
insert into `policecall` (`id`, `message`, `user`, `room`) values
(1, '[911] keep this here as default!', 'craig-martin', 7);
policecalldb:
Code:
create table if not exists `policecalldb` (
`id` int(10) not null auto_increment,
`username` varchar(25) not null,
`message` mediumtext character set utf8 not null,
`date` varchar(50) character set utf8 not null,
`used` enum('0','1') character set utf8 not null,
`subject` varchar(50) character set utf8 not null,
`roomid` int(20) not null,
primary key (`id`)
) engine=myisam default charset=latin1 auto_increment=1 ;
if you like this show your appreciation and click the thanks button!
thank you every much
Re: [RP] 911 CFH System [SLEDMORE]
Quote:
Originally Posted by
cooldude159
thank you every much
Aha, Ya welcome (;
Re: [RP] 911 CFH System [SLEDMORE]
Quote:
Originally Posted by
Sledmore
Aha, Ya welcome (;
Is it Just like HabboRP cfh system kinda???
i knew Harsh would of done that to btw :P
Re: [RP] 911 CFH System [SLEDMORE]
Quote:
Originally Posted by
cooldude159
Is it Just like HabboRP cfh system kinda???
i knew Harsh would of done that to btw :P
Yeah it is xD, Its the exact same, for the NYPD. And I'm abit pissed at it..
Re: [RP] 911 CFH System [SLEDMORE]
Quote:
Originally Posted by
Sledmore
Yeah it is xD, Its the exact same, for the NYPD. And I'm abit pissed at it..
Then Why do you work with him jeez I have to admit he good but not that good But witch hotel would you say better Mine or Habbolt byw you should know who i am???
Re: [RP] 911 CFH System [SLEDMORE]
Quote:
Originally Posted by
Sledmore
Yeah it is xD, Its the exact same, for the NYPD. And I'm abit pissed at it..
Soz Craig, Ma bad im looking forward to work with yu and cobe
wid habbolt sooo excited :)
ONT: 10/10
Re: [RP] 911 CFH System [SLEDMORE]
Quote:
Originally Posted by
cooldude159
Then Why do you work with him jeez I have to admit he good but not that good But witch hotel would you say better Mine or Habbolt byw you should know who i am???
You are such a leet coder
blah blah blah
Good JOb i hope to see more.
But i've given all of my 1 thanks to Harsh..
Cause he needed a Boost :)
Re: [RP] 911 CFH System [SLEDMORE]
Quote:
Originally Posted by
Shacobesaurus
Why are you asking him? lol
Is he like Mr.RP Know it All(Yes he is)
but do you code?
Just Asking
Craig your ugly
Just Saying
Nice Release
Just Playing
Just Kidding
Thanks for this
I'm Tired
Just Writing
Good Night
Lolll Funnnnnnnnnnnnnnnnny :D
Re: [RP] 911 CFH System [SLEDMORE]
Quote:
Originally Posted by
Shacobesaurus
Why are you asking him? lol
Is he like Mr.RP Know it All(Yes he is)
but do you code?
Just Asking
Craig your ugly
Just Saying
Nice Release
Just Playing
Just Kidding
Thanks for this
I'm Tired
Just Writing
Good Night
What the fuck are you ON LOL.
Re: [RP] 911 CFH System [SLEDMORE]
-deletes-
Now no-one can see it :D
Re: [RP] 911 CFH System [SLEDMORE]
Quote:
Originally Posted by
Shacobesaurus
You are such a leet coder
blah blah blah
Good JOb i hope to see more.
But i've given all of my 1 thanks to Harsh..
Cause he needed a Boost :)
Well i'm a little coder i can make commands better more stable that about it But Harsh only as needs 2 commands to Buy a gun and knife But on my side i only need 1 command for each item he needs well figures i can code a little shit but yeah! Once again Sledmore Thank you!!