Raised This Month: $ Target: $400
 0% 

need MP5 added to plugin on start


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-04-2009 , 13:18   Re: need MP5 added to plugin on start
Reply With Quote #1

More efficient :

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

#define PLUGIN "Start With MP5"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"

new Trie:g_tPreventEntityKeyvalue;

public 
plugin_init()
{
    
register_pluginPLUGINVERSIONAUTHOR );
}

public 
plugin_precache()
{
    new 
iEnt;

    
g_tPreventEntityKeyvalue TrieCreate();
    
TrieSetCell(g_tPreventEntityKeyvalue"player_weaponstrip"1);
    
TrieSetCell(g_tPreventEntityKeyvalue"game_player_equip"1);
    
TrieSetCell(g_tPreventEntityKeyvalue"info_map_parameters"1);

    
iEnt create_entity("player_weaponstrip");
    
DispatchKeyValue(iEnt"origin""99999 99999 99999");
    
DispatchKeyValue(iEnt"targetname""weaponstrip");
    
DispatchSpawn(iEnt);

    
iEnt create_entity("game_player_equip");
    
DispatchKeyValue(iEnt"targetname""player_equip");
    
DispatchKeyValue(iEnt"weapon_mp5navy""1");
    
DispatchKeyValue(iEnt"ammo_9mm""4");
    
DispatchSpawn(iEnt);

    
iEnt create_entity("multi_manager");
    
DispatchKeyValue(iEnt"weaponstrip""0");
    
DispatchKeyValue(iEnt"player_equip""1");
    
DispatchKeyValue(iEnt"targetname""game_playerspawn");
    
DispatchKeyValue(iEnt"spawnflags""1");
    
DispatchSpawn(iEnt);

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

public 
pfn_keyvalueiEnt 
{
    new 
szClassName[32], szCrap[2];
    
copy_keyvalue(szClassNamecharsmax(szClassName), szCrapcharsmax(szCrap), szCrapcharsmax(szCrap));
    if( 
TrieKeyExists(g_tPreventEntityKeyvalueszClassName) )
    {
        
remove_entity(iEnt);
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;
}

public 
plugin_cfg()
{
    
TrieDestroy(g_tPreventEntityKeyvalue);
    
set_cvar_float("sv_restart"1.0);

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 11-04-2009 at 16:52.
ConnorMcLeod is offline
Jon
Veteran Member
Join Date: Dec 2007
Old 11-04-2009 , 13:36   Re: need MP5 added to plugin on start
Reply With Quote #2

Quote:
Originally Posted by ConnorMcLeod View Post
More efficient :
1. Doesn't work, you don't get any weapons.
2. Why do people keep using and posting this piece of code when it gives new items on resethud?
Jon is offline
drumzplaya13
Senior Member
Join Date: Feb 2008
Location: TEXAS
Old 11-04-2009 , 13:40   Re: need MP5 added to plugin on start
Reply With Quote #3

I am glad everyone is trying to help. The main goal is to make it so default secondary weapons and knife, never show up and you cant even go to them. The code I posted works for that. I was hoping someone could implement giving an mp5 to both teams in the original code that I had working for no knife and no default secondary weapons.
__________________
Think Positive - Stay Positive
drumzplaya13 is offline
Jon
Veteran Member
Join Date: Dec 2007
Old 11-04-2009 , 14:19   Re: need MP5 added to plugin on start
Reply With Quote #4

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <fun>

public plugin_init( )
{
    
RegisterHamHam_Spawn"player""PlayerSpawn")
}

public 
PlayerSpawnid )
{
    if( !
is_user_aliveid ) )
    {
        return 
HAM_IGNORED
    
}
    
    
strip_user_weaponsid )
    
give_itemid"weapon_mp5navy" )
    
cs_set_user_bpammoidCSW_MP5NAVY120 )
    
    return 
HAM_IGNORED

Jon 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 17:42.


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