AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   WeaponS help (https://forums.alliedmods.net/showthread.php?t=104744)

lordshiva 09-27-2009 03:31

WeaponS help
 
if players dont ve Nightvision than only give otherwise dont give bcaz message comes like u already have it

if(!cs_set_user_nvg(client, 1);)

than give

how to code it

ConnorMcLeod 09-27-2009 03:32

Re: WeaponS help
 
I don't understand you, where are you from ?

lordshiva 09-27-2009 03:41

Re: WeaponS help
 
when user spawn they get nightvision @ free of cost.....

whn they already ve it than dont give it...or else if they dont have than give it

lordshiva 09-27-2009 04:28

Re: WeaponS help
 
fm_give_item(client, "ammo_338magnum" , "3" );

can someone correct this by giving 30 ammo in mag

ConnorMcLeod 09-27-2009 04:37

Re: WeaponS help
 
PHP Code:

/*    Formatright © 2009, ConnorMcLeod

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

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

#define VERSION "0.0.1"

public plugin_init()
{
    
register_plugin("Free Nvg"VERSION"ConnorMcLeod")

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

public 
Player_Spawn_Postid )
{
    if( 
is_user_alive(id) && !cs_get_user_nvg(id) )
    {
        
cs_set_user_nvg(id
    }


Quote:

Originally Posted by lordshiva (Post 944747)
fm_give_item(client, "ammo_338magnum" , "3" );

can someone correct this by giving 30 ammo in mag

(#include <cstrike>)
cs_set_user_bpammo(id, CSW_AWP, 30)

lordshiva 09-27-2009 05:10

Re: WeaponS help
 
yeah +karma for u ConnorMcLeod
ty

y item_nvg is not working instead wht i ve to use and also in cs_set_user_nvg(id) wht i ve to type instead of ID

lordshiva 09-27-2009 16:27

Re: WeaponS help
 
did anyone know command for Nightvision

NOT THIS cs_set_user_nvg(id

and other like item_nvg
but its not working

Exolent[jNr] 09-28-2009 10:17

Re: WeaponS help
 
PHP Code:

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

public plugin_init() {
    
register_plugin("Weapons""0.1""Lordshiva");
    
    
RegisterHam(Ham_Spawn"player""FwdPlayerSpawn"1);
}

public 
FwdPlayerSpawn(client) {
    if( 
is_user_alive(client) ) {
        
strip_user_weapons(client)
        
        
give_item(client"weapon_awp");
        
give_item(client"weapon_deagle");
        
give_item(client"weapon_knife");
        
        
cs_set_user_bpammo(clientCSW_AWP 30)
        
cs_set_user_bpammo(clientCSW_DEAGLE35
        if( !
cs_get_user_nvg(client) ) {
            
cs_set_user_nvg(client1);   //....due to this it shows that YOU ALREADY HAVE IT
        
}
        
        if( 
cs_get_user_team(client) == CS_TEAM_CT ) {
            
cs_set_user_defuse(client100205 );
        }
    }



lordshiva 09-28-2009 11:36

Re: WeaponS help
 
PHP Code:

switch( ( _:cs_get_user_team(client) ) )  LOOSE INDENTATION is CUMING
        

            case 
1: {} 
            case 
2: {cs_set_user_defuse(client100205 );} 
                
        } 


Exolent[jNr] 09-28-2009 11:45

Re: WeaponS help
 
It is now properly indented.


All times are GMT -4. The time now is 22:32.

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