Sythe     Register     FAQ     Members List     Calendar     Mark Forums Read    
 
Sythe  
  
[Pawn] Tutorial for Counter-Strike 1.6 [Pawn]
Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 12-30-2011, 11:52 PM
DarkAngelRng's Avatar
Active Member
 
Join Date: Dec 2011
Referrals: 1
Posts: 110
Send a message via MSN to DarkAngelRng Send a message via Skype™ to DarkAngelRng
 
Default [Pawn] Tutorial for Counter-Strike 1.6 [Pawn]

Hi everyone, like the title says. This is a tutorial about how to make a nice 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

Hope you learned something!

Last edited by DarkAngelRng : 12-31-2011 at 12:06 AM.
Copy this message to clipboard Reply With Quote
  #2  
Old 01-05-2012, 08:23 PM
Blupig's Avatar
butts
Zombie Visual Basic Programmers Retired Global Moderator
 
Join Date: Nov 2006
Location: Canada
Referrals: 15
Posts: 5,428
Send a message via MSN to Blupig Send a message via Skype™ to Blupig
 
MushyMuncher
Default Re: [Pawn] Tutorial for Counter-Strike 1.6 [Pawn]

This is more like a source lol, and I'm moving it to C++.
Copy this message to clipboard Reply With Quote
  #3  
Old 01-06-2012, 03:32 PM
DarkAngelRng's Avatar
Active Member
 
Join Date: Dec 2011
Referrals: 1
Posts: 110
Send a message via MSN to DarkAngelRng Send a message via Skype™ to DarkAngelRng
 
Default Re: [Pawn] Tutorial for Counter-Strike 1.6 [Pawn]

Quote:
Originally Posted by Blupig View Post
This is more like a source lol, and I'm moving it to C++.
It's a programming language to make plugins for a game called Counter-Strike 1.6.

This plugin just makes a menu and outputs the choosen number out of the menu.
Copy this message to clipboard Reply With Quote
Reply



 wow gold

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

All times are GMT +1. The time now is 05:51 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.1