Page 1 of 1

Nu mai inteleg ce se intampla..

Posted: 30 Nov 2018, 02:09
by L1oN98
Salut tuturor, dupa cum spune si titlul, chiar nu mai inteleg ce se intampla cu acest plugin..

Acum cateva ore mergea perfect tot pluginul, acum merge doar pe jumatate, cand mor sau cand scriu /respawn nu se mai intampla nimic..
desi cand sunt tero sau spectator si scriu /respawn imi apar acele mesaje "Atunci cand esti Terrorist nu poti folosi comanda /respawn" respectiv "Tasteaza /ct apoi foloseste comanda /respawn ".

Are cineva idee care ar fi cauza?
| Afiseaza codul
[code]
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <fun>

#define PLUGIN 		"ADVANCED - Respawn"
#define VERSION 		"1.0"
#define AUTHOR 		"K!D()X"

#pragma semicolon 1
new bool:g_Joined[33];

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_event("DeathMsg", "iDeathMsg", "a");
	register_clcmd("say /respawn", "RespawnFunction");
	RegisterHam(Ham_Spawn, "player", "ham_PlayerSpawn", 1);

	register_cvar("sv_respawn", "1");
}

public RespawnFunction(id) {
	

	if(cs_get_user_team(id) == CS_TEAM_SPECTATOR) {
		K1d0x_C_Color(id, "#tTasteaza #g/ct #tapoi foloseste comanda #g/respawn #t!");
		return 1;
	}

	if(cs_get_user_team(id) == CS_TEAM_T) {
		K1d0x_C_Color(id, "#gAtunci cand esti #tTerrorist #gnu poti folosi comanda #t/respawn #g!");
		return 1;
	}
	
	set_task(1.0, "CheckFunction", id);
	
	return 0;
}

public iDeathMsg(){
	new id = read_data(2);
   
	set_task(1.0, "CheckFunction", id);
}

public client_putinserver(id) {
	g_Joined[id] = true;
	
	if(g_Joined[id]) {
		set_task(4.0, "CheckFunction", id);
		g_Joined[id] = false;
	}
}

public CheckFunction(id){
	if(get_cvar_num("sv_respawn") == 0 || is_user_bot(id))
		return 0;
	
	new iPlayers[32], iNum;
	
	if(g_Joined[id] || cs_get_user_team(id) == CS_TEAM_SPECTATOR) {
		return 0;
	} else if(cs_get_user_team(id) == CS_TEAM_T) {
		get_players(iPlayers, iNum, "aeh", "TERRORIST");
	} else if(cs_get_user_team(id) == CS_TEAM_CT) {
		get_players(iPlayers, iNum, "aeh", "CT");
	}
	
	
		if(cs_get_user_team(id) == CS_TEAM_CT) {
			ExecuteHamB(Ham_CS_RoundRespawn, id);
		}
	

	return 1;
}

stock K1d0x_C_Color(const id, const input[], any:...) {
	new szNumber = 1, szPlayers[32];
	
	static szMsg[191];
	vformat(szMsg, 190, input, 3);
	
	replace_all(szMsg, 190, "#g", "^4");         /*    Green color                                     */
	replace_all(szMsg, 190, "#c", "^1");        /*    Color of chat                                   */
	replace_all(szMsg, 190, "#t", "^3");       /*    Color of team CT = Blue | TERRORIST = Red       */
	replace_all(szMsg, 190, "#dt", "^0");     /*    Default color of team                           */
	
	if(id)
		szPlayers[0] = id;
	else
	
	get_players(szPlayers, szNumber, "ch"); {
		for(new i = 0; i < szNumber; i++) {
			if(is_user_connected(szPlayers)) {
				message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, szPlayers);
				write_byte(szPlayers);
				write_string(szMsg);
				message_end();
			}
		}
	}
}
[/code]

Re: Nu mai inteleg ce se intampla..

Posted: 30 Nov 2018, 10:07
by Laurentiu P.
Si cei asa greu de inteles? Comanda functioneaza doar daca esti CT. Daca este SPECTATOR te muti la CT prin comanda "/ct" si apoi iti dai respawn.

Re: Nu mai inteleg ce se intampla..

Posted: 30 Nov 2018, 12:40
by L1oN98
Stiu asta, dar problema e ca nu mai functioneaza comanda /respawn si respawn automat cand un CT moare, desi inainte mergea