Raised This Month: $ Target: $400
 0% 

Onos blocker


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Newbster
Junior Member
Join Date: Feb 2005
Location: San Antonio, Texas
Old 02-21-2005 , 22:53   Onos blocker
Reply With Quote #1

Ok, ive been working on this onos blocker because the current ones i dislike. It compiles, but itdoesnt work. It wont let me onos. Can anyone help me? The point is to have at least 3 rines to every 1 ono.
Code:
#include <amxmod>
#include <ns2amx>
#include <amxmodx>
#include <engine>

public plugin_init()
{
	if(is_combat())
	{
		register_plugin("Onos Blocker","1.0.123.1","Newbster & Riot")
		register_impulse(117, "checkBlock",0)
		register_event("Countdown","gameStarting","a")
	}
}

public checkBlock(id)
{
	new Players[32], Float:aliens, Float:marines, Float:playerCount, Float: numonos
	//gets the number of marines... i think
	marines = get_players(Players,playerCount,"e","1")
	//ns_get_ent ( classname[], value ) 
	//^ THAT, is what we need to get the number of onoses on field i think.
	numonos = find_ent_by_class (-1,"onos")
	if ((marines/3) < numonos)	
		{
		client_print(id,print_chat,"[ONOSBLOCKER] You need to have 3 marines for every 1 onos, sorry!")
		return PLUGIN_HANDLED
	}
	else	{
		return PLUGIN_CONTINUE
	}
	return PLUGIN_CONTINUE
}

public gameStarting()
{
	return PLUGIN_CONTINUE
}
Newbster is offline
Send a message via AIM to Newbster
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 02-22-2005 , 01:50  
Reply With Quote #2

remove the
if(is_combat())
{
}

thing
Freecode is offline
Newbster
Junior Member
Join Date: Feb 2005
Location: San Antonio, Texas
Old 02-22-2005 , 02:56  
Reply With Quote #3

But, i only want it to work during combat. not co.
Newbster is offline
Send a message via AIM to Newbster
f1del1ty.oXi
Veteran Member
Join Date: Nov 2004
Old 02-22-2005 , 08:17  
Reply With Quote #4

well that made no sense, work in combat, not co. =\

Why not use it for NS as well, so if it's 1v3 aliens, one might have the indecency to go onos.. I know I've seen it done before... Doesn't hurt to see if free's right.
__________________
f1del1ty.oXi is offline
Newbster
Junior Member
Join Date: Feb 2005
Location: San Antonio, Texas
Old 02-22-2005 , 21:40  
Reply With Quote #5

sorry, co not ns. But can aanyone help me with getting it to work? (for co only)
__________________
www.j00s.com (67.95.103.222)
-j00- Public clan server and website
(j00 spelt with two zeros not letters)
Newbster is offline
Send a message via AIM to Newbster
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 02-22-2005 , 22:35  
Reply With Quote #6

dont noe much about NS but the register_plugin is called only once every map so if when map is loaded register_plugin is called and i doubt that is_combat() is set to true at that moment. so in my mind u never get to register ur commands. but i might be wrong since i dont play ns much.
Freecode is offline
Newbster
Junior Member
Join Date: Feb 2005
Location: San Antonio, Texas
Old 02-24-2005 , 22:18  
Reply With Quote #7

can someone who does play ns and knows how to script help me?
__________________
www.j00s.com (67.95.103.222)
-j00- Public clan server and website
(j00 spelt with two zeros not letters)
Newbster is offline
Send a message via AIM to Newbster
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 02-25-2005 , 11:57  
Reply With Quote #8

FreeCode is right. You put the code in the wrong position.

Take it out of plugin_init, and put it in your functions, like this:

Code:
public checkBlock(id)
{
	if(is_combat())
   	{
   		new Players[32], Float:aliens, Float:marines, Float:playerCount, Float: numonos
   		//gets the number of marines... i think
   		marines = get_players(Players,playerCount,"e","1")
   		//ns_get_ent ( classname[], value )
   		//^ THAT, is what we need to get the number of onoses on field i think.
   		numonos = find_ent_by_class (-1,"onos")
   		if ((marines/3) < numonos)   
   		   {
   		   client_print(id,print_chat,"[ONOSBLOCKER] You need to have 3 marines for every 1 onos, sorry!")
   		   return PLUGIN_HANDLED
   		}
   		else   {
   		   return PLUGIN_CONTINUE
   		}
	}	
   	return PLUGIN_CONTINUE
}
You still have to register the commands, no matter if its combat or not. But the commands dont have to function unless its combat, if you so choose it.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Newbster
Junior Member
Join Date: Feb 2005
Location: San Antonio, Texas
Old 02-27-2005 , 21:32  
Reply With Quote #9

How do you register the commands?
__________________
www.j00s.com (67.95.103.222)
-j00- Public clan server and website
(j00 spelt with two zeros not letters)
Newbster is offline
Send a message via AIM to Newbster
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 02-27-2005 , 21:51  
Reply With Quote #10

Well you registered an impulse...
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Reply


Thread Tools
Display Modes

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 14:16.


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