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

[REQ]No weapons on respawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
styler
Senior Member
Join Date: Oct 2011
Location: Oslo, Norway
Old 03-27-2013 , 05:34   [REQ]No weapons on respawn
Reply With Quote #1

I'm sure there is a plugin on this allready but whatever i search i don't seem to find it..

I'd like a plugin that just simply removes all your weapons on round start & whenever a round is done [Knife only at spawn so noone can spawnkill]

Thanks!
styler is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 03-27-2013 , 06:50   Re: [REQ]No weapons on respawn
Reply With Quote #2

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

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

#define PLUGIN "No Weapons at Spawn"
#define VERSION "1.0"
#define AUTHOR "Kia Armani"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""PlayerSpawn"1)
}

public 
PlayerSpawn(id)
{
    
strip_user_weapons(id)
    
give_item(id"weapon_knife")

__________________
Kia is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 03-27-2013 , 08:07   Re: [REQ]No weapons on respawn
Reply With Quote #3

@Kia

You forgot is_user_alive().
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 03-27-2013 , 10:27   Re: [REQ]No weapons on respawn
Reply With Quote #4

How can a player be dead when he's spawning?
__________________
Kia is offline
Torge
Veteran Member
Join Date: Oct 2011
Old 03-27-2013 , 11:51   Re: [REQ]No weapons on respawn
Reply With Quote #5

Quote:
Originally Posted by Kia View Post
How can a player be dead when he's spawning?
No, you got it wrong.

It'll display errors if you won't check whether player is alive cuz you set post = 1.
Torge is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 03-27-2013 , 12:11   Re: [REQ]No weapons on respawn
Reply With Quote #6

Quote:
Originally Posted by Kia View Post
How can a player be dead when he's spawning?
Quote:
Originally Posted by Arkshine View Post
Spawn() is called one time before when you are put in the server. ( so when you see the motd and you need to choose team )
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-27-2013 , 12:17   Re: [REQ]No weapons on respawn
Reply With Quote #7

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

#tryinclude <cstrike_pdatas>

#if !defined _cbaseentity_included
        #assert Cstrike Pdatas and Offsets library required! Read the below instructions:   \
                
1. Download it at forums.alliedmods.net/showpost.php?p=1712101#post1712101   \
                
2. Put it into amxmodx/scripting/include/ folder   \
                
3. Compile this plugin locallydetailswiki.amxmodx.org/index.php/Compiling_Plugins_%28AMX_Mod_X%29   \
                
4. Install compiled plugindetailswiki.amxmodx.org/index.php/Configuring_AMX_Mod_X#Installing
#endif

#define PLUGIN "No Spawn Weapons"
#define VERSION "0.0.1"

const WEAPON_SUIT 31
const WEAPON_SUIT_BIT 1<<WEAPON_SUIT

public plugin_init()
{
    
register_pluginPLUGINVERSION"ConnorMcLeod" )
    
RegisterHam(Ham_Spawn"player""OnCBasePlayer_Spawn"false)
}

public 
OnCBasePlayer_Spawnid )
{
    if( 
pev_valid(id) == && (<= get_pdata_int(idm_iTeam) <= 2) )
    {
        
set_pdata_bool(idm_bHasReceivedDefItemstrue)
        new 
weapons pev(idpev_weapons)
        if( ~
weapons WEAPON_SUIT_BIT )
        {
            
set_pev(idpev_weaponsweapons WEAPON_SUIT_BIT)
        }
        return 
HAM_HANDLED
    
}
    return 
HAM_IGNORED

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 03-27-2013 , 12:35   Re: [REQ]No weapons on respawn
Reply With Quote #8

Connor's arriving with hardcore solution.
__________________
Kia is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-27-2013 , 15:52   Re: [REQ]No weapons on respawn
Reply With Quote #9

That code won't strip weapons that would have been bought or picked up when player has survived the round.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
styler
Senior Member
Join Date: Oct 2011
Location: Oslo, Norway
Old 03-29-2013 , 06:30   Re: [REQ]No weapons on respawn
Reply With Quote #10

Thanks! I'll test it right away

EDIT: I got this error when trying to compile your code Connor.

/tmp/textsXV33V.sma( : fatal error 110: assertion failed: Cstrike Pdatas and Offsets library required! Read the below instructions:


Compilation aborted.
1 Error.
Done.

EDIT 2:
Not sure if this is because of Kia's plugin, but sometimes after you pick up a weapon and the next round starts you are not able to pick up any weapons.

Last edited by styler; 03-29-2013 at 06:53.
styler 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 14:17.


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