Raised This Month: $ Target: $400
 0% 

Search for plug,, awp & knife,, only


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
s3x0n
Junior Member
Join Date: Dec 2011
Old 12-08-2011 , 11:22   Search for plug,, awp & knife,, only
Reply With Quote #1

is this possible to find ?

I want all roundes has an automatic AWP and KNIFE

nothing else , just that two weapon ...
s3x0n is offline
MyPc
Senior Member
Join Date: Sep 2011
Old 12-08-2011 , 12:16   Re: Search for plug,, awp & knife,, only
Reply With Quote #2

Quote:
Originally Posted by s3x0n View Post
is this possible to find ?

I want all roundes has an automatic AWP and KNIFE

nothing else , just that two weapon ...
Code:
#include < amxmodx > #include < hamsandwich > #include < cstrike > #include < fun > new g_pStatus, g_pKnife, g_pBullets; public plugin_init( ) {     /* Cvars */     g_pStatus = register_cvar( "awp_only", "1" );     g_pKnife = register_cvar( "knife_enabled", "1" );     g_pBullets = register_cvar( "awp_bullets", "30" );         /* Events */     RegisterHam( Ham_Spawn, "player", "fnPlayerSpawn" );     register_event( "CurWeapon", "fnCurrentWeapon", "be", "1=1" );         /* Commands */     register_clcmd( "drop" , "fnClientPreDrop" ); } public fnPlayerSpawn( iIndex ) {     if( get_pcvar_num( g_pStatus ) )     {         strip_user_weapons( iIndex );         give_item( iIndex, "weapon_awp" );         cs_set_user_bpammo( iIndex, CSW_AWP, get_pcvar_num( g_pBullets ) );         if( get_pcvar_num( g_pKnife ) )         {             give_item( iIndex, "weapon_knife" );         }     } } public fnCurrentWeapon( iIndex ) {     if( get_pcvar_num( g_pStatus ) )     {         new iWeapon = get_user_weapon( iIndex )         if( iWeapon != CSW_AWP && iWeapon != CSW_KNIFE )         {             if( get_pcvar_num( g_pKnife ) )             {                 client_cmd( iIndex, "weapon_knife" );             }             else             {                 client_cmd( iIndex, "weapon_awp" );             }         }         else if( iWeapon == CSW_AWP )         {             if( cs_get_user_bpammo( iIndex, iWeapon ) != 30 )             {                 cs_set_user_bpammo( iIndex, CSW_AWP, 30 );             }         }     } } public fnClientPreDrop( iIndex ) {     if( get_pcvar_num( g_pStatus ) )     {         return PLUGIN_HANDLED;     }     return PLUGIN_CONTINUE; }

Untested

Last edited by MyPc; 12-08-2011 at 12:20.
MyPc is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 12-08-2011 , 13:23   Re: Search for plug,, awp & knife,, only
Reply With Quote #3

if that don't work,

try to replace

client_cmd( );

by

engclient_cmd( );
__________________
You can do anything you set your mind to, man.

Devil259 is offline
s3x0n
Junior Member
Join Date: Dec 2011
Old 12-08-2011 , 17:20   Re: Search for plug,, awp & knife,, only
Reply With Quote #4

its works good , just have one bug , cant drop awp with G :/ can fix that ..??
s3x0n is offline
MyPc
Senior Member
Join Date: Sep 2011
Old 12-09-2011 , 05:43   Re: Search for plug,, awp & knife,, only
Reply With Quote #5

Quote:
Originally Posted by s3x0n View Post
its works good , just have one bug , cant drop awp with G :/ can fix that ..??
I blocked that so they won't pickup any other weapons :@
Code:
#include < amxmodx > #include < hamsandwich > #include < cstrike > #include < fun > new g_pStatus, g_pKnife, g_pBullets; public plugin_init( ) {     /* Cvars */     g_pStatus = register_cvar( "awp_only", "1" );     g_pKnife = register_cvar( "knife_enabled", "1" );     g_pBullets = register_cvar( "awp_bullets", "30" );         /* Events */     RegisterHam( Ham_Spawn, "player", "fnPlayerSpawn" );     register_event( "CurWeapon", "fnCurrentWeapon", "be", "1=1" );         /* Commands */     register_clcmd( "drop" , "fnClientPreDrop" ); } public fnPlayerSpawn( iIndex ) {     if( get_pcvar_num( g_pStatus ) )     {         strip_user_weapons( iIndex );         give_item( iIndex, "weapon_awp" );         cs_set_user_bpammo( iIndex, CSW_AWP, get_pcvar_num( g_pBullets ) );         if( get_pcvar_num( g_pKnife ) )         {             give_item( iIndex, "weapon_knife" );         }     } } public fnCurrentWeapon( iIndex ) {     if( get_pcvar_num( g_pStatus ) )     {         new iWeapon = get_user_weapon( iIndex )         if( iWeapon != CSW_AWP && iWeapon != CSW_KNIFE )         {             if( get_pcvar_num( g_pKnife ) )             {                 client_cmd( iIndex, "weapon_knife" );             }             else             {                 client_cmd( iIndex, "weapon_awp" );             }         }         else if( iWeapon == CSW_AWP )         {             if( cs_get_user_bpammo( iIndex, iWeapon ) != 30 )             {                 cs_set_user_bpammo( iIndex, CSW_AWP, 30 );             }         }     } } public fnClientPreDrop( iIndex ) {     if( get_pcvar_num( g_pStatus ) )     {         if( get_user_weapon( iIndex ) != CSW_AWP )         {             return PLUGIN_HANDLED;         }     }     return PLUGIN_CONTINUE; }

