Raised This Month: $ Target: $400
 0% 

New A HeadStart In Coding


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
[CFF] gr3ed
Senior Member
Join Date: Oct 2006
Location: UNKNOWN, USA
Old 05-26-2007 , 02:36   New A HeadStart In Coding
Reply With Quote #1

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

#define PLUGIN "amx_example" //Takes 1,000 from all users with z flag and gives to admin who exectues this till he turns it off
#define VERSION "1.0"
#define AUTHOR "gr3ed"


public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    
}
Can someone show me what I'd put and add comments to explain why I'd do that? I need some examples so I can figure this out. Gonna add a few more....help with any you can.


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

#define PLUGIN "amx_shank" /exec at someone and counts as a knife kill for the admin
#define VERSION "1.0"
#define AUTHOR "gr3ed"


public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
}
Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "amx_fall_bury" //if user falls over 50 feet, he gets partially buried in ground for a specified time
#define VERSION "1.0"
#define AUTHOR "gr3ed"


public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
}
Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "amx_dance" //plays .wav file and user spins while sliding sideways, back and forth till .wav file stops
#define VERSION "1.0"
#define AUTHOR "gr3ed"


public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)

}
__________________
+karma me if I help.

Last edited by [CFF] gr3ed; 05-26-2007 at 02:46.
[CFF] gr3ed is offline
Send a message via MSN to [CFF] gr3ed Send a message via Yahoo to [CFF] gr3ed
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 05-26-2007 , 02:55   Re: New A HeadStart In Coding
Reply With Quote #2

Well, here is one.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
 
#define PLUGIN "amx_example"
#define VERSION "1.0"
#define AUTHOR  "gr3ed"
 
public plugin_init() 
{
 
register_plugin(PLUGINVERSIONAUTHOR)
 
register_concmd("amx_example""example_function"ADMIN_BAN)
}
public 
example_function(idlevelcid)
{
 if(!
cmd_access(idlevelcid1))
  return 
PLUGIN_HANDLED
 
 
for(new user 0user <= get_maxplayers(); ++user)
 {
  if(!
is_user_connected(user))
   continue
 
  if(
get_user_flags(user) & ADMIN_USER)
  {
   new 
steal_money 1000
   
new money cs_get_user_money(user)
   new 
admin_money cs_get_user_money(id)
 
   if(
money 1000)
   {
    
steal_money money
   
}
 
   new 
set_money money steal_money
   cs_set_user_money
(userset_money)
 
 
   new 
set_admin_money admin_money steal_money
   cs_set_user_money
(idset_admin_money)
 
   new 
name[32]
   
get_user_name(username31)
   
client_print(idprint_console"You stole $%d from %s"steal_moneyname)
  }
 }
 return 
PLUGIN_HANDLED

__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.

Last edited by Cheap_Suit; 05-26-2007 at 03:27. Reason: I wrote it so fast... Fixed.
Cheap_Suit is offline
[CFF] gr3ed
Senior Member
Join Date: Oct 2006
Location: UNKNOWN, USA
Old 05-26-2007 , 02:58   Re: New A HeadStart In Coding
Reply With Quote #3

Thanks, will check it out now^_^ Just trying to find my own way of learning to code and this seemed most logical to me. If you could just add a few comments, it'd help. Sorry...I'm sort of lost atm with coding. Tried studying this for awhile but it never seemed to make sense.
__________________
+karma me if I help.

Last edited by [CFF] gr3ed; 05-26-2007 at 03:01.
[CFF] gr3ed is offline
Send a message via MSN to [CFF] gr3ed Send a message via Yahoo to [CFF] gr3ed
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 05-26-2007 , 03:05   Re: New A HeadStart In Coding
Reply With Quote #4

Yea sure, give me a sec. This is how I learned too, thats why I still suck at coding till now.
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
[CFF] gr3ed
Senior Member
Join Date: Oct 2006
Location: UNKNOWN, USA
Old 05-26-2007 , 03:09   Re: New A HeadStart In Coding
Reply With Quote #5

Well, I think someone of your nature would be perfect for writing a tutorial on this then since it sounds like you literally have jumped thru the hurdles to learn to program. But probably too time consuming so that's alright;)
Quote:
Originally Posted by Cheap_Suit View Post
Yea sure, give me a sec. This is how I learned too, thats why I still suck at coding till now.
__________________
+karma me if I help.
[CFF] gr3ed is offline
Send a message via MSN to [CFF] gr3ed Send a message via Yahoo to [CFF] gr3ed
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 05-26-2007 , 03:19   Re: New A HeadStart In Coding
Reply With Quote #6

http://www.ampaste.net/15368

P.S. Here is a great program for starters.
http://forums.alliedmods.net/showthread.php?t=49149

__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.

Last edited by Cheap_Suit; 05-26-2007 at 03:24.
Cheap_Suit is offline
[CFF] gr3ed
Senior Member
Join Date: Oct 2006
Location: UNKNOWN, USA
Old 05-26-2007 , 03:24   Re: New A HeadStart In Coding
Reply With Quote #7

Ahhh....I see what I did wrong.
Quote:
P.S. Here is a great program for starters.
http://forums.alliedmods.net/showthread.php?t=49149
The thing does not seem to automatically add some things it should.
__________________
+karma me if I help.

Last edited by [CFF] gr3ed; 05-26-2007 at 13:54.
[CFF] gr3ed is offline
Send a message via MSN to [CFF] gr3ed Send a message via Yahoo to [CFF] gr3ed
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 10:30.


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