Plugin Regenerator HP

Pluginuri pentru modul AmxModX.

Moderators: Moderatori ajutatori, Moderatori

Post Reply
User avatar
Truth*
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 776
Joined: 11 Oct 2013, 10:08
Detinator Steam: Da
SteamID: Ezeru
Reputatie: Moderator ajutator
Membru Club eXtreamCS (4 luni)
Nume anterior: HyperioN.
Scripter eXtreamCS
0.2 / 3
Fond eXtream: 0
Location: Sibiu
Has thanked: 46 times
Been thanked: 123 times
Contact:

24 Jun 2014, 15:02

Descriere: Acesta este un system de regenerare HP ce poate fi modificat usor dupa dorinta voastra si poate fi adaugat in shop-uri etc. Pluginul acesta iti returneaza o valuare selectata de voi prin cvar intr-un anumit timp selectat tot de voi prin cvar. In momentul in care ti se va returna viata vei primi un mesaj in HUD sus "[REGENERATOR HP] +5HP" si ti se va face ecranul cu culoarea selectata si iti va tremura.

SURSA :

Code: Select all

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta_util>
#include <hamsandwich>

#define PLUGIN "[System Regeneration]"
#define VERSION "1.1"

#define VIP_FLAGS	ADMIN_LEVEL_H

new bool:HasRegenerator[ 33 ];


new cvar_hp, cvar_max_hp, cvar_time, cvar_color, cvar_vip;

public plugin_init() {
	register_plugin(PLUGIN, VERSION, "HyperioN.")
	
	cvar_hp = register_cvar("regeneration_hp", "5");
	cvar_max_hp = register_cvar("regeneration_maxhp", "110");
	cvar_time = register_cvar("regeneration_time", "3.0");
	cvar_color = register_cvar("regeneration_color_screen", "2");
	cvar_vip = register_cvar("regeneration_vip", "0");
	
	RegisterHam( Ham_Spawn, "player", "SpawnCMD", true );
	// Add your code here...
}

public SpawnCMD ( id )
	{
	HasRegenerator[ id ] = false;
	if ( is_user_alive ( id ) ) {
		
		
		if( get_pcvar_num ( cvar_vip ) ) {
			
			if ( get_user_flags ( id ) & VIP_FLAGS )
				{
				CMDRegenerare ( id );
			}
			
			
		}
		
		else
		CMDRegenerare ( id );
		
	}
}

public CMDRegenerare ( id )
	{
	
	if( is_user_alive(id))
		{
		if( HasRegenerator[ id ])
			{
			new iHealth = get_user_health(id);
			
			if( iHealth < get_pcvar_num( cvar_max_hp ) )
				{
				
				switch ( get_pcvar_num( cvar_color ) ) {
					
					case 0: {
						
						
						FadeScreen ( id, 2.0, 0, 0, 255, 100 );
						ShakeScreen ( id, 2.0 );
						set_hudmessage(0, 255, 0, -1.0, 0.00, 0, 6.0, 2.0)
						show_hudmessage(id, "[REGENERATOR HP]^n + %dHP", get_pcvar_num( cvar_hp))
						fm_set_user_health(id, iHealth + get_pcvar_num( cvar_hp ));
						
					}
					
					case 1: {
						
						switch ( get_user_team ( id ) ) {
							
							case 1:
							{
								
								
								FadeScreen ( id, 2.0, 255, 0, 0, 100 );
								ShakeScreen ( id, 2.0 );
								set_hudmessage(0, 255, 0, -1.0, 0.00, 0, 6.0, 2.0)
								show_hudmessage(id, "[REGENERATOR HP]^n + %dHP", get_pcvar_num( cvar_hp))
								fm_set_user_health(id, iHealth + get_pcvar_num( cvar_hp ));
								
								
							}
							
							
							case 2:
							{
								
								FadeScreen ( id, 2.0, 0, 0, 255, 100 );
								ShakeScreen ( id, 2.0 );
								set_hudmessage(0, 255, 0, -1.0, 0.00, 0, 6.0, 2.0)
								show_hudmessage(id, "[REGENERATOR HP]^n + %dHP", get_pcvar_num( cvar_hp))
								fm_set_user_health(id, iHealth + get_pcvar_num( cvar_hp ));
								
							}
							
							
						}
					}
					case 2: {
						
						
						FadeScreen ( id, 2.0, 0, 255, 0, 100 );
						ShakeScreen ( id, 2.0 );
						set_hudmessage(0, 255, 0, -1.0, 0.00, 0, 6.0, 2.0)
						show_hudmessage(id, "[REGENERATOR HP]^n + %dHP", get_pcvar_num( cvar_hp))
						fm_set_user_health(id, iHealth + get_pcvar_num( cvar_hp ));
						
					}
				}
			}
			
			set_task( float(get_pcvar_num(cvar_time)), "CMDRegenerare", id);
		}
		else
		{
			HasRegenerator[ id ] = true;
			set_task( float(get_pcvar_num(cvar_time)), "CMDRegenerare", id);
		}
	}
}

