Player "not in-game" at Ham_Spawn (post) on lastest 1.9 but working on 1.8.2
While testing this plugin:
PHP Code:
Code:
[ENGINE] Invalid player 1 (not in-game) here are pictures from the console (i was using rehlds when i got the error, so i did had to switch to vanilla hlds to test too) (Win) HLDS (8196) & AMXX v1.9.0.5249: https://i.imgur.com/cS7EeSc.png (Win) HLDS (8196) & AMXX v1.8.2: https://i.imgur.com/WLUbtxp.png (Win) reHLDS (3.6.0.672-dev) & AMXX v1.9.0.5249: https://i.imgur.com/eG0m9TD.png (Win) reHLDS (3.6.0.672-dev) & AMXX v1.8.2: https://i.imgur.com/t8IxZdN.png the hlds build is a couple of months old (too lazy to update it), but the issue gets noticed on the images with the server version and meta dll too (also tested with other metamod with the same) also, i wasn't expecting is_user_alive returning 0 in Ham_Spawn_Post, but, as the result is the same as 1.9.0, i will do a workaround for it --- Edit 1 --- Forgot to add that, on the 1.9.0 tests, i tested both plugins: Compiled with 1.9.0 and with 1.8.2 and the issue was present on both cases (just in case) --- Edit 2 --- Got to test on a linux server too (just with reHLDS 3.7.0.687-dev) and it was the same result (Linux) reHLDS (3.7.0.687-dev) & AMXX v1.9.0.5249: https://i.imgur.com/A62ZMj4.png (Linux) reHLDS (3.7.0.6872-dev) & AMXX v1.8.2: https://i.imgur.com/D4AM6be.png --- Edit 3 --- Solved, the issue was on 1.8.2, more info: https://forums.alliedmods.net/showpo...87&postcount=5 If anybody wants to use the plugin, apply the workaround on the post and uncomment the "if" block |
Re: Player "not in-game" at Ham_Spawn (post) on lastest 1.9 but working on 1.8.2
You have to always check if user is alive in Ham_Spawn post, bcz Ham_Spawn is got called also when the player join in the server.
|
Re: Player "not in-game" at Ham_Spawn (post) on lastest 1.9 but working on 1.8.2
Quote:
|
Re: Player "not in-game" at Ham_Spawn (post) on lastest 1.9 but working on 1.8.2
Quote:
PHP Code:
|
Re: Player "not in-game" at Ham_Spawn (post) on lastest 1.9 but working on 1.8.2
Quote:
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:
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:
|
Re: Player "not in-game" at Ham_Spawn (post) on lastest 1.9 but working on 1.8.2
Quote:
I'm not sure why you think you wouldn't need an alive check in any version of AMX Mod X. Also, I didn't really understand why you are calling your Ham_Spawn post function at client_putinserver(). Ham_Spawn will occur when you spawn. Also, you can't be alive is you are not yet in the server. |
Re: Player "not in-game" at Ham_Spawn (post) on lastest 1.9 but working on 1.8.2
Just for curiosity
PHP Code:
|
Re: Player "not in-game" at Ham_Spawn (post) on lastest 1.9 but working on 1.8.2
Quote:
I always disliked how random_num gives results that looks "not so random" when using small numbers, so i make a big random number and apply modulo on it to get a value from 0-(%1 - 1) Of course, this is just personal opinion... But i have noticed the differences while using it and i'm happy with it. |
Re: Player "not in-game" at Ham_Spawn (post) on lastest 1.9 but working on 1.8.2
Quote:
In HL there is no team/class select on connect, so you spawn directly at PutInServer as there is no need to defer the (alive) spawn... But, on that first spawn (hooked with HAM), is_user_alive returns false because AMXX's PutInServer_Post hook (from meta) hasn't been called yet... It's something a little bit like this issue. So, i have 2 options for doing the stuff i need to do on that first spawn when is_user_alive (and _connected) are true and can run functions on the player:
The first one it's the best option, so that's why there is a call to the Spawn_Post hook at there. |
All times are GMT -4. The time now is 09:19. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.