Raised This Month: $32 Target: $400
 8% 

[SMALL] Weapon Menu Edit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zetus
Junior Member
Join Date: Oct 2007
Old 11-01-2007 , 16:15   [SMALL] Weapon Menu Edit
Reply With Quote #1

Helo ! Guys .. first way sorry 4 my bad english ... i have edited a plugin ... in the section of the WEAPONS MENU ... but I am doing some erro because I CANT GET OUT OF THE MENU OF RIFLES PLEASE SOMEONE HELP ME

HE WE GO :

public Showguns(id) {
show_menu(id, Keysguns, " \y[28WL] BuyMenu \w $cost^n^n 1. Famas 2250^n 2. Defender 2000^n 3. AK-47 2500^n 4. M4A1 3100^n 5. Aug 3500^n 6. Krieg 552 3500^n 7. Krieg 550 4200^n 8. D3 5000^n 9. Aup 4750^n^n\w0. \yBack^n", -1, "guns") // Display menu|
}

public Pressedguns(id, key) {
/* Menu:
* [28WL] BuyMenu $cost
*
* 1. Flama 2250
* 2. Defender 2000
* 3. AK-47 2500
* 4. M4A1 3100
* 5. Aug 3500
* 6. Krieg 552 3500
* 7. Krieg 550 4200
* 8. D3 5000
* 9. Aup 4750
*
* 0. Back
*/

switch (key) {
case 0: { // 1
if((cs_get_user_money(id) - 2250) < 0)
{
client_print(id,print_center,"[Buy Menu] Sorry you do not have enough money")
Showguns(id)
return PLUGIN_HANDLED
}
give_item(id,"weapon_famas")
cs_set_user_bpammo(id,CSW_FAMAS,250)
cs_set_user_money(id, cs_get_user_money(id) - 2250)
Showbuyitem(id)
}
case 1: { // 2
if((cs_get_user_money(id) - 2250) < 0)
{
client_print(id,print_center,"[Buy Menu] Sorry you do not have enough money")
Showguns(id)
return PLUGIN_HANDLED
}
give_item(id,"weapon_galil")
cs_set_user_bpammo(id,CSW_GALIL,250)
cs_set_user_money(id, cs_get_user_money(id) - 2250)
Showbuyitem(id)
}
case 2: { // 3
if((cs_get_user_money(id) - 2500) < 0)
{
client_print(id,print_center,"[Buy Menu] Sorry you do not have enough money")
Showguns(id)
return PLUGIN_HANDLED
}
give_item(id,"weapon_ak47")
cs_set_user_bpammo(id,CSW_AK47,250)
cs_set_user_money(id, cs_get_user_money(id) - 2500)
Showbuyitem(id)
}
case 3: { // 4
if((cs_get_user_money(id) - 3100) < 0)
{
client_print(id,print_center,"[Buy Menu] Sorry you do not have enough money")
Showguns(id)
return PLUGIN_HANDLED
}
give_item(id,"weapon_m4a1")
cs_set_user_bpammo(id,CSW_M4A1,250)
cs_set_user_money(id, cs_get_user_money(id) - 3100)
Showbuyitem(id)
}
case 4: { // 5
if((cs_get_user_money(id) - 3500) < 0)
{
client_print(id,print_center,"[Buy Menu] Sorry you do not have enough money")
Showguns(id)
return PLUGIN_HANDLED
}
give_item(id,"weapon_aug")
cs_set_user_bpammo(id,CSW_AUG,250)
cs_set_user_money(id, cs_get_user_money(id) - 3500)
Showbuyitem(id)
}
case 5: { // 6
if((cs_get_user_money(id) - 3500) < 0)
{
client_print(id,print_center,"[Buy Menu] Sorry you do not have enough money")
Showguns(id)
return PLUGIN_HANDLED
}
give_item(id,"weapon_sg552")
cs_set_user_bpammo(id,CSW_SG552,250)
cs_set_user_money(id, cs_get_user_money(id) - 4200)
Showbuyitem(id)
}
case 6: { // 7
if((cs_get_user_money(id) - 3500) < 0)
{
client_print(id,print_center,"[Buy Menu] Sorry you do not have enough money")
Showguns(id)
return PLUGIN_HANDLED
}
give_item(id,"weapon_sg550")
cs_set_user_bpammo(id,CSW_SG550,250)
cs_set_user_money(id, cs_get_user_money(id) - 4200)
Showbuyitem(id)
}
case 7: { // 8
if((cs_get_user_money(id) - 3500) < 0)
{
client_print(id,print_center,"[Buy Menu] Sorry you do not have enough money")
Showguns(id)
return PLUGIN_HANDLED
}
give_item(id,"weapon_g3sg1")
cs_set_user_bpammo(id,CSW_G3SG1,250)
cs_set_user_money(id, cs_get_user_money(id) - 4200)
Showbuyitem(id)
}
case 8: { // 9
if((cs_get_user_money(id) - 3500) < 0)
{
client_print(id,print_center,"[Buy Menu] Sorry you do not have enough money")
Showguns(id)
return PLUGIN_HANDLED
}
give_item(id,"weapon_awp")
cs_set_user_bpammo(id,CSW_AWP,250)
cs_set_user_money(id, cs_get_user_money(id) - 4750)
Showbuyitem(id)
}
case 9: { // 0
Showbuyitem(id)
}
}
return PLUGIN_CONTINUE
}


