Newbie Spellweaver
- Joined
- Jul 18, 2014
- Messages
- 85
- Reaction score
- 39
case 97:
{
if (Params.Length >= 2)
{
using (DatabaseClient dbClient = Phoenix.GetDatabase().GetClient())
{
dbClient.AddParamWithValue("userid", Phoenix.GetGame().GetClientManager().method_27(Params[1]));
DataTable dataTable = dbClient.ReadDataTable("SELECT extra_data, timestamp FROM cmdlogs WHERE user_id = @[I][B][URL="https://forum.ragezone.com/members/1335.html"]user[/URL][/B][/I]id AND command='flagme' LIMIT 100;");
string motdMessage = "User " + Params[1] + " last 100 name changes: \n";
foreach(DataRow dataRow in dataTable.Rows)
{
string extraData = dataRow["extra_data"].ToString();
string newName = extraData.Substring(extraData.IndexOf(':') + 1).Split(' ')[1];
string oldName = extraData.Substring(extraData.IndexOf(':') + 1).Split(' ')[3];
DateTime whenChangedName = Phoenix.smethod_21(double.Parse((string)dataRow["timestamp"].ToString()));
motdMessage += whenChangedName.ToString() + " - Old name: " + oldName + " - New name: " + newName + "\n";
}
Session.SendNotif(motdMessage, 2);
}
return true;
}
else
{
return false;
}
}
Make it only for rank 4 and higher, because some people sometimes don't want to know what your old names where. It's only important for staffs.
ONT: Like this release.
Room system isin't id based? And yeah if user have changed many time his name and user use this command he can figure out if he have scammed someone under his old usernameWait a second why didn't you just put this in the other thread because its anoying that peaple make threads for all small things....
But ok I like the command but I can't see why this should of prevend cheaters? your chatlog is ID based... and your CMD log is ID based do I hope...
And your room system is ID based and... even the user system is ID based so yeah....
Thanks for your ideaSet a permission node for it. Hardcoding those ranks is just useless if you ever want to edit it in the future.
How to access the database and get name changes, if for instance it's after an emulator restart and it's not in the cache.Who would use MySQL for a simple command.... :thumbdown:
and Phoenix is a terrible emulator.
Who would use MySQL for a simple command.... :thumbdown:
and Phoenix is a terrible emulator.
Maybe you can make it for GTE? :')If it's a simple command, then why not use MySQL?
It is overkill to use any other method (for eg cache it) because it leads to more memory usage which could've been prevented in the first place.
Maybe you can make it for GTE? :')
I'm trying to make it for Goldtree emulator. But i get a error, do you know how to fix this?I suggest a cool down timer should be added so this command can't be spammed and abused.
Make what?
I'm trying to make it for Goldtree emulator. But i get a error, do you know how to fix this?
Screen:You must be registered to see links
Code:
Code:case 108: { if (Params.Length >= 2) { using (DatabaseClient dbClient = GoldTree.GetDatabase().GetClient()) { dbClient.AddParamWithValue("userid", GoldTree.GetGame().GetClientManager().method_27(Params[1])); DataTable dataTable = dbClient.ReadDataTable("SELECT extra_data, timestamp FROM cmdlogs WHERE user_id = [USER=1335]user[/USER]id AND command='flagme' LIMIT 100;"); string motdMessage = "User " + Params[1] + " last 100 name changes: \n"; foreach (DataRow dataRow in dataTable.Rows) { string extraData = dataRow["extra_data"].ToString(); string newName = extraData.Substring(extraData.IndexOf(':') + 1).Split(' ')[1]; string oldName = extraData.Substring(extraData.IndexOf(':') + 1).Split(' ')[3]; DateTime whenChangedName = GoldTree.smethod_21(double.Parse((string)dataRow["timestamp"].ToString())); motdMessage += whenChangedName.ToString() + " - Old name: " + oldName + " - New name: " + newName + "\n"; } Session.SendNotification(motdMessage, 2); } return true; } else { return false; } }