Raised This Month: $ Target: $400
 0% 

[Help] with task and plaer enter world


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zippel
Member
Join Date: Mar 2011
Location: RF
Old 04-30-2011 , 17:00   [Help] with task and plaer enter world
Reply With Quote #1

Quote:
public client_putinserver(id)
{
if(is_user_bot(id))
return PLUGIN_CONTINUE;

trololo[id][0] = 0;

if ( get_user_flags (id) & ADMIN_ACCESS & FL_ONGROUND)
{
set_task ( 5.0, "wait_entergame" , id )
}
return PLUGIN_HANDLED;
}
Why my code is incorrect? I want that my task must be started after 5 seconds after player, who entered in the world with admin access...
This task shouldn't run when player in spectator or not allowed of any team, only after when entered in world or new round.
zippel is offline
Send a message via ICQ to zippel Send a message via Skype™ to zippel
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-30-2011 , 18:14   Re: [Help] with task and plaer enter world
Reply With Quote #2

client_putinserver(id) is called when they enter the server (when you seee the MOTD). You probably need to hook Ham_Spawn and set the task then.
__________________
fysiks is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-30-2011 , 18:58   Re: [Help] with task and plaer enter world
Reply With Quote #3

So you want wait_entergame() to only be called when a player 1) first joins server 2) has selected a team 3) is spawned into the game? If this is not correct, please try to explain what you want more clearly.

Also, your flags check is incorrect. When you want to check a combination of flags you must OR them and then check if the resulting flags is what you're looking for.

PHP Code:
if ( ( get_user_flagsid ) & ( ADMIN_ACCESS FL_ONGROUND ) ) == ( ADMIN_ACCESS FL_ONGROUND ) ) 
__________________

Last edited by Bugsy; 04-30-2011 at 19:03.
Bugsy is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 04-30-2011 , 19:54   Re: [Help] with task and plaer enter world
Reply With Quote #4

ippel
Show task code. Maybe you unintentively terminating the task itself.
__________________

SonicSonedit is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-30-2011 , 20:13   Re: [Help] with task and plaer enter world
Reply With Quote #5

It was likely his flag checking to blame. I tested using his method and my corrected method and the corrected method successfully called the task function while his did not. There could be underlying problems in his task function as well, though.
__________________
Bugsy is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-30-2011 , 20:55   Re: [Help] with task and plaer enter world
Reply With Quote #6

Why are you checking FL_ONGROUND with the admin flags?

That should be checked with pev_flags (or EV_INT_flags).
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 04:18.


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