Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin generated by AMXX-Studio */
- #include < amxmodx >
- #include < fakemeta >
- #include < hamsandwich >
- const g_oCSTeams = 114;
- enum _:Weapon
- {
- SName[16],
- CName[22],
- CSWeapon
- }
- enum _:CsTeams
- {
- CS_TEAM_UNASSIGNED,
- CS_TEAM_T,
- CS_TEAM_CT,
- CS_TEAM_SPEC
- }
- new const szPrimarys[ ][ Weapon ] = {
- { "M4A1", "weapon_m4a1", CSW_M4A1 },
- { "AK47", "weapon_ak47", CSW_AK47 },
- { "GALIL", "weapon_galil", CSW_GALIL },
- { "FAMAS", "weapon_famas", CSW_FAMAS },
- { "AWP", "weapon_awp", CSW_AWP }
- }
- public plugin_init()
- {
- register_plugin( "Guards Weapons", "v0.1", "+ColdWar" )
- RegisterHam( Ham_Spawn, "player", "Ham_PlayerSpawn_Post", 1 );
- }
- public Ham_PlayerSpawn_Post( client )
- {
- if( !is_user_connected( client ) || !is_user_alive( client ) || fm_cs_get_user_team( client ) != CS_TEAM_CT )
- return HAM_IGNORED;
- new iMenu = menu_create( "\r[AMXX]\w Guard Weapons Menu", "sub_weapons" );
- for( new i = 0 ; i < sizeof szPrimarys ; i ++ )
- menu_additem( iMenu, szPrimarys[ SName ] );
- menu_display( client, iMenu );
- return HAM_IGNORED;
- }
- public sub_weapons( client, iMenu, item )
- {
- menu_destroy( iMenu );
- if( item == MENU_EXIT || fm_cs_get_user_team( client ) != CS_TEAM_CT )
- return 1;
- fm_strip_user_weapons( client );
- fm_give_item( client, "weapon_knife" );
- fm_give_item( client, szPrimarys[ item ][ CName ] );
- fm_give_item( client, "weapon_deagle" );
- fm_give_item( client , "weapon_smokegrenade" );
- fm_give_item( client , "weapon_flashbang" );
- fm_give_item( client , "weapon_hegrenade" );
- fm_cs_set_user_bpammo( client, szPrimarys[ item ][ CSWeapon ], 9999 );
- fm_cs_set_user_bpammo( client, CSW_DEAGLE, 9999 );
- fm_cs_set_user_bpammo( client, CSW_FLASHBANG, 2 );
- return 1;
- }
- stock fm_strip_user_weapons(index)
- {
- new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "player_weaponstrip"));
- if (!pev_valid(ent))
- return 0;
- dllfunc(DLLFunc_Spawn, ent);
- dllfunc(DLLFunc_Use, ent, index);
- engfunc(EngFunc_RemoveEntity, ent);
- return 1;
- }
- stock fm_give_item( client, const item[] )
- {
- if ( !equal( item, "weapon_", 7 ) )
- return 0;
- new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, item));
- if ( !pev_valid( ent ) )
- return 0;
- new Float:origin[3];
- pev( client, pev_origin, origin );
- set_pev( ent, pev_origin, origin );
- set_pev( ent, pev_spawnflags, pev( ent, pev_spawnflags ) | SF_NORESPAWN );
- dllfunc( DLLFunc_Spawn, ent );
- dllfunc( DLLFunc_Touch, ent, client );
- return ent;
- }
- stock fm_cs_get_user_team( client )
- {
- return get_pdata_int( client, g_oCSTeams );
- }
- stock fm_cs_set_user_bpammo( client, csweapon, amount )
- {
- new offset;
- switch(csweapon)
- {
- case CSW_AWP:
- offset = 377;
- case CSW_SCOUT,CSW_AK47,CSW_G3SG1:
- offset = 378;
- case CSW_M249:
- offset = 379;
- case CSW_M4A1,CSW_FAMAS,CSW_AUG,CSW_SG550,CSW_GALI,CSW_SG552:
- offset = 380;
- case CSW_M3,CSW_XM1014:
- offset = 381;
- case CSW_USP,CSW_UMP45,CSW_MAC10:
- offset = 382;
- case CSW_FIVESEVEN,CSW_P90:
- offset = 383;
- case CSW_DEAGLE:
- offset = 384;
- case CSW_P228:
- offset = 385;
- case CSW_GLOCK18,CSW_MP5NAVY,CSW_TMP,CSW_ELITE:
- offset = 386;
- case CSW_FLASHBANG:
- offset = 387;
- case CSW_HEGRENADE:
- offset = 388;
- case CSW_SMOKEGRENADE:
- offset = 389;
- case CSW_C4:
- offset = 390;
- }
- set_pdata_int(client,offset,amount);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment