Quote:
Originally Posted by bad_boy
That's why you are getting the error. E1_531G is correct.
PHP Code:
if( is_user_alive( id ) && is_spawn_valid(id, fVector))
|
The player is indeed alive at that moment, but is_user_alive returns 0 because is_user_connected is also returning 0...
Anyways, i'll re-add the user alive check and the "solution" (it's more a workaround) that i got for that
---
I got my own answer after checking and rechecking things, and to notice it better i wrote a small plugin to get this output (on both versions):
PHP Code:
* client_connect(1) *
* client_authorized(1) *
* Ham_Player_Spawn_Pre(1) *
* is_user_connecting(1): 1 | is_user_connected(1): 0 *
* pev_valid(1): 2 | is_user_alive(1): 0 *
* ExecuteHam(Ham_IsAlive, 1): 0 | entity_get_float(1, EV_FL_health): 0.00 *
* Ham_Player_Spawn_Post(1) *
* is_user_connecting(1): 1 | is_user_connected(1): 0 *
* pev_valid(1): 2 | is_user_alive(1): 0 *
* ExecuteHam(Ham_IsAlive, 1): 1 | entity_get_float(1, EV_FL_health): 100.00 *
* client_putinserver(1) *
* is_user_connecting(1): 0 | is_user_connected(1): 1 *
* pev_valid(1): 2 | is_user_alive(1): 1 *
* ExecuteHam(Ham_IsAlive, 1): 1 | entity_get_float(1, EV_FL_health): 100.00 *
AMXX doesn't consider the client fully connected until just before calling the client_putinserver forward... And... As is_user_alive also includes the is_user_connected check, it will return 0
I initially thought that it was an issue on 1.9, but on 1.8.2 lot's of engine functions didn't have safeguard checks for the entity, that's why it was working on 1.8.2.
So getting the error was the correct result, now i have to fix my plugin:
Re-adding the is_user_alive check that was commented on Ham_Player_Spawn_Post will make it work fine, but it won't be called "correctly" with the spawn when user joins, so as solution i will call the hook function on client_putinserver and that is all.
PHP Code:
public client_putinserver(id)
{
// Workaround for first spawn at join
Ham_Player_Spawn_Post(id);
}
Not all things works in the same way as cstrike plugins, i will mark the thread as solved.