Raised This Month: $ Target: $400
 0% 

Could someone pleaseeeeeeeeee tell me whats wrong with this?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Stealth Penguin
Junior Member
Join Date: Jan 2005
Old 02-17-2005 , 17:22   Could someone pleaseeeeeeeeee tell me whats wrong with this?
Reply With Quote #1

This is part of my plugin and the whole thing compiles fine with no errors but won't do anything when I use it in my menu in game... the menu part functions perfectly but I can't seem to get this set_user_godmode command to work correctly (and yes I have all the includes).
Please check it over for me? Any advice would be greatly appreciated.
Code:
public TGOMenuCommand(id,key) {     new player = g_menuPlayers[id][g_nTGOMenuPosition[id] * 7 + key]     switch (key)     {         case 8: ShowTGOMenu(id,++g_nTGOMenuPosition[id])         case 9: ShowTGOMenu(id,--g_nTGOMenuPosition[id])         default: set_user_godmode(player, 1 )     }     server_exec()     ShowTGOMenu(id,g_nTGOMenuPosition[id])     return PLUGIN_HANDLED }
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
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-17-2005 , 18:08  
Reply With Quote #2

DEBUG!

Do many console prints at many different break points with all the values up to that point.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
philman213
Member
Join Date: Feb 2005
Location: WA
Old 02-17-2005 , 18:23   Re: Could someone pleaseeeeeeeeee tell me whats wrong with t
Reply With Quote #3

Quote:
Originally Posted by Stealth Penguin
This is part of my plugin and the whole thing compiles fine with no errors but won't do anything when I use it in my menu in game... the menu part functions perfectly but I can't seem to get this set_user_godmode command to work correctly (and yes I have all the includes).
Please check it over for me? Any advice would be greatly appreciated.
Code:
public TGOMenuCommand(id,key) {     new player = g_menuPlayers[id][g_nTGOMenuPosition[id] * 7 + key]     switch (key)     {         case 8: ShowTGOMenu(id,++g_nTGOMenuPosition[id])         case 9: ShowTGOMenu(id,--g_nTGOMenuPosition[id])         default: set_user_godmode(player, 1 )     }     server_exec()     ShowTGOMenu(id,g_nTGOMenuPosition[id])     return PLUGIN_HANDLED }
Put quotes around the 1:
Code:
default: set_user_godmode(player,"1")
Make sure the plugin is enabled in your plugins.ini
philman213 is offline
Stealth Penguin
Junior Member
Join Date: Jan 2005
Old 02-17-2005 , 19:14  
Reply With Quote #4

when I put the quotes around the 1 it doesn't compile correctly
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
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-17-2005 , 21:49  
Reply With Quote #5

philman, what kind of crappy advice are you giving out? Don't tell people to do things such as use a string value where an integer is required.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Stealth Penguin
Junior Member
Join Date: Jan 2005
Old 02-18-2005 , 16:01  
Reply With Quote #6

Thank you very much for your replies XxAvalanchexX. I'm greatful to have caught someones ear :-). Could you show me an example of how I would use console_print to return values to me? All I found in the documentation was console_print ( id, const message[], ... ) and I don't seem to have much luck setting function parameters :-/ I'm going to see if I can get it to work myself but if you could show me an example of how to do it properly I would be forever indebted to you.
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
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-18-2005 , 18:12  
Reply With Quote #7

Code:
public TGOMenuCommand(id,key) {     new player = g_menuPlayers[id][g_nTGOMenuPosition[id] * 7 + key]     console_print(id,"PRE: key: %i - player: %i - menupos: %i",key,player,g_nTGOMenuPosition[id]);     switch (key)     {         case 8: ShowTGOMenu(id,++g_nTGOMenuPosition[id])         case 9: ShowTGOMenu(id,--g_nTGOMenuPosition[id])         default: set_user_godmode(player, 1 )     }     console_print(id,"POST: key: %i - player: %i - menupos: %i",key,player,g_nTGOMenuPosition[id]);     server_exec()     ShowTGOMenu(id,g_nTGOMenuPosition[id])     return PLUGIN_HANDLED }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Stealth Penguin
Junior Member
Join Date: Jan 2005
Old 02-18-2005 , 19:54  
Reply With Quote #8

Hmm, when I tried that it compiled fine and I like how you got rid of the extra code but it doesn't do anything more than before. Any ideas of what might be going wrong?
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
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-18-2005 , 21:28  
Reply With Quote #9

It isn't supposed to do anything else than before. Check the data in the console that it printed out (with console_print) and see if it matches what it should be.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Stealth Penguin
Junior Member
Join Date: Jan 2005
Old 02-19-2005 , 10:04  
Reply With Quote #10

what I meant is that it doesn't print anything to the console on either the server console or my console when I'm doing a dedicated server or to my console when I'm running a listen server.
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


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


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