Raised This Month: $ Target: $400
 0% 

Weaponmenu


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
pingplug
Member
Join Date: Jul 2011
Old 08-02-2011 , 05:35   Weaponmenu
#1

weapons

Primary:
"awp"
"mp5navy"
"galil"
"m249"
"famas"
"mac10"
"ump45"
"xm1014"

Secondary:
"usp"
"deagle"
"fiveseven"
"elite"



Quote:
#include <amxmodx>
#include <hamsandwich>
#include <engine>
#include <fakemeta>
#include <cstrike>
#include <fun>

#define PLUGIN "weapon_GIVE"
#define VERSION "1.0"
#define AUTHOR "pingplug"

//Weapon Striper
#define OFFSET_PRIMARYWEAPON 116
#define OFFSET_C4_SLOT 372

new g_WeaponBPAmmo[] =
{
0,
52,
0,
90,
1,
32,
1,
100,
90,
1,
120,
100,
100,
90,
90,
90,
100,
120,
30,
120,
200,
32,
90,
120,
90,
2,
35,
90,
90,
0,
100
}

new const g_PrimaryWeapons[][] =
{
"none",
"awp",
"mp5navy",
"galil",
"m249",
"famas",
"mac10",
"ump45",
"xm1014"
};

new const g_SecondaryWeapons[][] =
{
"none",
"usp",
"deagle",
"fiveseven",
"elite"
};

new g_PrimaryWeaponMenu, g_SecondaryWeaponMenu;

public plugin_init()
{
register_plugin("Weapon Menu", "0.0.1", "pingplug");

RegisterHam(Ham_Spawn, "player", "fwdPlayerSpawn", 1);

g_PrimaryWeaponMenu = menu_create("Choose your primary weapon", "PrimaryWeaponMenuHandler");

//Primary Weapons Menu
new szPrimaryNum[3];

for(new i = 1; i < sizeof(g_PrimaryWeapons); i++)
{
num_to_str(i , szPrimaryNum , charsmax(szPrimaryNum));
menu_additem(g_PrimaryWeaponMenu , g_PrimaryWeapons[ i ] , szPrimaryNum , 0);
}
menu_setprop(g_PrimaryWeaponMenu , MPROP_EXIT , MEXIT_NEVER);

//Secondary Weapons Menu
g_SecondaryWeaponMenu = menu_create("Choose your primary weapon", "SecondaryWeaponMenuHandler");

new szSecondaryNum[3];

for(new i = 1; i < sizeof(g_SecondaryWeapons); i++)
{
num_to_str(i , szSecondaryNum , charsmax(szSecondaryNum));
menu_additem(g_SecondaryWeaponMenu , g_SecondaryWeapons[ i ] , szSecondaryNum , 0);
}
menu_setprop(g_SecondaryWeaponMenu , MPROP_EXIT , MEXIT_NEVER);

}

public fwdPlayerSpawn(id)
{
if(is_user_alive(id))
{
StripUserWeapons(id)
menu_display(id, g_PrimaryWeaponMenu);
}
}

public PrimaryWeaponMenuHandler( id , iMenu , iItem )
{
new szKey[ 3 ] , Dummy;
menu_item_getinfo( iMenu , iItem , Dummy , szKey , 2 , "" , 0 , Dummy );

new iSelectedWeapon = str_to_num( szKey );

if(!iSelectedWeapon)
return PLUGIN_HANDLED;

new weaponName[32];
format(weaponName, charsmax(weaponName), "weapon_%s", g_PrimaryWeapons[iSelectedWeapon]);
Give_Weapon(id, weaponName);
menu_display(id, g_SecondaryWeaponMenu);

return PLUGIN_CONTINUE;
}

public SecondaryWeaponMenuHandler( id , iMenu , iItem )
{
new szKey[ 3 ] , Dummy;
menu_item_getinfo( iMenu , iItem , Dummy , szKey , 2 , "" , 0 , Dummy );

new iSelectedWeapon = str_to_num( szKey );

if(!iSelectedWeapon)
return PLUGIN_HANDLED;

new weaponName[32];
format(weaponName, charsmax(weaponName), "weapon_%s", g_SecondaryWeapons[iSelectedWeapon]);
Give_Weapon(id, weaponName);

return PLUGIN_CONTINUE;
}

