[Cerere] Plugin HNS Training [Rezolvat]

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
User avatar
RoL
Membru, skill +1
Membru, skill +1
Posts: 434
Joined: 19 Jul 2013, 13:19
Detinator Steam: Da
Detinator server CS: DA
SteamID: rolcs97
Has thanked: 47 times
Been thanked: 28 times
Contact:

13 Aug 2013, 23:54

| Afiseaza codul
Hide'N'Seek Training Sistem | Ascunde codul
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <fun>
#include <ColorChat>

#define PLUGIN "Hine'N'Seek Training Sistem "
#define VERSION "1.0"
#define AUTHOR "sPuf ?"

new humans_join_team;
new mp_autoteambalance;
new mp_limitteams;
new mp_roundtime;
new mp_timelimit;

new bool:TrainOn = false;
new hnst_checkpoints[33];
new hnst_gochecks[33];

new Float:hnst_lastcp[33][3];
new Float:hnst_prelastcp[33][3];

new bool:hook[33];
new hook_to[33][3];

/*================================================================================================*/
public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_clcmd("say /train","sayTrain");
	register_clcmd("say /hns","sayHns");
	
	RegisterHam(Ham_Spawn, "player", "hamSpawnPlayer_Post", 1 );
	
	register_clcmd("say /cp", "cmdCP");
	register_clcmd("cp", "cmdCP");
	register_clcmd("say /tp","cmdTele");
	register_clcmd("tp","cmdTele");
	register_concmd("+hook","hook_on");
	register_concmd("-hook","hook_off");
	
	//Cvar Pointers
	humans_join_team = get_cvar_pointer("humans_join_team");
	mp_autoteambalance = get_cvar_pointer("mp_autoteambalance");
	mp_limitteams = get_cvar_pointer("mp_limitteams");
	mp_roundtime = get_cvar_pointer("mp_roundtime");
	mp_timelimit = get_cvar_pointer("mp_timelimit");

}
public hook_on(id)
{		
	if( !TrainOn || hook[id])
	{
		return PLUGIN_HANDLED;
	}
	
	set_pev(id, pev_gravity, 0.0);
	set_task(0.1,"hook_prethink",id+10000,"",0,"b");
	
	hook[id]=true;
	hook_to[id][0]=999999;
	hook_prethink(id+10000);
	return PLUGIN_HANDLED;
}
public hook_off(id)
{
	
	set_pev(id, pev_gravity, 1.0);
	hook[id] = false;
	return PLUGIN_HANDLED;
}

public hook_prethink(id)
{
	id -= 10000;
	
	if(!is_user_alive(id))
	{
		hook[id]=false;
	}
	
	if(!hook[id])
	{
		remove_task(id+10000);
		return PLUGIN_HANDLED;
	}


	static origin1[3];
	new Float:origin[3];
	get_user_origin(id,origin1);
	pev(id, pev_origin, origin);

	if(hook_to[id][0]==999999)
	{
		static origin2[3];
		get_user_origin(id,origin2,3);
		hook_to[id][0]=origin2[0];
		hook_to[id][1]=origin2[1];
		hook_to[id][2]=origin2[2];
	}

	//Calculate Velocity
	static Float:velocity[3];
	velocity[0] = (float(hook_to[id][0]) - float(origin1[0])) * 3.0;
	velocity[1] = (float(hook_to[id][1]) - float(origin1[1])) * 3.0;
	velocity[2] = (float(hook_to[id][2]) - float(origin1[2])) * 3.0;

	static Float:y;
	y = velocity[0]*velocity[0] + velocity[1]*velocity[1] + velocity[2]*velocity[2];

	static Float:x;
	x = (900.0) / floatsqroot(y);

	velocity[0] *= x;
	velocity[1] *= x;
	velocity[2] *= x;

	set_velo(id,velocity);

	return PLUGIN_CONTINUE;
}

public set_velo(id,Float:velocity[3])
{
	return set_pev(id,pev_velocity,velocity);
}

public sayTrain( id )
{
	if( user_has_access( id ) )
	{
		new name[32];
		get_user_name(id, name,31);
		ColorChat(0,RED,"^x04[HNS]^x01 Modul train a fost pornit de catre adminul ^x03%s^x01.Credite lui^x04 fuzy^x01 !",name);

		TrainOn = true;
		set_pcvar_string(humans_join_team, "t");
		set_pcvar_num(mp_autoteambalance, 0);
		set_pcvar_num(mp_limitteams, 0);
		set_pcvar_num(mp_timelimit, 0);
		set_pcvar_num(mp_roundtime, 9);
		MovePlayers( );
	}
}
public MovePlayers( )
{
	new Players[32];
	new PlayersNum, plr;
	get_players(Players, PlayersNum, "c");	
	for(new i=0; i<PlayersNum; i++) {
		plr = Players;
		cs_set_user_team( plr, CS_TEAM_T );
		ExecuteHamB(Ham_CS_RoundRespawn, plr);
	}
}
public hamSpawnPlayer_Post( id )
{
	if(is_user_alive( id ) )
	{
		if(TrainOn)
		{
			set_user_godmode( id, 1);
		}
		else
		{
			set_user_godmode( id, 0);
		}
	}
}

public sayHns( id )
{
	if( user_has_access( id ) )
	{
		TrainOn = false;
		new name[32];
		get_user_name(id, name,31);
		ColorChat(0,RED,"^x04[HNS]^x01 Modul train a fost oprit de catre adminul ^x03%s^x01.Credite lui^x04 fuzy^x01 !",name);

		set_pcvar_string(humans_join_team, "any");
		set_pcvar_num(mp_autoteambalance, 1);
		set_pcvar_num(mp_limitteams, 3);
		set_pcvar_num(mp_timelimit, 30);
		set_pcvar_num(mp_roundtime, 3);
		set_task(10.0,"SecondRR");
		server_cmd("sv_restart 10");
	}
}
public SecondRR( )
{
	server_cmd("sv_restart 1");	
	set_task(1.0,"ThirdRR");
}

public ThirdRR( )
{
	server_cmd("sv_restart 1");	
}
	
stock bool:user_has_access( id )
{
	if( get_user_flags( id ) & ADMIN_CVAR )
		return true;
		
	return false;
}

