AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   HELP CODE! (https://forums.alliedmods.net/showthread.php?t=76343)

TrueType 08-22-2008 18:47

HELP CODE!
 
Hi!

I'm pretty new with scripting and i want to learn to make own plugins.

So i started a project from scratch and i mixed what i thought was good,

I want to when i say !PAININTHEASS it will give the player who said it 225 hp.

i watched a tutorial at http://wiki.amxmodx.org/index.php/In...od_X_Scripting and i used some lines of http://forums.alliedmods.net/showthread.php?t=12518

So i started with this. And i will have some help :P

Code:

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

new PLUGIN[]="PAIN IN THE ASS"
new AUTHOR[]="TRUETYPE"
new VERSION[]="1.00"

new !PAININTHEASS;

public plugin_init()
{
      register_plugin(PLUGIN, VERSION, AUTHOR)
      register_clcmd("say !PAININTHEASS", "!PAININTHEASS")
      register_cvar("sv_painintheass", "1")
      register_concmd("amx_hp", "cmd_hp")
}





      if(get_pcvar_num("!PAININTHEASS") == "cmd_hp 225 PLAYER"  {

I know that i sure have something wrong but I still want to learn :D I really dont know how to continue but I will have help with this so i can learn something about scripting xD

Please help me.

PvtSmithFSSF 08-22-2008 19:00

Re: HELP CODE!
 
try this:
Code:

#include <amxmodx>
#include <fun>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "Your Name"

new plugincvar

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("say !painintheass", "pain")
    plugincvar = register_cvar("pain_enabled", "1")
}

public pain(id)
{
    if (get_pcvar_num(plugincvar) == 1)
        set_user_health(id, 225)
}


YamiKaitou 08-22-2008 21:05

Re: HELP CODE!
 
As per the Global Forum Rules, you need to have a descriptive topic title. If you wish for this topic to stay open, please correct the topic title before you post again.


All times are GMT -4. The time now is 03:11.

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