Cookiez38
Member
- Aug 14, 2014
- 40
- 5
Hellow,
can someone tell me what wrong with this? because i get "ERROR in command "trois" : fatal error encountered during command execution
i use REALITYEMU edit
i ppay if someone fixe me it.
can someone tell me what wrong with this? because i get "ERROR in command "trois" : fatal error encountered during command execution
PHP:
case "trois":
{
Session TargetSession = SessionManager.GetSessionByCharacterId(CharacterResolverCache.GetUidFromName(Session.CharacterInfo.Username));
if (TargetSession == null || !TargetSession.InRoom)
{
Session.SendData(RoomChatComposer.Compose(Actor.Id, "Could not find " + Session.CharacterInfo.Username + " in this room!", 0, ChatType.Whisper));
return true;
}
int num1 = 0;
int num2 = 0;
string str1 = string.Empty;
int num3 = 0;
string Message = string.Empty;
string string2 = MergeParams(@params, 1);
int num4 = Session.CharacterInfo.CreditsBalance;
if (string2 == null && string.IsNullOrEmpty(string2))
return true;
using (SqlDatabaseClient MySqlClient = SqlDatabaseManager.GetClient())
{
DataRow row1 = MySqlClient.ExecuteQueryRow("SELECT a.*,b.* FROM zaprp_weapons AS a JOIN zaprp_user_weapons AS b ON (a.weapon_id = b.weapon_id) WHERE a.weapon_name = @wepname AND b.user_id = @userid");
MySqlClient.SetParameter("wepname", (object)string2);
MySqlClient.SetParameter("userid", (object)Session.CharacterInfo.Id);
if (row1 == null)
{
DataRow row = MySqlClient.ExecuteQueryRow("SELECT weapon_id, weapon_name, cost_credits, clip_size, type FROM zaprp_weapons WHERE weapon_name = @wepname LIMIT 1");
MySqlClient.SetParameter("wepname", (object)string2);
if (row != null)
{
num1 = (int)row["weapon_id"];
num2 = (int)row["cost_credits"];
str1 = (string)row["type"];
string2 = (string)row["weapon_name"];
num3 = (int)row["clip_size"];
}
else
{
Session.SendData(NotificationMessageComposer.Compose("That is an invalid weapon, please type :listweapons to view what is available!"));
return true;
}
}
else
{
Session.SendData(NotificationMessageComposer.Compose("You already own this weapon!"));
return true;
}
}
if (num4 >= num2)
{
using (SqlDatabaseClient MySqlClient = SqlDatabaseManager.GetClient())
{
MySqlClient.ExecuteNonQuery("REPLACE INTO zaprp_user_weapons (user_id, weapon_id, ammo_loaded, ammo_inventory) VALUES (@userid, @weaponid, @ammoloaded, @ammoinv)");
MySqlClient.SetParameter("userid", (object)Session.CharacterInfo.Id);
MySqlClient.SetParameter("weaponid", (object)num1);
if (str1 == "gun")
{
MySqlClient.SetParameter("ammoinv", (object)num3);
MySqlClient.SetParameter("ammoloaded", (object)0);
Message = "You have successfully purchased a " + string2 + "! You get one clip of " + num3.ToString() + " bullets on the house.";
}
else
{
MySqlClient.SetParameter("ammoinv", (object)0);
MySqlClient.SetParameter("ammoloaded", (object)0);
Message = "You have successfully purchased a " + string2 + ", enjoy it!";
}
return true;
}
SqlDatabaseClient MySqlClients = SqlDatabaseManager.GetClient();
int newcoins = Session.CharacterInfo.CreditsBalance - num2;
Session.SendData(CreditsBalanceComposer.Compose(newcoins));
Session.CharacterInfo.UpdateCreditsBalance(MySqlClients, -num2);
Session.SendData(RoomChatComposer.Compose(Actor.Id, "*Buys a " + string2 + "*", 0, ChatType.Whisper));
Session.SendData(NotificationMessageComposer.Compose((Message)));
}
else
Session.SendData(NotificationMessageComposer.Compose("You cannot afford to purchase a " + string2 + "!"));
}
return true;
i use REALITYEMU edit
i ppay if someone fixe me it.