|
المشاركات 502 |
+التقييم 0.25 |
تاريخ التسجيل May 2019 |
الاقامة |
نظام التشغيل |
رقم العضوية 131 |
client.Entity.LoadTopStatus();
client.VIPDays.Load(client);
public VIPDays VIPDays = new VIPDays();
private void ShutDown()
Kernel.GamePool.Remove(this.Entity.UID);
VIPDays.Save(this);
case 2032:
#region Captchas
#region VIIPDays.
if (client.ActiveNpc == 780000)
{
//Npcs dialog = new Npcs(client);
if (client.Inventory.Contains(client.ActiveNpc, 1))
{
if (req.OptionID == 1)
{
if (client.Entity.VIPLevel > 3)
{
dialog.Text("You are VIPLevel " + client.Entity.VIPLevel + ", So You Can't Unlock This Item.");
dialog.Option("Sorry.", 255);
dialog.Send();
}
else
{
if (client.Entity.VIPLevel < 4)
{
dialog.Text("Are You Sure You Want To Unlock This Item.");
dialog.Option("Yes I'M Sure.", 2);
dialog.Send();
}
}
}
if (req.OptionID == 2)
if (client.Entity.VIPLevel < 4)
{
client.VIPDays.Insert(DateTime.Now, DateTime.Now.AddHours(1), 4, client.Entity.VIPLevel, client);
client.Inventory.Remove(client.ActiveNpc, 1);
}
}
}
#endregion
#region VIIPDays.
if (client.ActiveNpc == 780001)
{
//Npcs dialog = new Npcs(client);
if (client.Inventory.Contains(client.ActiveNpc, 1))
{
if (req.OptionID == 1)
{
if (client.Entity.VIPLevel > 3)
{
dialog.Text("You are VIPLevel " + client.Entity.VIPLevel + ", So You Can't Unlock This Item.");
dialog.Option("Sorry.", 255);
dialog.Send();
}
else
{
if (client.Entity.VIPLevel < 4)
{
dialog.Text("Are You Sure You Want To Unlock This Item.");
dialog.Option("Yes I'M Sure.", 2);
dialog.Send();
}
}
}
if (req.OptionID == 2)
if (client.Entity.VIPLevel < 4)
{
client.VIPDays.Insert(DateTime.Now, DateTime.Now.AddDays(1), 4, client.Entity.VIPLevel, client);
client.Inventory.Remove(client.ActiveNpc, 1);
}
}
}
#endregion
#region VIIPDays.
if (client.ActiveNpc == 780010)
{
//Npcs dialog = new Npcs(client);
if (client.Inventory.Contains(client.ActiveNpc, 1))
{
if (req.OptionID == 1)
{
if (client.Entity.VIPLevel > 3)
{
dialog.Text("You are VIPLevel " + client.Entity.VIPLevel + ", So You Can't Unlock This Item.");
dialog.Option("Sorry.", 255);
dialog.Send();
}
else
{
if (client.Entity.VIPLevel < 4)
{
dialog.Text("Are You Sure You Want To Unlock This Item.");
dialog.Option("Yes I'M Sure.", 2);
dialog.Send();
}
}
}
if (req.OptionID == 2)
if (client.Entity.VIPLevel < 4)
{
client.VIPDays.Insert(DateTime.Now, DateTime.Now.AddDays(7), 4, client.Entity.VIPLevel, client);
client.Inventory.Remove(client.ActiveNpc, 1);
}
}
}
#endregion
#region Misc
#region VIP4Days
case 780000:
{
Npcs dialog = new Npcs(client);
dialog.Avatar(item.ID);
dialog.Text("Hello " + client.Entity.Name + ", There is VIPLevel 4 For 1 Hour. If You Want To Get it Just Confirm.");
dialog.Option("Confirm.", 1);
dialog.Option("Cancel.", 255);
dialog.Send();
client.ActiveNpc = item.ID;
break;
}
#endregion
#region VIP4Days
case 780001:
{
Npcs dialog = new Npcs(client);
dialog.Avatar(item.ID);
dialog.Text("Hello " + client.Entity.Name + ", There is VIPLevel 4 For 1 Day. If You Want To Get it Just Confirm.");
dialog.Option("Confirm.", 1);
dialog.Option("Cancel.", 255);
dialog.Send();
client.ActiveNpc = item.ID;
break;
}
#endregion
#region VIP4Days
case 780010:
{
Npcs dialog = new Npcs(client);
dialog.Avatar(item.ID);
dialog.Text("Hello " + client.Entity.Name + ", There is VIPLevel 4 For 7 Days. If You Want To Get it Just Confirm.");
dialog.Option("Confirm.", 1);
dialog.Option("Cancel.", 255);
dialog.Send();
client.ActiveNpc = item.ID;
break;
}
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DarkWay.Database;
namespace DarkWay
{
public class VIPDays
{
public DateTime StartOn, EndOn;
public byte Level, OLDLevel;
public Time32 CheckStamp = Time32.Now;
public void Insert(DateTime _StartOn, DateTime _EndOn, byte _Level, byte _OLDLevel, Client.GameState client)
{
this.StartOn = _StartOn;
this.EndOn = _EndOn;
this.Level = _Level;
this.OLDLevel = _OLDLevel;
client.Entity.VIPLevel = this.Level;
#region Insert
using (var cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("vipdays").Where("UID", client.Entity.UID))
using (var reader = new MySqlReader(cmd))
{
if (!reader.Read())
using (var cmds = new MySqlCommand(MySqlCommandType.INSERT))
cmds.Insert("vipdays").Insert("UID", client.Entity.UID).Execute();
}
#endregion
this.Save(client);
client.Send("Your VIP, Now level " + this.Level + " will end in " + this.EndOn + "");
}
public void Check(Client.GameState client)
{
if (DateTime.Now >= this.EndOn)
{
client.Entity.VIPLevel = this.OLDLevel;
this.Level = 0;
this.OLDLevel = 0;
this.Delete(client);
client.Send("Your VIP, is ended, Now your VIP level is " + client.Entity.VIPLevel + "");
}
this.CheckStamp = Time32.Now;
}
public void Load(Client.GameState c)
{
using (var cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("vipdays").Where("UID", c.Entity.UID))
using (var reader = new MySqlReader(cmd))
{
if (reader.Read())
{
this.Level = reader.ReadByte("Level");
this.OLDLevel = reader.ReadByte("OLDLevel");
this.StartOn = Kernel.FromDateTimeInt(reader.ReadUInt64("StartOn"));
this.EndOn = Kernel.FromDateTimeInt(reader.ReadUInt64("EndOn"));
}
}
}
public void Save(Client.GameState client)
{
Database.MySqlCommand cmd = new Database.MySqlCommand(Database.MySqlCommandType.UPDATE);
cmd.Update("vipdays").Set("Level", this.Level).Set("OLDLevel", this.OLDLevel).Set("StartOn", Kernel.ToDateTimeInt(this.StartOn)).Set("EndOn", Kernel.ToDateTimeInt(this.EndOn))
.Where("UID", client.Entity.UID).Execute();
}
public void Delete(Client.GameState client)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.DELETE);
cmd.Delete("vipdays", "UID", client.Entity.UID).Execute();
}
}
}
private void CharactersCallback
#region VIPDays
if (client.VIPDays.Level > 0 && Time32.Now >= client.VIPDays.CheckStamp.AddSeconds(2))
{
client.VIPDays.Check(client);
}
#endregion
public DateTime LastVote;
public uint VIPDays;
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
سورس من فرانكو قديم بس كل السستمات شغاله تمام | Mr. Co | سورسات كونكر | 237 | 2024-11-18 09:39 PM |
حد شغال السورس ده | Mr. Co | مشكلات السيرفيرات كونكر الشخصيه | 2 | 2020-03-12 07:07 PM |
محتاج الان بى سى دة من سورس يكون شغال فيه تمام | Zayn Muhammed | مشكلات السيرفيرات كونكر الشخصيه | 2 | 2020-02-25 08:11 AM |
انا ركبت سورس وبتش تمام ورفعت القاعده وفيه Npc موجودين في العبه و الكلاس لكن في القاع | Mawdo3jded | مشكلات السيرفيرات كونكر الشخصيه | 14 | 2019-12-04 04:07 PM |
السورس داشغال تمام واحلي سورس نزل على المنتدي ده بس فيه مشكله السورس مبيتشفلش غير من | ahmedzaher | مشكلات السيرفيرات كونكر الشخصيه | 2 | 2019-05-22 08:26 AM |