Raised This Month: $ Target: $400
 0% 

Compile for 0 bytes + set_task help.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 08-31-2004 , 15:07   Compile for 0 bytes + set_task help.
Reply With Quote #1

This compiles to .amx for a lovely 0 bytes. Since I'm new at this it's probably something very obvious(a PLUGIN_CONTINUE should be PLUGIN_HANDLED???), but please help me. Also, are my set_tasks doing what they are supposed to do. (Plugin is supposed to give one health a second to a player who has the boost activated.)

Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>

new bool:booston[32] = false

public plugin_init()
{
	register_plugin("Health Boost","0.1","twistedeuphoria")
	register_concmd("hboost","health_switch",ADMIN_IMMUNITY,"Blah-To be added later.")
	register_clcmd("hboost","health_switch",ADMIN_IMMUNITY,"Blah-To be added later.")
	set_task(.5,"check_boost",1,"b",1)
	return PLUGIN_CONTINUE
}



public health_switch(id)
{
	if(booston[id] == false)
		booston[id] = true
	if(booston[id] == true)
		booston[id] = false	
	return PLUGIN_CONTINUE
}

public check_boost()
{
	new i
	for(i=0,i<=31,i++)
	{
		if(booston[i] == true)
			set_task(1,"give_health",2,id,"b",1)
		if(booston[i] == false)
			remove_task(i,2)
	}	
	return PLUGIN_CONTINUE
}

public give_health(id)
{
	new oldhealth
	new newhealth
	oldhealth = get_user_health(id)
	newhealth = (oldhealth + 1)
	set_user_health(id,newhealth)
	return PLUGIN_CONTINUE
}
Thank you for your time.
twistedeuphoria is offline
 



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 17:21.


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