Raised This Month: $ Target: $400
 0% 

Give_Item


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-08-2009 , 06:49   Re: Give_Item
Reply With Quote #4

This works for me (tip is ti unset player vip and reset after gave weapons) :

PHP Code:
/*    Formatright © 2009, ConnorMcLeod

    VIP test 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 VIP test; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

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

#define VERSION "0.0.1"

public plugin_init()
{
    
register_plugin("VIP test"VERSION"ConnorMcLeod")

    
RegisterHam(Ham_AddPlayerItem"player""Player_AddPlayerItem")
}

public 
Player_AddPlayerItemid iWeapon )
{
    if(    
cs_get_user_vip(id)
    &&    
ExecuteHam(Ham_Item_GetWeaponPtriWeapon) == iWeapon
    
&&    cs_get_weapon_id(iWeapon) == CSW_USP    )
    {
        
cs_set_user_vip(id000)
        
give_item(id"weapon_fiveseven")
        
cs_set_user_bpammo(idCSW_FIVESEVEN100)

        
give_item(id"weapon_m4a1")
        
cs_set_user_bpammo(idCSW_M4A190)

        
client_print(idprint_chat"[VIP] You are the VIP. Have fun and good luck")
        
cs_set_user_vip(id100)
            
        
set_pev(iWeaponpev_flagspev(iWeaponpev_flags) | FL_KILLME)
        
SetHamReturnInteger(0)
        return 
HAM_SUPERCEDE
    
}
    return 
HAM_IGNORED

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 11-08-2009 at 06:52.
ConnorMcLeod is offline
 



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 17:35.


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