Jump to content

ostatní NPC Generátor


Ewwe

Recommended Posts

  • Administrátor

Je to taková blbost pro vygenerování a zkompilování scriptu pro spuštění NPC. Program po zadání jména nahrávky a typu nahrávky vytvoří pwn a amx soubor který umístíte do npcmodes

Prakticky nic na tom není a některým začátečníkům v C# se to třeba může hodit.

Zdrojový kód:

private void button1_Click(object sender, EventArgs e)
{
	int type = comboBox1.SelectedIndex;
	if (type == -1) button1.Text = "Vyber typ...";
	else if( textBox1.Text.Length == 0 ) button1.Text = "Zadej jméno...";
	else
	{
		if (type == 0) type = 2;
		else type = 1;

		string code = String.Format("#define RECORDING \"{0}\"", textBox1.Text) + Environment.NewLine;
		code += String.Format("#define RECORDING_TYPE {0}", type) + Environment.NewLine + Environment.NewLine;
		code += "#include <a_npc>" + Environment.NewLine;
  		code += "main(){}" + Environment.NewLine;
  		code += "public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING);" + Environment.NewLine;
  		if (type == 1)
  		{
  			code += "public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING);" + Environment.NewLine;
  			code += "public OnNPCExitVehicle() StopRecordingPlayback();" + Environment.NewLine;
  		}
  		else
  		{
  			code += "public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);" + Environment.NewLine;
  		}
  		System.IO.File.WriteAllText(String.Format("{0}.pwn", textBox1.Text), code);
  		ProcessStartInfo startInfo = new ProcessStartInfo();
  		startInfo.FileName = "pawncc.exe";
  		startInfo.Arguments = String.Format("{0}.pwn", textBox1.Text);
  		Process.Start(startInfo);
  	}
 }

 

Link to comment
Share on other sites

  • Administrátor

No tak trochu. Přišlo mi že mi zabere dost času udělat ten script pro npc.. Ŕádově třeba minutu času který můžu věnovat něčemu jinému. Tak jsem si napsal pidi apku která tu minut scvrkne na 3 vteřiny

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...