Raised This Month: $51 Target: $400
 12% 

Blanks (Spawn Prevention) *Update V. 1.6*


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Server Management       
Jordan
Veteran Member
Join Date: Aug 2005
Old 11-06-2005 , 13:52   Blanks (Spawn Prevention) *Update V. 1.6*
Reply With Quote #1

Well this is my first plugin so don't be so harsh on me

Current Version
1.6

Description

Basically, this is a spawn prevention plugin which uses blanks rather than godmode. Once the time period is up, players use real bullets. I got this idea from my clan's server which used the spawn prevention plugin with the HUD message, but players could still be killed.
Please tell me if anything isn't working

CVARS/Commands

amx_blanks <0|1> - Turns the program on and off.
mp_blanktime (Your Choice) - Amount of time in seconds blanks are enabled - default is 5.
amx_messages <0|1> - Turns the blanktime messages on/off. - Default is 1.

Required Modules
Engine
Fun

Known Bugs
ATM None.

THANKS TO:
Suicid3 for proving my plugin didn't work.
Charr for fixing some stuff.
Kensai for leading me in circles
Attached Files
File Type: sma Get Plugin or Get Source (blanks.sma - 1101 views - 2.2 KB)
Jordan is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 11-06-2005 , 14:08  
Reply With Quote #2

This plugin wont work like you want it to.
1) You dont do anything on a player spawn.
2) You have 3 registered commands
  • 1) 2 dont have a function to go to
    2) the one that has a function doesnt do anything but show a message and change a cvar.

This plugin will set a players hitzones to be blanks when they connect and never take them off.

Its a nice try for first plugin but it just doesnt work.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 11-06-2005 , 14:13  
Reply With Quote #3

Code:
#define PLUGIN "Blank Time" #define VERSION "1.0" #define AUTHOR "SatanWoJ, with help from Peli, and EKS"

That's useless, since you don't use it anywhere. If your looking to give credits, just make a commented section and do it there.

Code:
/* Thanks to Santa Claus for the coal blah balhb lhb alh sds gds fsd */

I would agree with Suicide, nice idea, but bad code.

Code:
register_concmd("amx_blanks","cmd_blanks",ADMIN_KICK, "0,1,")

I would change the "0,1," part to HOW you use it, something like this:

Code:
register_concmd("amx_blanks","cmd_blanks",ADMIN_KICK, "<0|1> - Does whatever")
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
Jordan
Veteran Member
Join Date: Aug 2005
Old 11-06-2005 , 14:17  
Reply With Quote #4

Hm. So... I have to create a function to work w/ players spawning?

And thx

Well....

