AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help] with task and plaer enter world (https://forums.alliedmods.net/showthread.php?t=156073)

zippel 04-30-2011 17:00

[Help] with task and plaer enter world
 
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.

fysiks 04-30-2011 18:14

Re: [Help] with task and plaer enter world
 
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.

Bugsy 04-30-2011 18:58

Re: [Help] with task and plaer enter world
 
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 ) ) 


SonicSonedit 04-30-2011 19:54

Re: [Help] with task and plaer enter world
 
ippel
Show task code. Maybe you unintentively terminating the task itself.

Bugsy 04-30-2011 20:13

Re: [Help] with task and plaer enter world
 
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.

Exolent[jNr] 04-30-2011 20:55

Re: [Help] with task and plaer enter world
 
Why are you checking FL_ONGROUND with the admin flags?

That should be checked with pev_flags (or EV_INT_flags).


All times are GMT -4. The time now is 04:18.

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