Thanks for providing the code, now I see why you were confused. However, as I said, the code is wrong. Ham_Spawn is executed per player so it has an "id" argument.
PHP Code:
public e_Player_Spawn(id)
Therefore, the task and iterating over players is not needed. You can simply do:
PHP Code:
public e_Player_Spawn(id)
{
if(is_user_alive(id))
{
strip_user_weapons( id);
give_item( id, "weapon_knife" );
give_item( id, "weapon_awp" );
cs_set_user_bpammo( id, CSW_AWP , 30 );
}
}
Now you should not notice any delays. The behavior you described makes perfect sense with your original code, but it's caused, as I said, by the wrong code. Try what I proposed and see that it should work just fine.
I removed the team check because it is no longer needed: an alive, spawned player will either be tero or ct.
Also, I suggest you read this:
https://forums.alliedmods.net/showthread.php?t=42159
To explain more about caching: a loop is executed multiple times. If values do not change between loop iterations then it's better to cache(save) them before the loop. This helps you avoid repeated native calls that will produce the same output. As a result, your code will be a bit faster. Assume you wanted to run a native that takes 1 second to run inside a loop that runs 32 times. This means that the time taken by that native is 32 runs * 1s per run = 32s. Now, if you cache the native before the loop, the whole run time of that native is only 1s. That's 32 times better.
__________________