I still don't see the problem -
Code:
public blanks_on(id) {     if(get_cvar_num("mp_blanks") == 1)     {         set_task(0.1, "blanks", id)     }     return PLUGIN_CONTINUE } public blanks(id) {     new Float:blanktime = get_cvar_float("mp_blanktime")     new Float:Blanks = get_cvar_float("mp_blanktime")     if(get_cvar_num("mp_messages") == 1)     {         set_hudmessage(255, 1, 1, -1.0, -1.0, 0, 6.0, blanktime, 0.1, 0.2, 4)         show_hudmessage(id, "Blanks are now enabled for %d seconds", Blanks)     }     set_task(Blanks, "blank_off", id)     return PLUGIN_HANDLED

Why doesn't this work??
Jordan is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 11-06-2005 , 15:05  
Reply With Quote #5

>.>

Just so no one thinks I'm stupid, all I did was fix the compiling errors, I didn't even read it.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Jordan
Veteran Member
Join Date: Aug 2005
Old 11-06-2005 , 16:12  
Reply With Quote #6

Anyone??
Jordan is offline
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 11-06-2005 , 16:14  
Reply With Quote #7

According to that, all "Blanks" does is make a HUD message.

You need the actual code that does wahtever, makes them fires blanks?

Maybe just have it so their damage is 0?
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
Jordan
Veteran Member
Join Date: Aug 2005
Old 11-06-2005 , 16:18  
Reply With Quote #8

Well I have it so that set_user_hitzones is 0 when the players join the server, but Suicid3 said that it won't turn off and when the players respawn nothing happens....

But, according to my code, it seems to me it's working - so I was wondering how to fix it so that it actually works o.O

Here's the full plugin code:

Code:
public plugin_init() {     register_concmd("amx_blanks","cmd_blanks",ADMIN_KICK, "0|1")     register_concmd("amx_blanktime","cmd_blanktime",ADMIN_KICK,"1-5")     register_concmd("amx_blankmessages","cmd_blankmessages",ADMIN_KICK,"0|1")     register_plugin("Blank Spawn Prevention","1.0.","SatanWoJ")     register_cvar("mp_blanks","1")     register_cvar("mp_blanktime","5")     register_cvar("mp_messages","1") } //---------------------------------------------------------------// public client_putinserver(id) {     new arg[4]     new VictimID = cmd_target(id,arg,3)     read_argv(1, arg, 3)     if (get_cvar_num("mp_blanks") > 0)         set_user_hitzones(VictimID, 0, 0)     else          set_user_hitzones(VictimID, 0, 255) } //---------------------------------------------------------------// public cmd_blanks(id,level,cid) {     if(!cmd_access(id, level, cid,2))         return 0;           new arg_str[3]     read_argv(1, arg_str, 3)     new arg = str_to_num(arg_str)     if(arg > 10 || arg < 1)     {         client_print(id, print_chat, "You have turned blanks on.")         return PLUGIN_HANDLED     }     else if (arg > 0 || arg < 11)     {         set_cvar_num("mp_blanktime", arg)         client_print(id, print_chat, "You have set the Blank Time to %d second(s)", arg)         return PLUGIN_CONTINUE     }           return 0; } //---------------------------------------------------------------// public blanks_on(id) {     if(get_cvar_num("mp_blanks") == 1)     {         set_task(0.1, "blanks", id)     }     return PLUGIN_CONTINUE } public blanks(id) {     new Float:blanktime = get_cvar_float("mp_blanktime")     new Float:Blanks = get_cvar_float("mp_blanktime")     if(get_cvar_num("mp_messages") == 1)     {         set_hudmessage(255, 1, 1, -1.0, -1.0, 0, 6.0, blanktime, 0.1, 0.2, 4)         show_hudmessage(id, "Blanks are now enabled for %d seconds", Blanks)     }     set_task(Blanks, "blank_off", id)     return PLUGIN_HANDLED } //---------------------------------------------------------------// public blank_off(id) {     if(!is_user_connected(id))     {         return PLUGIN_HANDLED     }     else     {         set_user_hitzones(id, 255)         return PLUGIN_HANDLED     }     return PLUGIN_HANDLED }
Jordan is offline
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 11-06-2005 , 16:25  
Reply With Quote #9

Huhm, very very strange code. Lol.

One question.

What's the difference between your cmds and cvars?

Code:
register_concmd("amx_blanks","cmd_blanks",ADMIN_KICK, "0|1")      register_concmd("amx_blanktime","cmd_blanktime",ADMIN_KICK,"1-5")      register_concmd("amx_blankmessages","cmd_blankmessages",ADMIN_KICK,"0|1")      register_plugin("Blank Spawn Prevention","1.0.","SatanWoJ")      register_cvar("mp_blanks","1")      register_cvar("mp_blanktime","5")      register_cvar("mp_messages","1")

They all do the same thing, but one's an admin command and ones a cvar???

I would just make those CVARS, with Required access flags, if you want that.

Code:
register_cvar("amx_blanks",ADMIN_KICK,"1")      register_cvar("amx_blanktime",ADMIN_KICK,"5")      register_cvar("amx_messages",ADMIN_KICK,"1")

As for the rest of it it's very confusing, I'll take a closer look later.
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
Jordan
Veteran Member
Join Date: Aug 2005
Old 11-06-2005 , 16:34  
Reply With Quote #10

yes well... its my first time so I get excuses ^.^


It doesn't compile with what you said o.O

/home/users/amxmodx/tmp3/phpPzKbUR.sma(23) : error 035: argument type mismatch (argument 2)
/home/users/amxmodx/tmp3/phpPzKbUR.sma(24) : error 035: argument type mismatch (argument 2)
/home/users/amxmodx/tmp3/phpPzKbUR.sma(25) : error 035: argument type mismatch (argument 2)
Jordan 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 03:59.


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