Raised This Month: $ Target: $400
 0% 

How do you use set_user_godmode with a menu? (read the doc)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Stealth Penguin
Junior Member
Join Date: Jan 2005
Old 02-15-2005 , 16:57   How do you use set_user_godmode with a menu? (read the doc)
Reply With Quote #1

Hello, my last post may have been to broad so this is a narrowed down one. I have read the documentation and tutorials for amx and amxx over and over and still cannot figure out how to make this certain part of the plugin I'm making work. I can't figure out how to get a command executed on a person who is chosen through a menu. Here is the part of the code that I believe is causing the problem:
Code:
public TGOMenuCommand(id,key) {     new player = g_menuPlayers[id][g_nTGOMenuPosition[id] * 7 + key]     new name[32], name2[32], authid[32],authid2[32]     get_user_name(player,name2,31)     get_user_authid(id,authid,31)     get_user_authid(player,authid2,31)     get_user_name(id,name,31)     new userid2 = get_user_userid(player)         switch (key) {         case 7: {         ++g_menuOption[id]         g_menuOption[id] %= 3       switch(g_menuOption[id])       {       case 0: g_menuSettings[id] = 0       case 1: g_menuSettings[id] = 5       case 2: g_menuSettings[id] = 60       }     ShowTGOMenu(id,g_nTGOMenuPosition[id])     }     case 8: ShowTGOMenu(id,++g_nTGOMenuPosition[id])     case 9: ShowTGOMenu(id,--g_nTGOMenuPosition[id])     default: {     log_amx("GodmodeOther: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%d^")",         name,get_user_userid(id),authid, name2,userid2,authid2, g_menuSettings[id] )     switch (get_cvar_num("amx_show_activity")) {         case 2: client_print(0,print_chat,"%L",LANG_PLAYER,"ADMIN_BAN_2",name,name2)         case 1: client_print(0,print_chat,"%L",LANG_PLAYER,"ADMIN_BAN_1",name2)     }              g_menuPlayers[id]         if(get_user_godmode(player, 0 ) == 1)         {         set_user_godmode(player, 1 ) // turn on         }     else         { // if already on         set_user_godmode(player, 0 ) // turn off         }     }     server_exec()     ShowTGOMenu(id,g_nTGOMenuPosition[id])     } }   return PLUGIN_HANDLED }

Any help would be appreciated very much.
Stealth Penguin is offline
Send a message via ICQ to Stealth Penguin Send a message via AIM to Stealth Penguin Send a message via Yahoo to Stealth Penguin
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 02-15-2005 , 19:37  
Reply With Quote #2

Well you should change this :
Code:
if(get_user_godmode(player, 0 ) == 1)         {         set_user_godmode(player, 1 ) // turn on         }     else         { // if already on         set_user_godmode(player, 0 ) // turn off         }
To this :
Code:
if(get_user_godmode(player) != 1) // Checks if godmode isn't on a player {    set_user_godmode(player, 1) // Sets godmode on a player }
That might work...
Peli is offline
Send a message via MSN to Peli
Stealth Penguin
Junior Member
Join Date: Jan 2005
Old 02-15-2005 , 20:49  
Reply With Quote #3

That clears the godmode stuff up but I think theres something thats stopping it from compiling correctly, mayhaps some brackets misplaced. Anything obvious that anyone can see that I might have missed?
Stealth Penguin is offline
Send a message via ICQ to Stealth Penguin Send a message via AIM to Stealth Penguin Send a message via Yahoo to Stealth Penguin
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 19:21.


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