Raised This Month: $51 Target: $400
 12% 

Blank String?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 06-14-2009 , 18:15   Blank String?
Reply With Quote #1

I have no idea why, but this isn't working:

Code:
if (equali(g_szBundleName[i], ""))

out of this code:

Code:
public cmd_create(id) {     if (!is_user_alive(id))         return PLUGIN_HANDLED     new const iIndex = id - 1     g_mCreateMenu[iIndex] = menu_create("Create Menu", "fnCreateMenu")     for (new i; i < 32; i++)     {         if (equali(g_szBundleName[i], ""))             break         num_to_str(i + 1, g_szKeys[i], 5)         menu_additem(g_mCreateMenu[iIndex], g_szBundleName[i], g_szKeys[i])     }     menu_setprop(g_mCreateMenu[iIndex], MPROP_TITLE, "Create Menu:")     menu_setprop(g_mCreateMenu[iIndex], MPROP_PERPAGE, 7)     menu_setprop(g_mCreateMenu[iIndex], MPROP_EXIT, MEXIT_ALL)     menu_display(id, g_mCreateMenu[iIndex], 0)     return PLUGIN_HANDLED }

I'm not sure that's the problem though. Help?
Spunky is offline
Send a message via AIM to Spunky
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-14-2009 , 18:18   Re: Blank String?
Reply With Quote #2

you can use something directly : if ( !g_szBundleName[i][0] )
__________________
Arkshine is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 06-14-2009 , 18:26   Re: Blank String?
Reply With Quote #3

I've tried that too. Same result. The menu never displays.
Spunky is offline
Send a message via AIM to Spunky
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-14-2009 , 18:34   Re: Blank String?
Reply With Quote #4

The menu won't display if there are no items added to it.
Try adding some debug messages of your g_szBundleName[i] to make sure they contain characters.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 06-14-2009 , 18:58   Re: Blank String?
Reply With Quote #5

Nevermind, I got it. Found a simple enough workaround.
Spunky is offline
Send a message via AIM to Spunky
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-14-2009 , 19:17   Re: Blank String?
Reply With Quote #6

Quote:
Originally Posted by Exolent[jNr] View Post
The menu won't display if there are no items added to it.
Try adding some debug messages of your g_szBundleName[i] to make sure they contain characters.
Some days I think we need a tutorial about adding debug messages that would be required to be read before posting here lol . Sorry for OT, just though I would share .
__________________
fysiks 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 19:44.


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