Raised This Month: $51 Target: $400
 12% 

Revive 3 Times for Round


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 12-07-2011 , 14:58   Revive 3 Times for Round
Reply With Quote #1

I need add a cvar in this plugin, example: amx_revivetimes 3... The admin can revive 3 times per round.. Anynone can make this for me?

Thanks!

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <hamsandwich>

#define PLUGIN "Respawn Admin"
#define VERSION "1.0"
#define AUTHOR "krm"

new g_MsgSay

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_MsgSay get_user_msgid "SayText" )
    
    
register_clcmd("say /reviver""CmdNascer")
}

public 
CmdNascer(id)
{
    if(
get_user_flags(id) & ADMIN_IMMUNITY)
    {
        
set_task(0.1"CmdRevive"id)
        return 
PLUGIN_HANDLED
    
}
    else
    {
        
client_printc(id"!g[VIRUSBR] !nApenas !tAdmins !ntem acesso a este Comando!")
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED
}

public 
CmdRevive(id)
{
    if(!
is_user_alive(id))
    {
        
client_printc(id"!g[VIRUSBR] !nVoce sera !trenascido !nem !g3 !nSegundos!")
        
set_task(3.1"CmdResp"id)
        return 
PLUGIN_HANDLED
    
}
    else
    {
        
client_printc(id"!g[VIRUSBR] !nVoce precisa estar !tMorto !npara executar esta acao!")
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED
}


public 
CmdResp(id)
{
    
ExecuteHamBHam_CS_RoundRespawnid )
    return 
PLUGIN_HANDLED
}

stock client_printc ( const index, const input [ ], const any:... )
{
    new 
players 32 ]
    new 
count
    
new message 191 ]
    new 
i
    
    count 
1
    
    vformat 
message190input)
    
    
replace_all message190"!n""^1" )
    
replace_all message190"!t""^3" )
    
replace_all message190"!g""^4" )
    
    if ( 
index )
    {
        
players ] = index
    
}
    
    else
    {
        
get_players playerscount"ch" )
    }
    
    for ( 
0count++ )
    {
        if ( 
is_user_connected players ] ) )
        {
            
message_begin MSG_ONE_UNRELIABLEg_MsgSay_players ] )
            
write_byte players ] )
            
write_string message )
            
message_end ( )
        }
    }
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1046\\ f0\\ fs16 \n\\ par }
*/ 
__________________
kramesa is offline
daNzEt
Senior Member
Join Date: Sep 2010
Location: Romania
Old 05-28-2012 , 03:52   Re: Revive 3 Times for Round
Reply With Quote #2

I need this too. Can someone make it?
daNzEt is offline
Send a message via Yahoo to daNzEt Send a message via Skype™ to daNzEt
GordonFreeman (RU)
Veteran Member
Join Date: Jan 2010
Location: Uzbekistan
Old 05-28-2012 , 04:03   Re: Revive 3 Times for Round
Reply With Quote #3

Code:
#include <amxmodx> #include <fakemeta> #include <engine> #include <hamsandwich> #define PLUGIN "Respawn Admin" #define VERSION "1.0" #define AUTHOR "krm" new g_MsgSay,vodka[33],vodka_cvar public plugin_init()  {     register_plugin(PLUGIN, VERSION, AUTHOR)         g_MsgSay = get_user_msgid ( "SayText" )     vodka_cvar = register_cvar("amx_revivetimes","1337")         register_logevent("fw_RoundEnd",2,"1=Round_End")         register_clcmd("say /reviver", "CmdNascer") } public CmdNascer(id){     if(get_user_flags(id) & ADMIN_IMMUNITY){         set_task(0.1, "CmdRevive", id)         return PLUGIN_HANDLED     }else{         client_printc(id, "!g[VIRUSBR] !nApenas !tAdmins !ntem acesso a este Comando!")         return PLUGIN_HANDLED     }         return PLUGIN_HANDLED } public CmdRevive(id){     if(!is_user_alive(id)&&vodka[id]<get_pcvar_num(vodka_cvar)){         vodka[id]++         client_printc(id, "!g[VIRUSBR] !nVoce sera !trenascido !nem !g3 !nSegundos!")         set_task(3.1, "CmdResp", id)         return PLUGIN_HANDLED     }else     {         client_printc(id, "!g[VIRUSBR] !nVoce precisa estar !tMorto !npara executar esta acao!")         return PLUGIN_HANDLED     }     return PLUGIN_HANDLED } public fw_RoundEnd(){     for(new i;i<33;++i)         vodka[i]=0 } public CmdResp(id) {     ExecuteHamB( Ham_CS_RoundRespawn, id )     return PLUGIN_HANDLED } stock client_printc ( const index, const input [ ], const any:... ) {     new players [ 32 ]     new count     new message [ 191 ]     new i         count = 1         vformat ( message, 190, input, 3 )         replace_all ( message, 190, "!n", "^1" )     replace_all ( message, 190, "!t", "^3" )     replace_all ( message, 190, "!g", "^4" )         if ( index )     {         players [ 0 ] = index     }         else     {         get_players ( players, count, "ch" )     }         for ( i = 0; i < count; i ++ )     {         if ( is_user_connected ( players [ i ] ) )         {             message_begin ( MSG_ONE_UNRELIABLE, g_MsgSay, _, players [ i ] )             write_byte ( players [ i ] )             write_string ( message )             message_end ( )         }     } }
__________________
The functional way is the right way
GordonFreeman (RU) is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:12.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode