AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Weapon Give Dont Work (https://forums.alliedmods.net/showthread.php?t=106944)

Stylaa 10-20-2009 17:31

Weapon Give Dont Work
 
I have this Funktion and the CT īs dont get a deagle or m4
Pls say me what i done Wrong


Code:

public Player_Spawn_Post( id )
{
    if( is_user_alive(id) )
    {
        strip_user_weapons(id)
        set_pdata_int(id, OFFSET_PRIMARYWEAPON, 0)

        give_item(id, "weapon_knife")

        if( cs_get_user_team(id) == CS_TEAM_CT )
        {
            give_item(id, "weapon_deagle")
            cs_set_user_bpammo(id, CSW_DEAGLE, 35)
            give_item(id, "weapon_m4a1")
            cs_set_user_bpammo(id, CSW_M4A1, 90)
            cs_set_user_armor(id, 100, CS_ARMOR_VESTHELM)
        }
    }
}


Hawk552 10-20-2009 17:35

Re: Weapon Give Dont Work
 
Use [ php][/php], [ pawn][/pawn] or [ code][/code] tags in the future.

Does everything else work?

Stylaa 10-20-2009 17:42

Re: Weapon Give Dont Work
 
yes everythink else work

Nextra 10-20-2009 18:08

Re: Weapon Give Dont Work
 
Say precisely what works and what does not.

- Is the user stripped off his weapons.
- Is the user given a knife.
- Is the user given m4 / deagle.
- Is the user given armor and helmet.

Give full code or at least all relevant parts.

benjibau 10-21-2009 15:36

Re: Weapon Give Dont Work
 
or use

PHP Code:

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

public plugin_init()
{
    
register_pluginPLUGINVERSIONAUTHOR 
    
RegisterHam(Ham_Spawn"player""Player_Spawn"1)
}

public 
Player_Spawn(id)
{
    if(
is_user_alive(id))
    { 
        if(
cs_get_user_team(id) == CS_TEAM_CT)
        {
            
strip_user_weapons(id)
            
give_item(id"weapon_knife")
            
give_item(id"weapon_deagle")
            
cs_set_user_bpammo(idCSW_DEAGLE35)
            
give_item(id"weapon_m4a1")
            
cs_set_user_bpammo(idCSW_M4A190)
            
cs_set_user_armor(id100CS_ARMOR_VESTHELM)
        }
    }




All times are GMT -4. The time now is 17:36.

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