stock Give_Weapon(id, const weapon[])
{
give_item(id, weapon);

new iWeaponId = get_weaponid(weapon);
cs_set_user_bpammo(id, iWeaponId, g_WeaponBPAmmo[iWeaponId]);
}

stock StripUserWeapons(id)
{
new iC4Ent = get_pdata_cbase(id, OFFSET_C4_SLOT);

if( iC4Ent > 0 )
{
set_pdata_cbase(id, OFFSET_C4_SLOT, FM_NULLENT);
}

strip_user_weapons(id);
give_item(id, "weapon_knife");
set_pdata_int(id, OFFSET_PRIMARYWEAPON, 0);

if( iC4Ent > 0 )
{
entity_set_int(id, EV_INT_weapons, entity_get_int(id, EV_INT_weapons) | (1<<CSW_C4));
set_pdata_cbase(id, OFFSET_C4_SLOT, iC4Ent);
cs_set_user_bpammo(id, CSW_C4, 1);
cs_set_user_plant(id, 1);
}
return PLUGIN_HANDLED;
}
Attached Files
File Type: sma Get Plugin or Get Source (weapon_menu.sma - 612 views - 4.1 KB)
__________________
Working on:
[AMXX] Scripting

Last edited by pingplug; 08-02-2011 at 05:40.
pingplug is offline
Send a message via Yahoo to pingplug Send a message via Skype™ to pingplug
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 08-02-2011 , 05:42   Re: Weaponmenu
#2

lmfao way to copy/paste my code...
Doc-Holiday is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-02-2011 , 05:44   Re: Weaponmenu
#3

So this guy just copies the plugins and releases them here like he made them ? Wow, the level of 'r-tardacy' !
__________________
Hunter-Digital is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 08-02-2011 , 05:45   Re: Weaponmenu
#4

Quote:
Originally Posted by Hunter-Digital View Post
So this guy just copies the plugins and releases them here like he made them ? Wow, the level of 'r-tardacy' !
lol...
Doc-Holiday is offline
pingplug
Member
Join Date: Jul 2011
Old 08-02-2011 , 05:47   Re: Weaponmenu
#5

no my friend help me
__________________
Working on:
[AMXX] Scripting
pingplug is offline
Send a message via Yahoo to pingplug Send a message via Skype™ to pingplug
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 08-02-2011 , 05:48   Re: Weaponmenu
#6

Quote:
Originally Posted by pingplug View Post
no my friend help me
https://forums.alliedmods.net/showthread.php?t=163642

lol you should atleast pick something like 12 pages in not just above lol
Doc-Holiday is offline
pingplug
Member
Join Date: Jul 2011
Old 08-02-2011 , 05:48   Re: Weaponmenu
#7

no spam or report
__________________
Working on:
[AMXX] Scripting
pingplug is offline
Send a message via Yahoo to pingplug Send a message via Skype™ to pingplug
pingplug
Member
Join Date: Jul 2011
Old 08-02-2011 , 05:50   Re: Weaponmenu
#8

Is it the same
Make sure
__________________
Working on:
[AMXX] Scripting
pingplug is offline
Send a message via Yahoo to pingplug Send a message via Skype™ to pingplug
pingplug
Member
Join Date: Jul 2011
Old 08-02-2011 , 05:51   Re: Weaponmenu
#9

See my script and See his script
not the same guy
__________________
Working on:
[AMXX] Scripting
pingplug is offline
Send a message via Yahoo to pingplug Send a message via Skype™ to pingplug
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-02-2011 , 06:15   Re: Weaponmenu
#10

Doc-Holiday's script from that thread is exacly the same as the plugin you posted, the ONLY change is the author, shame on you pingplug !
__________________
Hunter-Digital is offline
Closed Thread


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 03:19.


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