Raised This Month: $ Target: $400
 0% 

Whats wrong with this script?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarlD
Senior Member
Join Date: Aug 2004
Old 10-20-2005 , 15:47   Whats wrong with this script?
Reply With Quote #1

I get no errors while compiling, but when im in game, i type amx_hsonly and it wont turn it on! did i do an error for the command?
Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <fun> #define PLUGIN "amx_hsonly" #define VERSION "1.0" #define AUTHOR "Meta" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_concmd("amx_hsonly","hs_only",ADMIN_KICK,"enable hs only")     register_cvar("hs_only","0"); } public hs_only(id,level,cid) {     if(!cmd_access(id,level,cid,2))         return PLUGIN_HANDLED     new arg[12];     read_argv(1,arg,11);     if(str_to_num(arg) > 0)     {         client_print(0,print_chat,"Meta-HSONLY: HS ONLY MODE ENABLED FOR THIS ROUND")         set_user_hitzones(0,0,2)     }     else     {         client_print(0,print_chat,"Meta-HSONLY: HS ONLY MODE DISABLED FOR THIS ROUND")         set_user_hitzones(0,0,255) //this is how you set the hitzones back to normal     }     return PLUGIN_CONTINUE }
__________________
DarlD is offline
Send a message via MSN to DarlD
atomic
Veteran Member
Join Date: Jan 2005
Location: What The Foot?
Old 10-20-2005 , 16:07  
Reply With Quote #2

why do you have the cvar?
__________________
atomic is offline
atomic
Veteran Member
Join Date: Jan 2005
Location: What The Foot?
Old 10-20-2005 , 16:11  
Reply With Quote #3

Code:
 /* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <fun> #define PLUGIN "amx_hsonly" #define VERSION "1.0" #define AUTHOR "Meta" new hs public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_clcmd("amx_hsonly","hs_only",ADMIN_KICK,"<1|0>")   } public hs_only(id,level,cid)   {     if(!cmd_access(id,level,cid,2))         return PLUGIN_HANDLED     new arg[12];     read_argv(1,arg,11);     hs = str_to_num(arg)     if(hs== 1)     {         client_print(0,print_chat,"Meta-HSONLY: HS ONLY MODE ENABLED FOR THIS ROUND")         set_user_hitzones(0,0,2)     }     if(hs== 0)       {         client_print(0,print_chat,"Meta-HSONLY: HS ONLY MODE DISABLED FOR THIS ROUND")         set_user_hitzones(0,0,255) //this is how you set the hitzones back to normal     }     return PLUGIN_CONTINUE }

tell me if it works
__________________
atomic is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-20-2005 , 19:28  
Reply With Quote #4

You have to use amx_hsonly 1 for on or amx_hsonly 0 for off, you can't just enter the command amx_hsonly by itself.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 10-20-2005 , 20:05  
Reply With Quote #5

Also, put "return PLUGIN_HANDLED" at the end instead of "return PLUGIN_CONTINUE" for commands ;)
__________________
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
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-20-2005 , 20:23  
Reply With Quote #6

OK i know was wrong about the hud messages having an index of 0,


but i am like 90% sure you can not put 0 in this funciton, but i could be wrong.




In the case that i am right,

Code:
 new i    for( i = 0; i < get_maxplayers(); i++ ) {       if( !is_user_connected(i) ) continue       set_user_hitzones(i,i,255)  }
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 10-20-2005 , 20:48  
Reply With Quote #7

Nope, wrong again. Sorry
Quote:
Originally Posted by Function Doc
set_user_hitzones ( [ index = 0, target = 0, body = 255 [ )

Set index to a player's index and leave target at 0 to define what bodyparts this player can hit when he is firing.

Notes
Sets hit zones for player.
Parts of body are as bits:
1 - generic
2 - head
4 - chest
8 - stomach
16 - left arm
32 - right arm
64 - left leg
128 - right leg

Set index to 0 and target to a player's index to define what bodyparts on player other players can hit when they are firing.

Set both index and target to 0 to define globally what bodyparts people can hit and what bodyparts can be hit when firing.
Example: ( Make a single player fire blanks )
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-20-2005 , 20:50  
Reply With Quote #8

Sigh, i know there is some situations where you cant use 0, or else it will give you an error
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 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 23:44.


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