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

passing id through set_task


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 06-11-2009 , 19:21   passing id through set_task
Reply With Quote #1

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

new energy[33];

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	return PLUGIN_CONTINUE
}
public client_putinserver(id) {

	//Welcome message
	new cName[33]
	get_user_name(id,cName,32)
	client_print(0,print_chat,"Velkommen %s",cName)
	
	set_task(6.0,"showPool",0,_,_,"b")
	set_task(3.0,"addEnergy",0,_,_,"b")
	
	return PLUGIN_CONTINUE
}

public addEnergy(id) {
	energy[id] += 1
	
	new cName[33]
	get_user_name(id,cName,32)
	
	client_print(0,print_chat,"UN:%s",cName)
}
When the server prints text, i does not show the actual name, it shows "Counter-Strike" as if it's getting the servername instead of the player name.

I've roughly searched the forum whitout any result... i would be more than glad for any help.
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-11-2009 , 19:25   Re: passing id through set_task
Reply With Quote #2

set_task(6.0,"showPool",id,_,_,"b")
set_task(3.0,"addEnergy",id,_,_,"b")

Are you intending on looping this constantly or do you want it called just once?
__________________
Bugsy is offline
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 06-11-2009 , 19:28   Re: passing id through set_task
Reply With Quote #3

looping

ooh i just thought that a 0 would pass the id :/

Thanks for the prompt answer
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
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 11:32.


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