AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   do any 1 have guide how to make plugins ? (https://forums.alliedmods.net/showthread.php?t=52006)

Damir 02-28-2007 16:37

do any 1 have guide how to make plugins ?
 
do any 1 have guide how to make plugins ?:)
sorry bad english...

Martin1 02-28-2007 18:27

Re: do any 1 have guide how to make plugins ?
 
scripting isnīt something like riding a bike, its more of a way of thinking, you need to start learning functions, start reading other plugins and such. Look at scripting help and so on

FormulaZero 02-28-2007 18:45

Re: do any 1 have guide how to make plugins ?
 
Yes, here if you can read and understand this you can script, use the search plugin for ideas and such, at the bottom of some plugin theres something that says: Get Source. This, downloads the code for the plugin you have selected; go to AMXX-Studio and open the file, this will give you the code to that certain plugin. Theres characters like: <, ;, " ", (id) in plugins, You can't rip codes either you'll be banned. If you can read this and understand, you can call yourself a Starting Scripter:
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <fun>

#define PLUGIN "Regain Armor"
#define VERSION "0.5"
#define AUTHOR "FormulaZero"

new p_ArmorBack
new p_HealthBack

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /armor","armorback",_,"Gives the client their armor back.")
    
register_clcmd("say /health","healthback",_,"Gives the client their health back.")
    
register_event("Damage","armorback","be")
    
register_event("Damage","healthback","be")
    
    new 
Cvar[] = "amx_armorback"
    
register_cvar(Cvar,"50")
    
p_ArmorBack get_cvar_pointer(Cvar)
}

public 
armorback(id)
{
    if(!
is_user_alive(id))
        return
    
    if(
get_user_armor(id) < 1)
        
set_user_armor(id,clamp(get_pcvar_num(p_ArmorBack),0,100))


SOURCE: By me.

schnitzelmaker 03-01-2007 03:35

Re: do any 1 have guide how to make plugins ?
 
http://wiki.amxmodx.org/index.php/Pawn_Tutorial

The best is learning the basics and look inside little plugins how they work.

To understand which function what do, is this helpfull:http://www.amxmodx.org/funcwiki.php

FormulaZero 03-01-2007 06:36

Re: do any 1 have guide how to make plugins ?
 
allways in plugins you need to add:
#includes, #defines are optional but #include is allways needed.
EXAMPLE: If you were making a plugin about TFC Weapon you would:
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <tfcx> 

<--
PHP Code:

#include <fun> 

might need to be added depending on what you add to your plugin. PM me if you need some help on things ;)


All times are GMT -4. The time now is 00:37.

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