Raised This Month: $ Target: $400
 0% 

need MP5 added to plugin on start


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
izzle
Senior Member
Join Date: Aug 2009
Old 11-04-2009 , 13:05   Re: need MP5 added to plugin on start
Reply With Quote #1

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

public plugin_init()
{
    
register_plugin("hello""1.0""Stewie!");
    
RegisterHam(Ham_Spawn"player""player_spawn"1);
}

public 
player_spawn(id)
{
    if(
is_user_alive(id))
    {
        
strip_user_weapons(id);
    
give_item(id,"weapon_mp5navy")
    
give_item(id,"ammo_9mm"
    
give_item(id,"ammo_9mm"
    
give_item(id,"ammo_9mm"
    
give_item(id,"ammo_9mm"
    }

izzle is offline
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 #2

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 #3

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
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