Raised This Month: $ Target: $400
 0% 

HS only script


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarlD
Senior Member
Join Date: Aug 2004
Old 10-19-2005 , 11:45   HS only script
Reply With Quote #1

ok so basicly its working. but i would like to be able to take it off some how.

right now thats the code i have for the HS only script

Code:
register_concmd("ma_hsonly","hs_only",ADMIN_KICK,"enable hs only") register_cvar("hs_only","0"); public hs_only() {     {         client_print(0,print_chat,"Meta-Addons: HS ONLY MODE ENABLED FOR THIS ROUND")         set_user_hitzones(0,0,2)     }     return PLUGIN_CONTINUE }

i would like to know how to make commands like amx_hsonly 1= on 0= off
__________________
DarlD is offline
Send a message via MSN to DarlD
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 10-19-2005 , 12:41  
Reply With Quote #2

all you would have to do is set another command to let all the hitzones be shot...its not that hard, but i dont know the hitzones...
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-19-2005 , 14:31  
Reply With Quote #3

Code:
register_concmd("ma_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-Addons: HS ONLY MODE ENABLED FOR THIS ROUND")         set_user_hitzones(0,0,2)     }     else     {         client_print(0,print_chat,"Meta-Addons: HS ONLY MODE DISABLED FOR THIS ROUND")         // reset hitzones however you do it     }     return PLUGIN_CONTINUE }

This uses the cmd_access function from the amxmisc include to make sure the person calling the function really has access to it. The last parameter is the number of arguments the function has plus one. Since we only want one argument, on or off, we take that and add one to get two.

It then uses the read_argv function to read the first argument (that's the first parameter, 1) into the arg variable. Then we check to see if it is more then one and turn it on, otherwise we turn it off.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-19-2005 , 14:53  
Reply With Quote #4

set_user_hitzones is broken AFAIK
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
DarlD
Senior Member
Join Date: Aug 2004
Old 10-19-2005 , 15:33  
Reply With Quote #5

So if i type ma_hsonly 1 in console it will enable it? and if i type ma_hsonly 0 it will disable it?

Code:
register_concmd("ma_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-Addons: HS ONLY MODE ENABLED FOR THIS ROUND")         set_user_hitzones(0,0,2)     }     else     {         client_print(0,print_chat,"Meta-Addons: 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
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-19-2005 , 15:44  
Reply With Quote #6

Try it.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX 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:37.


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