public ShakeScreen( id, const Float:seconds )
	{
	message_begin( MSG_ONE, get_user_msgid( "ScreenShake" ), { 0, 0, 0 }, id );
	write_short( floatround( 4096.0 * seconds, floatround_round ) );
	write_short( floatround( 4096.0 * seconds, floatround_round ) );
	write_short( 1<<13 );
	message_end( );
	
}

public FadeScreen( id, const Float:seconds, const redd, const greenn, const bluee, const alpha )
	{      
	message_begin( MSG_ONE, get_user_msgid( "ScreenFade" ), _, id );
	write_short( floatround( 4096.0 * seconds, floatround_round ) );
	write_short( floatround( 4096.0 * seconds, floatround_round ) );
	write_short( 0x0000 );
	write_byte( redd );
	write_byte( greenn );
	write_byte( bluee );
	write_byte( alpha );
	message_end( );
	
}
Nume: [System Regeneration]
Versiune: 1.1
Link oficial: http://www.extreamcs.com/forum/amxmodx/ ... 42901.html

Instalare:
1. Fisierul regenerator_hp.sma il puneti in addons/amxmodx/scripting
2. Fisierul regenerator_hp.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:

Code: Select all

regenerator_hp.amxx
Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
  • regeneration_hp 5 - Seteaza cata viata sa dea la timpul setat de tine.
    regeneration_maxhp 110 - Seteaza cat de multa viata sa regenereze.
    regeneration_time 3.0 - Seteaza timpul la care se va regenera viata. ( Valoarea trebuie setata in felul urmator 5.0 sau 10.0. Deci dupa numarul de secunde trbuie neaparat sa aiba".0" )
    regeneration_color_screen 0 -Selecteaza culoarea ecranului. 0 ( Culoarea Albastra ) | 1 ( Culoarea Echipei. Rosu Pentru Teroristi si Albastru pentru Counter-Teroristi ) | 2 ( Culoarea Verde )
    regeneration_vip 0 -Seteaza accesul celor care folosesc regeneratorul. 0 ( Toti Playeri ) | 1 ( Cei cu flagul "t" )
Comenzi administrative (se tasteaza in consola si trebuie sa fiti administrator):
  • -
Comenzi publice (se tasteaza in joc prin apasarea tastei Y):
  • -


Imagini:
Imagine cu Cvarul de culoare setat pe 0 | Afiseaza codul
[img]
http://www11.zippyshare.com/scaled/94805719/file.html
[/img]
Imagine cu Cvarul de culoare setat pe 1 | Afiseaza codul
[img]
http://www11.zippyshare.com/scaled/94805719/file.html
[/img]
[img]
http://www11.zippyshare.com/scaled/32317870/file.html
[/img]
Imagine cu Cvarul de culoare setat pe 2 | Afiseaza codul
[img]
http://www11.zippyshare.com/scaled/34155210/file.html
[/img]
Last edited by Alexeey on 21 Jul 2016, 20:03, edited 1 time in total.
Reason: Am sters link-ul de descarcare deoarece era invalid si am pus sursa in code
P.S.: Netestat = Nu am avut timp să mă uit atent peste cod. Deci ceea ce am scris este posibil să fie greşit sau să aibă erori.

