Raised This Month: $ Target: $400
 0% 

Stomach Ache


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dt_torres
Member
Join Date: Sep 2007
Old 10-03-2007 , 20:24   Stomach Ache
Reply With Quote #1

This is my first plugin, I'm just starting it, it is my first plugin

the point of this plugin is to kill only in the stomach (im doing this coz its easy)

this is what ive got, tell me if Im on the right track plz

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

new PLUGIN[]="Stomach Ache"
new AUTHOR[]="DT_TORRES"
new VERSION[]="BETA"

public plugin_init()

{
register_plugin(PLUGINVERSIONAUTHOR)
register_concmd("amx_stomachache""HIT_STOMACH 3"ADMIN_SLAY,"<target>")


btw:plz gimme karma im working a lot learning scrpting, i deserver it


ty m4a1 for help

Last edited by dt_torres; 10-03-2007 at 20:38.
dt_torres is offline
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 10-03-2007 , 20:32   Re: Stomach Ache
Reply With Quote #2

2 things:

1) "HIT_STOMACH 3" needs to be the name of a public function. Meaning, you need to create another procedure called HIT_STOMACH 3. Infact, that can't even be done. HIT_STOMACH 3 needs to be one phrase (this is the name of the function, and name doesn't matter - you create it). I'll post an example of how it should work.

You will also want to consider #include <amxmisc>, as it contains some good stuff (like checking if the user has ADMIN_SLAY to use the command)

And getting back to the HIT_STOMACH 3 deal, look what I put in place of that:
PHP Code:
register_concmd("amx_stomachache""setStomachAche"ADMIN_SLAY"<target>"
PHP Code:
public setStomachAche() {


That means that the command "amx_stomachache" will do the public function called "setStomachAche"

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

#define PLUGIN "Stomach Ache"
#define VERSION "DT_TORRES"
#define AUTHOR "BETA"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_concmd("amx_stomachache""setStomachAche"ADMIN_SLAY"<target>")
}

public 
setStomachAche() {
    
// Check if the user has access
    // Read in parameters
    // Set a target based on parameters
    // Set hitboxes

2) Wrap your code around [php] tags, this is how get code to look like the above.
__________________

Last edited by M249-M4A1; 10-03-2007 at 20:46.
M249-M4A1 is offline
dt_torres
Member
Join Date: Sep 2007
Old 10-03-2007 , 20:37   Re: Stomach Ache
Reply With Quote #3

u r starting to be my best Amx Friend xD

ty very much

+karma as possible
dt_torres is offline
dt_torres
Member
Join Date: Sep 2007
Old 10-03-2007 , 20:44   Re: Stomach Ache
Reply With Quote #4

but if u need to put the function.. why is the function StomachAche if it doesnt even exist?
dt_torres is offline
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 10-03-2007 , 20:46   Re: Stomach Ache
Reply With Quote #5

What do you mean?
__________________
M249-M4A1 is offline
dt_torres
Member
Join Date: Sep 2007
Old 10-03-2007 , 20:47   Re: Stomach Ache
Reply With Quote #6

you arent supposed to put the function u r using?
dt_torres is offline
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 10-03-2007 , 20:51   Re: Stomach Ache
Reply With Quote #7

Take a look at this line:
PHP Code:
register_concmd("amx_stomachache""setStomachAche"ADMIN_SLAY"<target>"
The second parameter: "setStomachAche" is the name of the function that will run when someone does amx_stomachache.

Now look at this:
PHP Code:
public setStomachAche() { 
    
// Check if the user has access 
    // Read in parameters 
    // Set a target based on parameters 
    // Set hitboxes 

This actually creates the fucntion called setStomachAche. The amx_stomachache will run the above procedure. You put whatever necessary code in there.
__________________
M249-M4A1 is offline
dt_torres
Member
Join Date: Sep 2007
Old 10-03-2007 , 20:58   Re: Stomach Ache
Reply With Quote #8

ok
dt_torres 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 16:14.


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