Last edited by MyPc; 12-09-2011 at 05:45.
MyPc is offline
s3x0n
Junior Member
Join Date: Dec 2011
Old 12-10-2011 , 16:09   Re: Search for plug,, awp & knife,, only
Reply With Quote #6

Your plugin failed to compile! Read the errors below:
Welcome to the AMX Mod X 1.8.1-300 Compiler. Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team /tmp/text3r3b2g.sma(0) : error 075: input line too long (after substitutions) /tmp/text3r3b2g.sma(1) : error 038: extra characters on line /tmp/text3r3b2g.sma(1) : error 075: input line too long (after substitutions) /tmp/text3r3b2g.sma(4) : error 010: invalid function or declaration /tmp/text3r3b2g.sma(4) : error 013: no entry point (no public functions)
s3x0n is offline
MyPc
Senior Member
Join Date: Sep 2011
Old 12-11-2011 , 00:02   Re: Search for plug,, awp & knife,, only
Reply With Quote #7

Quote:
Originally Posted by s3x0n View Post
Your plugin failed to compile! Read the errors below:
Welcome to the AMX Mod X 1.8.1-300 Compiler. Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team /tmp/text3r3b2g.sma(0) : error 075: input line too long (after substitutions) /tmp/text3r3b2g.sma(1) : error 038: extra characters on line /tmp/text3r3b2g.sma(1) : error 075: input line too long (after substitutions) /tmp/text3r3b2g.sma(4) : error 010: invalid function or declaration /tmp/text3r3b2g.sma(4) : error 013: no entry point (no public functions)
idk it compiled good for me..
MyPc is offline
jackas
Senior Member
Join Date: Feb 2011
Old 12-10-2011 , 18:09   Re: Search for plug,, awp & knife,, only
Reply With Quote #8

EnJOy
PHP Code:
#include <amxmodx>
#include <engine>

#define VERSION "0.0.1"

public plugin_init()
{
    
register_plugin("Spawn With Awp"VERSION"ConnorMcLeod")
}

public 
plugin_precache()
{
    new 
iEnt
    iEnt 
create_entity("game_player_equip")
    
    
DispatchKeyValue(iEnt"weapon_knife""1")
    
DispatchKeyValue(iEnt"weapon_awp""0")
    
DispatchKeyValue(iEnt"338magnum""3")
    
DispatchSpawn(iEnt)

    
iEnt create_entity("info_map_parameters")
    
DispatchKeyValue(iEnt"buying""3")
    
DispatchSpawn(iEnt)
}

public 
pfn_keyvalueiEnt 
{
    new 
szClassName[32], szKeyName[32], szValue[32]
    
copy_keyvalue(szClassNamecharsmax(szClassName), szKeyNamecharsmax(szKeyName), szValuecharsmax(szValue)) 
    if(    
equal(szClassName"game_player_equip")
    ||    
equal(szClassName"info_map_parameters")    )
    {
        
remove_entity(iEnt)
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE
}

public 
plugin_cfg()
{
    
set_cvar_float("sv_restart"1.0)

__________________
For our new family member's in alliedmods
Quote:
Originally Posted by bo0m View Post
Ok, there are a couple ways to find this, here are about 5:
1. Search
2. Search again
3. If you don't find it, then search again.
4. After searching the 3rd time, search again
5. Then when you are tired of searching, just search some more!!!!
jackas is offline
s3x0n
Junior Member
Join Date: Dec 2011
Old 12-10-2011 , 18:56   Re: Search for plug,, awp & knife,, only
Reply With Quote #9

this is good code ,but can you put 30 bullets in AWP...
thnx verry mucchhh for post...
s3x0n is offline
s3x0n
Junior Member
Join Date: Dec 2011
Old 12-11-2011 , 05:17   Re: Search for plug,, awp & knife,, only
Reply With Quote #10

can upload for me ?
s3x0n is offline
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 20:55.


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