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

[TUT/INFO] set_tasks: when they are and when they aren't necessary


Post New Thread Reply   
 
Thread Tools Display Modes
Drak
Veteran Member
Join Date: Jul 2005
Old 11-02-2006 , 12:40   Re: set_tasks: when they are and when they aren't necessary
Reply With Quote #11

Would there be a way around a simple welcome message? Or would I have to use tasks?
Code:
public client_putinserver(id) {           set_task(8.0,"welcome_msg",id) } public welcome_msg(id) {           new name[33]           get_user_name(id,name,32)           client_print(id,print_chat,"Welcome %s, to the server.",name) }
Drak is offline
Send a message via MSN to Drak
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 11-02-2006 , 15:31   Re: set_tasks: when they are and when they aren't necessary
Reply With Quote #12

Quote:
Originally Posted by SixTwin View Post
Would there be a way around a simple welcome message? Or would I have to use tasks?
Code:
public client_putinserver(id) { set_task(8.0,"welcome_msg",id) } public welcome_msg(id) { new name[33] get_user_name(id,name,32) client_print(id,print_chat,"Welcome %s, to the server.",name) }
Not really, since it's just 1 task there's no real point in evading it.

prody & watch:

I'd merge in your changes, but I didn't take a copy of this tutorial as a text file (which I happen to have done with all my other tutorials other than the mirrors from the wiki). That means that I'll either have to redo all the code (due to the code editing bug) or just accept the fact that people will have to look down to your posts.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
The Specialist
BANNED
Join Date: Nov 2006
Old 11-14-2006 , 16:28   Re: set_tasks: when they are and when they aren't necessary
Reply With Quote #13

instead of registering a forward why not use for and while and do while loops ?
The Specialist is offline
Send a message via AIM to The Specialist
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 01-17-2007 , 01:19   Re: set_tasks: when they are and when they aren't necessary
Reply With Quote #14

How do you specify which ent to hook? It's a bit hazy there. You just hook the next think to a function, and uhh... I'm confuserized.
__________________
Bad_Bud is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 01-17-2007 , 16:00   Re: set_tasks: when they are and when they aren't necessary
Reply With Quote #15

I don't know if you're going to see this (since you were banned), but to check which ent it is, simply hook the classname that the ent belongs to. The ent id is passed into the think function call. Just compare it inside the function.

EDIT: Or you can hook FM_Think and check if the entity thinking is the ent you want
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Old 01-19-2007, 21:22
SweatyBanana
This message has been deleted by Brad. Reason: irrelevant to this thread
Old 01-19-2007, 21:23
Hawk552
This message has been deleted by Brad. Reason: irrelevant to this thread
JCobra
Senior Member
Join Date: Mar 2006
Location: Canada
Old 01-19-2007 , 22:13   Re: set_tasks: when they are and when they aren't necessary
Reply With Quote #16

Nice tutorial

+Karma
__________________
User has abandoned this account.
JCobra is offline
Send a message via AIM to JCobra
Old 01-19-2007, 22:24
Zenith77
This message has been deleted by Brad. Reason: irrelevant to this thread
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 10-05-2007 , 21:14   Re: set_tasks: when they are and when they aren't necessary
Reply With Quote #17

Quote:
Originally Posted by Hawk552 View Post
I'd merge in your changes, but I didn't take a copy of this tutorial as a text file (which I happen to have done with all my other tutorials other than the mirrors from the wiki). That means that I'll either have to redo all the code (due to the code editing bug) or just accept the fact that people will have to look down to your posts.
A workaround is to use the Standard Editor (UserCP -> Edit Options -> Miscellaneous Options).
Lee is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-05-2007 , 23:51   Re: [TUT/INFO] set_tasks: when they are and when they aren't necessary
Reply With Quote #18

@Hawk552 :

Code:
// optimization new Float:g_Cooldown = ATTACK_COOLDOWN

Can you explain why it's an optimization, please ?
__________________

Last edited by Arkshine; 10-06-2007 at 00:52.
Arkshine is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-06-2007 , 00:14   Re: [TUT/INFO] set_tasks: when they are and when they aren't necessary
Reply With Quote #19

Quote:
Originally Posted by arkshine View Post
@Haw552 :

Code:
// optimization new Float:g_Cooldown = ATTACK_COOLDOWN


Can you explain why it's an optimization, please ?
I don't know who this "Haw552" character is, but I'll answer for him. If it's used more than once in the script, the data only appears in memory once. If you use the define, the memory is allocated for each time it's referenced.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-06-2007 , 00:53   Re: [TUT/INFO] set_tasks: when they are and when they aren't necessary
Reply With Quote #20

Thanks for your answer, Hawk552.
__________________
Arkshine 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 12:17.


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