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

[REQ] Only knife on first 10 seconds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Pop0N
Member
Join Date: Apr 2011
Old 04-07-2012 , 09:51   [REQ] Only knife on first 10 seconds
Reply With Quote #1

Hi,
I need mod my surfing server.
When the round starts players can't switch weapons except a knife. (First 10 seconds of the round)
I made the mod via client_cmd makes the player slot3 but I'm looking for something more programmed.

Thanks!
Pop0N is offline
kapzz
Member
Join Date: Mar 2012
Location: Mars
Old 04-07-2012 , 14:28   Re: [REQ] Only knife on first 10 seconds
Reply With Quote #2

I used spawn instead of roundstart, think it's okay and will do the same thing since it's a surf server.
Try and if it does what u want.
PHP Code:
/* Surf Start */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <Hamsandwich>
#include <cstrike>

new const g_Version[] = "1.0";

const 
MAX_PLAYERS 32;


new 
g_player_WeaponsMAX_PLAYERS ] [ 32 ],
g_player_weapons_num[33] = 0

public plugin_init() 
{
    
register_plugin("Knife Time"g_Version"kapzz")
    
    
RegisterHam(Ham_Spawn"player""KnifeTime"1)
}

public 
KnifeTime(iPlayer)
{
    if ( 
is_user_aliveiPlayer ) ) {
        
//clear arrays
        
g_player_Weapons[iPlayer][0] = 0;
        
g_player_weapons_num[0] = 0;
        
        
get_user_weaponsiPlayerg_player_Weapons[iPlayer], g_player_weapons_num[iPlayer] )
        
        
strip_user_weaponsiPlayer )
        
give_itemiPlayer"weapon_knife" )
        
        
set_task10.0"giveWeapons"iPlayer)
    }
    
}


public 
giveWeaponsiPlayer )
{
    if (
is_user_aliveiPlayer ) )
    {
        new 
wpn[32]
        for ( new 
i< (g_player_weapons_num[iPlayer]); i++)
        {
            new 
wepnum g_player_Weapons[iPlayer][i]
            if (
wepnum != 29 && wepnum != 0)
            {
                
get_weaponname(wepnum,wpn,31)
                
give_item(iPlayerwpn)
                
                if (
wepnum != && wepnum != && wepnum !=&& wepnum != && wepnum != 25)
                    
cs_set_user_bpammo(iPlayer,wepnum30// 30 for all weapons lazy do get maxclip
                
            
}
        }    
    }


Last edited by kapzz; 04-07-2012 at 14:30.
kapzz is offline
Pop0N
Member
Join Date: Apr 2011
Old 04-07-2012 , 14:43   Re: [REQ] Only knife on first 10 seconds
Reply With Quote #3

Quote:
Originally Posted by kapzz View Post
I used spawn instead of roundstart, think it's okay and will do the same thing since it's a surf server.
Try and if it does what u want.
PHP Code:
/* Surf Start */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <Hamsandwich>
#include <cstrike>

new const g_Version[] = "1.0";

const 
MAX_PLAYERS 32;


new 
g_player_WeaponsMAX_PLAYERS ] [ 32 ],
g_player_weapons_num[33] = 0

public plugin_init() 
{
    
register_plugin("Knife Time"g_Version"kapzz")
    
    
RegisterHam(Ham_Spawn"player""KnifeTime"1)
}

public 
KnifeTime(iPlayer)
{
    if ( 
is_user_aliveiPlayer ) ) {
        
//clear arrays
        
g_player_Weapons[iPlayer][0] = 0;
        
g_player_weapons_num[0] = 0;
        
        
get_user_weaponsiPlayerg_player_Weapons[iPlayer], g_player_weapons_num[iPlayer] )
        
        
strip_user_weaponsiPlayer )
        
give_itemiPlayer"weapon_knife" )
        
        
set_task10.0"giveWeapons"iPlayer)
    }
    
}


public 
giveWeaponsiPlayer )
{
    if (
is_user_aliveiPlayer ) )
    {
        new 
wpn[32]
        for ( new 
i< (g_player_weapons_num[iPlayer]); i++)
        {
            new 
wepnum g_player_Weapons[iPlayer][i]
            if (
wepnum != 29 && wepnum != 0)
            {
                
get_weaponname(wepnum,wpn,31)
                
give_item(iPlayerwpn)
                
                if (
wepnum != && wepnum != && wepnum !=&& wepnum != && wepnum != 25)
                    
cs_set_user_bpammo(iPlayer,wepnum30// 30 for all weapons lazy do get maxclip
                
            
}
        }    
    }

Thanks, i thought what you do but its not good because if player have USP and in this 10 seconds he get deagle its give him the usp, and he have DGL+USP.

Last edited by Pop0N; 04-07-2012 at 16:52.
Pop0N is offline
DarkT1
Member
Join Date: Oct 2011
Old 04-07-2012 , 17:24   Re: [REQ] Only knife on first 10 seconds
Reply With Quote #4

just strip weapon
DarkT1 is offline
Pop0N
Member
Join Date: Apr 2011
Old 04-07-2012 , 18:12   Re: [REQ] Only knife on first 10 seconds
Reply With Quote #5

Quote:
Originally Posted by DarkT1 View Post
just strip weapon
But i want the weapons has the player on spawn + before..
Pop0N is offline
kapzz
Member
Join Date: Mar 2012
Location: Mars
Old 04-08-2012 , 01:08   Re: [REQ] Only knife on first 10 seconds
Reply With Quote #6

bu t for that i could block buy and pick; on the 10 seconds.
(wroted on phone)
edit: didnt read ur last reply , i will try to do that but the thing i said above its easier.

Last edited by kapzz; 04-08-2012 at 01:12.
kapzz is offline
Pop0N
Member
Join Date: Apr 2011
Old 04-09-2012 , 17:07   Re: [REQ] Only knife on first 10 seconds
Reply With Quote #7

Hey guys, in another forum made me the mod.
but, have some bug, you can fix it?:
sometimes players has weapons from last round can shot 1 bullet and then its change to knife, i don't want people can shot 1 bullet in this 10 seconds.

Code:
PHP Code:
#include <amxmodx>
#define TASK_COUNT 25020


new const PLUGIN [] = "Weapons Dealy"
new const VERSION [] = "1.0"
new const AUTHOR [] = "reNN"
new g_Countboolg_StripWep;


public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_logevent("EventRoundStart"2"1=Round_Start");
    
register_event("TextMsg""EventRestartRound""a""2=#Game_will_restart_in"
    
register_event"CurWeapon""EventCurWeapon""be""2!29" );
}


public 
EventRoundStart()
{
    
g_StripWep true;
    
g_Count 10;
    
startCount( );
}


public 
EventRestartRound()
{
    
g_Count 0;
    
g_StripWep false;
    
remove_taskTASK_COUNT );
}




public 
EventCurWeaponid ) {
    if( 
g_StripWep )
    {
        
engclient_cmdid"weapon_knife" ); 
        
client_printidprint_center"try again more %d seconds !"g_Count);
    }
    return 
PLUGIN_CONTINUE;
}


public 
startCount( ) 
{
    switch( 
g_Count 
    {
        case 
0
        {
            
g_StripWep false
            remove_task
TASK_COUNT );
        }
        case 
1..10
        {
            
set_task1.0"startCount"TASK_COUNT)
        }
    }
    if( 
g_Count != ) {
        --
g_Count
    
}


Last edited by Pop0N; 04-09-2012 at 17:10.
Pop0N 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 00:52.


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