Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_pre.php on line 387

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_pre.php on line 387

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 337

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 339

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 341

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 343
[Pawn] Tutorial for Counter-Strike 1.6 [Pawn]

Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By stevpetersonn

Thread: [Pawn] Tutorial for Counter-Strike 1.6 [Pawn]

  1. #1
    Senior Member H4RDSTYL3_4_L1F3's Avatar
    Join Date
    Dec 2010
    Location
    Belgium
    Posts
    207

    [Pawn] Tutorial for Counter-Strike 1.6 [Pawn]

    Hi everyone, like the title says. This is a tutorial about how to make a basic menu plugin for counter-strike 1.6!

    All info explained in the code itselves!

    PHP Code:
    // ###################################################################################
    // **     *     * * *    * * *   * * * *   *          * * * * *  * * * * **     *
    // * *    *   *      *   *    *  *     *   *          *          *     * * *    *
    // *  *   *   *      *   *    *  *     *   *          *          *     * *  *   *
    // *   *  *   *      *   * * *   *     *   *          * * * * *  *     * *   *  *
    // *    * *   ********   *       *     *   *          *          *     * *    * *
    // *     **   *      *   *       *     *   *          *          *     * *     **
    // *      *   *      *   *       * * * *   * * * * *  * * * * *  * * * * *      *
    // ###################################################################################
    #include <amxmodx>

    #define VERSION "1.0"

    new menu

    public plugin_init() {
        
    register_plugin("Simple Menu"VERSION"NapoleoN#"// Only using a define for Version to optimize the code!
        
    register_clcmd("say /menu""Cmd_Menu"// Register our function + command
    }

    public 
    Cmd_Menu(id) { // Make our public function
        
    if(is_user_alive(id)) { // Check if our user is alive
            
    menu menu_create("Menu Title""menu_handler"// Create our menu
            
            
    menu_additem(menu"Hello!""1"// Add an item to our menu
            
    menu_additem(menu"Goodbye!""2"// Add an item to our menu
            
            
    menu_display(idmenu// Display our menu
        
    }
        else { 
    // If the user is not online, then use else. "if(!is_user_alive(id))" would work aswell.
            
    return PLUGIN_HANDLED // Do nothing with our plugin.
        
    }
        return 
    PLUGIN_HANDLED // End our function
    }

    public 
    menu_handler(idmenuitem) { // Make our public function for the menu_handler
        
    if(item == MENU_EXIT) { // If the option the player took is Exit, then
            
    menu_destroy(menu// Destroy our menu
            
    return PLUGIN_HANDLED
        
    }
        
        if(
    is_user_alive(id)) { // Check if our user is still alive, he might die while looking at the menu.
            
    new szName[32]; get_user_name(idszNamesizeof(szName) - 1// Retrieve the name from the user
            
    switch(item) {
                case 
    0client_print(0print_chat"Hello there! my name is %s!"szName// Print our message to everyone!
                
    case 1client_print(0print_chat"Goodbye! Have a nice day further %s!"szName// Print our message to everyone!
            
    }
        }
        else { 
    // If the user is not online, then use else. "if(!is_user_alive(id))" would work aswell.
            
    client_print(idprint_chat"You're not alive!")
        }
        return 
    PLUGIN_HANDLED

    The more you learn, the more you know. The more you know, the more you forget. The more you forget, the less you know. So why learn?

    Don't mess with Belgium!
    My Youtube Channel: http://www.youtube.com/gastonneke81/

  2. #2
    Junior Member
    Join Date
    May 2012
    Posts
    1

    Re: [Pawn] Tutorial for Counter-Strike 1.6 [Pawn]

    lol still people playing counter strike.lol btw nice tutorial of plugin.
    haxorka likes this.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •