Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

problem surf_ski_2_rules


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
2 odpowiedzi w tym temacie

#1 soczekmalinowy

    Życzliwy

  • Użytkownik

Reputacja: 2
Nowy

  • Postów:24
Offline

Napisano 21.08.2017 11:34

Witam dodałem debug po nazwie pluginu i takie coś wyrzuciła mi konsola co zrobić ?

 

 

L 08/21/2017 - 12:33:18: [FUN] Invalid player 2
L 08/21/2017 - 12:33:18: [AMXX] Displaying debug trace (plugin "surf_ski_2_rules.amxx")
L 08/21/2017 - 12:33:18: [AMXX] Run time error 10: native error (native "set_user_godmode")
L 08/21/2017 - 12:33:18: [AMXX] [0] surf_ski_2_rules.sma::restore_parametres (line 81)
L 08/21/2017 - 12:33:18: [AMXX] [1] surf_ski_2_rules.sma::check (line 145)


  • +
  • -
  • 0

#2 d0naciak

    Godlike

  • Power User

Reputacja: 1 029
Hero

  • Postów:2 414
  • GG:
  • Steam:steam
  • Imię:Dawid
  • Lokalizacja:Kotlarka
Offline

Napisano 21.08.2017 15:28

podaj sma


  • +
  • -
  • 0

#3 soczekmalinowy

    Życzliwy

  • Autor tematu
  • Użytkownik

Reputacja: 2
Nowy

  • Postów:24
Offline

Napisano 21.08.2017 22:49

#include <amxmodx>
#include <fakemeta>
#include <fun>

new counter_time[32]

new surf_ski_2_gunroom_god
new surf_ski_2_gunroom_time
new surf_ski_2_marioroom_god
new surf_ski_2_marioroom_time
new surf_ski_2_jail_god
new surf_ski_2_jail_time
new surf_ski_2_show_messages

new paremetres_restored[32]
new player_inside_area[32]

new welcome_message_counter=100

new origin_from_jail[3] =       {-405, 2900, 720}
new origin_from_marioroom[3] = {-405, 2949, 2422}
new origin_from_gunroom[3] =   {-486, -1000, -275}
                                   /*x0    x1    y0    y1   z0   z1*/
new origin_jail_area[6]=       {-625, -280, 2955, 3330, 585, 900}
new origin_marioroom_area[6]= {2250, 3655, 230, 1120, -2340, -2077}
new origin_gunroom_area[6]=   {-720, -290, -1000, -650, -156, -30}

new message[300]


public plugin_init() {
	register_plugin("surf_ski_2_rules", "2.0 beta", "Nikarus")
	
	new map[32]
	get_mapname(map, 32)
	if (equali(map, "surf_ski_2"))
	{
		register_forward(FM_CmdStart,"fwd_CmdStart")
		surf_ski_2_gunroom_god = register_cvar("surf_ski_2_gunroom_god","1")
		surf_ski_2_gunroom_time = register_cvar("surf_ski_2_gunroom_time","30")
		surf_ski_2_marioroom_god = register_cvar("surf_ski_2_marioroom_god","1")
		surf_ski_2_marioroom_time = register_cvar("surf_ski_2_marioroom_time","30")
		surf_ski_2_jail_god = register_cvar("surf_ski_2_jail_god","0")
		surf_ski_2_jail_time = register_cvar("surf_ski_2_jail_time","5")
		surf_ski_2_show_messages = register_cvar("surf_ski_2_show_messages","1")
		set_task(0.1, "check", 0, "", 0, "b")
	}
}

public player_in(index, origin_present[3], origin_area[6])
{
	if (origin_present[0]>=origin_area[0] && origin_present[0]<=origin_area[1] &&
	    origin_present[1]>=origin_area[2] && origin_present[1]<=origin_area[3] &&
	    origin_present[2]>=origin_area[4] && origin_present[2]<=origin_area[5])
	    {
		return 1;
	    }   
	return 0;
}

public throw_out(index, origin_to[3], time_allowed)
{
	
	if (counter_time[index]==0) counter_time[index]=get_systime()
	if ((get_systime()-counter_time[index])>=time_allowed)
	{
		set_user_origin(index, origin_to)
	}
	format(message, 300, "%sMasz %d sekund na wyjscie z klatki, albo wyrzuci cie automatycznie.", message, time_allowed-(get_systime()-counter_time[index]))
	
}

public godmod(index)
{
	format(message, 300, "%sTutaj nie mozna zabijac^n", message)
	set_user_godmode(index, 1)
}

public restore_parametres(index)
{
	set_user_godmode(index, 0)
	counter_time[index]=0
	paremetres_restored[index] = 1
}

public check()
{		
	if (welcome_message_counter>0)
	{
		welcome_message_counter--;
		if (welcome_message_counter==0)
		{
			set_hudmessage(255, 0, 0, 0.8, 0.5, 1)
			show_hudmessage(0, "Zapraszamy na popykajmy.ct8.pl")
		}
	}
	for (new index=1; index<=get_playersnum(); index++)
	{
		new origin_present[3]
		get_user_origin(index, origin_present)
		player_inside_area[index]=0;
		 //if player in JAIL
		if (player_in(index, origin_present, origin_jail_area))
		{
			paremetres_restored[index]=0
			player_inside_area[index]++
			if (get_pcvar_num(surf_ski_2_jail_god)) godmod(index);
			if (get_pcvar_num(surf_ski_2_jail_time)) throw_out(index, origin_from_jail, get_pcvar_num(surf_ski_2_jail_time));
		} 
		////////////////////
		
		 //if player in MARIOROOM
		if (player_in(index, origin_present, origin_marioroom_area))
		{
			format(message, 300, "Przybyles do mario room.^n")
			paremetres_restored[index]=0
			player_inside_area[index]++
			if (get_pcvar_num(surf_ski_2_marioroom_god)) godmod(index);
			if (get_pcvar_num(surf_ski_2_marioroom_time)) throw_out(index, origin_from_marioroom, get_pcvar_num(surf_ski_2_marioroom_time));
			if (get_pcvar_num(surf_ski_2_show_messages))
			{
				set_hudmessage(255, 0, 0, 0.8, 0.5, 0, 6.0, 0.2)
				show_hudmessage(0, message)
			}
		} 
		////////////////////
		
		//if player in GUNROOM
		if (player_in(index, origin_present, origin_gunroom_area))
		{
			format(message, 300, "Przybyles do gun room^n")
			paremetres_restored[index]=0
			player_inside_area[index]++
			if (get_pcvar_num(surf_ski_2_gunroom_god)) godmod(index);
			if (get_pcvar_num(surf_ski_2_gunroom_time)) throw_out(index, origin_from_gunroom, get_pcvar_num(surf_ski_2_gunroom_time));
			if (get_pcvar_num(surf_ski_2_show_messages))
			{
				set_hudmessage(255, 0, 0, 0.8, 0.5, 0, 6.0, 0.2)
				show_hudmessage(0, message)
			}
		} 
		////////////////////
		
		//Restoring parametres
		if (!paremetres_restored[index] && !player_inside_area[index]) restore_parametres(index);
		////////////////////
	}
}


  • +
  • -
  • 0




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych