Raised This Month: $ Target: $400
 0% 

if ! [Help] Equali, Print


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Baws
Veteran Member
Join Date: Oct 2012
Old 03-13-2014 , 21:10   if ! [Help] Equali, Print
Reply With Quote #1

I want something like when i type the command ( /search ) and if it didn't find anything it will print "Results: Nothing was found". What i did, didn't work. Tried many things didn't work. if(!...... else print ...etc didn't work. Is there a way to do it?


PHP Code:
public Cmd_Sayid 
{
        new 
szText192 ];
        
read_argsszTextcharsmaxszText ) );
        
remove_quotesszText );
    
        if( 
szText] != '/' )
                return 
PLUGIN_CONTINUE;
    
        if( 
equaliszText], "music") ) 
        {
                
SongListid );
        
                return 
PLUGIN_HANDLED;
        }
    
        else if( 
equaliszText], "stop") ) 
        {
                new 
Motd384 ], Len;
        
                
Len formatexMotdcharsmaxMotd ), "<html><head><style type=^"text/css^">pre{color:#FFB000;}body{background:#000000;margin-left:8px;margin-top:0px;}</style></head><pre><body><center>" );
                
Len += formatexMotdLen ], charsmaxMotd ) - Len"<b>Music Stopped</b>." );
                
Len += formatexMotdLen ], charsmaxMotd ) - Len"This has been brought you by %s.^n"g_szAuthor );
                
Len += formatexMotdLen ], charsmaxMotd ) - Len"%s is the most powerful music player plugin ever!^n"g_szPlugin );
                
Len += formatexMotdLen ], charsmaxMotd ) - Len"Hope you had fun listening to the nice music!^n" );
                
formatexMotdLen ], charsmaxMotd ) - Len"</center></body></pre></html>" );
        
                
show_motdidMotdg_szPlugin );
                return 
PLUGIN_HANDLED;
        }
    
        else if( 
equaliszText], "replay") ) 
        {
        
                if( 
g_Songid ] != )
                        
Play_Songidg_Songid ] );
                else
                        
client_print_coloridNORMAL"%L"id"NO_SONG_PLAYED" );
            
                return 
PLUGIN_HANDLED;
        }
    
        else if( 
equaliszText], "copy") ) 
        {
                
Cmd_CopySongid );
        
                return 
PLUGIN_HANDLED;
        }
    
        else if( 
equaliszText], "search") ) 
        {
                new 
szName64 ];
                
strbreakszText""0szNamecharsmaxszName ) );
        
                
Cmd_SearchidszName );
        
                return 
PLUGIN_HANDLED;
        }
    
        return 
PLUGIN_CONTINUE;
}

public 
SongList_HandleridhMenuitem 
{    
        if( 
item != MENU_EXIT )
        {
                new 
szData], szName64 ], accesscallback;
                
menu_item_getinfohMenuitemaccessszDatacharsmaxszData ), szNamecharsmaxszName ), callback )

                new 
sChoice str_to_numszData );

                
Play_SongidsChoice );
        }
    
        
menu_destroyhMenu )
        return 
PLUGIN_HANDLED;
}

Cmd_Searchid, const iText[ ] )
{
        
client_print_coloridNORMAL"%L"id"SEARCHED_FOR"iText ); //Where it says: "Searched for 'x'. " I want that if the 'x' word is not found well it will says instead of searched for, it'll say not found.

        
new szNum], hMenu menu_create"\ySearch Results:""SongList_Handler" );
    
        for( new 
g_SongCount i++ ) 
        {
                
num_to_striszNum)
                
ArrayGetArrayg_hArrayig_SongInformation );

                if( 
containig_SongInformationName ], iText ) == -)
                        continue;
        
                
menu_additemhMenug_SongInformationName ], szNum );
        }

        
menu_displayidhMenu )
        return 
PLUGIN_HANDLED;

__________________
Like my clean plugins and work?

Last edited by Baws; 03-13-2014 at 21:11.
Baws is offline
 



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 06:00.


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