Raised This Month: $ Target: $400
 0% 

HELP CODE!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TrueType
Junior Member
Join Date: May 2008
Location: sweden
Old 08-22-2008 , 18:47   HELP CODE!
Reply With Quote #1

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

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 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.
TrueType is offline
PvtSmithFSSF
Senior Member
Join Date: Jul 2008
Old 08-22-2008 , 19:00   Re: HELP CODE!
Reply With Quote #2

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)
}

Last edited by PvtSmithFSSF; 08-22-2008 at 19:13.
PvtSmithFSSF is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-22-2008 , 21:05   Re: HELP CODE!
Reply With Quote #3

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.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou 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 03:11.


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