If i helped you and you wanna thank me, you can donate at this link : here
This will motivate me to help you in the future.
[If you want a private plugin send me a PM.(No complex plugins please, I am a student and I don't have the time to make those)]
IG-BOOST.org - Instagram Followers Best, Cheap, Reliable
dxnRESPAWN
Membru, skill 0
Membru, skill 0
Posts: 1
Joined: 22 Jul 2015, 17:00
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

28 Jul 2015, 11:29

Pune alt link de descarcare, cel actual nu mai este valabil.
smileye
Fost moderator
Fost moderator
Posts: 4665
Joined: 12 Jun 2012, 14:18
Detinator Steam: Da
Reputatie: Fost moderator
Has thanked: 258 times
Been thanked: 38 times
Contact:

30 Jul 2015, 20:16

| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta_util>
#include <hamsandwich>

#define PLUGIN "[System Regeneration]"
#define VERSION "1.1"

#define VIP_FLAGS	ADMIN_LEVEL_H

new bool:HasRegenerator[ 33 ];


new cvar_hp, cvar_max_hp, cvar_time, cvar_color, cvar_vip;

public plugin_init() {
	register_plugin(PLUGIN, VERSION, "HyperioN.")
	
	cvar_hp = register_cvar("regeneration_hp", "5");
	cvar_max_hp = register_cvar("regeneration_maxhp", "110");
	cvar_time = register_cvar("regeneration_time", "3.0");
	cvar_color = register_cvar("regeneration_color_screen", "2");
	cvar_vip = register_cvar("regeneration_vip", "0");
	
	RegisterHam( Ham_Spawn, "player", "SpawnCMD", true );
	// Add your code here...
}

public SpawnCMD ( id )
	{
	HasRegenerator[ id ] = false;
	if ( is_user_alive ( id ) ) {
		
		
		if( get_pcvar_num ( cvar_vip ) ) {
			
			if ( get_user_flags ( id ) & VIP_FLAGS )
				{
				CMDRegenerare ( id );
			}
			
			
		}
		
		else
		CMDRegenerare ( id );
		
	}
}

public CMDRegenerare ( id )
	{
	
	if( is_user_alive(id))
		{
		if( HasRegenerator[ id ])
			{
			new iHealth = get_user_health(id);
			
			if( iHealth < get_pcvar_num( cvar_max_hp ) )
				{
				
				switch ( get_pcvar_num( cvar_color ) ) {
					
					case 0: {
						
						
						FadeScreen ( id, 2.0, 0, 0, 255, 100 );
						ShakeScreen ( id, 2.0 );
						set_hudmessage(0, 255, 0, -1.0, 0.00, 0, 6.0, 2.0)
						show_hudmessage(id, "[REGENERATOR HP]^n + %dHP", get_pcvar_num( cvar_hp))
						fm_set_user_health(id, iHealth + get_pcvar_num( cvar_hp ));
						
					}
					
					case 1: {
						
						switch ( get_user_team ( id ) ) {
							
							case 1:
							{
								
								
								FadeScreen ( id, 2.0, 255, 0, 0, 100 );
								ShakeScreen ( id, 2.0 );
								set_hudmessage(0, 255, 0, -1.0, 0.00, 0, 6.0, 2.0)
								show_hudmessage(id, "[REGENERATOR HP]^n + %dHP", get_pcvar_num( cvar_hp))
								fm_set_user_health(id, iHealth + get_pcvar_num( cvar_hp ));
								
								
							}
							
							
							case 2:
							{
								
								FadeScreen ( id, 2.0, 0, 0, 255, 100 );
								ShakeScreen ( id, 2.0 );
								set_hudmessage(0, 255, 0, -1.0, 0.00, 0, 6.0, 2.0)
								show_hudmessage(id, "[REGENERATOR HP]^n + %dHP", get_pcvar_num( cvar_hp))
								fm_set_user_health(id, iHealth + get_pcvar_num( cvar_hp ));
								
							}
							
							
						}
					}
					case 2: {
						
						
						FadeScreen ( id, 2.0, 0, 255, 0, 100 );
						ShakeScreen ( id, 2.0 );
						set_hudmessage(0, 255, 0, -1.0, 0.00, 0, 6.0, 2.0)
						show_hudmessage(id, "[REGENERATOR HP]^n + %dHP", get_pcvar_num( cvar_hp))
						fm_set_user_health(id, iHealth + get_pcvar_num( cvar_hp ));
						
					}
				}
			}
			
			set_task( float(get_pcvar_num(cvar_time)), "CMDRegenerare", id);
		}
		else
		{
			HasRegenerator[ id ] = true;
			set_task( float(get_pcvar_num(cvar_time)), "CMDRegenerare", id);
		}
	}
}

public ShakeScreen( id, const Float:seconds )
	{
	message_begin( MSG_ONE, get_user_msgid( "ScreenShake" ), { 0, 0, 0 }, id );
	write_short( floatround( 4096.0 * seconds, floatround_round ) );
	write_short( floatround( 4096.0 * seconds, floatround_round ) );
	write_short( 1<<13 );
	message_end( );
	
}

public FadeScreen( id, const Float:seconds, const redd, const greenn, const bluee, const alpha )
	{      
	message_begin( MSG_ONE, get_user_msgid( "ScreenFade" ), _, id );
	write_short( floatround( 4096.0 * seconds, floatround_round ) );
	write_short( floatround( 4096.0 * seconds, floatround_round ) );
	write_short( 0x0000 );
	write_byte( redd );
	write_byte( greenn );
	write_byte( bluee );
	write_byte( alpha );
	message_end( );
	
}
User avatar
NME
Membru, skill 0
Membru, skill 0
Posts: 13
Joined: 13 Jul 2018, 15:12
Detinator Steam: Da
CS Status: Mai bine lasa, fa-te ca nu-ti pasa !
Reputatie: Nume anterior: alex-utz
Fond eXtream: 0
Location: Bucuresti
Contact:

22 Mar 2019, 20:07

Buna seara, exista posibilitatea de a scoate Culoarea si Tremuratul din acest plugin? L-as dori simplu doar regen-ul pentru un server Classic.
Ma puteti ajuta cu asta ? Multumesc.
Post Reply

Return to “AmxModX”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests