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

Czemu nie można tego skompilować


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

#1 Droso

    Dawniej HubertTM

  • Support Team

Reputacja: 1 291
Godlike

  • Postów:2 371
  • Steam:steam
  • Imię:Hubert
  • Lokalizacja:Wrocław
Offline

Napisano 05.10.2011 17:40

show_hudmessage(0, "Admin: %s ^n Zbanowal %s ^n na %s Przyczyna: %s", admin_name, target_name, unban_time, reason)

// czemu tę linijkę kompilator nie chce przełknąć?

(
Error: Expected token: ";", but found "-identifier-" on line 755
)

Użytkownik HubertTM edytował ten post 05.10.2011 17:41

  • +
  • -
  • 0

Piszę pluginy pod: AMX MOD X oraz SOURCE MOD!

Na zlecenie i bez zlecenia zresztą też!


#2 speedkill

    Godlike

  • Przyjaciel

Reputacja: 1 592
Godlike

  • Postów:2 733
  • GG:
  • Steam:steam
  • Imię:Michał
  • Lokalizacja:Prudnik
Offline

Napisano 05.10.2011 17:52

Daj całe sma :]
  • +
  • -
  • 0

If you can dream it, you can do it.


#3 stepdub

    Profesjonalista

  • Użytkownik

Reputacja: 43
Pomocny

  • Postów:207
  • Lokalizacja:Kobyłka
Offline

Napisano 05.10.2011 17:52

pokaż większy wycinek :] najlepiej całą funkcję, bo to nie w tym leży problem, prawdopodobnie masz to na końcu funkcji i dlatego akurat ta linijka jest zaznaczona
  • +
  • -
  • 0

#4 Droso

    Dawniej HubertTM

  • Autor tematu
  • Support Team

Reputacja: 1 291
Godlike

  • Postów:2 371
  • Steam:steam
  • Imię:Hubert
  • Lokalizacja:Wrocław
Offline

Napisano 05.10.2011 17:53


public CmdAddBan(client, level, cid)

{

if( !cmd_access(client, level, cid, 5) ) return PLUGIN_HANDLED;



static target_name[32], target_authid[35], bantime[10], reason[128];

read_argv(1, target_name, sizeof(target_name) - 1);

read_argv(2, target_authid, sizeof(target_authid) - 1);

read_argv(3, bantime, sizeof(bantime) - 1);

read_argv(4, reason, sizeof(reason) - 1);



new bool:is_ip = bool:(containi(target_authid, ".") != -1);



if( !is_ip && !IsValidAuthid(target_authid) )

{

  console_print(client, "[AdvancedBans] %L", client, "AB_INVALID_STEAMID");

  console_print(client, "[AdvancedBans] %L", client, "AB_VALID_STEAMID_FORMAT");

 

  return PLUGIN_HANDLED;

}

else if( is_ip )

{

  new pos = contain(target_authid, ":");

  if( pos > 0 )

  {

   target_authid[pos] = 0;

  }

 

  if( !IsValidIP(target_authid) )

  {

   console_print(client, "[AdvancedBans] %L", client, "AB_INVALID_IP");

  

   return PLUGIN_HANDLED;

  }

}



#if MAX_BANS <= 0

if( TrieKeyExists(g_trie, target_authid) )

{

  console_print(client, "[AdvancedBans] %L", client, is_ip ? "AB_ALREADY_BANNED_IP" : "AB_ALREADY_BANNED_STEAMID");

  return PLUGIN_HANDLED;

}

#else

for( new i = 0; i < g_total_bans; i++ )

{

  if( !strcmp(target_authid, g_steamids[i], 1) )

  {

   console_print(client, "[AdvancedBans] %L", client, is_ip ? "AB_ALREADY_BANNED_IP" : "AB_ALREADY_BANNED_STEAMID");

   return PLUGIN_HANDLED;

  }

}

#endif



new length = str_to_num(bantime);

new maxlength = GetMaxBanTime(client);



if( maxlength && (!length || length > maxlength) )

{

  console_print(client, "[AdvancedBans] %L", client, "AB_MAX_BAN_TIME", maxlength);

  return PLUGIN_HANDLED;

}



if( is_user_connected(find_player(is_ip ? "d" : "c", target_authid)) )

{

  client_cmd(client, "amx_ban ^"%s^" %i ^"%s^"", target_authid, length, reason);

 

  return PLUGIN_HANDLED;

}



static unban_time[32];

if( length == 0 )

{

  formatex(unban_time, sizeof(unban_time) - 1, "%L", client, "AB_PERMANENT_BAN");

}

else

{

  GenerateUnbanTime(length, unban_time, sizeof(unban_time) - 1);

}



static admin_name[64], admin_authid[35];

get_user_name(client, admin_name, sizeof(admin_name) - 1);

get_user_authid(client, admin_authid, sizeof(admin_authid) - 1);



AddBan(target_name, target_authid, reason, length, unban_time, admin_name, admin_authid);



PrintBanInformation(client, target_name, target_authid, reason, length, unban_time, "", "", false, false);



GetBanTime(length, unban_time, sizeof(unban_time) - 1);



PrintActivity(admin_name, "^x04[AdvancedBans] $name^x01 :^x03  zbanowal %s %s. Przyczyna: %s. Dlugosc bana: %s", is_ip ? "IP" : "SteamID", target_authid, reason, unban_time);







set_hudmessage(0, 255, 0, 0.0, 0.2, 0, 6.0, 12.0)

  show_hudmessage(0, "Admin: %s ^n Zbanowal %s ^n na %s Przyczyna: %s", admin_name, target_name, unban_time, reason)









Log("%s <%s> banned %s <%s> || Reason: ^"%s^" || Ban Length: %s", admin_name, admin_authid, target_name, target_authid, reason, unban_time);



return PLUGIN_HANDLED;

}


  • +
  • -
  • 0

Piszę pluginy pod: AMX MOD X oraz SOURCE MOD!

Na zlecenie i bez zlecenia zresztą też!


#5 speedkill

    Godlike

  • Przyjaciel

Reputacja: 1 592
Godlike

  • Postów:2 733
  • GG:
  • Steam:steam
  • Imię:Michał
  • Lokalizacja:Prudnik
Offline

Napisano 05.10.2011 18:01


public CmdAddBan(client, level, cid)

{

	if( !cmd_access(client, level, cid, 5) ) return PLUGIN_HANDLED;

	

	static target_name[32], target_authid[35], bantime[10], reason[128];

	read_argv(1, target_name, sizeof(target_name) - 1);

	read_argv(2, target_authid, sizeof(target_authid) - 1);

	read_argv(3, bantime, sizeof(bantime) - 1);

	read_argv(4, reason, sizeof(reason) - 1);

	

	new bool:is_ip = bool:(containi(target_authid, ".") != -1);

	

	if( !is_ip && !IsValidAuthid(target_authid) )

	{

		console_print(client, "[AdvancedBans] %L", client, "AB_INVALID_STEAMID");

		console_print(client, "[AdvancedBans] %L", client, "AB_VALID_STEAMID_FORMAT");

		

		return PLUGIN_HANDLED;

	}

	else if( is_ip )

	{

		new pos = contain(target_authid, ":");

		if( pos > 0 )

		{

			target_authid[pos] = 0;

		}

		

		if( !IsValidIP(target_authid) )

		{

			console_print(client, "[AdvancedBans] %L", client, "AB_INVALID_IP");

			

			return PLUGIN_HANDLED;

		}

	}

	

	#if MAX_BANS <= 0

	if( TrieKeyExists(g_trie, target_authid) )

	{

		console_print(client, "[AdvancedBans] %L", client, is_ip ? "AB_ALREADY_BANNED_IP" : "AB_ALREADY_BANNED_STEAMID");

		return PLUGIN_HANDLED;

	}

	#else

	for( new i = 0; i < g_total_bans; i++ )

	{

		if( !strcmp(target_authid, g_steamids[i], 1) )

		{

			console_print(client, "[AdvancedBans] %L", client, is_ip ? "AB_ALREADY_BANNED_IP" : "AB_ALREADY_BANNED_STEAMID");

			return PLUGIN_HANDLED;

		}

	}

	#endif

	

	new length = str_to_num(bantime);

	new maxlength = GetMaxBanTime(client);

	

	if( maxlength && (!length || length > maxlength) )

	{

		console_print(client, "[AdvancedBans] %L", client, "AB_MAX_BAN_TIME", maxlength);

		return PLUGIN_HANDLED;

	}

	

	if( is_user_connected(find_player(is_ip ? "d" : "c", target_authid)) )

	{

		client_cmd(client, "amx_ban ^"%s^" %i ^"%s^"", target_authid, length, reason);

		

		return PLUGIN_HANDLED;

	}

	

	static unban_time[32];

	if( length == 0 )

	{

		formatex(unban_time, sizeof(unban_time) - 1, "%L", client, "AB_PERMANENT_BAN");

	}

	else

	{

		GenerateUnbanTime(length, unban_time, sizeof(unban_time) - 1);

	}

	

	static admin_name[64], admin_authid[35];

	get_user_name(client, admin_name, sizeof(admin_name) - 1);

	get_user_authid(client, admin_authid, sizeof(admin_authid) - 1);

	

	AddBan(target_name, target_authid, reason, length, unban_time, admin_name, admin_authid);

	

	PrintBanInformation(client, target_name, target_authid, reason, length, unban_time, "", "", false, false);

	

	GetBanTime(length, unban_time, sizeof(unban_time) - 1);

	

	PrintActivity(admin_name, "^x04[AdvancedBans] $name^x01 :^x03  zbanowal %s %s. Przyczyna: %s. Dlugosc bana: %s", is_ip ? "IP" : "SteamID", target_authid, reason, unban_time);

	

	

	

	set_hudmessage(0, 255, 0, 0.0, 0.2, 0, 6.0, 12.0);

	show_hudmessage(0, "Admin: %s ^n Zbanowal %s ^n na %s Przyczyna: %s", admin_name, target_name, unban_time, reason);

	

	

	

	

	Log("%s <%s> banned %s <%s> || Reason: ^"%s^" || Ban Length: %s", admin_name, admin_authid, target_name, target_authid, reason, unban_time);

	

	return PLUGIN_HANDLED;

}

  • +
  • -
  • 1

If you can dream it, you can do it.


#6 Droso

    Dawniej HubertTM

  • Autor tematu
  • Support Team

Reputacja: 1 291
Godlike

  • Postów:2 371
  • Steam:steam
  • Imię:Hubert
  • Lokalizacja:Wrocław
Offline

Napisano 05.10.2011 18:14

To close
  • +
  • -
  • 0

Piszę pluginy pod: AMX MOD X oraz SOURCE MOD!

Na zlecenie i bez zlecenia zresztą też!


#7 mierzwi

    Banned

  • Zbanowany

Reputacja: 235
Wszechwidzący

  • Postów:651
  • Lokalizacja:Polska
Offline

Napisano 05.10.2011 19:11

brak ";" na końcu lini - chyba masz pragme semicolon na 1 ;d

Użytkownik funfel edytował ten post 05.10.2011 19:11

jeśli masz fejsa i chcesz mi pomóc to wejdź tutaj: Zaproś kumpla by lubił nasz sklep | Facebook

na pewno jakoś C się odwdzięczę!





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

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