Raised This Month: $ Target: $400
 0% 

Help pls


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
horcrux
Junior Member
Join Date: Jun 2011
Old 11-09-2011 , 12:38   Help pls
Reply With Quote #1

Hi friends,

I am very new to scripting.I am a totally beginner to this plugin scripting and all.But its my passion to learn how to make a plugin.Please can ne 1 tell me from begining how to make plugin in easy language.Thank you.

~ Ho[R]cRuX
horcrux is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 11-09-2011 , 12:57   Re: Help pls
Reply With Quote #2

This is a very simple plugin, look:

PHP Code:
#include <amxmodx>  
#include <amxmisc>

#define PLUGIN "Simple Plugin"  
#define VERSION "1.0"  
#define AUTHOR "kramesa"  

public plugin_init()   
{  
    
register_plugin(PLUGINVERSIONAUTHOR
    
register_cmd("say /buyawp""Awp"
}  

public 
Awp(id

    
give_item(id"weapon_awp")

View this forum: http://forums.alliedmods.net/forumdisplay.php?f=83
__________________
kramesa is offline
horcrux
Junior Member
Join Date: Jun 2011
Old 11-17-2011 , 06:10   Re: Help pls
Reply With Quote #3

tell me how to make more plugins with lil bit description pls
horcrux is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-17-2011 , 06:48   Re: Help pls
Reply With Quote #4

PHP Code:
#include <amxmodx>
#include <colorchat>

#define VERSION "1.0" //Only define our Version to optimize the plugin.

public plugin_init() {
    
register_plugin("Say Hello!"VERSION"NapoleoN#"// Register out plugin.
    
register_clcmd("say /hi""Handle_Say")
}

public 
Handle_Say(id) {
    if(
is_user_connected(id)) {
        
ColorChat(idGREEN"[Hello]^X01 Welcome to the server!"// Prints our message when you are connected.
    
}

__________________

Last edited by Napoleon_be; 11-17-2011 at 06:49.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 11-17-2011 , 07:42   Re: Help pls
Reply With Quote #5

Quote:
Originally Posted by Napoleon_be View Post
PHP Code:
#include <amxmodx>
#include <colorchat>

#define VERSION "1.0" //Only define our Version to optimize the plugin.

public plugin_init() {
    
register_plugin("Say Hello!"VERSION"NapoleoN#"// Register out plugin.
    
register_clcmd("say /hi""Handle_Say")
}

public 
Handle_Say(id) {
    if(
is_user_connected(id)) {
        
ColorChat(idGREEN"[Hello]^X01 Welcome to the server!"// Prints our message when you are connected.
    
}

You don't have to check if the user is connected.
He can't say anything if he isn't connected.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-17-2011 , 10:29   Re: Help pls
Reply With Quote #6

Quote:
Originally Posted by drekes View Post
You don't have to check if the user is connected.
He can't say anything if he isn't connected.
A server could slowhack some binds into his config wich can contain the command "quit". This is just to be sure.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Ex1ne
Senior Member
Join Date: Oct 2011
Location: Norway
Old 11-17-2011 , 11:18   Re: Help pls
Reply With Quote #7

Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <hamsandwich>
#include <fun>

#define PLUGIN "VIP Idea"
#define VERSION "1.0"
#define AUTHOR "Ex1ne^"
//Add a cvar
new pcvar_hpammount

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
//Add a cvar command
pcvar_hpammount = register_cvar("amx_viphealth", "120")
RegisterHam(Ham_Spawn, "player", "VIPIdea", 1)
}
//Now the user flags for the cvar
public VIPIdea(id) {
if(get_user_flags(id) & ADMIN_CFG) {
set_user_health(id, get_pcvar_num(pcvar_hpammount))
}
}
Just for fun realy, but can be used for a VIP plugin.
Ex1ne is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 11-17-2011 , 11:43   Re: Help pls
Reply With Quote #8

Quote:
Originally Posted by Napoleon_be View Post
A server could slowhack some binds into his config wich can contain the command "quit". This is just to be sure.
I still think it's useless.

I've never done it in the 2 years i'm working with amxx and never got any problems or errors my way.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
horcrux
Junior Member
Join Date: Jun 2011
Old 11-18-2011 , 05:47   Re: Help pls
Reply With Quote #9

why we write (id) in bracket can sum1 tell
and from where i can get all the commands like if(user_is_connected) etc.

Last edited by horcrux; 11-18-2011 at 06:00.
horcrux is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 11-18-2011 , 06:02   Re: Help pls
Reply With Quote #10

Quote:
Originally Posted by horcrux View Post
why we write (id) in bracket can sum1 tell
It's a parameter from that function / forward.
It can be named whatever you want but most people use id because it holds the id of the player.

Quote:
Originally Posted by horcrux View Post
and from where i can get all the commands like if(user_is_connected) etc.
The includes & the funcwiki.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Reply


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

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:22.


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