AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Search for plug,, awp & knife,, only (https://forums.alliedmods.net/showthread.php?t=173644)

s3x0n 12-08-2011 11:22

Search for plug,, awp & knife,, only
 
is this possible to find ?

I want all roundes has an automatic AWP and KNIFE

nothing else , just that two weapon ...

MyPc 12-08-2011 12:16

Re: Search for plug,, awp & knife,, only
 
Quote:

Originally Posted by s3x0n (Post 1609738)
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

Devil259 12-08-2011 13:23

Re: Search for plug,, awp & knife,, only
 
if that don't work,

try to replace

client_cmd( );

by

engclient_cmd( );

s3x0n 12-08-2011 17:20

Re: Search for plug,, awp & knife,, only
 
its works good , just have one bug , cant drop awp with G :/ can fix that ..??

MyPc 12-09-2011 05:43

Re: Search for plug,, awp & knife,, only
 
Quote:

Originally Posted by s3x0n (Post 1609963)
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; }

s3x0n 12-10-2011 16:09

Re: Search for plug,, awp & knife,, only
 
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)

jackas 12-10-2011 18:09

Re: Search for plug,, awp & knife,, only
 
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)



s3x0n 12-10-2011 18:56

Re: Search for plug,, awp & knife,, only
 
this is good code ,but can you put 30 bullets in AWP...
thnx verry mucchhh for post...

MyPc 12-11-2011 00:02

Re: Search for plug,, awp & knife,, only
 
Quote:

Originally Posted by s3x0n (Post 1610957)
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..

s3x0n 12-11-2011 05:17

Re: Search for plug,, awp & knife,, only
 
can upload for me ?


All times are GMT -4. The time now is 20:55.

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