Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.IO;
- namespace WindowsFormsApplication7
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- textBox4.Hide();
- textBox6.Hide();
- label1.Hide();
- textBox5.Hide();
- checkBox1.Hide();
- label2.Hide();
- listBox2.Hide();
- listBox3.Hide();
- }
- private void textBox1_TextChanged(object sender, EventArgs e)
- {
- }
- private void label1_Click(object sender, EventArgs e)
- {
- }
- private void textBox4_TextChanged(object sender, EventArgs e)
- {
- }
- private void button1_Click(object sender, EventArgs e)
- {
- string name = textBox2.Text.Replace(" ", string.Empty); ;
- name = name.ToLower();
- var file = File.Create( textBox1.Text + "\\" + name + ".lua" );
- file.Close();
- string code = "";
- if (listBox1.SelectedIndex == 2) {
- code =
- @"ITEM.Name = '" + textBox2.Text + @"'
- ITEM.Price = " + textBox3.Text + @"
- ITEM.Model = '" + textBox4.Text + @"'
- ITEM.AdminOnly = " + (checkBox2.Checked ? "true" : "false") + @"
- function ITEM:OnEquip(ply, modifications)
- if not ply._OldModel then
- ply._OldModel = ply:GetModel()
- end
- timer.Simple(1, function() ply:SetModel(self.Model) end)
- end
- function ITEM:OnHolster(ply)
- if ply._OldModel then
- ply:SetModel(ply._OldModel)
- end
- end
- function ITEM:PlayerSetModel(ply)
- ply:SetModel(self.Model)
- end
- ";
- }
- if (listBox1.SelectedIndex == 4)
- {
- code =
- @"ITEM.Name = '" + textBox2.Text + @"'
- ITEM.Price = " + textBox3.Text + @"
- ITEM.Material = '" + textBox6.Text + @"'
- ITEM.AdminOnly = " + (checkBox2.Checked ? "true" : "false") + @"
- function ITEM:OnEquip(ply, modifications)
- ply." + name + @" = util.SpriteTrail(ply, 0, modifications.color, false, 15, 1, 4, 0.125, self.Material)
- end
- function ITEM:OnHolster(ply)
- SafeRemoveEntity(ply." + name + @")
- end
- function ITEM:Modify(modifications)
- PS:ShowColorChooser(self, modifications)
- end
- function ITEM:OnModify(ply, modifications)
- SafeRemoveEntity(ply." + name + @")
- self:OnEquip(ply, modifications)
- end
- ";
- }
- if (listBox1.SelectedIndex == 5)
- {
- code =
- @"
- ITEM.Name = '" + textBox2.Text + @"'
- ITEM.Price = " + textBox3.Text + @"
- ITEM.Model = '"+ textBox4.Text + @"'
- ITEM.WeaponClass = '" + textBox5.Text + @"'
- ITEM.SingleUse = " + (checkBox1.Checked ? "true" : "false") + @"
- ITEM.AdminOnly = " + (checkBox2.Checked ? "true" : "false") + @"
- function ITEM:OnBuy(ply)
- ply:Give(self.WeaponClass)
- ply:SelectWeapon(self.WeaponClass)
- end
- function ITEM:OnSell(ply)
- ply:StripWeapon(self.WeaponClass)
- end
- ";
- }
- File.WriteAllText(textBox1.Text + "\\" + name + ".lua", code);
- }
- private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- textBox4.Hide();
- textBox6.Hide();
- textBox5.Hide();
- checkBox1.Hide();
- label1.Hide();
- label2.Hide();
- listBox2.Hide();
- listBox3.Hide();
- switch (listBox1.SelectedIndex){
- case 0:
- textBox4.Show();
- textBox4.Text = "Model path";
- listBox2.Show();
- label1.Show();
- break;
- case 1:
- textBox4.Show();
- textBox4.Text = "Model path";
- label2.Show();
- listBox3.Show();
- break;
- case 2:
- textBox4.Show();
- textBox4.Text = "Model path";
- break;
- case 3:
- textBox4.Show();
- textBox4.Text = "Model path";
- break;
- case 4:
- textBox6.Show();
- textBox6.Text = "Material path";
- break;
- case 5:
- textBox4.Show();
- textBox5.Show();
- checkBox1.Show();
- break;
- }
- }
- private void label1_Click_1(object sender, EventArgs e)
- {
- }
- private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement