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

[ROZWIĄZANE] spec switch - bład podczas kompilacji "if, ;"


Najlepsza odpowiedź Dziobak?, 01.09.2014 22:58

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <ColorChat>

#define PLUGIN "Spec Switch"
#define VERSION "0.1.3"
#define AUTHOR "many"

new CsTeams:zTeam[33]
new zDeath[33]
new bool:type_spec[33] = false
new g_cvar

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	/* Cvar */
	g_cvar	= register_cvar("amx_specmode",	"0") 	// 0 - enable use to all, 1 - enable use only ADMINs
	/* Client Commands */
	register_clcmd("say /spec", 		"cmdSpec", ADMIN_ALL, "- go to spectator")
	register_clcmd("say_team /spec", 	"cmdSpec", ADMIN_ALL, "- go to spectator")
	register_clcmd("say /back", 		"cmdBack", ADMIN_ALL, "- go back to your team")
	register_clcmd("say_team /back", 	"cmdBack", ADMIN_ALL, "- go back to your team")
}

public cmdSpec(id)
{
	if(!get_pcvar_num(g_cvar)) Spec(id)
	else if( get_pcvar_num(g_cvar) && (get_user_flags(id) & ADMIN_KICK)) Spec(id)
	else if( get_pcvar_num(g_cvar) && !(get_user_flags(id) & ADMIN_KICK)) PrintUserNotAdmin(id)
}

public cmdBack(id)
{
	if (type_spec[id] && cs_get_user_team(id) == CS_TEAM_SPECTATOR && zTeam[id] != CS_TEAM_SPECTATOR ) Back(id)
	else if( get_pcvar_num(g_cvar) && !(get_user_flags(id) & ADMIN_KICK) ) PrintUserNotAdmin(id)
}

public Spec(id)
{
	zDeath[id] = cs_get_user_deaths(id)
	if (cs_get_user_team(id) == CS_TEAM_SPECTATOR)
	return
	else{
		type_spec[id] = true
		zTeam[id] = cs_get_user_team(id)
		cs_set_user_team(id, CS_TEAM_SPECTATOR)
		user_silentkill(id)
		ColorChat(id, GREEN, "de_dust2^x01 # Uzyj komendy^x03 /back^x01 aby wrocic do swojej druzyny.")
	}
	return
}

public Back(id)
{
	cs_set_user_team(id, zTeam[id])
	cs_set_user_deaths(id, zDeath[id])
}

PrintUserNotAdmin(id)
{
	ColorChat(id, GREEN, "de_dust2^x01 # Tylko admini moga uzyc komendy^x03/spec ^x01i^x03 /back")
}

public client_putinserver(id)
{
	if( get_pcvar_num(g_cvar) && (get_user_flags(id) & ADMIN_KICK))
	return;
}

public client_disconnect(id)
{
	type_spec[id] = false
}
public client_connect(id)
{
	type_spec[id] = false
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n{\\ colortbl ;\\ red0\\ green0\\ blue0;}\n\\ viewkind4\\ uc1\\ pard\\ cf1\\ lang1033\\ b\\ f0\\ fs16 \n\\ par }
*/

Tak powinno być dobrze.

Przejdź do postu


  • Zamknięty Temat jest zamknięty
2 odpowiedzi w tym temacie

#1 patryQ1997

    Profesjonalista

  • Użytkownik

Reputacja: 5
Nowy

  • Postów:204
  • GG:
  • Imię:Patryk
  • Lokalizacja:Czeladź
Offline

Napisano 01.09.2014 21:46

Siemka

 

Mam problem z plugin spec switch, nie chce mi sie skompilowac

wyskakuja takie bledy:

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

spec_switch.sma(72) : error 029: invalid expression, assumed zero
spec_switch.sma(72) : warning 215: expression has no effect
spec_switch.sma(72) : error 001: expected token: ";", but found "if"
spec_switch.sma(73) : error 029: invalid expression, assumed zero
spec_switch.sma(73 -- 75) : warning 215: expression has no effect
spec_switch.sma(75) : warning 217: loose indentation
spec_switch.sma(75) : error 029: invalid expression, assumed zero
spec_switch.sma(75) : error 004: function "client_disconnect" is not implemented
spec_switch.sma(75) : fatal error 107: too many error messages on one line

Compilation aborted.
6 Errors.
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <ColorChat>

#define PLUGIN "Spec Switch"
#define VERSION "0.1.3"
#define AUTHOR "many"

new CsTeams:zTeam[33]
new zDeath[33]
new bool:type_spec[33] = false
new g_cvar

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	/* Cvar */
	g_cvar	= register_cvar("amx_specmode",	"0") 	// 0 - enable use to all, 1 - enable use only ADMINs
	/* Client Commands */
	register_clcmd("say /spec", 		"cmdSpec", ADMIN_ALL, "- go to spectator")
	register_clcmd("say_team /spec", 	"cmdSpec", ADMIN_ALL, "- go to spectator")
	register_clcmd("say /back", 		"cmdBack", ADMIN_ALL, "- go back to your team")
	register_clcmd("say_team /back", 	"cmdBack", ADMIN_ALL, "- go back to your team")
}

public cmdSpec(id)
{
	if(!get_pcvar_num(g_cvar)) Spec(id)
	else if( get_pcvar_num(g_cvar) && (get_user_flags(id) & ADMIN_KICK)) Spec(id)
	else if( get_pcvar_num(g_cvar) && !(get_user_flags(id) & ADMIN_KICK)) PrintUserNotAdmin(id)
}

public cmdBack(id)
{
	if (type_spec[id] && cs_get_user_team(id) == CS_TEAM_SPECTATOR && zTeam[id] != CS_TEAM_SPECTATOR ) Back(id)
	else if( get_pcvar_num(g_cvar) && !(get_user_flags(id) & ADMIN_KICK) ) PrintUserNotAdmin(id)
}

public Spec(id)
{
	zDeath[id] = cs_get_user_deaths(id)
	if (cs_get_user_team(id) == CS_TEAM_SPECTATOR)
	return
	else{
		type_spec[id] = true
		zTeam[id] = cs_get_user_team(id)
		cs_set_user_team(id, CS_TEAM_SPECTATOR)
		user_silentkill(id)
		ColorChat(id, GREEN, "de_dust2^x01 # Uzyj komendy^x03 /back^x01 aby wrocic do swojej druzyny.")
	}
	return
}

public Back(id)
{
	cs_set_user_team(id, zTeam[id])
	cs_set_user_deaths(id, zDeath[id])
}

PrintUserNotAdmin(id)
{
	ColorChat(id, GREEN, "de_dust2^x01 # Tylko admini moga uzyc komendy^x03/spec ^x01i^x03 /back")
}

public client_putinserver(id)
{
	if(!get_pcvar_num(g_cvar))
	else if( get_pcvar_num(g_cvar) && (get_user_flags(id) & ADMIN_KICK))
}

public client_disconnect(id) type_spec[id] = false
public client_connect(id) type_spec[id] = false

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n{\\ colortbl ;\\ red0\\ green0\\ blue0;}\n\\ viewkind4\\ uc1\\ pard\\ cf1\\ lang1033\\ b\\ f0\\ fs16 \n\\ par }
*/

  • +
  • -
  • 0

#2 Dziobak?

    Wszechmogący

  • Power User

Reputacja: 271
Wszechwidzący

  • Postów:645
  • GG:
  • Steam:steam
  • Imię:Michał
  • Lokalizacja:Radom
Offline

Napisano 01.09.2014 22:58   Najlepsza odpowiedź

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <ColorChat>

#define PLUGIN "Spec Switch"
#define VERSION "0.1.3"
#define AUTHOR "many"

new CsTeams:zTeam[33]
new zDeath[33]
new bool:type_spec[33] = false
new g_cvar

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	/* Cvar */
	g_cvar	= register_cvar("amx_specmode",	"0") 	// 0 - enable use to all, 1 - enable use only ADMINs
	/* Client Commands */
	register_clcmd("say /spec", 		"cmdSpec", ADMIN_ALL, "- go to spectator")
	register_clcmd("say_team /spec", 	"cmdSpec", ADMIN_ALL, "- go to spectator")
	register_clcmd("say /back", 		"cmdBack", ADMIN_ALL, "- go back to your team")
	register_clcmd("say_team /back", 	"cmdBack", ADMIN_ALL, "- go back to your team")
}

public cmdSpec(id)
{
	if(!get_pcvar_num(g_cvar)) Spec(id)
	else if( get_pcvar_num(g_cvar) && (get_user_flags(id) & ADMIN_KICK)) Spec(id)
	else if( get_pcvar_num(g_cvar) && !(get_user_flags(id) & ADMIN_KICK)) PrintUserNotAdmin(id)
}

public cmdBack(id)
{
	if (type_spec[id] && cs_get_user_team(id) == CS_TEAM_SPECTATOR && zTeam[id] != CS_TEAM_SPECTATOR ) Back(id)
	else if( get_pcvar_num(g_cvar) && !(get_user_flags(id) & ADMIN_KICK) ) PrintUserNotAdmin(id)
}

public Spec(id)
{
	zDeath[id] = cs_get_user_deaths(id)
	if (cs_get_user_team(id) == CS_TEAM_SPECTATOR)
	return
	else{
		type_spec[id] = true
		zTeam[id] = cs_get_user_team(id)
		cs_set_user_team(id, CS_TEAM_SPECTATOR)
		user_silentkill(id)
		ColorChat(id, GREEN, "de_dust2^x01 # Uzyj komendy^x03 /back^x01 aby wrocic do swojej druzyny.")
	}
	return
}

public Back(id)
{
	cs_set_user_team(id, zTeam[id])
	cs_set_user_deaths(id, zDeath[id])
}

PrintUserNotAdmin(id)
{
	ColorChat(id, GREEN, "de_dust2^x01 # Tylko admini moga uzyc komendy^x03/spec ^x01i^x03 /back")
}

public client_putinserver(id)
{
	if( get_pcvar_num(g_cvar) && (get_user_flags(id) & ADMIN_KICK))
	return;
}

public client_disconnect(id)
{
	type_spec[id] = false
}
public client_connect(id)
{
	type_spec[id] = false
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n{\\ colortbl ;\\ red0\\ green0\\ blue0;}\n\\ viewkind4\\ uc1\\ pard\\ cf1\\ lang1033\\ b\\ f0\\ fs16 \n\\ par }
*/

Tak powinno być dobrze.


  • +
  • -
  • 1

#3 patryQ1997

    Profesjonalista

  • Autor tematu
  • Użytkownik

Reputacja: 5
Nowy

  • Postów:204
  • GG:
  • Imię:Patryk
  • Lokalizacja:Czeladź
Offline

Napisano 02.09.2014 16:09

Dzięki, temat do zamknięcia.


  • +
  • -
  • 0




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

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