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

i need 2 plugins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mplayerexe
Senior Member
Join Date: Dec 2008
Old 07-15-2009 , 07:56   i need 2 plugins
Reply With Quote #1

1.I want a plugin to execute a command every x seconds (set by a cvar)
2.
PHP Code:
#include <amxmodx> 
#include <cstrike>  
#include <hamsandwich> 
#include <fun> 
  
#define RED random(255) 
#define GREEN random(255) 
#define BLUE random(255)  
  
new RespawnerIntervalMaxPlayers

new 
pCvarMoneypCvarMoneyAmount

new 
CountDown
  
public 
plugin_init() 

    
register_plugin("Timed Respawner""1.1""hleV"); 
  
    
RespawnerInterval register_cvar("respawner_interval""60"); 
    
MaxPlayers get_maxplayers(); 
     
    
pCvarMoney register_cvar "bonus_money""1" 
    
pCvarMoneyAmount register_cvar "bonus_moneyamount""1000" )     
     
    
RegisterHam Ham_Spawn"player""fwHamPlayerSpawnPost"
         
    
CountDown get_pcvar_num(RespawnerInterval); 
    
set_task(1.0"RespawnPlayers"__,_"b"); 


public 
fwHamPlayerSpawnPost id )  

    if ( ( 
get_pcvar_num pCvarMoney ) == ) && ( is_user_alive(id) ) ) 
    { 
        
cs_set_user_money idcs_get_user_money id ) + get_pcvar_num pCvarMoneyAmount ) ) 
    } 


public 
RespawnPlayers() 

    --
CountDown
    for (new 
Cl 1Cl <= MaxPlayersCl++) 
    { 
        if (
cs_get_user_team(Cl) == CS_TEAM_SPECTATOR
            return; 
        else 
        if (!
is_user_connected(Cl) || is_user_alive(Cl)) 
            continue; 
                 
        if( 
CountDown == 
            
ExecuteHamB(Ham_CS_RoundRespawnCl); 
        else 
        { 
            
set_hudmessage(REDGREENBLUE, -1.00.800.01.10.00.0, -1); 
            
show_hudmessage(Cl"You will respawn in %i second%s"CountDownCountDown == "" "s"); 
        } 
    } 
         
    if( 
CountDown == 
        
CountDown 
and modify this plugin to respawn every 10 seconds the player (respawn_interval cvar)
__________________
mplayerexe is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-15-2009 , 07:59   Re: i need 2 plugins
Reply With Quote #2

1. plugin amx_task
2. respawner_interval 10
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
mplayerexe
Senior Member
Join Date: Dec 2008
Old 07-15-2009 , 08:49   Re: i need 2 plugins
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
1. plugin amx_task
2. respawner_interval 10
yea but this plugin respawn all players every 60 seconds i want to respawn each player 10 seconds after they are dead
__________________
mplayerexe is offline
EvolDay
Senior Member
Join Date: Apr 2008
Location: Canada
Old 07-15-2009 , 09:46   Re: i need 2 plugins
Reply With Quote #4

check if they are alive or not with is_user_alive(id)

if (is_user_connected(Cl) && !is_user_alive(Cl))
__________________

Last edited by EvolDay; 07-15-2009 at 09:55.
EvolDay is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-15-2009 , 09:56   Re: i need 2 plugins
Reply With Quote #5

You can try something like :

Code:
    #include <amxmodx>     #include <hamsandwich>     #include <cstrike>     const TASKID_RESPAWN = 4548;     new pCvarTimeToWait;     public plugin_init()     {         register_plugin( "Respawn On Death", "1.0.0", "Arskhine" );         pCvarTimeToWait = register_cvar( "respawner_interval", "10" );         RegisterHam( Ham_Killed, "player", "CPlayer_Killed", 1 );     }     public client_connect ( Player )     {         remove_task( Player + TASKID_RESPAWN );     }     public CPlayer_Killed ( const Victim )     {         new Float:TimeToWait = floatmax( get_pcvar_float( pCvarTimeToWait ), 0.1 );         set_hudmessage( 255, 255, 255, -1.0, 0.8, 1, 3.0, 6.0, 0.1, 0.2, -1 );         show_hudmessage( Victim, "You will respawn in %.1f second(s)", TimeToWait );         set_task( TimeToWait, "CTask_PlayerRespawn", Victim + TASKID_RESPAWN );     }     public CTask_PlayerRespawn ( const TaskID )     {         new Player = TaskID - TASKID_RESPAWN;         if ( !is_user_alive( Player ) && CS_TEAM_T <= cs_get_user_team( Player ) <= CS_TEAM_CT )         {             ExecuteHamB( Ham_CS_RoundRespawn, Player );         }     }
__________________
Arkshine is offline
mplayerexe
Senior Member
Join Date: Dec 2008
Old 07-15-2009 , 09:59   Re: i need 2 plugins
Reply With Quote #6

please add money too
l.e and add countdown please
__________________

Last edited by mplayerexe; 07-15-2009 at 10:02.
mplayerexe is offline
Old 07-15-2009, 17:01
mplayerexe
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
mplayerexe
Senior Member
Join Date: Dec 2008
Old 07-21-2009 , 08:46   Re: i need 2 plugins
Reply With Quote #7

up
__________________
mplayerexe 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 03:41.


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