Page 1 of 1

Plugin cumpara antiflash.

Posted: 10 Jan 2019, 19:51
by NemeSyS17
Plugin Cerut: Cumparare antiflash
Descriere (adica ce face el mai exact): As vrea cand playeruls crie "/af" "/antiflash" sa cumpere anti flash care sa fie activ pana cand playerul maore! , si pluginul sa aibe niste mesaje in chat care le las mai jos !
1 - "Ai prea putini bani pentru a cumpara ANTI-FLASH , iti trebuie 6000$"
2 - "Ai cumparat ANTI-FLASH, vei fi protejat de anti flash pana ce vei murii."
Serverul ruleaza (HLDS/ReHLDS): ReHLDS
Versiune AMX Mod X: nu stiu , daca imi spuneti cum sa aflu , va spun
Modul Serverului: Furien!

Re: Plugin cumpara antiflash.

Posted: 10 Jan 2019, 20:12
by levin
| Afiseaza codul
[code]
#include <amxmodx> 
#include <fakemeta>  
#include <hamsandwich> 
#include <cstrike>

#pragma tabsize 0

const PEV_NADE_TYPE = pev_flTimeStepSound 
const NADE_TYPE_FLASH = 3333 

new g_msgid_ScreenFade 
new g_PlayerFlasher 

new bool:af[33]

public plugin_init() 
{ 
    register_plugin("AntiFlash FINAL VIP", "5.0", "Leo_[BH]") 
     
    g_msgid_ScreenFade = get_user_msgid("ScreenFade") 

    register_message(g_msgid_ScreenFade, "message_screenfade"); 

    register_forward(FM_SetModel, "fw_SetModel") 
    RegisterHam(Ham_Think, "grenade", "fw_ThinkGrenade") 


register_clcmd("say /af","BuyAF")
register_clcmd("say /antiflash","BuyAF")
register_clcmd("say_team /af","BuyAF")
register_clcmd("say_team /antiflash","BuyAF")

RegisterHam(Ham_Killed, "player", "fwd_Ham_Killed_post", 1)
} 

public fwd_Ham_Killed_post(victim,attacker)	if(af[victim])	af[victim]=false

public BuyAF(id)
{
	if(!is_user_alive(id)||af[id])	return PLUGIN_HANDLED

	if(cs_get_user_money(id)<6000)
	{
		client_print(id,print_chat,"Ai prea putini bani pentru a cumpara ANTI-FLASH , iti trebuie 6000$")
		return PLUGIN_HANDLED
	}

	client_print(id,print_chat,"Ai cumparat ANTI-FLASH, vei fi protejat de anti flash pana ce vei murii.")

	cs_set_user_money(id,cs_get_user_money(id)-6000,1)

	af[id]=true

	return PLUGIN_CONTINUE
}

public message_screenfade(msg_id, msg_dest, id)
{
     
    if (id != g_PlayerFlasher && get_user_team(id) == get_user_team(g_PlayerFlasher) || af[id]) { 
            return PLUGIN_HANDLED; 
    } 

    new iRed,iGreen,iBlue
    switch(get_cvar_num("amx_fb_mode"))    {
        case 1: {
            iRed =   get_cvar_num("amx_fb_r")
            iGreen = get_cvar_num("amx_fb_g")
            iBlue =  get_cvar_num("amx_fb_b")
        }
        case 2:    {
            iRed =   random_num(0,255)
            iGreen = random_num(0,255)
            iBlue =  random_num(0,255)
        }
    }
    if ( !( iRed ) || !( iGreen) || !( iBlue ) ) {
        iRed =   100
        iGreen = 100
        iBlue =  100
    }

    set_msg_arg_int(4, get_msg_argtype(4), iRed)
    set_msg_arg_int(5, get_msg_argtype(5), iGreen)
    set_msg_arg_int(6, get_msg_argtype(6), iBlue)

    return PLUGIN_CONTINUE
} 

public fw_SetModel(entity, szModel[])  
{ 
    if(!equal(szModel, "models/w_flashbang.mdl"))  
        return FMRES_IGNORED; 
     
    set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_FLASH) 

    return FMRES_IGNORED; 
}  

public fw_ThinkGrenade(entity) 
{ 
    if (!pev_valid(entity)) return HAM_IGNORED; 
     
    static Float:dmgtime 
    pev(entity, pev_dmgtime, dmgtime) 
     
    if (dmgtime > get_gametime()) 
        return HAM_IGNORED; 
     
    switch (pev(entity, PEV_NADE_TYPE)) 
    { 
        case NADE_TYPE_FLASH: // Flash Grenade 
        { 
            g_PlayerFlasher = pev(entity, pev_owner) 
            return HAM_IGNORED; 
        } 
    } 
     
    return HAM_IGNORED; 
}  
[/code]

Re: Plugin cumpara antiflash.

Posted: 10 Jan 2019, 21:05
by NemeSyS17
Nu functioneaza! doar schimba culoarea la flash ... in una gri , nici mesajele chat !

Re: Plugin cumpara antiflash.

Posted: 10 Jan 2019, 21:23
by levin
ciudat
vezi ăsta
| Afiseaza codul
[code]
#include < amxmodx >
#include <cstrike>
#include < hamsandwich >

#pragma tabsize 0

new const 
PLUGIN_VERSION[ ] = "1.4",
PLUGIN_AUTHOR[ ] = "YONTU",
PLUGIN_NAME[ ] = "[Bio] Addon: VIP System";

new bool:af[33]

public plugin_init( ) {
	
	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
	
	register_message( get_user_msgid( "ScreenFade" ), "MessageScreenFade" );


register_clcmd("say /af","BuyAF")
register_clcmd("say /antiflash","BuyAF")
register_clcmd("say_team /af","BuyAF")
register_clcmd("say_team /antiflash","BuyAF")

RegisterHam(Ham_Killed, "player", "fwd_Ham_Killed_post", 1)
} 

public fwd_Ham_Killed_post(victim,attacker)   if(af[victim])   af[victim]=false

public BuyAF(id)
{
   if(!is_user_alive(id)||af[id])   return PLUGIN_HANDLED

   if(cs_get_user_money(id)<6000)
   {
      client_print(id,print_chat,"Ai prea putini bani pentru a cumpara ANTI-FLASH , iti trebuie 6000$")
      return PLUGIN_HANDLED
   }

   client_print(id,print_chat,"Ai cumparat ANTI-FLASH, vei fi protejat de anti flash pana ce vei murii.")

   cs_set_user_money(id,cs_get_user_money(id)-6000,1)

   af[id]=true

   return PLUGIN_CONTINUE
}

public MessageScreenFade( iMsgId, iMsgDest, id ) {
	if( af[id] ) {
		if( is_user_alive( id ) )
			return 1;
			
			static szData[ 4 ];
			
			szData[ 0 ] = get_msg_arg_int( 4 );
			szData[ 1 ] = get_msg_arg_int( 5 );
			szData[ 2 ] = get_msg_arg_int( 6 );
			szData[ 3 ] = get_msg_arg_int( 7 );
			
			if( szData[ 0 ] == 255 && szData[ 1 ] == 255 && szData[ 2 ] == 255 && szData[ 3] > 199 )
				return 1;
	}
		return 0;
}
[/code]

Re: Plugin cumpara antiflash.

Posted: 11 Jan 2019, 21:37
by NemeSyS17
Adryyy wrote:ciudat
vezi ăsta
| Afiseaza codul
[code]
#include < amxmodx >
#include <cstrike>
#include < hamsandwich >

#pragma tabsize 0

new const 
PLUGIN_VERSION[ ] = "1.4",
PLUGIN_AUTHOR[ ] = "YONTU",
PLUGIN_NAME[ ] = "[Bio] Addon: VIP System";

new bool:af[33]

public plugin_init( ) {
	
	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
	
	register_message( get_user_msgid( "ScreenFade" ), "MessageScreenFade" );


register_clcmd("say /af","BuyAF")
register_clcmd("say /antiflash","BuyAF")
register_clcmd("say_team /af","BuyAF")
register_clcmd("say_team /antiflash","BuyAF")

RegisterHam(Ham_Killed, "player", "fwd_Ham_Killed_post", 1)
} 

public fwd_Ham_Killed_post(victim,attacker)   if(af[victim])   af[victim]=false

public BuyAF(id)
{
   if(!is_user_alive(id)||af[id])   return PLUGIN_HANDLED

   if(cs_get_user_money(id)<6000)
   {
      client_print(id,print_chat,"Ai prea putini bani pentru a cumpara ANTI-FLASH , iti trebuie 6000$")
      return PLUGIN_HANDLED
   }

   client_print(id,print_chat,"Ai cumparat ANTI-FLASH, vei fi protejat de anti flash pana ce vei murii.")

   cs_set_user_money(id,cs_get_user_money(id)-6000,1)

   af[id]=true

   return PLUGIN_CONTINUE
}

public MessageScreenFade( iMsgId, iMsgDest, id ) {
	if( af[id] ) {
		if( is_user_alive( id ) )
			return 1;
			
			static szData[ 4 ];
			
			szData[ 0 ] = get_msg_arg_int( 4 );
			szData[ 1 ] = get_msg_arg_int( 5 );
			szData[ 2 ] = get_msg_arg_int( 6 );
			szData[ 3 ] = get_msg_arg_int( 7 );
			
			if( szData[ 0 ] == 255 && szData[ 1 ] == 255 && szData[ 2 ] == 255 && szData[ 3] > 199 )
				return 1;
	}
		return 0;
}
[/code]
, nu nici asta !

Re: Plugin cumpara antiflash.

Posted: 11 Jan 2019, 21:53
by WHOAMI?
NemeSyS17 wrote:
Adryyy wrote:ciudat
vezi ăsta
| Afiseaza codul
[code]
#include < amxmodx >
#include <cstrike>
#include < hamsandwich >

#pragma tabsize 0

new const 
PLUGIN_VERSION[ ] = "1.4",
PLUGIN_AUTHOR[ ] = "YONTU",
PLUGIN_NAME[ ] = "[Bio] Addon: VIP System";

new bool:af[33]

public plugin_init( ) {
	
	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
	
	register_message( get_user_msgid( "ScreenFade" ), "MessageScreenFade" );


register_clcmd("say /af","BuyAF")
register_clcmd("say /antiflash","BuyAF")
register_clcmd("say_team /af","BuyAF")
register_clcmd("say_team /antiflash","BuyAF")

RegisterHam(Ham_Killed, "player", "fwd_Ham_Killed_post", 1)
} 

public fwd_Ham_Killed_post(victim,attacker)   if(af[victim])   af[victim]=false

public BuyAF(id)
{
   if(!is_user_alive(id)||af[id])   return PLUGIN_HANDLED

   if(cs_get_user_money(id)<6000)
   {
      client_print(id,print_chat,"Ai prea putini bani pentru a cumpara ANTI-FLASH , iti trebuie 6000$")
      return PLUGIN_HANDLED
   }

   client_print(id,print_chat,"Ai cumparat ANTI-FLASH, vei fi protejat de anti flash pana ce vei murii.")

   cs_set_user_money(id,cs_get_user_money(id)-6000,1)

   af[id]=true

   return PLUGIN_CONTINUE
}

public MessageScreenFade( iMsgId, iMsgDest, id ) {
	if( af[id] ) {
		if( is_user_alive( id ) )
			return 1;
			
			static szData[ 4 ];
			
			szData[ 0 ] = get_msg_arg_int( 4 );
			szData[ 1 ] = get_msg_arg_int( 5 );
			szData[ 2 ] = get_msg_arg_int( 6 );
			szData[ 3 ] = get_msg_arg_int( 7 );
			
			if( szData[ 0 ] == 255 && szData[ 1 ] == 255 && szData[ 2 ] == 255 && szData[ 3] > 199 )
				return 1;
	}
		return 0;
}
[/code]
, nu nici asta !
amx_plugins in consola si vezi daca pluginul ruleaza , explica mai exact ce nu merge.

Re: Plugin cumpara antiflash.

Posted: 12 Jan 2019, 17:18
by NemeSyS17
cs_all wrote:
NemeSyS17 wrote:
Adryyy wrote:ciudat
vezi ăsta
| Afiseaza codul
[code]
#include < amxmodx >
#include <cstrike>
#include < hamsandwich >

#pragma tabsize 0

new const 
PLUGIN_VERSION[ ] = "1.4",
PLUGIN_AUTHOR[ ] = "YONTU",
PLUGIN_NAME[ ] = "[Bio] Addon: VIP System";

new bool:af[33]

public plugin_init( ) {
	
	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
	
	register_message( get_user_msgid( "ScreenFade" ), "MessageScreenFade" );


register_clcmd("say /af","BuyAF")
register_clcmd("say /antiflash","BuyAF")
register_clcmd("say_team /af","BuyAF")
register_clcmd("say_team /antiflash","BuyAF")

RegisterHam(Ham_Killed, "player", "fwd_Ham_Killed_post", 1)
} 

public fwd_Ham_Killed_post(victim,attacker)   if(af[victim])   af[victim]=false

public BuyAF(id)
{
   if(!is_user_alive(id)||af[id])   return PLUGIN_HANDLED

   if(cs_get_user_money(id)<6000)
   {
      client_print(id,print_chat,"Ai prea putini bani pentru a cumpara ANTI-FLASH , iti trebuie 6000$")
      return PLUGIN_HANDLED
   }

   client_print(id,print_chat,"Ai cumparat ANTI-FLASH, vei fi protejat de anti flash pana ce vei murii.")

   cs_set_user_money(id,cs_get_user_money(id)-6000,1)

   af[id]=true

   return PLUGIN_CONTINUE
}

public MessageScreenFade( iMsgId, iMsgDest, id ) {
	if( af[id] ) {
		if( is_user_alive( id ) )
			return 1;
			
			static szData[ 4 ];
			
			szData[ 0 ] = get_msg_arg_int( 4 );
			szData[ 1 ] = get_msg_arg_int( 5 );
			szData[ 2 ] = get_msg_arg_int( 6 );
			szData[ 3 ] = get_msg_arg_int( 7 );
			
			if( szData[ 0 ] == 255 && szData[ 1 ] == 255 && szData[ 2 ] == 255 && szData[ 3] > 199 )
				return 1;
	}
		return 0;
}
[/code]
, nu nici asta !
amx_plugins in consola si vezi daca pluginul ruleaza , explica mai exact ce nu merge.
da , nu ruleaza , arata unknow