Raised This Month: $ Target: $400
 0% 

Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
omgitsme
Veteran Member
Join Date: Mar 2010
Old 07-30-2010 , 15:03   Re: Help
Reply With Quote #1

thanks, and another last question (i hope)
i searched for spawn in the tutorials, and found a tutorial on new rounds, spawn and stuff. and i wanna know, how can i give a weapon/item to a player upon spawn?
Code:
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
 
 
public plugin_init()
{
    register_clcmd("say /deagle", "weapon");
    RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)
}
 
public weapon(id)
{
    if(is_user_alive(id))
    {
        strip_user_weapons(id)
        give_item( id, "weapon_knife" );
        give_item( id, "weapon_deagle" );
        cs_set_user_bpammo(id, CSW_DEAGLE, 200);
        set_user_health (id, 150);
        client_print(id, print_chat, "You got a deagle and 150 hp");
}

}
 
public fwHamPlayerSpawnPost(iPlayer) {
        if (is_user_alive(iPlayer)) {
    {
        give_item( id, "weapon_awp")
    }
}
{
i tried this, but it dosen't work. i'm just guessing, but i think it doesn't work because it's not a ham command and it's in the ham section? am i right? and i could'ent find the command for giving a item with ham. thanks for your help guys
__________________
omgitsme is offline
Send a message via Skype™ to omgitsme
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 07-30-2010 , 15:08   Re: Help
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>
 
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

public plugin_init()
{
     
register_clcmd("say /deagle""weapon");

     
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1)
}
 
public 
weapon(id)
{
     if(
is_user_alive(id))
     {
          
strip_user_weapons(id)
          
give_itemid"weapon_knife" );
          
give_itemid"weapon_deagle" );
          
cs_set_user_bpammo(idCSW_DEAGLE200);
          
set_user_health (id150);
          
client_print(idprint_chat"You got a deagle and 150 hp");
     }
}
 
public 
fwHamPlayerSpawnPost(id
{
     if (
is_user_alive(id))
          
give_itemid"weapon_awp")

__________________
You can do anything you set your mind to, man.

Devil259 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:08.


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