الموضوع: طلب سيستم
عرض مشاركة واحدة
قديم 2019-09-16, 08:57 AM
المشاركة 5
ElSaher
.:: مشرف قسم المشاكل ::.
  • غير متواجد
Mark رد: طلب سيستم
program.cs
سيرش
#region exceptions & logs
جواه ارمي

كود:
 public static void addgmcommando(string gmstring commandstr)
        {
            
string foldern datetime.now.year "-" datetime.now.month,
                
path "gmlogs\\ridergmcommandslog\\",
                
newpath system.io.path.combine(pathfoldern);
            if (!
file.exists(newpath foldern))
            {
                
system.io.directory.createdirectory(system.io.path.combine(pathfoldern));
            }
            if (!
file.exists(newpath "\\" datetime.now.day ".txt"))
            {
                
using (system.io.filestream fs system.io.file.create(newpath "\\" datetime.now.day ".txt"))
                {
                    
fs.close();
                }
            }

            
using (system.io.streamwriter file = new system.io.streamwriter(newpath "\\" datetime.now.day ".txt"true))
            {
                
file.writeline(gm commandstr);
            }
        } 

سيرش

كود:
 if (message.startswith("@"))
                {
                    
string message_ message.substring(1).tolower();
                    
string mess message.substring(1);
                    
string[] data message_.split(' '); 

فوق

كود:
switch (data[0]) 

ضيف

كود:
  program.addgmcommando(client.entity.name"   " client.account.state.tostring() + "   @" message_ "    " datetime.now.tostring()); 

اعمل حركه دي مرتين
بعدها ابحث عن

كود:
if (message.startswith("/")) 

تحت

كود:
string[] data message_.split(' '

حط كود ده

كود:
  program.addgmcommando(client.entity.name"   " client.account.state.tostring() + "   @" message_ "    " datetime.now.tostring()); 
طيب منا هعرف ازاي بردو ههههههه