native "cs_get_user_team" & native "cs_get_weapon_silen" - The complicated way
Greetings,
Hope everybody is having a great time here. Had to post this after a lot of searching and fixing didn't help. Error : PHP Code:
PHP Code:
PHP Code:
I'd love to get a fixed code and also learn how to fix these type of errors, especially with SayHandlers. Lemme know if you need any additional information. Kind Regards, ZEDD |
Re: native "cs_get_user_team" - The complicated way
Checking if the user is connected before getting his team should without any doubt prevent that error. Every time you see an "invalid player X" error, it means that the user is not connected. Add the check in the beginning of the function and stop the code from going any further if it returns false.
|
Re: native "cs_get_user_team" - The complicated way
Quote:
Thanks OciXCrom, definitely something to keep in mind for my future projects as well. Really appreciate the help, simple but significantly differential. If errors do me any more negative, I'll update this thread. Warm Regards, ZEDD |
Re: native "cs_get_user_team" - The complicated way
Code:
Maybe this will help you. |
Re: native "cs_get_user_team" - The complicated way
Quote:
Already fixed it myself, but this will definitely be an option if mine fails at all. Thanks mate! Warmest Regards, ZEDD |
Re: native "cs_get_user_team" - The complicated way
Greetings,
Ran into another error, a different one : PHP Code:
PHP Code:
Regards, ZEDD |
Re: native "cs_get_user_team" & native "cs_get_weapon_silen" - The complicated way
is_user_alive already check if the player is connected, so you don't need to verify. Also, you need to check if weapon is a valid entity.
Code:
Also, consider to use switch instead of a lot of "if" |
Re: native "cs_get_user_team" & native "cs_get_weapon_silen" - The complicated way
Quote:
Will keep switch() in mind as well. Thanks again and Regards, ZEDD |
| All times are GMT -4. The time now is 12:13. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.