Raised This Month: $ Target: $400
 0% 

I want to code plugins.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
preetham
Member
Join Date: Sep 2012
Location: India
Old 08-14-2016 , 04:33   I want to code plugins.
Reply With Quote #1

Im an ABSOLUTE BEGINNER at coding. I've been playing and hosting cs 1.6 server for years now. So I've finally decided to learn how to code amx plugins.

So what should i do? Where should i start?
Is there any tutorial on internet?

And for your info, by "Absolute beginner" i mean at the WHOLE COMPUTER PROGRAMMING WORLD! Not specifically at amxmodx coding!

Help!

EDIT: Are there any other languages like c, c++ etc that i need to learn before coming to amxmodx?
__________________

Last edited by preetham; 08-14-2016 at 04:43. Reason: Provided extra info
preetham is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-14-2016 , 05:09   Re: I want to code plugins.
Reply With Quote #2

No, you don't need c/c++ to create plugins, you need them for modules.
https://forums.alliedmods.net/showth...awnProgramming start here with general, then pawn specific and amxx specific.

Also, this is the best place to start: https://forums.alliedmods.net/showthread.php?t=94381
You could also read the pawn manual, but at this point I don't feel like it will help you much. Probably will be just boring and won't make much sense.

When I started, I did not know anything about programming, so don't worry.
__________________

Last edited by HamletEagle; 08-14-2016 at 05:10.
HamletEagle is offline
preetham
Member
Join Date: Sep 2012
Location: India
Old 08-14-2016 , 05:43   Re: I want to code plugins.
Reply With Quote #3

Thank you very much Hamlet!
Quote:
When I started, I did not know anything about programming, so don't worry
These words encouraged me so much!
__________________
preetham is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 08-14-2016 , 07:45   Re: I want to code plugins.
Reply With Quote #4

Quote:
Originally Posted by preetham View Post
Where should i start?
Is there any tutorial on internet?
You should start by reading your other thread.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 08-15-2016 , 03:20   Re: I want to code plugins.
Reply With Quote #5

preetham its so easy to learn pawn scripting

read function one by one and test it as per required http://www.amxmodx.org/funcwiki.php
First you must know what is variable float chars string etc function read this tut
Tutorial:https://forums.alliedmods.net/forumdisplay.php?f=83

suppose now you want learn how to get name ?
okay after little bit searching i got the function native get_user_name(index, name[], len);
but i didnt understand what is this ? yeah its really confusing for starter

now what you have to do just search get_user_name in suggestion or scripting help section
you will get 1000+ pages about this native yeah after searching finally i got what i want
Link: https://forums.alliedmods.net/showth...=get_user_name

then i tested in my local hlds, yeah it works man and i learnt a new function
code:
PHP Code:
#include <amxmodx>
//this is called preprocessor where native has been stored example to make a readable/reliable code direct function is given to you else for get_user_name you have to write 10 lines to get the name

public plugin_init() //now your plugin is intiallizing it calls on server start or map change
{
register_clcmd("say /mynick","show_my_name"); //as you can see command /mynick is set to our function show_my_name
}

public 
show_my_name(id)
{
new 
name[33]; //initialize string array 
get_user_nameidnamecharsmax(name) );// id= index 0= return the server name 

client_print(id,print_chat,"your name is %s",name); //%s is for string as name is string size of 33 

go to server
say /mynick
output:
PHP Code:
your name is indra26 
#srry for bad engrich and i m also newbie in pawn scripting
__________________
Thanks everyone. #miss_you_all
indraraj striker is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 08-15-2016 , 06:57   Re: I want to code plugins.
Reply With Quote #6

Quote:
Originally Posted by indraraj striker View Post
PHP Code:
#include <amxmodx>
//this is called preprocessor where native has been stored example to make a readable/reliable code direct function is given to you else for get_user_name you have to write 10 lines to get the name

public plugin_init() //now your plugin is intiallizing it calls on server start or map change
{
register_clcmd("say /mynick","show_my_name"); //as you can see command /mynick is set to our function show_my_name
}

public 
show_my_name(id)
{
new 
name[33]; //initialize string array 
get_user_nameidnamecharsmax(name) );// id= index 0= return the server name 

client_print(id,print_chat,"your name is %s",name); //%s is for string as name is string size of 33 

-->
PHP Code:
#include <amxmodx>
//this is called preprocessor where native has been stored example to make a
//readable/reliable code direct function is given to you else for get_user_name
//you have to write 10 lines to get the name

//now your plugin is intiallizing it calls on server start or map change
public plugin_init() 
{
    
//as you can see command /mynick is set to our function show_my_name
    
register_clcmd("say /mynick","show_my_name"); 
}

public 
show_my_name(id)
{
    new 
name[33]; //initialize string array 
    
get_user_nameidnamecharsmax(name) ); // id= index 0= return the server name 

    //%s is for string as name is string size of 33 
    
client_print(id,print_chat,"your name is %s",name); 

It is my suggestion. This is called indenting your code and breaking lines.
  1. Good programming habits
  2. [TUT] Code Styling & Good Programming Habits
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective
addons_zz is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-15-2016 , 09:53   Re: I want to code plugins.
Reply With Quote #7

Don't worry about it , If you want you can do anything! Everything's possible.
I'm 13 and I'm learning C++ lool , gonna start learning amxmodx when I get used to C++ A little more.
__________________
edon1337 is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 08-15-2016 , 10:46   Re: I want to code plugins.
Reply With Quote #8

Quote:
Originally Posted by addons_zz View Post
-->
PHP Code:
#include <amxmodx>
//this is called preprocessor where native has been stored example to make a
//readable/reliable code direct function is given to you else for get_user_name
//you have to write 10 lines to get the name

//now your plugin is intiallizing it calls on server start or map change
public plugin_init() 
{
    
//as you can see command /mynick is set to our function show_my_name
    
register_clcmd("say /mynick","show_my_name"); 
}

public 
show_my_name(id)
{
    new 
name[33]; //initialize string array 
    
get_user_nameidnamecharsmax(name) ); // id= index 0= return the server name 

    //%s is for string as name is string size of 33 
    
client_print(id,print_chat,"your name is %s",name); 

It is my suggestion. This is called indenting your code and breaking lines.
  1. Good programming habits
  2. [TUT] Code Styling & Good Programming Habits
--->
PHP Code:
#include <amxmodx> 
/*this is called preprocessor where native has been stored example to make a 
readable/reliable code direct function is given to you else for get_user_name 
you have to write 10 lines to get the name */ 
btw thanks for suggestion i will read it later.
__________________
Thanks everyone. #miss_you_all
indraraj striker 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 14:17.


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