Raised This Month: $32 Target: $400
 8% 

Pistol And Ammo (Verison 1.1)


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff        Approver:   Hawk552 (427)
wilson409
Junior Member
Join Date: May 2006
Location: 香港HongKong
Old 09-16-2009 , 06:17   Pistol And Ammo (Verison 1.1)
Reply With Quote #1

Pistol And Ammo
Description:

This is a simple plugin, if you drop your pistol then next round will give you a pistol(Ct = USP,
T = Glock18 ) and ammo

Cvar:

amx_pna - 1 enabled / 0 - disabled (def 1)

Modules:

- cstrike
- hamsandwich
- fun

Credits]

ConnorMcLeod - Ham_Spawn , has_user_pistol( id )

To DO]

V1.2 - which pistol you drop , which pistol you will get
Attached Files
File Type: sma Get Plugin or Get Source (PistolAndAmmo.sma - 3063 views - 1.2 KB)

Last edited by wilson409; 09-19-2009 at 03:24.
wilson409 is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 09-16-2009 , 06:43   Re: Pistol And Amno
Reply With Quote #2

WTF? you just give ammo & pistols & nothing more oO wahts when i drop my DEAGLE ? =))
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Xevious
Senior Member
Join Date: Sep 2009
Location: Computer Chair
Old 09-16-2009 , 06:46   Re: Pistol And Amno
Reply With Quote #3

nice plugin , keep it up!
Xevious is offline
Send a message via MSN to Xevious
wilson409
Junior Member
Join Date: May 2006
Location: 香港HongKong
Old 09-16-2009 , 07:41   Re: Pistol And Amno
Reply With Quote #4

Quote:
Originally Posted by One View Post
WTF? you just give ammo & pistols & nothing more oO wahts when i drop my DEAGLE ? =))
Thank for your remind ! Changed Description
wilson409 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-16-2009 , 07:55   Re: Pistol And Amno
Reply With Quote #5

Actually, your plugin give pistols even if players still have some pistols.
Would be more correct to give a gun when player has no gun, and to give default ammo when player has less than default.
Feel free to use my code.

PHP Code:
/*    Formatright © 2009, ConnorMcLeod

    Spawn with Pistols is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Spawn with Pistols; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <cstrike>
// #include <engine>
// #include <fakemeta>
#include <fun>
#include <hamsandwich>

#define VERSION "0.0.1"

#define m_rgpPlayerItems_slot2    369

public plugin_init()
{
    
register_plugin("Spawn with Pistols"VERSION"ConnorMcLeod")

    
RegisterHam(Ham_Spawn"player""Player_Spawn_Post"1)
}

public 
Player_Spawn_Postid )
{
    if( 
is_user_alive(id) && !has_user_pistol(id) )
    {
        switch( 
cs_get_user_teamid ) )
        {
            case 
CS_TEAM_T:
            {
                
give_item(id"weapon_glock18")
                if( 
cs_get_user_bpammo(idCSW_GLOCK18) < 40 )
                {
                    
cs_set_user_bpammo(idCSW_GLOCK1840)
                }
            }
            case 
CS_TEAM_CT:
            {
                
give_item(id"weapon_usp")
                if( 
cs_get_user_bpammo(idCSW_USP) < 24 )
                {
                    
cs_set_user_bpammo(idCSW_USP24)
                }
            }
        }
    }
}

has_user_pistolid )
{
    return ( 
get_pdata_cbase(idm_rgpPlayerItems_slot25) > )

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 09-16-2009 at 07:57.
ConnorMcLeod is offline
Old 09-16-2009, 09:53
wilson409
This message has been deleted by wilson409.
wilson409
Junior Member
Join Date: May 2006
Location: 香港HongKong
Old 09-17-2009 , 05:23   Re: Pistol And Amno
Reply With Quote #6

Quote:
Originally Posted by ConnorMcLeod View Post
Actually, your plugin give pistols even if players still have some pistols.
Would be more correct to give a gun when player has no gun, and to give default ammo when player has less than default.
Feel free to use my code.

PHP Code:
/*    Formatright © 2009, ConnorMcLeod

    Spawn with Pistols is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Spawn with Pistols; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <cstrike>
// #include <engine>
// #include <fakemeta>
#include <fun>
#include <hamsandwich>

#define VERSION "0.0.1"

#define m_rgpPlayerItems_slot2    369

public plugin_init()
{
    
register_plugin("Spawn with Pistols"VERSION"ConnorMcLeod")

    
RegisterHam(Ham_Spawn"player""Player_Spawn_Post"1)
}

public 
Player_Spawn_Postid )
{
    if( 
is_user_alive(id) && !has_user_pistol(id) )
    {
        switch( 
cs_get_user_teamid ) )
        {
            case 
CS_TEAM_T:
            {
                
give_item(id"weapon_glock18")
                if( 
cs_get_user_bpammo(idCSW_GLOCK18) < 40 )
                {
                    
cs_set_user_bpammo(idCSW_GLOCK1840)
                }
            }
            case 
CS_TEAM_CT:
            {
                
give_item(id"weapon_usp")
                if( 
cs_get_user_bpammo(idCSW_USP) < 24 )
                {
                    
cs_set_user_bpammo(idCSW_USP24)
                }
            }
        }
    }
}

has_user_pistolid )
{
    return ( 
get_pdata_cbase(idm_rgpPlayerItems_slot25) > )

Thank you very much
wilson409 is offline
wilson409
Junior Member
Join Date: May 2006
Location: 香港HongKong
Old 09-19-2009 , 03:13   Re: Pistol And Amno (Verison 1.1)
Reply With Quote #7

updated
wilson409 is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 09-19-2009 , 03:16   Re: Pistol And Amno (Verison 1.1)
Reply With Quote #8

Amno -> Ammo

drop away your pistol -> drop your pistol
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
wilson409
Junior Member
Join Date: May 2006
Location: 香港HongKong
Old 09-19-2009 , 03:22   Re: Pistol And Amno (Verison 1.1)
Reply With Quote #9

Quote:
Originally Posted by crazyeffect View Post
Amno -> Ammo

drop away your pistol -> drop your pistol
sorry for my bad english
wilson409 is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 09-20-2009 , 15:59   Re: Pistol And Ammo (Verison 1.1)
Reply With Quote #10

This plugin is well done.

If you would like any information regarding possible adjustments you could make or things you could do to make this better, please feel free to post here or PM me.

Approved.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Reply


Thread Tools
Display Modes

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:53.


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