Raised This Month: $ Target: $400
 0% 

menu help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
atambo
Senior Member
Join Date: Oct 2004
Location: Pittsburgh, PA
Old 09-03-2005 , 23:24   menu help
Reply With Quote #1

I made a new remove credit menu for credit mod but when I am looking at the "(Cont) Remove Item Menu" and I click on anything it will use the RemoveAIMenu(id, keys) instead of the RemoveTWOAIMenu(id, keys) function...I'm going to attach the plugin below and post the parts that are important I've tried renaming them a few times and everything else is working fine but for some reason it doesn't want to use the RemoveTWOAIMenu(id, keys) with the "(Cont) Remove Item Menu"

Code:
    register_menucmd(register_menuid("Remove Item Menu"), 1023, "RemoveAIMenu")     register_menucmd(register_menuid("(Cont) Remove Item Menu"), 1023, "RemoveTWOAIMenu")

Code:
public RemoveIMenu(id) {     new authid[32]     new playtime = (get_user_time(id) - lastplaytime[id])     lastplaytime[id] = get_user_time(id)     get_user_authid(id,authid,31)     new tmp_vault_time,vault_time[21]     get_vaultdata(authid,vault_time,20)     tmp_vault_time = str_to_num(vault_time)     tmp_vault_time += playtime     connecttime[id] = tmp_vault_time     num_to_str(tmp_vault_time,vault_time,20)     set_vaultdata(authid,vault_time)     new tmp_minutes = floatround(float(connecttime[id]/60),floatround_floor)     new minutes = tmp_minutes % (credittime/60)     new keys     new szMenuBody[512]     new len = format(szMenuBody, 511, "\yRemove Item Menu:^n")     len += format(szMenuBody[len], 511-len, "^n\w1. Battle Aura (Cost: %d Credit)", hpscost)     len += format(szMenuBody[len], 511-len, "^n\w2. First Aid (Cost: %d Credit)", regenerationcost)     len += format(szMenuBody[len], 511-len, "^n\w3. Weapon Training (Cost: %d Credit)", weapontrainingcost)     len += format(szMenuBody[len], 511-len, "^n\w4. Jump Module (Cost: %d Credit)", jumpmodulecost)     len += format(szMenuBody[len], 511-len, "^n\w5. Climbing Gear (Cost: %d Credit)", climbgearcost)     len += format(szMenuBody[len], 511-len, "^n\w6. Promotion (Cost: %d Credit)", promocost)     len += format(szMenuBody[len], 511-len, "^n\w7. Unlimited Ammo (Cost: %d Credit)", unlacost)     len += format(szMenuBody[len], 511-len, "^n\w8. Next Items")     len += format(szMenuBody[len], 511-len, "^n^n\w9.  Back")     len += format(szMenuBody[len], 511-len, "^n\w0.  Cancel")     len += format(szMenuBody[len], 511-len, "^n^nCredits: %i (%i minutes remaining until next credit)",connecttime[id]/credittime,(credittime/60)-minutes)     keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9)     show_menu(id, keys, szMenuBody, -1)     return PLUGIN_HANDLED } public RemoveAIMenu(id, key) {     switch(key)     {         case 0:         {             if(hpstlr[id] == 0)                 client_print(id, print_chat, "[AMXX] You do not have Battle Aura to remove")             else             {                 creditsspent[id]--                 itemcap[id]--                 hpstlr[id] = 0                 upgraderemoved(id)             }             RemoveIMenu(id)         }         case 1:         {             if(regeneration[id] == 0)                 client_print(id, print_chat, "[AMXX] You do not have First Aid to remove")             else             {                 creditsspent[id]--                 itemcap[id]--                 regeneration[id] = 0                 if(task_exists(FAID_TASK +id))                     remove_task(FAID_TASK + id)                 upgraderemoved(id)             }             RemoveIMenu(id)         }         case 2:         {             if(weapontraining[id] == 0)                 client_print(id, print_chat, "[AMXX] You do not have Weapon Training to remove")             else             {                 creditsspent[id]--                 itemcap[id]--                 weapontraining[id] = 0                 upgraderemoved(id)             }             RemoveIMenu(id)         }         case 3:         {             if(jumpmodule[id] == 0)                 client_print(id, print_chat, "[AMXX] You do not have Jump Module to remove")             else             {                 creditsspent[id]--                 itemcap[id]--                 jumpmodule[id] = 0                 upgraderemoved(id)             }             RemoveIMenu(id)         }         case 4:         {             if(climb[id] == 0)                 client_print(id, print_chat, "[AMXX] You do not have Climbing Gear to remove")             else             {                 creditsspent[id]--                 itemcap[id]--                 climb[id] = 0                 if(task_exists(CLIMB_TASK +id))                     remove_task(CLIMB_TASK + id)                 upgraderemoved(id)             }             RemoveIMenu(id)         }         case 5:         {             if(promotion[id] == 0)                 client_print(id, print_chat, "[AMXX] You do not have Promotion to remove")             else             {                 creditsspent[id]--                 itemcap[id]--                 promotion[id] = 0                 upgraderemoved(id)             }             RemoveIMenu(id)         }         case 6:         {             if(gHasuammo[id] == 0)                 client_print(id, print_chat, "[AMXX] You do not have Unlimited Ammo to remove")             else             {                 creditsspent[id]--                 itemcap[id]--                 gHasuammo[id] = 0                 upgraderemoved(id)             }             RemoveIMenu(id)         }         case 7: RemoveTWOIMenu(id)         case 8: RemoveMenu(id)     }     return PLUGIN_HANDLED } public RemoveTWOIMenu(id) {     new authid[32]     new playtime = (get_user_time(id) - lastplaytime[id])     lastplaytime[id] = get_user_time(id)     get_user_authid(id,authid,31)     new tmp_vault_time,vault_time[21]     get_vaultdata(authid,vault_time,20)     tmp_vault_time = str_to_num(vault_time)     tmp_vault_time += playtime     connecttime[id] = tmp_vault_time     num_to_str(tmp_vault_time,vault_time,20)     set_vaultdata(authid,vault_time)     new tmp_minutes = floatround(float(connecttime[id]/60),floatround_floor)     new minutes = tmp_minutes % (credittime/60)     new keys     new szMenuBody[512]     new len = format(szMenuBody, 511, "\y(Cont) Remove Item Menu:^n")     len += format(szMenuBody[len], 511-len, "^n\w1. E.S.P (Cost: %d Credit)", espcost)     len += format(szMenuBody[len], 511-len, "^n\w2. Laser Pointer (Cost: %d Credit)", lasercost)     len += format(szMenuBody[len], 511-len, "^n\w3. Crowbar (Cost: %d Credit)", crowbarcost)     len += format(szMenuBody[len], 511-len, "^n\w4. Stealth Shoes (Cost: %d Credit)", sshoecost)     len += format(szMenuBody[len], 511-len, "^n^n\w9.  Back")     len += format(szMenuBody[len], 511-len, "^n\w0.  Cancel")     len += format(szMenuBody[len], 511-len, "^n^nCredits: %i (%i minutes remaining until next credit)",connecttime[id]/credittime,(credittime/60)-minutes)     keys = (1<<0|1<<1|1<<2|1<<3|1<<8|1<<9)     show_menu(id, keys, szMenuBody, -1)     return PLUGIN_HANDLED } public RemoveTWOAIMenu(id, key) {     switch(key)     {         case 0:         {             if(esp[id] == 0)                 client_print(id, print_chat, "[AMXX] You do not have ESP to remove")             else             {                 creditsspent[id]--                 itemcap[id]--                 esp[id] = 0                 if(task_exists(ESP_TASK +id))                     remove_task(ESP_TASK + id)                 upgraderemoved(id)             }             RemoveTWOIMenu(id)         }         case 1:         {             if(laser[id] == 0)                 client_print(id, print_chat, "[AMXX] You do not have Laser Pointer to remove")             else             {                 creditsspent[id]--                 itemcap[id]--                 laser[id] = 0                 upgraderemoved(id)             }             RemoveTWOIMenu(id)         }         case 2:         {             if(crowbar[id] == 0)                 client_print(id, print_chat, "[AMXX] You do not have Crowbar to remove")             else             {                 creditsspent[id]--                 itemcap[id]--                 crowbar[id] = 0                 upgraderemoved(id)             }             RemoveTWOIMenu(id)         }         case 3:         {             if(sshoe[id] == 0)                 client_print(id, print_chat, "[AMXX] You do not have Stealth Shoes to remove")             else             {                 creditsspent[id]--                 itemcap[id]--                 sshoe[id] = 0                 set_user_footsteps(id, 0)                 upgraderemoved(id)             }             RemoveTWOIMenu(id)         }         case 8: RemoveIMenu(id)     }     return PLUGIN_HANDLED }
Attached Files
File Type: sma Get Plugin or Get Source (creditswithgive.sma - 482 views - 59.0 KB)
__________________
atambo is offline
Send a message via AIM to atambo Send a message via MSN to atambo Send a message via Yahoo to atambo
 


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 14:35.


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