Modificare Plugin

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
Zpp.Mihai94
Membru, skill 0
Membru, skill 0
Posts: 95
Joined: 05 Feb 2018, 13:03
Detinator Steam: Da
CS Status: ZMXP
Detinator server CS: ZMXP.WESTCSTRIKE.RO
Fond eXtream: 0
Has thanked: 4 times
Been thanked: 1 time
Contact:

04 Dec 2022, 09:48

va salut, am acest plugin de dat viata la playeri el functioneaza perfect se poate acorda viata numai ca are o problema la adminii care au imunitate nu pot da viata, se poate scoate treaba asta?

SMA:
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <zombie_plague_special>

new g_iMsgId_Health;
new g_logfile[64];

public plugin_init( ) {
register_plugin( "ZP Viata", "0.1", "Exolent" );
	
register_concmd( "amx_viata", "CmdGive", ADMIN_IMMUNITY, "<NUME> <VIATA>" );
	
g_iMsgId_Health = get_user_msgid( "Health" );

get_time( "addons/amxmodx/logs/credite_nivel/viata_%Y%m%d.log", g_logfile, charsmax ( g_logfile ) );
}

public CmdGive( client, iLevel, iCId ) {
if( !cmd_access( client, iLevel, iCId, 3 ) ) {
return PLUGIN_HANDLED;
}
	
static szArg[ 35 ];
read_argv( 1, szArg, 34 );
	
new iPlayer = cmd_target( client, szArg, 13 );
if( !iPlayer ) {
return PLUGIN_HANDLED;
}
	
read_argv( 2, szArg, 5 );

new szText[ 164 ];
new iAmount = str_to_num( szArg );
if( iAmount <= 0 ) {
console_print( client, "Suma de HP trebuie sa fie mai mare decat 0!" );
return PLUGIN_HANDLED;
}
	
SetHealth( iPlayer, get_user_health( iPlayer ) + iAmount );
	
static szNames[ 2 ][ 32 ], szAuthids[ 2 ][ 35 ];
get_user_name( client, szNames[ 0 ], 31 );
get_user_authid( client, szAuthids[ 0 ], 34 );
get_user_name( iPlayer, szNames[ 1 ], 31 );
get_user_authid( iPlayer, szAuthids[ 1 ], 34 );
	
show_activity( client, szNames[ 0 ], "Ai dat %i viata lui %s.", iAmount, szNames[ 1 ] );
formatex( szText, charsmax( szText ),"[ZP VIATA] Admin %s a setat viata de %i lui %s.", szNames, iAmount, szAuthids );
	
log_amx( "%s<%s> gave %i health to %s<%s>", szNames[ 0 ], szAuthids[ 0 ], iAmount, szNames[ 1 ], szAuthids[ 1 ] );
log_to_file( g_logfile, szText );
	
return PLUGIN_HANDLED;
} 
stock SetHealth( client, iHealth ) {
if( iHealth <= 0 ) {
user_kill( client );
}
else
{
set_user_health( client, iHealth );
		
emessage_begin( MSG_ONE_UNRELIABLE, g_iMsgId_Health, _, client );
ewrite_byte( iHealth );
emessage_end( );
}
}
RoyalServer
Zpp.Mihai94
Membru, skill 0
Membru, skill 0
Posts: 95
Joined: 05 Feb 2018, 13:03
Detinator Steam: Da
CS Status: ZMXP
Detinator server CS: ZMXP.WESTCSTRIKE.RO
Fond eXtream: 0
Has thanked: 4 times
Been thanked: 1 time
Contact:

18 Dec 2022, 10:38

Rezolvat T/C
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests