AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Menu problems (https://forums.alliedmods.net/showthread.php?t=28998)

unnamed :) 05-27-2006 15:06

Menu problems
 
*newest code here*
The menu isn't giving me powerups. And I need to somehow close it in the inMenu check.

unnamed :) 05-28-2006 03:06

I hate to bump but I really need help.

Basic-Master 05-28-2006 07:32

Re: Menu problems
 
Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <tsfun> new inMenu[33] public plugin_init() {     register_plugin("Powerup Menu","unnamed","1.0")     register_clcmd("pumenu","ShowMenu",ADMIN_SLAY,"- shows the Powerup Menu")     register_menucmd(register_menuid("\yPowerup Menu:"),1023,"MenuPU") } public ShowMenu(id,level,cid) {     if(!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED     if(inMenu[id] == 1) {         inMenu[id] = 0 // need to close the menu here somehow         return PLUGIN_HANDLED     }     inMenu[id] = 1         new szMenuBody[256]     new keys     new nLen = format( szMenuBody, 255, "\yPowerup Menu:^n" )     nLen += format( szMenuBody[nLen], 255-nLen, "^n\w0. Random" )     nLen += format( szMenuBody[nLen], 255-nLen, "^n\w1. Slow Motion" )     nLen += format( szMenuBody[nLen], 255-nLen, "^n\w2. Infite Ammo" )     nLen += format( szMenuBody[nLen], 255-nLen, "^n\w3. Kung Fu" )     nLen += format( szMenuBody[nLen], 255-nLen, "^n\w4. Slow Pause" )     nLen += format( szMenuBody[nLen], 255-nLen, "^n\w5. Double Firerate" )     nLen += format( szMenuBody[nLen], 255-nLen, "^n\w6. Grenade" )     nLen += format( szMenuBody[nLen], 255-nLen, "^n\w7. Health" )     nLen += format( szMenuBody[nLen], 255-nLen, "^n\w8. Armor" )     nLen += format( szMenuBody[nLen], 255-nLen, "^n\w9. Superjump" )     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,"\yPowerup Menu:") // <<< title     return PLUGIN_CONTINUE } public MenuPU(id,key) {     switch(key) {         case 0: {             ts_givepwup(id,1)         }         case 1: {             ts_givepwup(id,2)         }         case 2: {             ts_givepwup(id,4)         }         case 3: {             ts_givepwup(id,8)         }         case 4: {             ts_givepwup(id,16)         }         case 5: {             ts_givepwup(id,32)         }         case 6: {             ts_givepwup(id,64)         }         case 7: {             ts_givepwup(id,128)         }         case 8: {             ts_givepwup(id,256)         }         case 9: {             ts_givepwup(id,0)         }     }     return PLUGIN_HANDLED }

try that

unnamed :) 05-28-2006 10:40

Still not getting the powerups.

unnamed :) 05-31-2006 07:59

Please?

Rolnaaba 05-31-2006 09:00

I see you said on callback to exec
Code:
ts_givepwup(id,1)
or w/e number did you set these to do an action such as
Code:
public ts_givewup(id) {       cs_set_user_armor(id,500,CS_ARMOR_VESTHELM) }
to give armor or whatever you want it to do, because I don't see where you put what these function calls do

Xanimos 05-31-2006 09:06

Quote:

Originally Posted by Rolnaaba
I see you said on callback to exec
Code:
ts_givepwup(id,1)
or w/e number did you set these to do an action such as
Code:
public ts_givewop(id) {       cs_set_user_armor(id,500,CS_ARMOR_VESTHELM) }
to give armor or whatever you want it to do, because I don't see where you put what these function calls do

Its a function in TSX module.
http://amxmodx.org/funcwiki.php?go=func&id=654
But I don't see where you created the pwup?
http://amxmodx.org/funcwiki.php?go=func&id=653

Rolnaaba 05-31-2006 09:08

ahh my bad I not used to the TSX module yet still little new sry

unnamed :) 06-01-2006 15:28

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <tsfun> public plugin_init() {     register_plugin("Powerup Menu","unnamed","1.0")     register_concmd("pumenu","ShowMenu",ADMIN_SLAY,"- shows the Powerup Menu")     register_menucmd(register_menuid("Powerup Menu:"),1023,"MenuPU") } public ShowMenu(id) {     if(is_user_admin(id) == 0) return PLUGIN_HANDLED         new szMenuBody[256]     new keys     new nLen = format( szMenuBody, 255, "Powerup Menu:" )     nLen += format( szMenuBody[nLen], 255-nLen, "^n^n0. Random" )     nLen += format( szMenuBody[nLen], 255-nLen, "^n1. Slow Motion" )     nLen += format( szMenuBody[nLen], 255-nLen, "^n2. Infite Ammo" )     nLen += format( szMenuBody[nLen], 255-nLen, "^n3. Kung Fu" )     nLen += format( szMenuBody[nLen], 255-nLen, "^n4. Slow Pause" )     nLen += format( szMenuBody[nLen], 255-nLen, "^n5. Double Firerate" )     nLen += format( szMenuBody[nLen], 255-nLen, "^n6. Grenade" )     nLen += format( szMenuBody[nLen], 255-nLen, "^n7. Health" )     nLen += format( szMenuBody[nLen], 255-nLen, "^n8. Armor" )     nLen += format( szMenuBody[nLen], 255-nLen, "^n9. Superjump" )     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_CONTINUE } public MenuPU(id,key) {     switch(key) {         case 0: {             ts_createpwup(1)             ts_givepwup(id,1)         }         case 1: {             ts_createpwup(2)             ts_givepwup(id,2)         }         case 2: {             ts_createpwup(4)             ts_givepwup(id,4)         }         case 3: {             ts_createpwup(8)             ts_givepwup(id,8)         }         case 4: {             ts_createpwup(16)             ts_givepwup(id,16)         }         case 5: {             ts_createpwup(32)             ts_givepwup(id,32)         }         case 6: {             ts_createpwup(64)             ts_givepwup(id,64)         }         case 7: {             ts_createpwup(128)             ts_givepwup(id,128)         }         case 8: {             ts_createpwup(256)             ts_givepwup(id,256)         }         case 9: {             ts_createpwup(0)             ts_givepwup(id,0)         }     }     return PLUGIN_HANDLED }
Still not working...

unnamed :) 06-02-2006 15:34

Wrong button, sorry.


All times are GMT -4. The time now is 16:33.

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