Jump to content

script RCON Panel


jenkings

Recommended Posts

Zdravím.

 

Našel jsem v počítači tenhle script, a jelikož už nepawním tak vám ho sem dávám :d

 

Je tam jen jeden příkaz pro RCON /controlpanel , který vám zobrazí dialog ze kterého si můžete vybrat co chcete dělat.

 

 

 

#include

#define DIALOGID 3000
#define COLOR_RED 0xAA3333AA
new aobjekt[1];

stock IsNumeric(const string[])
{
new length=strlen(string);
if(length==0)
{
	return 0;
}
for (new i=0; i 	{
	if (!((string[i] <= '9' && string[i] >= '0') || (i==0 && (string[i]=='-' || string[i]=='+'))))
	{
		return false;
	}
}
return 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/controlpanel", cmdtext, true, 10) == 0)
{
	if(IsPlayerAdmin(playerid))
	{
	ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Admin Control Panel", "Počasí\nČas\nGravitace\nAkce pro všechny\nOstatní příkazy\nMoje příkazy", "Select", "Cancel");
	}
	return 1;
}
return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOGID)
{
	if(response)
	{
		if(listitem == 0)
		{
			ShowPlayerDialog(playerid, DIALOGID+1, DIALOG_STYLE_LIST, "Vyber si počasí", "Slunečno\nPod Mrakem\nDeštivo\nPísečná Bouře\nSilný Déšť\nZataženo\nHurikán\nSlabší písečná bouře\nKonec Světa\nFialové nebe", "Select", "Cancel");
		}
		if(listitem == 1)
		{
			ShowPlayerDialog(playerid, DIALOGID+2, DIALOG_STYLE_LIST, "Nastav Denní dobu", "1\n2\n3\n4\n5\n4\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24", "Select", "Cancel");
		}
		if(listitem == 2)
		{
			ShowPlayerDialog(playerid, DIALOGID+3, DIALOG_STYLE_LIST, "Gravitace", "0\n1\n2\n5\nNormální\n10\n15", "Select", "Cancel");
		}
		if(listitem == 3)
		{
			ShowPlayerDialog(playerid, DIALOGID+4, DIALOG_STYLE_LIST, "Akce pro všechny", "Opít\nVystřízlivět", "Select", "Cancel");
		}
		if(listitem == 4)
		{
			ShowPlayerDialog(playerid, DIALOGID+5, DIALOG_STYLE_LIST, "Ostatní příkazy", "Say\nZabít Hráče\nSpawn vozidla\nRestartovat server", "Select", "Cancel");
		}
		if(listitem == 5)
		{
			ShowPlayerDialog(playerid, DIALOGID+10, DIALOG_STYLE_LIST, "Moje příkazy", "Zdraví\nVesta", "Select", "Cancel");
		}
	}
	return 1;
}

if(dialogid == DIALOGID+1) // počasí
{
	if(response)
	{
		if(listitem == 0)
		{
			SetWeather(1);
		}
		if(listitem == 1)
		{
			SetWeather(4);
		}
		if(listitem == 2)
		{
			SetWeather(8);
		}
		if(listitem == 3)
		{
			SetWeather(19);
		}
		if(listitem == 4)
		{
			SetWeather(20);
		}
		if(listitem == 5)
		{
			SetWeather(21);
		}
		if(listitem == 6)
		{
			SetWeather(32);
		}
		if(listitem == 7)
		{
			SetWeather(42);
		}
		if(listitem == 8)
		{
			SetWeather(250);
		}
		if(listitem == 9)
		{
			SetWeather(2009);
		}
	}
	return 1;
}

if(dialogid == DIALOGID+2)
{
	if(response)
	{
		if(listitem == 0)
		{
			SetWorldTime(1);
		}
		if(listitem == 1)
		{
			SetWorldTime(2);
		}
		if(listitem == 2)
		{
			SetWorldTime(3);
		}
		if(listitem == 3)
		{
			SetWorldTime(4);
		}
		if(listitem == 4)
		{
			SetWorldTime(5);
		}
		if(listitem == 5)
		{
			SetWorldTime(6);
		}
		if(listitem == 6)
		{
			SetWorldTime(7);
		}
		if(listitem == 7)
		{
			SetWorldTime(8);
		}
		if(listitem == 8)
		{
			SetWorldTime(9);
		}
		if(listitem == 9)
		{
			SetWorldTime(10);
		}
		if(listitem == 10)
		{
			SetWorldTime(11);
		}
		if(listitem == 11)
		{
			SetWorldTime(12);
		}
		if(listitem == 12)
		{
			SetWorldTime(13);
		}
		if(listitem == 13)
		{
			SetWorldTime(14);
		}
		if(listitem == 14)
		{
			SetWorldTime(15);
		}
		if(listitem == 15)
		{
			SetWorldTime(16);
		}
		if(listitem == 16)
		{
			SetWorldTime(17);
		}
		if(listitem == 17)
		{
			SetWorldTime(18);
		}
		if(listitem == 18)
		{
			SetWorldTime(19);
		}
		if(listitem == 19)
		{
			SetWorldTime(20);
		}
		if(listitem == 20)
		{
			SetWorldTime(21);
		}
		if(listitem == 21)
		{
			SetWorldTime(22);
		}
		if(listitem == 22)
		{
			SetWorldTime(23);
		}
		if(listitem == 23)
		{
			SetWorldTime(24);
		}

	}
	return 1;
}
if(dialogid == DIALOGID+3) // Gravitace
	{
		if(response)
		{
		  if(listitem == 0)
		  {
			  SetGravity(0.000);
		  }
		  if(listitem == 1)
		  {
			  SetGravity(0.001);
		  }
		  if(listitem == 2)
		  {
			 SetGravity(0.003);
		  }
		  if(listitem == 3)
		  {
			  SetGravity(0.005);
		  }
		  if(listitem == 4)
		  {
			 SetGravity(0.008);
		  }
		  if(listitem == 5)
		  {
			  SetGravity(0.010);
		  }
		  if(listitem == 6)
		  {
			  SetGravity(0.015);
		}
		}
		return 1;
	}
if(dialogid == DIALOGID+4)
{
	if(response)
	{
		if(listitem == 0)
		{
			for(new i;i

 

  • Líbí se mi to! (+1) 1
Link to comment
Share on other sites

No, screeny asi těžko udělám když to nemám jak vyzkoušet že jo :d Stahovat GTA se mi kvůli tomu nechce , ale kdyby se našel někdo kdo by to vyzkoušel a screeny udělal tak mi je PLZ pošlete do SZ a já je dám do prvního příspěvku.

 

 

P.S. -> to jak to vypadá a k čemu to je se dá poznat podle kódu ;)

Link to comment
Share on other sites

  • Globální moderátor
No, screeny asi těžko udělám když to nemám jak vyzkoušet že jo :d Stahovat GTA se mi kvůli tomu nechce , ale kdyby se našel někdo kdo by to vyzkoušel a screeny udělal tak mi je PLZ pošlete do SZ a já je dám do prvního příspěvku.

 

 

P.S. -> to jak to vypadá a k čemu to je se dá poznat podle kódu ;)

 

to jako jo

jinak to nehází errory

Link to comment
Share on other sites

Nešlo by toto

 

if(dialogid == DIALOGID+2)
{
if(response)
{
if(listitem == 0)
{
SetWorldTime(1);
}
if(listitem == 1)
{
SetWorldTime(2);
}
if(listitem == 2)
{
SetWorldTime(3);
}
if(listitem == 3)
{
SetWorldTime(4);
}
if(listitem == 4)
{
SetWorldTime(5);
}
if(listitem == 5)
{
SetWorldTime(6);
}
if(listitem == 6)
{
SetWorldTime(7);
}
if(listitem == 7)
{
SetWorldTime(8);
}
if(listitem == 8)
{
SetWorldTime(9);
}
if(listitem == 9)
{
SetWorldTime(10);
}
if(listitem == 10)
{
SetWorldTime(11);
}
if(listitem == 11)
{
SetWorldTime(12);
}
if(listitem == 12)
{
SetWorldTime(13);
}
if(listitem == 13)
{
SetWorldTime(14);
}
if(listitem == 14)
{
SetWorldTime(15);
}
if(listitem == 15)
{
SetWorldTime(16);
}
if(listitem == 16)
{
SetWorldTime(17);
}
if(listitem == 17)
{
SetWorldTime(18);
}
if(listitem == 18)
{
SetWorldTime(19);
}
if(listitem == 19)
{
SetWorldTime(20);
}
if(listitem == 20)
{
SetWorldTime(21);
}
if(listitem == 21)
{
SetWorldTime(22);
}
if(listitem == 22)
{
SetWorldTime(23);
}
if(listitem == 23)
{
SetWorldTime(24);
}

 

 

Třeba takto jedodušeji ?

 

if(dialogid == DIALOGID+2)
{
if(response)
{
   SetWorldTime(listitem);
}

 

Podle mě by to celé šlo udělat jednodušeji přes Array :d

Link to comment
Share on other sites

Nešlo by toto

 

if(dialogid == DIALOGID+2)
{
if(response)
{
if(listitem == 0)
{
SetWorldTime(1);
}
if(listitem == 1)
{
SetWorldTime(2);
}
if(listitem == 2)
{
SetWorldTime(3);
}
if(listitem == 3)
{
SetWorldTime(4);
}
if(listitem == 4)
{
SetWorldTime(5);
}
if(listitem == 5)
{
SetWorldTime(6);
}
if(listitem == 6)
{
SetWorldTime(7);
}
if(listitem == 7)
{
SetWorldTime(8);
}
if(listitem == 8)
{
SetWorldTime(9);
}
if(listitem == 9)
{
SetWorldTime(10);
}
if(listitem == 10)
{
SetWorldTime(11);
}
if(listitem == 11)
{
SetWorldTime(12);
}
if(listitem == 12)
{
SetWorldTime(13);
}
if(listitem == 13)
{
SetWorldTime(14);
}
if(listitem == 14)
{
SetWorldTime(15);
}
if(listitem == 15)
{
SetWorldTime(16);
}
if(listitem == 16)
{
SetWorldTime(17);
}
if(listitem == 17)
{
SetWorldTime(18);
}
if(listitem == 18)
{
SetWorldTime(19);
}
if(listitem == 19)
{
SetWorldTime(20);
}
if(listitem == 20)
{
SetWorldTime(21);
}
if(listitem == 21)
{
SetWorldTime(22);
}
if(listitem == 22)
{
SetWorldTime(23);
}
if(listitem == 23)
{
SetWorldTime(24);
}

 

 

Třeba takto jedodušeji ?

 

if(dialogid == DIALOGID+2)
{
if(response)
{
   SetWorldTime(listitem);
}

 

 

Jasně že by to šlo :d ten script jsem dělal tak před rokem, takže dnes už bych většinu těch věcí řešil jinak ;) Ale třeba to někdo použije a nic mu nebrání si to upravit ;)

Link to comment
Share on other sites

  • 4 weeks later...

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...