Raised This Month: $ Target: $400
 0% 

Help with first plugin please


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BRUm
Junior Member
Join Date: May 2005
Location: UK
Old 05-07-2005 , 14:42   Help with first plugin please
Reply With Quote #1

Hi, i've decided to make a simple plugin. The basic and only origional idea I could think of, was to make, on map startup, a message being displayed on every player's HUD, and their health being set to a random amount.

I've got this so far, and have got stuck

Code:
#include <amxmodx> new PLUGIN[]="Nerd's revenge" new AUTHOR[]="BRUm" new VERSION[]="1.00" public plugin_init() {      register_plugin(PLUGIN, VERSION, AUTHOR)      register_concmd("admin_nerd", "cmd_nerd", ADMIN_CHAT, "admin_nerd") } public cmd_nerd(id, level, cid) {      //This will check if the user calling the command has the right access level.        if (!cmd_access(id, level, cid, 0)) {           //This terminates the command           return PLUGIN_HANDLED      }      //This prints a message to all clients      client_print(0, print_chat, "YoU hAvE bEeN cUrSeD bY tEh EvIl nErD!")      return PLUGIN_HANDLED }
__________________
#1 Aim/WC3 server - tab.no-ip.com
#1 Webhosting - xwebhost.co.uk
-----------------------------------------
BRUm is offline
Send a message via MSN to BRUm
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 05-07-2005 , 14:59  
Reply With Quote #2

Code:
#include <amxmodx> #include <amxmisc> #include <fun> new PLUGIN[]="Nerd's revenge" new AUTHOR[]="BRUm" new VERSION[]="1.00" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_concmd("admin_nerd", "cmd_nerd", ADMIN_CHAT, "admin_nerd") } public cmd_nerd(id, level, cid) {     //This will check if the user calling the command has the right access level.     if (!cmd_access(id, level, cid, 0)) {     //This terminates the command         return PLUGIN_HANDLED     }     //This prints a message to all clients     client_print(0, print_chat, "YoU hAvE bEeN cUrSeD bY tEh EvIl nErD!")     // Variable that hold information     new Players[32]     new playerCount     new player     // Get players only that are alive     get_players(Players, playerCount, "a")     for (new i=0; i<playerCount; i++)     {         new randomhealth         // player hold the index of the player.         player = Players[i]         // Random a number from 1 to 255 for health         randomhealth = random_num(1, 255)         if(is_user_connected(player) && is_user_connected(player))         {             // Set user health from  (Any number above 255 will not display correctly on the health bar.)             set_user_health(player, randomhealth)         }     }     return PLUGIN_HANDLED } /*small  /small*/
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-07-2005 , 15:20  
Reply With Quote #3

Code:
if (!cmd_access(id, level, cid, 1)) {
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
BRUm
Junior Member
Join Date: May 2005
Location: UK
Old 05-07-2005 , 15:28  
Reply With Quote #4

lol thanks guys... Miming posts, wow! heheh
__________________
#1 Aim/WC3 server - tab.no-ip.com
#1 Webhosting - xwebhost.co.uk
-----------------------------------------
BRUm is offline
Send a message via MSN to BRUm
BRUm
Junior Member
Join Date: May 2005
Location: UK
Old 05-07-2005 , 15:34  
Reply With Quote #5

Code:
 new Players[32]
Is this an array? And how come you've set it to 32?

Code:
   // Get players only that are alive     get_players(Players, playerCount, "a")     for (new i=0; i<playerCount; i++)     {         new randomhealth         // player hold the index of the player.         player = Players[i]

Also, could you explain what the 'i's are, and why the '++? And, what's the index of the player?

Thanks
__________________
#1 Aim/WC3 server - tab.no-ip.com
#1 Webhosting - xwebhost.co.uk
-----------------------------------------
BRUm is offline
Send a message via MSN to BRUm
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 05-07-2005 , 15:44  
Reply With Quote #6

http://www.amxmodx.org/doc/source/scripting/index.htm

You need to read this. Then if you don't understand i'll try to help you.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
BRUm
Junior Member
Join Date: May 2005
Location: UK
Old 05-07-2005 , 17:03  
Reply With Quote #7

lol.. the amount of times i've studied that guide, and the huge pdf..
__________________
#1 Aim/WC3 server - tab.no-ip.com
#1 Webhosting - xwebhost.co.uk
-----------------------------------------
BRUm is offline
Send a message via MSN to BRUm
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 05-07-2005 , 17:47  
Reply With Quote #8

That the smallest tutorial guide compare to the one at that other website about small. Like i said if you don't understand it after reading it. i'll help you.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-07-2005 , 22:08  
Reply With Quote #9

Go here.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
BRUm
Junior Member
Join Date: May 2005
Location: UK
Old 05-08-2005 , 03:04  
Reply With Quote #10

Ok i've had a look at boths tutorials. I understand the arithmatic, but none of the tutorials show specific amxx coding, like commands for health, and players and stuff. Know where I could find one?
__________________
#1 Aim/WC3 server - tab.no-ip.com
#1 Webhosting - xwebhost.co.uk
-----------------------------------------
BRUm is offline
Send a message via MSN to BRUm
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:35.


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