Raised This Month: $ Target: $400
 0% 

Language for creating plugins on cs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
marian1999
New Member
Join Date: Oct 2015
Old 10-30-2015 , 07:19   Language for creating plugins on cs
Reply With Quote #1

Is true that only Pawn is used for creation of plugins for cs servers?

If yes please explain me from where to start:
-What program is used to write in pawn
-How to test and run "Hello world"


Eventually some book or site for learning how to create plugins, not deprecated from the new standarst


I'm using Windows (7) OS


Thank you in advance.

Last edited by marian1999; 10-30-2015 at 07:20.
marian1999 is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 10-30-2015 , 08:48   Re: Language for creating plugins on cs
Reply With Quote #2

Yes Pawn is the most precise language for GoldSource games' plugins.

Amx Mod X Studio, you can download it from amxmodx.org

It's very easy to learn, you just need to know basic programming and get to know the constants and some ingame logics... or something.

There are a lot of examples for plugins, you can download any plugins' source you want from this site. The extension is .sma, compiled (The one you put in your server's directory is .amxx) Download the .sma's and take a look at them, to see how are those plugins made, what does it contain.

Here's a simple Hello World plugin. This simply prints out a chat message whenever a player types /hello in chat

PHP Code:
#include <amxmodx> // We must include this library everywhere

public plugin_init() // This function is called when the server starts
{
    
register_plugin("Hello World""1.0""redivcram"); // We must register the plugin, there are 3 parameters
    //separated by commas!
    // 1st Parameter - Plugin Name
    // 2nd Parameter - Version
    // 3rd Parameter - Author of the plugin
    
    
register_clcmd("say /hello""cmd_hello"); // We register a command to call the function that prints out the msg
    // 1st Parameter - Command
    // 2nd Parameter - Function called by the command
}

public 
cmd_hello(id// This is the function that is called when a player types /hello in chat
{
    
client_print(idprint_chat"[AMXX] Hello World!!!"); // This prints out the message
    // 1st Parameter - Index (If set to "id". the msg will print out to the player who typed /hello
    // If set to "0", the msg will print out to everyone online
    // 2nd Parameter - Message type (print_chat - print in chat | print_console - in console | print_center - like terrorists win)
    // 3rd Parameter - The message (Make sure the message you want to print out is quoted!!

To compile it, You can do it with your local compiler, but I use a web compiler, you can search or here's this one. It's on polish language, but I can understand few things.
http://amxx.pl/kompilator/

Upload your .sma, or paste the code, then click "Kompiluj"
If it compiles without errors, you can download it by clicking "POBIERZ"
redivcram is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-30-2015 , 09:03   Re: Language for creating plugins on cs
Reply With Quote #3

Any text editor is fine.
Check the tutorial section.
__________________
Arkshine is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 10-31-2015 , 10:03   Re: Language for creating plugins on cs
Reply With Quote #4

I use the Sublime Text, simple and easy interface to handle, each with their preference.
__________________








CrazY. 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 18:09.


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