Waiting Reply please someone help me
Zetus is offline
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 11-01-2007 , 18:12   Re: [SMALL] Weapon Menu Edit
Reply With Quote #2

did register "catch the event when player presses a key to the menu"?
__________________
I USED A SECOND ACCOUNT TO DO MORE KARMA UPS AND DOWNS UNTIL GREENTRYST CAUGHT ME
kp_uparrow is offline
Zetus
Junior Member
Join Date: Oct 2007
Old 11-01-2007 , 21:55   Re: [SMALL] Weapon Menu Edit
Reply With Quote #3

Yeah its a weapon menu for players ... but i have add a new weapon ... but when i get in section Rifles ... i cant get out =/ pressing 0 ... there is the original...


public Showguns(id) {
show_menu(id, Keysguns, " \y[28WL] BuyMenu \w $cost^n^n 1. Famas 2250^n 2. Defender 2000^n 3. AK-47 2500^n 4. M4A1 3100^n 5. Aug 3500^n 6. Krieg 552 3500^n 7. Krieg 550 4200^n 8. D3 5000^n^n\w9. \yBack^n", -1, "guns") // Display menu
}

public Pressedguns(id, key) {
/* Menu:
* [28WL] BuyMenu $cost
*
* 1. Flama 2250
* 2. Defender 2000
* 3. AK-47 2500
* 4. M4A1 3100
* 5. Aug 3500
* 6. Krieg 552 3500
* 7. Krieg 550 4200
* 8. D3 5000
* 9. Aup 4750
*
* 0. Back
*/

switch (key) {
case 0: { // 1
if((cs_get_user_money(id) - 2250) < 0)
{
client_print(id,print_center,"[Buy Menu] Sorry you do not have enough money")
Showguns(id)
return PLUGIN_HANDLED
}
give_item(id,"weapon_famas")
cs_set_user_bpammo(id,CSW_FAMAS,250)
cs_set_user_money(id, cs_get_user_money(id) - 2250)
Showbuyitem(id)
}
case 1: { // 2
if((cs_get_user_money(id) - 2250) < 0)
{
client_print(id,print_center,"[Buy Menu] Sorry you do not have enough money")
Showguns(id)
return PLUGIN_HANDLED
}
give_item(id,"weapon_galil")
cs_set_user_bpammo(id,CSW_GALIL,250)
cs_set_user_money(id, cs_get_user_money(id) - 2250)
Showbuyitem(id)
}
case 2: { // 3
if((cs_get_user_money(id) - 2500) < 0)
{
client_print(id,print_center,"[Buy Menu] Sorry you do not have enough money")
Showguns(id)
return PLUGIN_HANDLED
}
give_item(id,"weapon_ak47")
cs_set_user_bpammo(id,CSW_AK47,250)
cs_set_user_money(id, cs_get_user_money(id) - 2500)
Showbuyitem(id)
}
case 3: { // 4
if((cs_get_user_money(id) - 3100) < 0)
{
client_print(id,print_center,"[Buy Menu] Sorry you do not have enough money")
Showguns(id)
return PLUGIN_HANDLED
}
give_item(id,"weapon_m4a1")
cs_set_user_bpammo(id,CSW_M4A1,250)
cs_set_user_money(id, cs_get_user_money(id) - 3100)
Showbuyitem(id)
}
case 4: { // 5
if((cs_get_user_money(id) - 3500) < 0)
{
client_print(id,print_center,"[Buy Menu] Sorry you do not have enough money")
Showguns(id)
return PLUGIN_HANDLED
}
give_item(id,"weapon_aug")
cs_set_user_bpammo(id,CSW_AUG,250)
cs_set_user_money(id, cs_get_user_money(id) - 3500)
Showbuyitem(id)
}
case 5: { // 6
if((cs_get_user_money(id) - 3500) < 0)
{
client_print(id,print_center,"[Buy Menu] Sorry you do not have enough money")
Showguns(id)
return PLUGIN_HANDLED
}
give_item(id,"weapon_sg552")
cs_set_user_bpammo(id,CSW_SG552,250)
cs_set_user_money(id, cs_get_user_money(id) - 4200)
Showbuyitem(id)
}
case 6: { // 7
if((cs_get_user_money(id) - 3500) < 0)
{
client_print(id,print_center,"[Buy Menu] Sorry you do not have enough money")
Showguns(id)
return PLUGIN_HANDLED
}
give_item(id,"weapon_sg550")
cs_set_user_bpammo(id,CSW_SG550,250)
cs_set_user_money(id, cs_get_user_money(id) - 4200)
Showbuyitem(id)
}
case 7: { // 8
if((cs_get_user_money(id) - 3500) < 0)
{
client_print(id,print_center,"[Buy Menu] Sorry you do not have enough money")
Showguns(id)
return PLUGIN_HANDLED
}
give_item(id,"weapon_g3sg1")
cs_set_user_bpammo(id,CSW_G3SG1,250)
cs_set_user_money(id, cs_get_user_money(id) - 4200)
Showbuyitem(id)
}
case 8: { // 9
Showbuyitem(id)
}
}
return PLUGIN_CONTINUE
}
Zetus is offline
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 11-02-2007 , 01:01   Re: [SMALL] Weapon Menu Edit
Reply With Quote #4

whats the Keysguns
show us your WHOLE code inside [small] [ /small]
__________________
I USED A SECOND ACCOUNT TO DO MORE KARMA UPS AND DOWNS UNTIL GREENTRYST CAUGHT ME
kp_uparrow is offline
Zetus
Junior Member
Join Date: Oct 2007
Old 11-02-2007 , 17:23   Re: [SMALL] Weapon Menu Edit
Reply With Quote #5

say menu ... to get in ... he is the first menu

public Showbuyitem(id) {
show_menu(id, Keysbuyitem, "\y [28WL] BuyMenu \w^n^n 1. Handgun^n 2. Shotgun^n 3. Sub-Machine Gun^n 4. Rifle^n 5. Machine Gun^n^n 6. Primary weapon ammo 1000^n 7. Secondary weapon ammo 600^n^n 8. Equipment^n^n 0. \yExit^n", -1, "buyitem") // Display menu
}

public Pressedbuyitem(id, key) {
/* Menu:
* [28WL] BuyMenu
*
* 1. Handgun
* 2. Shotgun
* 3. Sub-Machine Gun
* 4. Rifle
* 5. Machine Gun
*
* 6. Primary weapon ammo
* 7. Secondary weapon ammo
*
* 8. Equipment
*
* 0. Exit
*/
switch (key) {
case 0: { // 1
if(!is_user_alive(id))
{
client_print(id,print_chat,"Your not alive")
return PLUGIN_HANDLED
}
Showhandgun(id)
}
case 1: { // 2
if(!is_user_alive(id))
{
client_print(id,print_chat,"Your not alive")
return PLUGIN_HANDLED
}
Showshotgun(id)
}
case 2: { // 3
if(!is_user_alive(id))
{
client_print(id,print_chat,"Your not alive")
return PLUGIN_HANDLED
}
Showsubgun(id)
}
case 3: { // 4
if(!is_user_alive(id) )
{
client_print(id,print_chat,"Your not alive")
return PLUGIN_HANDLED
}
Showguns(id)
}
case 4: { // 5
if(!is_user_alive(id))
{
client_print(id,print_chat,"Your not alive")
return PLUGIN_HANDLED
}
Showmachinegun(id)
}
case 5: { // 6
if(!is_user_alive(id))
{
client_print(id,print_chat,"Your not alive")
return PLUGIN_HANDLED
}
if((cs_get_user_money(id) - 100) < 0)
{
client_print(id,print_center,"[Buy Menu] Sorry you do not have enough money")
return PLUGIN_HANDLED
}

cs_set_user_money(id, cs_get_user_money(id) - 100)
Showbuyitem(id)
priammo(id)
}
case 6: { // 7
if(!is_user_alive(id))
{
client_print(id,print_chat,"Your not alive")
return PLUGIN_HANDLED
}
if((cs_get_user_money(id) - 100) < 0)
{
client_print(id,print_center,"[Buy Menu] Sorry you do not have enough money")
return PLUGIN_HANDLED
}

cs_set_user_money(id, cs_get_user_money(id) - 100)
Showbuyitem(id)
secammo(id)

}
case 7: { // 8
if(!is_user_alive(id))
{
client_print(id,print_chat,"Your not alive")
return PLUGIN_HANDLED
}
Showequipment(id)
}
case 9: { // 0
client_print(id,print_chat,"[BuyMenu] Type menu for this menu again.")
}
}
return PLUGIN_CONTINUE
}
Zetus is offline
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 11-02-2007 , 18:18   Re: [SMALL] Weapon Menu Edit
Reply With Quote #6

someone tell him what the WHOLE code means and how to use [small]...
__________________
I USED A SECOND ACCOUNT TO DO MORE KARMA UPS AND DOWNS UNTIL GREENTRYST CAUGHT ME
kp_uparrow is offline
Zetus
Junior Member
Join Date: Oct 2007
Old 11-03-2007 , 14:13   Re: [SMALL] Weapon Menu Edit
Reply With Quote #7

I'm Sorry about of the problems ... but please man help me fix this ... i get in the rifles section and I cant get out Pressing 0 (Zero) ... Please help me +Karma for You ^^ thanks

_____________________________________________ ____
There here is All the code Sma is in the mensage plx help me T_T
Attached Files
File Type: sma Get Plugin or Get Source (28Wl 2 All Gun Patch xD.sma - 614 views - 55.8 KB)

Last edited by Zetus; 11-03-2007 at 14:17.
Zetus is offline
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 11-03-2007 , 15:23   Re: [SMALL] Weapon Menu Edit
Reply With Quote #8

line 58

#define Keysguns (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1< <6)|(1<<7)|(1<<8 ) // Keys: 123456789 missing key 0

to

#define Keysguns (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1< <6)|(1<<7)|(1<<8 )|(1<<9) // Keys: 1234567890
__________________
I USED A SECOND ACCOUNT TO DO MORE KARMA UPS AND DOWNS UNTIL GREENTRYST CAUGHT ME
kp_uparrow is offline
Zetus
Junior Member
Join Date: Oct 2007
Old 11-03-2007 , 18:03   Re: [SMALL] Weapon Menu Edit
Reply With Quote #9

Thank You Very much man ... you can help me ? in another problem plx .. is very simples i got put the link here ok? ^^
___________________________________

http://forums.alliedmods.net/showthr...062#post549062

Last edited by Zetus; 11-03-2007 at 18:09.
Zetus 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 08:39.


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