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

[REQ]10 Seconds no Gun's


Post New Thread Reply   
 
Thread Tools Display Modes
SpokY
Senior Member
Join Date: Feb 2009
Location: Darmstadt
Old 06-10-2009 , 06:36   Re: [REQ]10 Seconds no Gun's
Reply With Quote #11

mhm
dont work.. after 10 seconds .. we dont get any weapon.
__________________
xtream.eSports Weil's einfach nur Geil ist !
www.xtream-esports.com
SpokY is offline
Send a message via ICQ to SpokY Send a message via MSN to SpokY
[X]-RayCat
Senior Member
Join Date: Sep 2006
Old 06-10-2009 , 09:48   Re: [REQ]10 Seconds no Gun's
Reply With Quote #12

cs_set_weapon_ammo doesn't work that way. Index is the weapon entity's index.

Fakemeta way:
Code:
stock fm_get_weapon_id(index, const weapon[]) {     new ent = -1;         while((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", weapon)) != 0)     {         if(index == pev(ent, pev_owner))             return ent;     }     return 0; }

Engine way:
Code:
stock get_weapon_id(id, const weapon[]) {     new ent = -1         while((ent = find_ent_by_class(ent, weapon)) != 0)     {         if(id == entity_get_edict(ent, EV_ENT_owner))             return ent     }         return 0 }

Fakemeta: cs_set_weapon_ammo( fm_get_weapon_id( player, "weapon_*" ), ammo )
Engine: cs_set_weapon_ammo( get_weapon_id( player, "weapon_*" ), ammo )


Also you must skip dead players in spawn event.
__________________

Last edited by [X]-RayCat; 06-10-2009 at 09:56.
[X]-RayCat is offline
SpokY
Senior Member
Join Date: Feb 2009
Location: Darmstadt
Old 06-10-2009 , 10:19   Re: [REQ]10 Seconds no Gun's
Reply With Quote #13

can u please make a compleat code :S sorry xD
__________________
xtream.eSports Weil's einfach nur Geil ist !
www.xtream-esports.com
SpokY is offline
Send a message via ICQ to SpokY Send a message via MSN to SpokY
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-10-2009 , 10:30   Re: [REQ]10 Seconds no Gun's
Reply With Quote #14

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "TitANious"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam Ham_Spawn"player""fwSpawn" );
}
public 
fwSpawn id )
{
    
strip_user_weapons id )
    
    
set_task 10.0"GiveWeapons"id )
}
public 
GiveWeapons id )
{
    if ( 
get_user_team id ) == )
    {
        
give_item id"weapon_usp" );
        
cs_set_user_bpammo idCSW_USP100 )
    }
    else if ( 
get_user_team id ) == 2)
    {
        
give_item id"weapon_glock18" );
        
cs_set_user_bpammo idCSW_GLOCK18100 )
    }

What about this?
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
SpokY
Senior Member
Join Date: Feb 2009
Location: Darmstadt
Old 06-10-2009 , 10:35   Re: [REQ]10 Seconds no Gun's
Reply With Quote #15

ok it works but, when iam a ct so i get only a glock and when i t i get a usp but all without a knife :S
__________________
xtream.eSports Weil's einfach nur Geil ist !
www.xtream-esports.com
SpokY is offline
Send a message via ICQ to SpokY Send a message via MSN to SpokY
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-10-2009 , 10:36   Re: [REQ]10 Seconds no Gun's
Reply With Quote #16

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "TitANious"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam Ham_Spawn"player""fwSpawn" );
}
public 
fwSpawn id )
{
    
strip_user_weapons id )
    
    
set_task 10.0"GiveWeapons"id )
}
public 
GiveWeapons id )
{
    
give_item id"weapon_knife" );
    
    if ( 
get_user_team id ) == )
    {
        
give_item id"weapon_usp" );
        
cs_set_user_bpammo idCSW_USP100 )
    }
    else if ( 
get_user_team id ) == 2)
    {
        
give_item id"weapon_glock18" );
        
cs_set_user_bpammo idCSW_GLOCK18100 )
    }

__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
SpokY
Senior Member
Join Date: Feb 2009
Location: Darmstadt
Old 06-10-2009 , 10:43   Re: [REQ]10 Seconds no Gun's
Reply With Quote #17

works but now we get the guns after the respawn and not after 10 secounds
__________________
xtream.eSports Weil's einfach nur Geil ist !
www.xtream-esports.com
SpokY is offline
Send a message via ICQ to SpokY Send a message via MSN to SpokY
[X]-RayCat
Senior Member
Join Date: Sep 2006
Old 06-10-2009 , 10:43   Re: [REQ]10 Seconds no Gun's
Reply With Quote #18

Quote:
Originally Posted by TitANious View Post
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "TitANious"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam Ham_Spawn"player""fwSpawn" );
}
public 
fwSpawn id )
{
    
strip_user_weapons id )
    
    
set_task 10.0"GiveWeapons"id )
}
public 
GiveWeapons id )
{
    
give_item id"weapon_knife" );
    
    if ( 
get_user_team id ) == )
    {
        
give_item id"weapon_usp" );
        
cs_set_user_bpammo idCSW_USP100 )
    }
    else if ( 
get_user_team id ) == 2)
    {
        
give_item id"weapon_glock18" );
        
cs_set_user_bpammo idCSW_GLOCK18100 )
    }

You must skip dead players on spawn event.

Code:
public fwSpawn( id ) {     if( is_user_alive( id ) )     {         //yay user is alive.. do whatever you like     } }
__________________
[X]-RayCat is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-10-2009 , 10:45   Re: [REQ]10 Seconds no Gun's
Reply With Quote #19

Like this
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "TitANious"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam Ham_Spawn"player""fwSpawn" );
}
public 
fwSpawn id )
{
    
strip_user_weapons id )
    
    
set_task 10.0"GiveWeapons"id )
}
public 
GiveWeapons id )
{
    if ( 
is_user_alive id ) )
    {
        
give_item id"weapon_knife" );
    
        if ( 
get_user_team id ) == )
        {
            
give_item id"weapon_usp" );
            
cs_set_user_bpammo idCSW_USP100 )
        }
        else if ( 
get_user_team id ) == 2)
        {
            
give_item id"weapon_glock18" );
            
cs_set_user_bpammo idCSW_GLOCK18100 )
        }
    }

__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
[X]-RayCat
Senior Member
Join Date: Sep 2006
Old 06-10-2009 , 10:49   Re: [REQ]10 Seconds no Gun's
Reply With Quote #20

Quote:
Originally Posted by TitANious View Post
Like this
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "TitANious"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam Ham_Spawn"player""fwSpawn" );
}
public 
fwSpawn id )
{
    
strip_user_weapons id )
    
    
set_task 10.0"GiveWeapons"id )
}
public 
GiveWeapons id )
{
    if ( 
is_user_alive id ) )
    {
        
give_item id"weapon_knife" );
    
        if ( 
get_user_team id ) == )
        {
            
give_item id"weapon_usp" );
            
cs_set_user_bpammo idCSW_USP100 )
        }
        else if ( 
get_user_team id ) == 2)
        {
            
give_item id"weapon_glock18" );
            
cs_set_user_bpammo idCSW_GLOCK18100 )
        }
    }

I said on spawn event.

More info:
http://forums.alliedmods.net/showthread.php?t=42159
__________________
[X]-RayCat 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 06:20.


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