public cmdCP(id)
{
	if(TrainOn)
	{
		
		if(is_user_alive(id))
		{

			if( hnst_checkpoints[id] == 0 )
			{
				pev(id, pev_origin, hnst_lastcp[id])
			}
			else
			{
				hnst_prelastcp[id] = hnst_lastcp[id]
				pev(id, pev_origin, hnst_lastcp[id])
			}
			hnst_checkpoints[id]++
			
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}

public cmdTele(id)
{
	if(TrainOn)
	{	
		if(!is_user_alive(id))
		{
			return PLUGIN_HANDLED;
		}

		if( hnst_checkpoints[id] != 0 )
		{
			set_pev(id, pev_velocity, Float:{0.0, 0.0, 0.0})
			set_pev(id, pev_origin, hnst_lastcp[id])
			hnst_gochecks[id]++
			fm_set_entity_flags(id, FL_DUCKING, 1);
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}


public cmdStuck(id)
{
	if( !TrainOn )
		return 1

	if(!is_user_alive(id))
	{
			return 1;
	}

	set_pev(id, pev_velocity, Float:{0.0, 0.0, 0.0})
	set_pev(id, pev_origin, hnst_prelastcp[id])
	
	// Add a GoCheck because player can use this for bugs GoChecks
	hnst_gochecks[id]++
	
	fm_set_entity_flags(id, FL_DUCKING, 1);
	
	return 1;
}

public force_duck(id)
{
	id -= 111222;
	fm_set_entity_flags(id, FL_DUCKING, 1);
}


stock fm_set_entity_flags(index, flag, onoff) 
{
	new flags = pev(index, pev_flags);
	if ((flags & flag) > 0)
		return onoff == 1 ? 2 : 1 + 0 * set_pev(index, pev_flags, flags - flag);
	else
		return onoff == 0 ? 2 : 1 + 0 * set_pev(index, pev_flags, flags + flag);

	return 0;
}

public plugin_end( )
{
	set_pcvar_string(humans_join_team, "any");
	set_pcvar_num(mp_autoteambalance, 1);
	set_pcvar_num(mp_limitteams, 3);
	set_pcvar_num(mp_timelimit, 30);
	set_pcvar_num(mp_roundtime, 3);
}


Modificati-mi va rog ca in acest plugin sa fie si /nc respectiv /noclip (noclip) si /gm respectiv /godmode (godmode)

Si daca puteti sa mi-l faceti sa aiba acces doar flagurile "sty" , multumsc .
Server: HNS.CSBLACKDEVIL.COM
Mod: 500 GRAVITY + LVLMODE !
Owner : RoL

Multe altele pe server ! Ajuta-ma sa-l populez ..
http://www.extreamcs.com/forum/mesaj166 ... o_id=46686
RoyalServer 2
User avatar
Ulquiorra
Fost moderator
Fost moderator
Posts: 2053
Joined: 25 Jul 2010, 17:29
Detinator Steam: Da
CS Status: A mai trecut o zi asteptand una mai buna
Detinator server CS: Retras.
SteamID: STEAM_0:1:318247XX
Reputatie: Fost Scripter eXtreamCS
Fost Moderator ajutator
Nick anterior: Askhanar
Location: Braila, Romania.
Has thanked: 215 times
Been thanked: 1132 times

14 Aug 2013, 03:17

daca nu ti`l face nimeni ti`l fac eu maine.
Caut o persoana dedicata care se pricepe si stie ce face.
Vreau sa creeze si sa se ocupe de administrarea unui server de MU, da e vorba de vechiul joc..ma gandesc undeva la un season 3 ep1/2.

O sa achizitionez un domeniu .ro.
Totodata sponsorizez absolut orice este necesar.
Ma puteti contacta prin: http://solo.to/stfrzv
OneShot.
Membru, skill +2
Membru, skill +2
Posts: 719
Joined: 12 Sep 2011, 19:17
Detinator Steam: Da
Detinator server CS: drx.indungi.ro
SteamID: oneshot_01
Reputatie: Fost moderator ajutator
Nume anterior: OnlyHD
Location: Bucuresti
Has thanked: 196 times
Been thanked: 66 times
Contact:

14 Aug 2013, 13:31

hns train | Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <fun>
#include <ColorChat>

#define PLUGIN "Hine'N'Seek Training Sistem "
#define VERSION "1.0"
#define AUTHOR "sPuf ?"

new humans_join_team;
new mp_autoteambalance;
new mp_limitteams;
new mp_roundtime;
new mp_timelimit;

new bool:TrainOn = false;
new hnst_checkpoints[33];
new hnst_gochecks[33];

new Float:hnst_lastcp[33][3];
new Float:hnst_prelastcp[33][3];

new bool:hook[33];
new hook_to[33][3];

/*================================================================================================*/
public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_clcmd("say /train","sayTrain");
	register_clcmd("say /hns","sayHns");
	
	RegisterHam(Ham_Spawn, "player", "hamSpawnPlayer_Post", 1 );
	
	register_clcmd("say /cp", "cmdCP");
	register_clcmd("cp", "cmdCP");
	register_clcmd("say /tp","cmdTele");
	register_clcmd("tp","cmdTele");
	register_clcmd("say /gmon","ClCmdSayGodModeOn");
	register_clcmd("say /gmoff","ClCmdSayGodModeOff");
	register_clcmd("say /ncoff","ClCmdSayNoClipOff");
	register_clcmd("say /ncon","ClCmdSayNoClipOn");
	register_concmd("+hook","hook_on");
	register_concmd("-hook","hook_off");
	
	//Cvar Pointers
	humans_join_team = get_cvar_pointer("humans_join_team");
	mp_autoteambalance = get_cvar_pointer("mp_autoteambalance");
	mp_limitteams = get_cvar_pointer("mp_limitteams");
	mp_roundtime = get_cvar_pointer("mp_roundtime");
	mp_timelimit = get_cvar_pointer("mp_timelimit");

}

//m-am inspirat din tutorialul lui Askhanar despre godmode si noclip :D : http://www.extreamcs.com/forum/pluginur ... 07269.html

public ClCmdSayGodModeOn( id )
{
	set_user_godmode( id, 1 );
	ColorChat(id ,RED, "^x04[HNS]^x01 Ai activat^x03 godmode^x01 tasteaza^x03 /gmoff^x01 pentru a-l oprii !" );
	return PLUGIN_HANDLED;
	
}

public ClCmdSayGodModeOff( id )
{
	set_user_godmode( id, 0 );	/*Dupa cum vedeti am pus (id, 0)*/
	ColorChat(id ,RED, "^x04[HNS]^x01 Ai dezactivat^x03 godmode^x01 !" );
	return PLUGIN_HANDLED;
	
}

public ClCmdSayNoClipOn id )
{
	
	set_user_noclip( id, 1 );
	ColorChat(id ,RED, "^x04[HNS]^x01 Ai activat^x03 noclip^x01 tasteaza^x03 /ncoff^x01 pentru a-l oprii !" );
	return PLUGIN_HANDLED;
	
}

public ClCmdSayNoClipOff( id )
{
	set_user_noclip( id, 0 );
	ColorChat(id ,RED, "^x04[HNS]^x01 Ai dezactivat^x03 noclip^x01 !" );
	return PLUGIN_HANDLED;
	
}

public hook_on(id)
{		
	if( !TrainOn || hook[id])
	{
		return PLUGIN_HANDLED;
	}
	
	set_pev(id, pev_gravity, 0.0);
	set_task(0.1,"hook_prethink",id+10000,"",0,"b");
	
	hook[id]=true;
	hook_to[id][0]=999999;
	hook_prethink(id+10000);
	return PLUGIN_HANDLED;
}
public hook_off(id)
{
	
	set_pev(id, pev_gravity, 1.0);
	hook[id] = false;
	return PLUGIN_HANDLED;
}

public hook_prethink(id)
{
	id -= 10000;
	
	if(!is_user_alive(id))
	{
		hook[id]=false;
	}
	
	if(!hook[id])
	{
		remove_task(id+10000);
		return PLUGIN_HANDLED;
	}


	static origin1[3];
	new Float:origin[3];
	get_user_origin(id,origin1);
	pev(id, pev_origin, origin);

	if(hook_to[id][0]==999999)
	{
		static origin2[3];
		get_user_origin(id,origin2,3);
		hook_to[id][0]=origin2[0];
		hook_to[id][1]=origin2[1];
		hook_to[id][2]=origin2[2];
	}

	//Calculate Velocity
	static Float:velocity[3];
	velocity[0] = (float(hook_to[id][0]) - float(origin1[0])) * 3.0;
	velocity[1] = (float(hook_to[id][1]) - float(origin1[1])) * 3.0;
	velocity[2] = (float(hook_to[id][2]) - float(origin1[2])) * 3.0;

	static Float:y;
	y = velocity[0]*velocity[0] + velocity[1]*velocity[1] + velocity[2]*velocity[2];

	static Float:x;
	x = (900.0) / floatsqroot(y);

	velocity[0] *= x;
	velocity[1] *= x;
	velocity[2] *= x;

	set_velo(id,velocity);

	return PLUGIN_CONTINUE;
}

public set_velo(id,Float:velocity[3])
{
	return set_pev(id,pev_velocity,velocity);
}

public sayTrain( id )
{
	if( user_has_access( id ) )
	{
		new name[32];
		get_user_name(id, name,31);
		ColorChat(0,RED,"^x04[HNS]^x01 Modul train a fost pornit de catre adminul ^x03%s^x01.Credite lui^x04 fuzy^x01 !",name);

		TrainOn = true;
		set_pcvar_string(humans_join_team, "t");
		set_pcvar_num(mp_autoteambalance, 0);
		set_pcvar_num(mp_limitteams, 0);
		set_pcvar_num(mp_timelimit, 0);
		set_pcvar_num(mp_roundtime, 9);
		MovePlayers( );
	}
}
public MovePlayers( )
{
	new Players[32];
	new PlayersNum, plr;
	get_players(Players, PlayersNum, "c");	
	for(new i=0; i<PlayersNum; i++) {
		plr = Players;
		cs_set_user_team( plr, CS_TEAM_T );
		ExecuteHamB(Ham_CS_RoundRespawn, plr);
	}
}
public hamSpawnPlayer_Post( id )
{
	if(is_user_alive( id ) )
	{
		if(TrainOn)
		{
			set_user_godmode( id, 1);
		}
		else
		{
			set_user_godmode( id, 0);
		}
	}
}

public sayHns( id )
{
	if( user_has_access( id ) )
	{
		TrainOn = false;
		new name[32];
		get_user_name(id, name,31);
		ColorChat(0,RED,"^x04[HNS]^x01 Modul train a fost oprit de catre adminul ^x03%s^x01.Credite lui^x04 fuzy^x01 !",name);

		set_pcvar_string(humans_join_team, "any");
		set_pcvar_num(mp_autoteambalance, 1);
		set_pcvar_num(mp_limitteams, 3);
		set_pcvar_num(mp_timelimit, 30);
		set_pcvar_num(mp_roundtime, 3);
		set_task(10.0,"SecondRR");
		server_cmd("sv_restart 10");
	}
}
public SecondRR( )
{
	server_cmd("sv_restart 1");	
	set_task(1.0,"ThirdRR");
}

public ThirdRR( )
{
	server_cmd("sv_restart 1");	
}
	
stock bool:user_has_access( id )
{
	if( get_user_flags( id ) & ADMIN_CVAR )
		return true;
		
	return false;
}

public cmdCP(id)
{
	if(TrainOn)
	{
		
		if(is_user_alive(id))
		{

			if( hnst_checkpoints[id] == 0 )
			{
				pev(id, pev_origin, hnst_lastcp[id])
			}
			else
			{
				hnst_prelastcp[id] = hnst_lastcp[id]
				pev(id, pev_origin, hnst_lastcp[id])
			}
			hnst_checkpoints[id]++
			
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}

public cmdTele(id)
{
	if(TrainOn)
	{	
		if(!is_user_alive(id))
		{
			return PLUGIN_HANDLED;
		}

		if( hnst_checkpoints[id] != 0 )
		{
			set_pev(id, pev_velocity, Float:{0.0, 0.0, 0.0})
			set_pev(id, pev_origin, hnst_lastcp[id])
			hnst_gochecks[id]++
			fm_set_entity_flags(id, FL_DUCKING, 1);
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}


public cmdStuck(id)
{
	if( !TrainOn )
		return 1

	if(!is_user_alive(id))
	{
			return 1;
	}

	set_pev(id, pev_velocity, Float:{0.0, 0.0, 0.0})
	set_pev(id, pev_origin, hnst_prelastcp[id])
	
	// Add a GoCheck because player can use this for bugs GoChecks
	hnst_gochecks[id]++
	
	fm_set_entity_flags(id, FL_DUCKING, 1);
	
	return 1;
}

public force_duck(id)
{
	id -= 111222;
	fm_set_entity_flags(id, FL_DUCKING, 1);
}


stock fm_set_entity_flags(index, flag, onoff) 
{
	new flags = pev(index, pev_flags);
	if ((flags & flag) > 0)
		return onoff == 1 ? 2 : 1 + 0 * set_pev(index, pev_flags, flags - flag);
	else
		return onoff == 0 ? 2 : 1 + 0 * set_pev(index, pev_flags, flags + flag);

	return 0;
}

public plugin_end( )
{
	set_pcvar_string(humans_join_team, "any");
	set_pcvar_num(mp_autoteambalance, 1);
	set_pcvar_num(mp_limitteams, 3);
	set_pcvar_num(mp_timelimit, 30);
	set_pcvar_num(mp_roundtime, 3);
}


Comenzi :

/gmon activeaza godmode
/gmoff dezactiveaza godmode
/ncon activeaza noclip
/ncoff dezactiveaza noclip
User avatar
Ulquiorra
Fost moderator
Fost moderator
Posts: 2053
Joined: 25 Jul 2010, 17:29
Detinator Steam: Da
CS Status: A mai trecut o zi asteptand una mai buna
Detinator server CS: Retras.
SteamID: STEAM_0:1:318247XX
Reputatie: Fost Scripter eXtreamCS
Fost Moderator ajutator
Nick anterior: Askhanar
Location: Braila, Romania.
Has thanked: 215 times
Been thanked: 1132 times

14 Aug 2013, 15:00

@ only e bine facut, dar ai uitat sa verifici daca modul train este activ.. astfel el putea folosi noclip si godmode tot timpu'
| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <fun>
#include <ColorChat>

#define PLUGIN "Hine'N'Seek Training Sistem "
#define VERSION "1.0"
#define AUTHOR "sPuf ?"

new humans_join_team;
new mp_autoteambalance;
new mp_limitteams;
new mp_roundtime;
new mp_timelimit;

new bool:TrainOn = false;
new hnst_checkpoints[33];
new hnst_gochecks[33];

new Float:hnst_lastcp[33][3];
new Float:hnst_prelastcp[33][3];

new bool:hook[33];
new hook_to[33][3];

/*================================================================================================*/
public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_clcmd("say /train","sayTrain");
	register_clcmd("say /hns","sayHns");
	
	RegisterHam(Ham_Spawn, "player", "hamSpawnPlayer_Post", 1 );
	
	register_clcmd("say /cp", "cmdCP");
	register_clcmd("cp", "cmdCP");
	register_clcmd("say /tp","cmdTele");
	register_clcmd("tp","cmdTele");
	register_clcmd("say /gmon","ClCmdSayGodModeOn");
	register_clcmd("say /gmoff","ClCmdSayGodModeOff");
	register_clcmd("say /ncoff","ClCmdSayNoClipOff");
	register_clcmd("say /ncon","ClCmdSayNoClipOn");
	register_concmd("+hook","hook_on");
	register_concmd("-hook","hook_off");
	
	//Cvar Pointers
	humans_join_team = get_cvar_pointer("humans_join_team");
	mp_autoteambalance = get_cvar_pointer("mp_autoteambalance");
	mp_limitteams = get_cvar_pointer("mp_limitteams");
	mp_roundtime = get_cvar_pointer("mp_roundtime");
	mp_timelimit = get_cvar_pointer("mp_timelimit");

}

//m-am inspirat din tutorialul lui Askhanar despre godmode si noclip :D : pluginuri-cs/modulul-fun-t207269.html

public ClCmdSayGodModeOn( id )
{
	if( !TrainOn )
	{
		ColorChat( id, RED, "^x04[HNS]^x01 Modul^x03 TRAIN^x01 nu este activ!" );
		return PLUGIN_HANDLED;
	}
	
	set_user_godmode( id, 1 );
	ColorChat(id ,RED, "^x04[HNS]^x01 Ai activat^x03 godmode^x01 tasteaza^x03 /gmoff^x01 pentru a-l oprii !" );
	return PLUGIN_HANDLED;
	
}

public ClCmdSayGodModeOff( id )
{
	if( !TrainOn )
	{
		ColorChat( id, RED, "^x04[HNS]^x01 Modul^x03 TRAIN^x01 nu este activ!" );
		return PLUGIN_HANDLED;
	}
	
	set_user_godmode( id, 0 );	/*Dupa cum vedeti am pus (id, 0)*/
	ColorChat(id ,RED, "^x04[HNS]^x01 Ai dezactivat^x03 godmode^x01 !" );
	return PLUGIN_HANDLED;
	
}

public ClCmdSayNoClipOn ( id )
{
	if( !TrainOn )
	{
		ColorChat( id, RED, "^x04[HNS]^x01 Modul^x03 TRAIN^x01 nu este activ!" );
		return PLUGIN_HANDLED;
	}
	
	set_user_noclip( id, 1 );
	ColorChat(id ,RED, "^x04[HNS]^x01 Ai activat^x03 noclip^x01 tasteaza^x03 /ncoff^x01 pentru a-l oprii !" );
	return PLUGIN_HANDLED;
	
}

public ClCmdSayNoClipOff( id )
{
	if( !TrainOn )
	{
		ColorChat( id, RED, "^x04[HNS]^x01 Modul^x03 TRAIN^x01 nu este activ!" );
		return PLUGIN_HANDLED;
	}
	
	set_user_noclip( id, 0 );
	ColorChat(id ,RED, "^x04[HNS]^x01 Ai dezactivat^x03 noclip^x01 !" );
	return PLUGIN_HANDLED;
	
}

public hook_on(id)
{		
	if( !TrainOn || hook[id])
	{
		return PLUGIN_HANDLED;
	}
	
	set_pev(id, pev_gravity, 0.0);
	set_task(0.1,"hook_prethink",id+10000,"",0,"b");
	
	hook[id]=true;
	hook_to[id][0]=999999;
	hook_prethink(id+10000);
	return PLUGIN_HANDLED;
}
public hook_off(id)
{
	
	set_pev(id, pev_gravity, 1.0);
	hook[id] = false;
	return PLUGIN_HANDLED;
}

public hook_prethink(id)
{
	id -= 10000;
	
	if(!is_user_alive(id))
	{
		hook[id]=false;
	}
	
	if(!hook[id])
	{
		remove_task(id+10000);
		return PLUGIN_HANDLED;
	}


	static origin1[3];
	new Float:origin[3];
	get_user_origin(id,origin1);
	pev(id, pev_origin, origin);

	if(hook_to[id][0]==999999)
	{
		static origin2[3];
		get_user_origin(id,origin2,3);
		hook_to[id][0]=origin2[0];
		hook_to[id][1]=origin2[1];
		hook_to[id][2]=origin2[2];
	}

	//Calculate Velocity
	static Float:velocity[3];
	velocity[0] = (float(hook_to[id][0]) - float(origin1[0])) * 3.0;
	velocity[1] = (float(hook_to[id][1]) - float(origin1[1])) * 3.0;
	velocity[2] = (float(hook_to[id][2]) - float(origin1[2])) * 3.0;

	static Float:y;
	y = velocity[0]*velocity[0] + velocity[1]*velocity[1] + velocity[2]*velocity[2];

	static Float:x;
	x = (900.0) / floatsqroot(y);

	velocity[0] *= x;
	velocity[1] *= x;
	velocity[2] *= x;

	set_velo(id,velocity);

	return PLUGIN_CONTINUE;
}

public set_velo(id,Float:velocity[3])
{
	return set_pev(id,pev_velocity,velocity);
}

public sayTrain( id )
{
	if( user_has_access( id ) )
	{
		new name[32];
		get_user_name(id, name,31);
		ColorChat(0,RED,"^x04[HNS]^x01 Modul train a fost pornit de catre adminul ^x03%s^x01.Credite lui^x04 fuzy^x01 !",name);

		TrainOn = true;
		set_pcvar_string(humans_join_team, "t");
		set_pcvar_num(mp_autoteambalance, 0);
		set_pcvar_num(mp_limitteams, 0);
		set_pcvar_num(mp_timelimit, 0);
		set_pcvar_num(mp_roundtime, 9);
		MovePlayers( );
	}
}
public MovePlayers( )
{
	new Players[32];
	new PlayersNum, plr;
	get_players(Players, PlayersNum, "c");	
	for(new i=0; i<PlayersNum; i++) {
		plr = Players;
		cs_set_user_team( plr, CS_TEAM_T );
		ExecuteHamB(Ham_CS_RoundRespawn, plr);
	}
}
public hamSpawnPlayer_Post( id )
{
	if(is_user_alive( id ) )
	{
		if(TrainOn)
		{
			set_user_godmode( id, 1);
		}
		else
		{
			set_user_godmode( id, 0);
		}
	}
}

public sayHns( id )
{
	if( user_has_access( id ) )
	{
		TrainOn = false;
		new name[32];
		get_user_name(id, name,31);
		ColorChat(0,RED,"^x04[HNS]^x01 Modul train a fost oprit de catre adminul ^x03%s^x01.Credite lui^x04 fuzy^x01 !",name);

		set_pcvar_string(humans_join_team, "any");
		set_pcvar_num(mp_autoteambalance, 1);
		set_pcvar_num(mp_limitteams, 3);
		set_pcvar_num(mp_timelimit, 30);
		set_pcvar_num(mp_roundtime, 3);
		set_task(10.0,"SecondRR");
		server_cmd("sv_restart 10");
	}
}
public SecondRR( )
{
	server_cmd("sv_restart 1");	
	set_task(1.0,"ThirdRR");
}

public ThirdRR( )
{
	server_cmd("sv_restart 1");	
}
	
stock bool:user_has_access( id )
{
	if( get_user_flags( id ) & ADMIN_CVAR )
		return true;
		
	return false;
}

public cmdCP(id)
{
	if(TrainOn)
	{
		
		if(is_user_alive(id))
		{

			if( hnst_checkpoints[id] == 0 )
			{
				pev(id, pev_origin, hnst_lastcp[id])
			}
			else
			{
				hnst_prelastcp[id] = hnst_lastcp[id]
				pev(id, pev_origin, hnst_lastcp[id])
			}
			hnst_checkpoints[id]++
			
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}

public cmdTele(id)
{
	if(TrainOn)
	{	
		if(!is_user_alive(id))
		{
			return PLUGIN_HANDLED;
		}

		if( hnst_checkpoints[id] != 0 )
		{
			set_pev(id, pev_velocity, Float:{0.0, 0.0, 0.0})
			set_pev(id, pev_origin, hnst_lastcp[id])
			hnst_gochecks[id]++
			fm_set_entity_flags(id, FL_DUCKING, 1);
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}


public cmdStuck(id)
{
	if( !TrainOn )
		return 1

	if(!is_user_alive(id))
	{
			return 1;
	}

	set_pev(id, pev_velocity, Float:{0.0, 0.0, 0.0})
	set_pev(id, pev_origin, hnst_prelastcp[id])
	
	// Add a GoCheck because player can use this for bugs GoChecks
	hnst_gochecks[id]++
	
	fm_set_entity_flags(id, FL_DUCKING, 1);
	
	return 1;
}

public force_duck(id)
{
	id -= 111222;
	fm_set_entity_flags(id, FL_DUCKING, 1);
}


stock fm_set_entity_flags(index, flag, onoff) 
{
	new flags = pev(index, pev_flags);
	if ((flags & flag) > 0)
		return onoff == 1 ? 2 : 1 + 0 * set_pev(index, pev_flags, flags - flag);
	else
		return onoff == 0 ? 2 : 1 + 0 * set_pev(index, pev_flags, flags + flag);

	return 0;
}

public plugin_end( )
{
	set_pcvar_string(humans_join_team, "any");
	set_pcvar_num(mp_autoteambalance, 1);
	set_pcvar_num(mp_limitteams, 3);
	set_pcvar_num(mp_timelimit, 30);
	set_pcvar_num(mp_roundtime, 3);
}
Caut o persoana dedicata care se pricepe si stie ce face.
Vreau sa creeze si sa se ocupe de administrarea unui server de MU, da e vorba de vechiul joc..ma gandesc undeva la un season 3 ep1/2.

O sa achizitionez un domeniu .ro.
Totodata sponsorizez absolut orice este necesar.
Ma puteti contacta prin: http://solo.to/stfrzv
User avatar
RoL
Membru, skill +1
Membru, skill +1
Posts: 434
Joined: 19 Jul 2013, 13:19
Detinator Steam: Da
Detinator server CS: DA
SteamID: rolcs97
Has thanked: 47 times
Been thanked: 28 times
Contact:

14 Aug 2013, 15:31

Mersi askhanar merge dar nu imi poti face sa fie doar o comanda pentru 2 functii adica, sa scriu /nc Sa apara in chat ti-ai activat noclip si sa scriu iar /nc si sa scrie in chat ti-ai dezactivat noclip

Adica sa nu fie 2 comenzi /ncoff si /ncon , sa fie doar una si la fel si la /gm te rog :D
Server: HNS.CSBLACKDEVIL.COM
Mod: 500 GRAVITY + LVLMODE !
Owner : RoL

Multe altele pe server ! Ajuta-ma sa-l populez ..
http://www.extreamcs.com/forum/mesaj166 ... o_id=46686
User avatar
RoL
Membru, skill +1
Membru, skill +1
Posts: 434
Joined: 19 Jul 2013, 13:19
Detinator Steam: Da
Detinator server CS: DA
SteamID: rolcs97
Has thanked: 47 times
Been thanked: 28 times
Contact:

14 Aug 2013, 18:07

Cineva ?
Server: HNS.CSBLACKDEVIL.COM
Mod: 500 GRAVITY + LVLMODE !
Owner : RoL

Multe altele pe server ! Ajuta-ma sa-l populez ..
http://www.extreamcs.com/forum/mesaj166 ... o_id=46686
User avatar
Ulquiorra
Fost moderator
Fost moderator
Posts: 2053
Joined: 25 Jul 2010, 17:29
Detinator Steam: Da
CS Status: A mai trecut o zi asteptand una mai buna
Detinator server CS: Retras.
SteamID: STEAM_0:1:318247XX
Reputatie: Fost Scripter eXtreamCS
Fost Moderator ajutator
Nick anterior: Askhanar
Location: Braila, Romania.
Has thanked: 215 times
Been thanked: 1132 times

14 Aug 2013, 23:50

| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <fun>
#include <ColorChat>

#define PLUGIN "Hine'N'Seek Training Sistem "
#define VERSION "1.0"
#define AUTHOR "sPuf ?"

new humans_join_team;
new mp_autoteambalance;
new mp_limitteams;
new mp_roundtime;
new mp_timelimit;

new bool:TrainOn = false;
new hnst_checkpoints[33];
new hnst_gochecks[33];

new Float:hnst_lastcp[33][3];
new Float:hnst_prelastcp[33][3];

new bool:hook[33];
new hook_to[33][3];

/*================================================================================================*/
public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_clcmd("say /train","sayTrain");
	register_clcmd("say /hns","sayHns");
	
	RegisterHam(Ham_Spawn, "player", "hamSpawnPlayer_Post", 1 );
	
	register_clcmd("say /cp", "cmdCP");
	register_clcmd("cp", "cmdCP");
	register_clcmd("say /tp","cmdTele");
	register_clcmd("tp","cmdTele");
	register_clcmd("say /gm","ClCmdSayGodMode");
	register_clcmd("say /nc","ClCmdSayNoClip");
	register_concmd("+hook","hook_on");
	register_concmd("-hook","hook_off");
	
	//Cvar Pointers
	humans_join_team = get_cvar_pointer("humans_join_team");
	mp_autoteambalance = get_cvar_pointer("mp_autoteambalance");
	mp_limitteams = get_cvar_pointer("mp_limitteams");
	mp_roundtime = get_cvar_pointer("mp_roundtime");
	mp_timelimit = get_cvar_pointer("mp_timelimit");

}

//m-am inspirat din tutorialul lui Askhanar despre godmode si noclip :D : pluginuri-cs/modulul-fun-t207269.html

public ClCmdSayGodMode( id )
{
	if( !TrainOn )
	{
		ColorChat( id, RED, "^x04[HNS]^x01 Modul^x03 TRAIN^x01 nu este activ!" );
		return PLUGIN_HANDLED;
	}
	
	new iGM = get_user_godmode( id );
	set_user_godmode( id, iGM ? 0 : 1 );
	ColorChat(id ,RED, "^x04[HNS]^x01 Ai %sactivat^x03 godmode^x01 !", iGM == 1 ? "dez" : ""  );
	return PLUGIN_HANDLED;
	
}

public ClCmdSayNoClip ( id )
{
	if( !TrainOn )
	{
		ColorChat( id, RED, "^x04[HNS]^x01 Modul^x03 TRAIN^x01 nu este activ!" );
		return PLUGIN_HANDLED;
	}
	
	new iNC = get_user_noclip( id );
	set_user_noclip( id, iNC ? 0 : 1 );
	ColorChat(id ,RED, "^x04[HNS]^x01 Ai dezactivat^x03 noclip^x01 !", iNC ? "dez" : "" );
	return PLUGIN_HANDLED;
	
}

public hook_on(id)
{		
	if( !TrainOn || hook[id])
	{
		return PLUGIN_HANDLED;
	}
	
	set_pev(id, pev_gravity, 0.0);
	set_task(0.1,"hook_prethink",id+10000,"",0,"b");
	
	hook[id]=true;
	hook_to[id][0]=999999;
	hook_prethink(id+10000);
	return PLUGIN_HANDLED;
}
public hook_off(id)
{
	
	set_pev(id, pev_gravity, 1.0);
	hook[id] = false;
	return PLUGIN_HANDLED;
}

public hook_prethink(id)
{
	id -= 10000;
	
	if(!is_user_alive(id))
	{
		hook[id]=false;
	}
	
	if(!hook[id])
	{
		remove_task(id+10000);
		return PLUGIN_HANDLED;
	}


	static origin1[3];
	new Float:origin[3];
	get_user_origin(id,origin1);
	pev(id, pev_origin, origin);

	if(hook_to[id][0]==999999)
	{
		static origin2[3];
		get_user_origin(id,origin2,3);
		hook_to[id][0]=origin2[0];
		hook_to[id][1]=origin2[1];
		hook_to[id][2]=origin2[2];
	}

	//Calculate Velocity
	static Float:velocity[3];
	velocity[0] = (float(hook_to[id][0]) - float(origin1[0])) * 3.0;
	velocity[1] = (float(hook_to[id][1]) - float(origin1[1])) * 3.0;
	velocity[2] = (float(hook_to[id][2]) - float(origin1[2])) * 3.0;

	static Float:y;
	y = velocity[0]*velocity[0] + velocity[1]*velocity[1] + velocity[2]*velocity[2];

	static Float:x;
	x = (900.0) / floatsqroot(y);

	velocity[0] *= x;
	velocity[1] *= x;
	velocity[2] *= x;

	set_velo(id,velocity);

	return PLUGIN_CONTINUE;
}

public set_velo(id,Float:velocity[3])
{
	return set_pev(id,pev_velocity,velocity);
}

public sayTrain( id )
{
	if( user_has_access( id ) )
	{
		new name[32];
		get_user_name(id, name,31);
		ColorChat(0,RED,"^x04[HNS]^x01 Modul train a fost pornit de catre adminul ^x03%s^x01.Credite lui^x04 fuzy^x01 !",name);

		TrainOn = true;
		set_pcvar_string(humans_join_team, "t");
		set_pcvar_num(mp_autoteambalance, 0);
		set_pcvar_num(mp_limitteams, 0);
		set_pcvar_num(mp_timelimit, 0);
		set_pcvar_num(mp_roundtime, 9);
		MovePlayers( );
	}
}
public MovePlayers( )
{
	new Players[32];
	new PlayersNum, plr;
	get_players(Players, PlayersNum, "c");	
	for(new i=0; i<PlayersNum; i++) {
		plr = Players;
		cs_set_user_team( plr, CS_TEAM_T );
		ExecuteHamB(Ham_CS_RoundRespawn, plr);
	}
}
public hamSpawnPlayer_Post( id )
{
	if(is_user_alive( id ) )
	{
		if(TrainOn)
		{
			set_user_godmode( id, 1);
		}
		else
		{
			set_user_godmode( id, 0);
		}
	}
}

public sayHns( id )
{
	if( user_has_access( id ) )
	{
		TrainOn = false;
		new name[32];
		get_user_name(id, name,31);
		ColorChat(0,RED,"^x04[HNS]^x01 Modul train a fost oprit de catre adminul ^x03%s^x01.Credite lui^x04 fuzy^x01 !",name);

		set_pcvar_string(humans_join_team, "any");
		set_pcvar_num(mp_autoteambalance, 1);
		set_pcvar_num(mp_limitteams, 3);
		set_pcvar_num(mp_timelimit, 30);
		set_pcvar_num(mp_roundtime, 3);
		set_task(10.0,"SecondRR");
		server_cmd("sv_restart 10");
	}
}
public SecondRR( )
{
	server_cmd("sv_restart 1");	
	set_task(1.0,"ThirdRR");
}

public ThirdRR( )
{
	server_cmd("sv_restart 1");	
}
	
stock bool:user_has_access( id )
{
	if( get_user_flags( id ) & ADMIN_CVAR )
		return true;
		
	return false;
}

public cmdCP(id)
{
	if(TrainOn)
	{
		
		if(is_user_alive(id))
		{

			if( hnst_checkpoints[id] == 0 )
			{
				pev(id, pev_origin, hnst_lastcp[id])
			}
			else
			{
				hnst_prelastcp[id] = hnst_lastcp[id]
				pev(id, pev_origin, hnst_lastcp[id])
			}
			hnst_checkpoints[id]++
			
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}

public cmdTele(id)
{
	if(TrainOn)
	{	
		if(!is_user_alive(id))
		{
			return PLUGIN_HANDLED;
		}

		if( hnst_checkpoints[id] != 0 )
		{
			set_pev(id, pev_velocity, Float:{0.0, 0.0, 0.0})
			set_pev(id, pev_origin, hnst_lastcp[id])
			hnst_gochecks[id]++
			fm_set_entity_flags(id, FL_DUCKING, 1);
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}


public cmdStuck(id)
{
	if( !TrainOn )
		return 1

	if(!is_user_alive(id))
	{
			return 1;
	}

	set_pev(id, pev_velocity, Float:{0.0, 0.0, 0.0})
	set_pev(id, pev_origin, hnst_prelastcp[id])
	
	// Add a GoCheck because player can use this for bugs GoChecks
	hnst_gochecks[id]++
	
	fm_set_entity_flags(id, FL_DUCKING, 1);
	
	return 1;
}

public force_duck(id)
{
	id -= 111222;
	fm_set_entity_flags(id, FL_DUCKING, 1);
}


stock fm_set_entity_flags(index, flag, onoff) 
{
	new flags = pev(index, pev_flags);
	if ((flags & flag) > 0)
		return onoff == 1 ? 2 : 1 + 0 * set_pev(index, pev_flags, flags - flag);
	else
		return onoff == 0 ? 2 : 1 + 0 * set_pev(index, pev_flags, flags + flag);

	return 0;
}

public plugin_end( )
{
	set_pcvar_string(humans_join_team, "any");
	set_pcvar_num(mp_autoteambalance, 1);
	set_pcvar_num(mp_limitteams, 3);
	set_pcvar_num(mp_timelimit, 30);
	set_pcvar_num(mp_roundtime, 3);
}


nu l-am testat.. dar merge 100%.
Caut o persoana dedicata care se pricepe si stie ce face.
Vreau sa creeze si sa se ocupe de administrarea unui server de MU, da e vorba de vechiul joc..ma gandesc undeva la un season 3 ep1/2.

O sa achizitionez un domeniu .ro.
Totodata sponsorizez absolut orice este necesar.
Ma puteti contacta prin: http://solo.to/stfrzv
User avatar
RoL
Membru, skill +1
Membru, skill +1
Posts: 434
Joined: 19 Jul 2013, 13:19
Detinator Steam: Da
Detinator server CS: DA
SteamID: rolcs97
Has thanked: 47 times
Been thanked: 28 times
Contact:

15 Aug 2013, 13:21

Askhanar wrote:
| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <fun>
#include <ColorChat>

#define PLUGIN "Hine'N'Seek Training Sistem "
#define VERSION "1.0"
#define AUTHOR "sPuf ?"

new humans_join_team;
new mp_autoteambalance;
new mp_limitteams;
new mp_roundtime;
new mp_timelimit;

new bool:TrainOn = false;
new hnst_checkpoints[33];
new hnst_gochecks[33];

new Float:hnst_lastcp[33][3];
new Float:hnst_prelastcp[33][3];

new bool:hook[33];
new hook_to[33][3];

/*================================================================================================*/
public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_clcmd("say /train","sayTrain");
	register_clcmd("say /hns","sayHns");
	
	RegisterHam(Ham_Spawn, "player", "hamSpawnPlayer_Post", 1 );
	
	register_clcmd("say /cp", "cmdCP");
	register_clcmd("cp", "cmdCP");
	register_clcmd("say /tp","cmdTele");
	register_clcmd("tp","cmdTele");
	register_clcmd("say /gm","ClCmdSayGodMode");
	register_clcmd("say /nc","ClCmdSayNoClip");
	register_concmd("+hook","hook_on");
	register_concmd("-hook","hook_off");
	
	//Cvar Pointers
	humans_join_team = get_cvar_pointer("humans_join_team");
	mp_autoteambalance = get_cvar_pointer("mp_autoteambalance");
	mp_limitteams = get_cvar_pointer("mp_limitteams");
	mp_roundtime = get_cvar_pointer("mp_roundtime");
	mp_timelimit = get_cvar_pointer("mp_timelimit");

}

//m-am inspirat din tutorialul lui Askhanar despre godmode si noclip :D : pluginuri-cs/modulul-fun-t207269.html

public ClCmdSayGodMode( id )
{
	if( !TrainOn )
	{
		ColorChat( id, RED, "^x04[HNS]^x01 Modul^x03 TRAIN^x01 nu este activ!" );
		return PLUGIN_HANDLED;
	}
	
	new iGM = get_user_godmode( id );
	set_user_godmode( id, iGM ? 0 : 1 );
	ColorChat(id ,RED, "^x04[HNS]^x01 Ai %sactivat^x03 godmode^x01 !", iGM == 1 ? "dez" : ""  );
	return PLUGIN_HANDLED;
	
}

public ClCmdSayNoClip ( id )
{
	if( !TrainOn )
	{
		ColorChat( id, RED, "^x04[HNS]^x01 Modul^x03 TRAIN^x01 nu este activ!" );
		return PLUGIN_HANDLED;
	}
	
	new iNC = get_user_noclip( id );
	set_user_noclip( id, iNC ? 0 : 1 );
	ColorChat(id ,RED, "^x04[HNS]^x01 Ai dezactivat^x03 noclip^x01 !", iNC ? "dez" : "" );
	return PLUGIN_HANDLED;
	
}

public hook_on(id)
{		
	if( !TrainOn || hook[id])
	{
		return PLUGIN_HANDLED;
	}
	
	set_pev(id, pev_gravity, 0.0);
	set_task(0.1,"hook_prethink",id+10000,"",0,"b");
	
	hook[id]=true;
	hook_to[id][0]=999999;
	hook_prethink(id+10000);
	return PLUGIN_HANDLED;
}
public hook_off(id)
{
	
	set_pev(id, pev_gravity, 1.0);
	hook[id] = false;
	return PLUGIN_HANDLED;
}

public hook_prethink(id)
{
	id -= 10000;
	
	if(!is_user_alive(id))
	{
		hook[id]=false;
	}
	
	if(!hook[id])
	{
		remove_task(id+10000);
		return PLUGIN_HANDLED;
	}


	static origin1[3];
	new Float:origin[3];
	get_user_origin(id,origin1);
	pev(id, pev_origin, origin);

	if(hook_to[id][0]==999999)
	{
		static origin2[3];
		get_user_origin(id,origin2,3);
		hook_to[id][0]=origin2[0];
		hook_to[id][1]=origin2[1];
		hook_to[id][2]=origin2[2];
	}

	//Calculate Velocity
	static Float:velocity[3];
	velocity[0] = (float(hook_to[id][0]) - float(origin1[0])) * 3.0;
	velocity[1] = (float(hook_to[id][1]) - float(origin1[1])) * 3.0;
	velocity[2] = (float(hook_to[id][2]) - float(origin1[2])) * 3.0;

	static Float:y;
	y = velocity[0]*velocity[0] + velocity[1]*velocity[1] + velocity[2]*velocity[2];

	static Float:x;
	x = (900.0) / floatsqroot(y);

	velocity[0] *= x;
	velocity[1] *= x;
	velocity[2] *= x;

	set_velo(id,velocity);

	return PLUGIN_CONTINUE;
}

public set_velo(id,Float:velocity[3])
{
	return set_pev(id,pev_velocity,velocity);
}

public sayTrain( id )
{
	if( user_has_access( id ) )
	{
		new name[32];
		get_user_name(id, name,31);
		ColorChat(0,RED,"^x04[HNS]^x01 Modul train a fost pornit de catre adminul ^x03%s^x01.Credite lui^x04 fuzy^x01 !",name);

		TrainOn = true;
		set_pcvar_string(humans_join_team, "t");
		set_pcvar_num(mp_autoteambalance, 0);
		set_pcvar_num(mp_limitteams, 0);
		set_pcvar_num(mp_timelimit, 0);
		set_pcvar_num(mp_roundtime, 9);
		MovePlayers( );
	}
}
public MovePlayers( )
{
	new Players[32];
	new PlayersNum, plr;
	get_players(Players, PlayersNum, "c");	
	for(new i=0; i<PlayersNum; i++) {
		plr = Players;
		cs_set_user_team( plr, CS_TEAM_T );
		ExecuteHamB(Ham_CS_RoundRespawn, plr);
	}
}
public hamSpawnPlayer_Post( id )
{
	if(is_user_alive( id ) )
	{
		if(TrainOn)
		{
			set_user_godmode( id, 1);
		}
		else
		{
			set_user_godmode( id, 0);
		}
	}
}

public sayHns( id )
{
	if( user_has_access( id ) )
	{
		TrainOn = false;
		new name[32];
		get_user_name(id, name,31);
		ColorChat(0,RED,"^x04[HNS]^x01 Modul train a fost oprit de catre adminul ^x03%s^x01.Credite lui^x04 fuzy^x01 !",name);

		set_pcvar_string(humans_join_team, "any");
		set_pcvar_num(mp_autoteambalance, 1);
		set_pcvar_num(mp_limitteams, 3);
		set_pcvar_num(mp_timelimit, 30);
		set_pcvar_num(mp_roundtime, 3);
		set_task(10.0,"SecondRR");
		server_cmd("sv_restart 10");
	}
}
public SecondRR( )
{
	server_cmd("sv_restart 1");	
	set_task(1.0,"ThirdRR");
}

public ThirdRR( )
{
	server_cmd("sv_restart 1");	
}
	
stock bool:user_has_access( id )
{
	if( get_user_flags( id ) & ADMIN_CVAR )
		return true;
		
	return false;
}

public cmdCP(id)
{
	if(TrainOn)
	{
		
		if(is_user_alive(id))
		{

			if( hnst_checkpoints[id] == 0 )
			{
				pev(id, pev_origin, hnst_lastcp[id])
			}
			else
			{
				hnst_prelastcp[id] = hnst_lastcp[id]
				pev(id, pev_origin, hnst_lastcp[id])
			}
			hnst_checkpoints[id]++
			
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}

public cmdTele(id)
{
	if(TrainOn)
	{	
		if(!is_user_alive(id))
		{
			return PLUGIN_HANDLED;
		}

		if( hnst_checkpoints[id] != 0 )
		{
			set_pev(id, pev_velocity, Float:{0.0, 0.0, 0.0})
			set_pev(id, pev_origin, hnst_lastcp[id])
			hnst_gochecks[id]++
			fm_set_entity_flags(id, FL_DUCKING, 1);
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}


public cmdStuck(id)
{
	if( !TrainOn )
		return 1

	if(!is_user_alive(id))
	{
			return 1;
	}

	set_pev(id, pev_velocity, Float:{0.0, 0.0, 0.0})
	set_pev(id, pev_origin, hnst_prelastcp[id])
	
	// Add a GoCheck because player can use this for bugs GoChecks
	hnst_gochecks[id]++
	
	fm_set_entity_flags(id, FL_DUCKING, 1);
	
	return 1;
}

public force_duck(id)
{
	id -= 111222;
	fm_set_entity_flags(id, FL_DUCKING, 1);
}


stock fm_set_entity_flags(index, flag, onoff) 
{
	new flags = pev(index, pev_flags);
	if ((flags & flag) > 0)
		return onoff == 1 ? 2 : 1 + 0 * set_pev(index, pev_flags, flags - flag);
	else
		return onoff == 0 ? 2 : 1 + 0 * set_pev(index, pev_flags, flags + flag);

	return 0;
}

public plugin_end( )
{
	set_pcvar_string(humans_join_team, "any");
	set_pcvar_num(mp_autoteambalance, 1);
	set_pcvar_num(mp_limitteams, 3);
	set_pcvar_num(mp_timelimit, 30);
	set_pcvar_num(mp_roundtime, 3);
}


nu l-am testat.. dar merge 100%.


Imi poti baga sa aiba acces doar flagurile "sty", la comanda "/train si /hns"? , ca in plugin am vazut o linie cu ADMIN_CVAR ..

Si daca imi poti baga un meniu , ca la serverele de train sti tu cum sunt restu , se deschide un meniu in hud si ai mai multe obtiuni , checkpoint , goto checkpoint , ca sa le selecteze si cu 1 si 2 nu numai din tastarea a 2 cuvinte |/cp| |/tp|

Multumesc
Server: HNS.CSBLACKDEVIL.COM
Mod: 500 GRAVITY + LVLMODE !
Owner : RoL

Multe altele pe server ! Ajuta-ma sa-l populez ..
http://www.extreamcs.com/forum/mesaj166 ... o_id=46686
User avatar
-Turbo-
Membru, skill +4
Membru, skill +4
Posts: 1664
Joined: 11 Nov 2012, 01:28
Detinator Steam: Da
CS Status: Bored !
Detinator server CS: Da
SteamID: kingforbidden
Reputatie: Utilizator neserios ( tepar )
Restrictie moderator
Ban scos ( achitat )
Nume anterior: Turbo19973
Location: Botosani
Has thanked: 49 times
Been thanked: 212 times

15 Aug 2013, 18:53

| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <fun>
#include <ColorChat>

#define PLUGIN "Hine'N'Seek Training Sistem "
#define VERSION "1.0"
#define AUTHOR "sPuf ?"

new humans_join_team;
new mp_autoteambalance;
new mp_limitteams;
new mp_roundtime;
new mp_timelimit;

new bool:TrainOn = false;
new hnst_checkpoints[33];
new hnst_gochecks[33];

new Float:hnst_lastcp[33][3];
new Float:hnst_prelastcp[33][3];

new bool:hook[33];
new hook_to[33][3];

/*================================================================================================*/
public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_clcmd("say /train","sayTrain");
	register_clcmd("say /hns","sayHns");
	
	RegisterHam(Ham_Spawn, "player", "hamSpawnPlayer_Post", 1 );
	
	register_clcmd("say /cp", "cmdCP");
	register_clcmd("cp", "cmdCP");
	register_clcmd("say /tp","cmdTele");
	register_clcmd("tp","cmdTele");
	register_clcmd("say /gm","ClCmdSayGodMode");
	register_clcmd("say /nc","ClCmdSayNoClip");
	register_concmd("+hook","hook_on");
	register_concmd("-hook","hook_off");
	
	//Cvar Pointers
	humans_join_team = get_cvar_pointer("humans_join_team");
	mp_autoteambalance = get_cvar_pointer("mp_autoteambalance");
	mp_limitteams = get_cvar_pointer("mp_limitteams");
	mp_roundtime = get_cvar_pointer("mp_roundtime");
	mp_timelimit = get_cvar_pointer("mp_timelimit");

}

//m-am inspirat din tutorialul lui Askhanar despre godmode si noclip :D : pluginuri-cs/modulul-fun-t207269.html

public ClCmdSayGodMode( id )
{
	if( !TrainOn )
	{
		ColorChat( id, RED, "^x04[HNS]^x01 Modul^x03 TRAIN^x01 nu este activ!" );
		return PLUGIN_HANDLED;
	}
	
	new iGM = get_user_godmode( id );
	set_user_godmode( id, iGM ? 0 : 1 );
	ColorChat(id ,RED, "^x04[HNS]^x01 Ai %sactivat^x03 godmode^x01 !", iGM == 1 ? "dez" : ""  );
	return PLUGIN_HANDLED;
	
}

public ClCmdSayNoClip ( id )
{
	if( !TrainOn )
	{
		ColorChat( id, RED, "^x04[HNS]^x01 Modul^x03 TRAIN^x01 nu este activ!" );
		return PLUGIN_HANDLED;
	}
	
	new iNC = get_user_noclip( id );
	set_user_noclip( id, iNC ? 0 : 1 );
	ColorChat(id ,RED, "^x04[HNS]^x01 Ai dezactivat^x03 noclip^x01 !", iNC ? "dez" : "" );
	return PLUGIN_HANDLED;
	
}

public hook_on(id)
{		
	if( !TrainOn || hook[id])
	{
		return PLUGIN_HANDLED;
	}
	
	set_pev(id, pev_gravity, 0.0);
	set_task(0.1,"hook_prethink",id+10000,"",0,"b");
	
	hook[id]=true;
	hook_to[id][0]=999999;
	hook_prethink(id+10000);
	return PLUGIN_HANDLED;
}
public hook_off(id)
{
	
	set_pev(id, pev_gravity, 1.0);
	hook[id] = false;
	return PLUGIN_HANDLED;
}

public hook_prethink(id)
{
	id -= 10000;
	
	if(!is_user_alive(id))
	{
		hook[id]=false;
	}
	
	if(!hook[id])
	{
		remove_task(id+10000);
		return PLUGIN_HANDLED;
	}


	static origin1[3];
	new Float:origin[3];
	get_user_origin(id,origin1);
	pev(id, pev_origin, origin);

	if(hook_to[id][0]==999999)
	{
		static origin2[3];
		get_user_origin(id,origin2,3);
		hook_to[id][0]=origin2[0];
		hook_to[id][1]=origin2[1];
		hook_to[id][2]=origin2[2];
	}

	//Calculate Velocity
	static Float:velocity[3];
	velocity[0] = (float(hook_to[id][0]) - float(origin1[0])) * 3.0;
	velocity[1] = (float(hook_to[id][1]) - float(origin1[1])) * 3.0;
	velocity[2] = (float(hook_to[id][2]) - float(origin1[2])) * 3.0;

	static Float:y;
	y = velocity[0]*velocity[0] + velocity[1]*velocity[1] + velocity[2]*velocity[2];

	static Float:x;
	x = (900.0) / floatsqroot(y);

	velocity[0] *= x;
	velocity[1] *= x;
	velocity[2] *= x;

	set_velo(id,velocity);

	return PLUGIN_CONTINUE;
}

public set_velo(id,Float:velocity[3])
{
	return set_pev(id,pev_velocity,velocity);
}

public sayTrain( id )
{
	if( user_has_access( id ) )
	{
		new name[32];
		get_user_name(id, name,31);
		ColorChat(0,RED,"^x04[HNS]^x01 Modul train a fost pornit de catre adminul ^x03%s^x01.Credite lui^x04 fuzy^x01 !",name);

		TrainOn = true;
		set_pcvar_string(humans_join_team, "t");
		set_pcvar_num(mp_autoteambalance, 0);
		set_pcvar_num(mp_limitteams, 0);
		set_pcvar_num(mp_timelimit, 0);
		set_pcvar_num(mp_roundtime, 9);
		MovePlayers( );
	}
}
public MovePlayers( )
{
	new Players[32];
	new PlayersNum, plr;
	get_players(Players, PlayersNum, "c");	
	for(new i=0; i<PlayersNum; i++) {
		plr = Players;
		cs_set_user_team( plr, CS_TEAM_T );
		ExecuteHamB(Ham_CS_RoundRespawn, plr);
	}
}
public hamSpawnPlayer_Post( id )
{
	if(is_user_alive( id ) )
	{
		if(TrainOn)
		{
			set_user_godmode( id, 1);
		}
		else
		{
			set_user_godmode( id, 0);
		}
	}
}

public sayHns( id )
{
	if( user_has_access( id ) )
	{
		TrainOn = false;
		new name[32];
		get_user_name(id, name,31);
		ColorChat(0,RED,"^x04[HNS]^x01 Modul train a fost oprit de catre adminul ^x03%s^x01.Credite lui^x04 fuzy^x01 !",name);

		set_pcvar_string(humans_join_team, "any");
		set_pcvar_num(mp_autoteambalance, 1);
		set_pcvar_num(mp_limitteams, 3);
		set_pcvar_num(mp_timelimit, 30);
		set_pcvar_num(mp_roundtime, 3);
		set_task(10.0,"SecondRR");
		server_cmd("sv_restart 10");
	}
}
public SecondRR( )
{
	server_cmd("sv_restart 1");	
	set_task(1.0,"ThirdRR");
}

public ThirdRR( )
{
	server_cmd("sv_restart 1");	
}
	
stock bool:user_has_access( id )
{
	if(get_user_flags(id) == read_flags("sty"))
		return true;
		
	return false;
}

public cmdCP(id)
{
	if(TrainOn)
	{
		
		if(is_user_alive(id))
		{

			if( hnst_checkpoints[id] == 0 )
			{
				pev(id, pev_origin, hnst_lastcp[id])
			}
			else
			{
				hnst_prelastcp[id] = hnst_lastcp[id]
				pev(id, pev_origin, hnst_lastcp[id])
			}
			hnst_checkpoints[id]++
			
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}

public cmdTele(id)
{
	if(TrainOn)
	{	
		if(!is_user_alive(id))
		{
			return PLUGIN_HANDLED;
		}

		if( hnst_checkpoints[id] != 0 )
		{
			set_pev(id, pev_velocity, Float:{0.0, 0.0, 0.0})
			set_pev(id, pev_origin, hnst_lastcp[id])
			hnst_gochecks[id]++
			fm_set_entity_flags(id, FL_DUCKING, 1);
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}


public cmdStuck(id)
{
	if( !TrainOn )
		return 1

	if(!is_user_alive(id))
	{
			return 1;
	}

	set_pev(id, pev_velocity, Float:{0.0, 0.0, 0.0})
	set_pev(id, pev_origin, hnst_prelastcp[id])
	
	// Add a GoCheck because player can use this for bugs GoChecks
	hnst_gochecks[id]++
	
	fm_set_entity_flags(id, FL_DUCKING, 1);
	
	return 1;
}

public force_duck(id)
{
	id -= 111222;
	fm_set_entity_flags(id, FL_DUCKING, 1);
}


stock fm_set_entity_flags(index, flag, onoff) 
{
	new flags = pev(index, pev_flags);
	if ((flags & flag) > 0)
		return onoff == 1 ? 2 : 1 + 0 * set_pev(index, pev_flags, flags - flag);
	else
		return onoff == 0 ? 2 : 1 + 0 * set_pev(index, pev_flags, flags + flag);

	return 0;
}

public plugin_end( )
{
	set_pcvar_string(humans_join_team, "any");
	set_pcvar_num(mp_autoteambalance, 1);
	set_pcvar_num(mp_limitteams, 3);
	set_pcvar_num(mp_timelimit, 30);
	set_pcvar_num(mp_roundtime, 3);
}
User avatar
RoL
Membru, skill +1
Membru, skill +1
Posts: 434
Joined: 19 Jul 2013, 13:19
Detinator Steam: Da
Detinator server CS: DA
SteamID: rolcs97
Has thanked: 47 times
Been thanked: 28 times
Contact:

15 Aug 2013, 20:48

| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <fun>
#include <ColorChat>

#define PLUGIN "Hine'N'Seek Training Sistem "
#define VERSION "1.0"
#define AUTHOR "sPuf ?"

new humans_join_team;
new mp_autoteambalance;
new mp_limitteams;
new mp_roundtime;
new mp_timelimit;

new bool:TrainOn = false;
new hnst_checkpoints[33];
new hnst_gochecks[33];

new Float:hnst_lastcp[33][3];
new Float:hnst_prelastcp[33][3];

new bool:hook[33];
new hook_to[33][3];

/*================================================================================================*/
public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_clcmd("say /train","sayTrain");
	register_clcmd("say /hns","sayHns");
	
	RegisterHam(Ham_Spawn, "player", "hamSpawnPlayer_Post", 1 );
	
	register_clcmd("say /cp", "cmdCP");
	register_clcmd("cp", "cmdCP");
	register_clcmd("say /tp","cmdTele");
	register_clcmd("tp","cmdTele");
	register_clcmd("say /gm","ClCmdSayGodMode");
	register_clcmd("say /nc","ClCmdSayNoClip");
	register_concmd("+hook","hook_on");
	register_concmd("-hook","hook_off");
	
	//Cvar Pointers
	humans_join_team = get_cvar_pointer("humans_join_team");
	mp_autoteambalance = get_cvar_pointer("mp_autoteambalance");
	mp_limitteams = get_cvar_pointer("mp_limitteams");
	mp_roundtime = get_cvar_pointer("mp_roundtime");
	mp_timelimit = get_cvar_pointer("mp_timelimit");

}

//m-am inspirat din tutorialul lui Askhanar despre godmode si noclip :D : pluginuri-cs/modulul-fun-t207269.html

public ClCmdSayGodMode( id )
{
	if( !TrainOn )
	{
		ColorChat( id, RED, "^x04[HNS]^x01 Modul^x03 TRAIN^x01 nu este activ!" );
		return PLUGIN_HANDLED;
	}
	
	new iGM = get_user_godmode( id );
	set_user_godmode( id, iGM ? 0 : 1 );
	ColorChat(id ,RED, "^x04[HNS]^x01 Ai %sactivat^x03 godmode^x01 !", iGM == 1 ? "dez" : ""  );
	return PLUGIN_HANDLED;
	
}

public ClCmdSayNoClip ( id )
{
	if( !TrainOn )
	{
		ColorChat( id, RED, "^x04[HNS]^x01 Modul^x03 TRAIN^x01 nu este activ!" );
		return PLUGIN_HANDLED;
	}
	
	new iNC = get_user_noclip( id );
	set_user_noclip( id, iNC ? 0 : 1 );
	ColorChat(id ,RED, "^x04[HNS]^x01 Ai dezactivat^x03 noclip^x01 !", iNC ? "dez" : "" );
	return PLUGIN_HANDLED;
	
}

public hook_on(id)
{		
	if( !TrainOn || hook[id])
	{
		return PLUGIN_HANDLED;
	}
	
	set_pev(id, pev_gravity, 0.0);
	set_task(0.1,"hook_prethink",id+10000,"",0,"b");
	
	hook[id]=true;
	hook_to[id][0]=999999;
	hook_prethink(id+10000);
	return PLUGIN_HANDLED;
}
public hook_off(id)
{
	
	set_pev(id, pev_gravity, 1.0);
	hook[id] = false;
	return PLUGIN_HANDLED;
}

public hook_prethink(id)
{
	id -= 10000;
	
	if(!is_user_alive(id))
	{
		hook[id]=false;
	}
	
	if(!hook[id])
	{
		remove_task(id+10000);
		return PLUGIN_HANDLED;
	}


	static origin1[3];
	new Float:origin[3];
	get_user_origin(id,origin1);
	pev(id, pev_origin, origin);

	if(hook_to[id][0]==999999)
	{
		static origin2[3];
		get_user_origin(id,origin2,3);
		hook_to[id][0]=origin2[0];
		hook_to[id][1]=origin2[1];
		hook_to[id][2]=origin2[2];
	}

	//Calculate Velocity
	static Float:velocity[3];
	velocity[0] = (float(hook_to[id][0]) - float(origin1[0])) * 3.0;
	velocity[1] = (float(hook_to[id][1]) - float(origin1[1])) * 3.0;
	velocity[2] = (float(hook_to[id][2]) - float(origin1[2])) * 3.0;

	static Float:y;
	y = velocity[0]*velocity[0] + velocity[1]*velocity[1] + velocity[2]*velocity[2];

	static Float:x;
	x = (900.0) / floatsqroot(y);

	velocity[0] *= x;
	velocity[1] *= x;
	velocity[2] *= x;

	set_velo(id,velocity);

	return PLUGIN_CONTINUE;
}

public set_velo(id,Float:velocity[3])
{
	return set_pev(id,pev_velocity,velocity);
}

public sayTrain( id )
{
	if( user_has_access( id ) )
	{
		new name[32];
		get_user_name(id, name,31);
		ColorChat(0,RED,"^x04[HNS]^x01 Modul train a fost pornit de catre adminul ^x03%s^x01.Credite lui^x04 fuzy^x01 !",name);

		TrainOn = true;
		set_pcvar_string(humans_join_team, "t");
		set_pcvar_num(mp_autoteambalance, 0);
		set_pcvar_num(mp_limitteams, 0);
		set_pcvar_num(mp_timelimit, 0);
		set_pcvar_num(mp_roundtime, 9);
		MovePlayers( );
	}
}
public MovePlayers( )
{
	new Players[32];
	new PlayersNum, plr;
	get_players(Players, PlayersNum, "c");	
	for(new i=0; i<PlayersNum; i++) {
		plr = Players;
		cs_set_user_team( plr, CS_TEAM_T );
		ExecuteHamB(Ham_CS_RoundRespawn, plr);
	}
}
public hamSpawnPlayer_Post( id )
{
	if(is_user_alive( id ) )
	{
		if(TrainOn)
		{
			set_user_godmode( id, 1);
		}
		else
		{
			set_user_godmode( id, 0);
		}
	}
}

public sayHns( id )
{
	if( user_has_access( id ) )
	{
		TrainOn = false;
		new name[32];
		get_user_name(id, name,31);
		ColorChat(0,RED,"^x04[HNS]^x01 Modul train a fost oprit de catre adminul ^x03%s^x01.Credite lui^x04 fuzy^x01 !",name);

		set_pcvar_string(humans_join_team, "any");
		set_pcvar_num(mp_autoteambalance, 1);
		set_pcvar_num(mp_limitteams, 3);
		set_pcvar_num(mp_timelimit, 30);
		set_pcvar_num(mp_roundtime, 3);
		set_task(10.0,"SecondRR");
		server_cmd("sv_restart 10");
	}
}
public SecondRR( )
{
	server_cmd("sv_restart 1");	
	set_task(1.0,"ThirdRR");
}

public ThirdRR( )
{
	server_cmd("sv_restart 1");	
}
	
stock bool:user_has_access( id )
{
	if( get_user_flags( id ) & ADMIN_CVAR )
		return true;
		
	return false;
}

public cmdCP(id)
{
	if(TrainOn)
	{
		
		if(is_user_alive(id))
		{

			if( hnst_checkpoints[id] == 0 )
			{
				pev(id, pev_origin, hnst_lastcp[id])
			}
			else
			{
				hnst_prelastcp[id] = hnst_lastcp[id]
				pev(id, pev_origin, hnst_lastcp[id])
			}
			hnst_checkpoints[id]++
			
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}

public cmdTele(id)
{
	if(TrainOn)
	{	
		if(!is_user_alive(id))
		{
			return PLUGIN_HANDLED;
		}

		if( hnst_checkpoints[id] != 0 )
		{
			set_pev(id, pev_velocity, Float:{0.0, 0.0, 0.0})
			set_pev(id, pev_origin, hnst_lastcp[id])
			hnst_gochecks[id]++
			fm_set_entity_flags(id, FL_DUCKING, 1);
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}


public cmdStuck(id)
{
	if( !TrainOn )
		return 1

	if(!is_user_alive(id))
	{
			return 1;
	}

	set_pev(id, pev_velocity, Float:{0.0, 0.0, 0.0})
	set_pev(id, pev_origin, hnst_prelastcp[id])
	
	// Add a GoCheck because player can use this for bugs GoChecks
	hnst_gochecks[id]++
	
	fm_set_entity_flags(id, FL_DUCKING, 1);
	
	return 1;
}

public force_duck(id)
{
	id -= 111222;
	fm_set_entity_flags(id, FL_DUCKING, 1);
}


stock fm_set_entity_flags(index, flag, onoff) 
{
	new flags = pev(index, pev_flags);
	if ((flags & flag) > 0)
		return onoff == 1 ? 2 : 1 + 0 * set_pev(index, pev_flags, flags - flag);
	else
		return onoff == 0 ? 2 : 1 + 0 * set_pev(index, pev_flags, flags + flag);

	return 0;
}

public plugin_end( )
{
	set_pcvar_string(humans_join_team, "any");
	set_pcvar_num(mp_autoteambalance, 1);
	set_pcvar_num(mp_limitteams, 3);
	set_pcvar_num(mp_timelimit, 30);
	set_pcvar_num(mp_roundtime, 3);
}

Turbo daca vrei sa ma ajuti modificami te rog pluginul de mai sus facut de askhanar (P.S , al tau nu merge deloc .)

1 ) Cand dau /nc imi apare doar un mesaj Ai activat noclip si daca scriu iar nu zice : Ai dezactivat noclip zice tot activat .
2 ) Cand dau /gm imi apare doar un mesaj Ai activat godmode si daca scriu iar nu zice : Ai dezactivat godmode zice tot activat .
3 ) Acest plugin cand scriu /train ii muta pe toti la TERO imi puteti face sa-i bage pe toti la CT ?
4 ) Cand cineva scrie in chat /cp (Sa apara un mesaj tot in chat "[DR] Checkpoint #1 creeat !" , la al doilea checkpoint "[DR] Checkpoint #2 creeat")
5 ) Cand cineva scrie in chat /tp (Sa apara in chat un mesaj "[DR] Te-am teleportat la checkpoint-ul anterior !")
Server: HNS.CSBLACKDEVIL.COM
Mod: 500 GRAVITY + LVLMODE !
Owner : RoL

Multe altele pe server ! Ajuta-ma sa-l populez ..
http://www.extreamcs.com/forum/mesaj166 ... o_id=46686
User avatar
-Turbo-
Membru, skill +4
Membru, skill +4
Posts: 1664
Joined: 11 Nov 2012, 01:28
Detinator Steam: Da
CS Status: Bored !
Detinator server CS: Da
SteamID: kingforbidden
Reputatie: Utilizator neserios ( tepar )
Restrictie moderator
Ban scos ( achitat )
Nume anterior: Turbo19973
Location: Botosani
Has thanked: 49 times
Been thanked: 212 times

16 Aug 2013, 19:25

Scuza-ma dar asta ma depaseste complet, astepta sa te ajute cineva cu mai multa experienta cum ar fi ask,kronos,rainq,cry si alti :)
User avatar
Ulquiorra
Fost moderator
Fost moderator
Posts: 2053
Joined: 25 Jul 2010, 17:29
Detinator Steam: Da
CS Status: A mai trecut o zi asteptand una mai buna
Detinator server CS: Retras.
SteamID: STEAM_0:1:318247XX
Reputatie: Fost Scripter eXtreamCS
Fost Moderator ajutator
Nick anterior: Askhanar
Location: Braila, Romania.
Has thanked: 215 times
Been thanked: 1132 times

16 Aug 2013, 20:54

| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <fun>
#include <ColorChat>

#define PLUGIN "Hine'N'Seek Training Sistem "
#define VERSION "1.0"
#define AUTHOR "sPuf ?"

new humans_join_team;
new mp_autoteambalance;
new mp_limitteams;
new mp_roundtime;
new mp_timelimit;

new bool:TrainOn = false;
new hnst_checkpoints[33];
new hnst_gochecks[33];

new Float:hnst_lastcp[33][3];
new Float:hnst_prelastcp[33][3];

new bool:g_bGM[ 33 ];
new bool:g_bNC[ 33 ];

new bool:hook[33];
new hook_to[33][3];

/*================================================================================================*/
public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_clcmd("say /train","sayTrain");
	register_clcmd("say /hns","sayHns");
	
	RegisterHam(Ham_Spawn, "player", "hamSpawnPlayer_Post", 1 );
	
	register_clcmd("say /cp", "cmdCP");
	register_clcmd("cp", "cmdCP");
	register_clcmd("say /tp","cmdTele");
	register_clcmd("tp","cmdTele");
	register_clcmd("say /gm","ClCmdSayGodMode");
	register_clcmd("say /nc","ClCmdSayNoClip");
	register_concmd("+hook","hook_on");
	register_concmd("-hook","hook_off");
	
	//Cvar Pointers
	humans_join_team = get_cvar_pointer("humans_join_team");
	mp_autoteambalance = get_cvar_pointer("mp_autoteambalance");
	mp_limitteams = get_cvar_pointer("mp_limitteams");
	mp_roundtime = get_cvar_pointer("mp_roundtime");
	mp_timelimit = get_cvar_pointer("mp_timelimit");

}

//m-am inspirat din tutorialul lui Askhanar despre godmode si noclip :D : pluginuri-cs/modulul-fun-t207269.html

public ClCmdSayGodMode( id )
{
	if( !TrainOn )
	{
		ColorChat( id, RED, "^x04[DR]^x01 Modul^x03 TRAIN^x01 nu este activ!" );
		return PLUGIN_HANDLED;
	}
	
	if( g_bGM[ id ] )
	{
	
		g_bGM[ id ] = false;
		set_user_godmode( id, 0 );
		ColorChat(id ,RED, "^x04[DR]^x01 Ai dezactivat^x03 godmode^x01!" );
	}
	else
	{
		g_bGM[ id ] = true;
		set_user_godmode( id, 1 );
		ColorChat(id ,RED, "^x04[DR]^x01 Ai activat^x03 godmode^x01!" );
	
	}
	
	return PLUGIN_HANDLED;

}

public ClCmdSayNoClip ( id )
{
	if( !TrainOn )
	{
		ColorChat( id, RED, "^x04[DR]^x01 Modul^x03 TRAIN^x01 nu este activ!" );
		return PLUGIN_HANDLED;
	}
	
	if( g_bNC[ id ] )
	{
	
		g_bNC[ id ] = false;
		set_user_noclip( id, 0 );
		ColorChat(id ,RED, "^x04[DR]^x01 Ai dezactivat^x03 noclip^x01!" );
	}
	else
	{
		g_bNC[ id ] = true;
		set_user_noclip( id, 1 );
		ColorChat(id ,RED, "^x04[DR]^x01 Ai activat^x03 noclip^x01!" );
	}
	
	return PLUGIN_HANDLED;

}

public hook_on(id)
{		
	if( !TrainOn || hook[id])
	{
		return PLUGIN_HANDLED;
	}
	
	set_pev(id, pev_gravity, 0.0);
	set_task(0.1,"hook_prethink",id+10000,"",0,"b");
	
	hook[id]=true;
	hook_to[id][0]=999999;
	hook_prethink(id+10000);
	return PLUGIN_HANDLED;
}
public hook_off(id)
{
	
	set_pev(id, pev_gravity, 1.0);
	hook[id] = false;
	return PLUGIN_HANDLED;
}

public hook_prethink(id)
{
	id -= 10000;
	
	if(!is_user_alive(id))
	{
		hook[id]=false;
	}
	
	if(!hook[id])
	{
		remove_task(id+10000);
		return PLUGIN_HANDLED;
	}


	static origin1[3];
	new Float:origin[3];
	get_user_origin(id,origin1);
	pev(id, pev_origin, origin);

	if(hook_to[id][0]==999999)
	{
		static origin2[3];
		get_user_origin(id,origin2,3);
		hook_to[id][0]=origin2[0];
		hook_to[id][1]=origin2[1];
		hook_to[id][2]=origin2[2];
	}

	//Calculate Velocity
	static Float:velocity[3];
	velocity[0] = (float(hook_to[id][0]) - float(origin1[0])) * 3.0;
	velocity[1] = (float(hook_to[id][1]) - float(origin1[1])) * 3.0;
	velocity[2] = (float(hook_to[id][2]) - float(origin1[2])) * 3.0;

	static Float:y;
	y = velocity[0]*velocity[0] + velocity[1]*velocity[1] + velocity[2]*velocity[2];

	static Float:x;
	x = (900.0) / floatsqroot(y);

	velocity[0] *= x;
	velocity[1] *= x;
	velocity[2] *= x;

	set_velo(id,velocity);

	return PLUGIN_CONTINUE;
}

public set_velo(id,Float:velocity[3])
{
	return set_pev(id,pev_velocity,velocity);
}

public sayTrain( id )
{
	if( user_has_access( id ) )
	{
		new name[32];
		get_user_name(id, name,31);
		ColorChat(0,RED,"^x04[DR]^x01 Modul train a fost pornit de catre adminul ^x03%s^x01.Credite lui^x04 fuzy^x01 !",name);

		TrainOn = true;
		set_pcvar_string(humans_join_team, "ct");
		set_pcvar_num(mp_autoteambalance, 0);
		set_pcvar_num(mp_limitteams, 0);
		set_pcvar_num(mp_timelimit, 0);
		set_pcvar_num(mp_roundtime, 9);
		MovePlayers( );
	}
}
public MovePlayers( )
{
	new Players[32];
	new PlayersNum, plr;
	get_players(Players, PlayersNum, "c");	
	for(new i=0; i<PlayersNum; i++) {
		plr = Players;
		cs_set_user_team( plr, CS_TEAM_CT );
		ExecuteHamB(Ham_CS_RoundRespawn, plr);
	}
}
public hamSpawnPlayer_Post( id )
{
	if(is_user_alive( id ) )
	{
		if(TrainOn)
		{
			if( g_bGM[ id ] )
			{
			
				g_bGM[ id ] = false;
				set_user_godmode( id, 0 );
				
			}
			else
			{
				g_bGM[ id ] = true;
				set_user_godmode( id, 1 );
			}
			
			if( g_bNC[ id ] )
			{
			
				g_bNC[ id ] = false;
				set_user_noclip( id, 0 );
				
			}
			else
			{
				g_bNC[ id ] = true;
				set_user_noclip( id, 1 );
			
			}
		}

		else
		{
			set_user_godmode( id, 0);
		}
	}
}

public sayHns( id )
{
	if( user_has_access( id ) )
	{
		TrainOn = false;
		new name[32];
		get_user_name(id, name,31);
		ColorChat(0,RED,"^x04[DR]^x01 Modul train a fost oprit de catre adminul ^x03%s^x01 !",name);

		set_pcvar_string(humans_join_team, "any");
		set_pcvar_num(mp_autoteambalance, 1);
		set_pcvar_num(mp_limitteams, 3);
		set_pcvar_num(mp_timelimit, 30);
		set_pcvar_num(mp_roundtime, 3);
		set_task(10.0,"SecondRR");
		server_cmd("sv_restart 10");
	}
}
public SecondRR( )
{
	server_cmd("sv_restart 1");	
	set_task(1.0,"ThirdRR");
}

public ThirdRR( )
{
	server_cmd("sv_restart 1");	
}
	
stock bool:user_has_access( id )
{
	if( get_user_flags( id ) & ADMIN_CVAR )
		return true;
		
	return false;
}

public cmdCP(id)
{
	if(TrainOn)
	{
		
		if(is_user_alive(id))
		{

			if( hnst_checkpoints[id] == 0 )
			{
				pev(id, pev_origin, hnst_lastcp[id])
			}
			else
			{
				hnst_prelastcp[id] = hnst_lastcp[id]
				pev(id, pev_origin, hnst_lastcp[id])
			}
			hnst_checkpoints[id]++
			
		}
		
		ColorChat( id, RED, "^x04[DR]^x01 Checkpoint #%i creat!", hnst_checkpoints[ id ] );
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}

public cmdTele(id)
{
	if(TrainOn)
	{	
		if(!is_user_alive(id))
		{
			return PLUGIN_HANDLED;
		}

		if( hnst_checkpoints[id] != 0 )
		{
			set_pev(id, pev_velocity, Float:{0.0, 0.0, 0.0})
			set_pev(id, pev_origin, hnst_lastcp[id])
			hnst_gochecks[id]++
			fm_set_entity_flags(id, FL_DUCKING, 1);
		}
		ColorChat( id, RED,  "^x04[DR]^x01 Te-am teleportat la checkpoint-ul anterior!" );
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}


public cmdStuck(id)
{
	if( !TrainOn )
		return 1

	if(!is_user_alive(id))
	{
			return 1;
	}

	set_pev(id, pev_velocity, Float:{0.0, 0.0, 0.0})
	set_pev(id, pev_origin, hnst_prelastcp[id])
	
	// Add a GoCheck because player can use this for bugs GoChecks
	hnst_gochecks[id]++
	ColorChat( id, RED,  "^x04[DR]^x01 Checkpoint STERS!" );
	
	fm_set_entity_flags(id, FL_DUCKING, 1);
	
	return 1;
}

public force_duck(id)
{
	id -= 111222;
	fm_set_entity_flags(id, FL_DUCKING, 1);
}


stock fm_set_entity_flags(index, flag, onoff) 
{
	new flags = pev(index, pev_flags);
	if ((flags & flag) > 0)
		return onoff == 1 ? 2 : 1 + 0 * set_pev(index, pev_flags, flags - flag);
	else
		return onoff == 0 ? 2 : 1 + 0 * set_pev(index, pev_flags, flags + flag);

	return 0;
}

public plugin_end( )
{
	set_pcvar_string(humans_join_team, "any");
	set_pcvar_num(mp_autoteambalance, 1);
	set_pcvar_num(mp_limitteams, 3);
	set_pcvar_num(mp_timelimit, 30);
	set_pcvar_num(mp_roundtime, 3);
}
Caut o persoana dedicata care se pricepe si stie ce face.
Vreau sa creeze si sa se ocupe de administrarea unui server de MU, da e vorba de vechiul joc..ma gandesc undeva la un season 3 ep1/2.

O sa achizitionez un domeniu .ro.
Totodata sponsorizez absolut orice este necesar.
Ma puteti contacta prin: http://solo.to/stfrzv
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 46 guests