Loading incorrect model. (string is concatenating?)
Hello, I'm creating a custom ironsights plugin, however, in some rare cases server is crashing because it's loading an invalid model. I checked the console and it appears the model string is concatenating instead of replacing itself as you can see here.
Code:
FATAL ERROR (shutting down): SV_ModelIndex: model models/motv/2017_contrabandista/models/motv/2017_contrabandista/opfor/v_aug.mdl not precachedCode:
What could be the cause of this? |
Re: Loading incorrect model. (string is concatenating?)
most likely problem with the part of code where you set oldVModel[id]
|
Re: Loading incorrect model. (string is concatenating?)
Yes but the question is why.
In all tests I've done this plugin works correctly but as soon as I put it in my working public server a crash happens randomly. |
Re: Loading incorrect model. (string is concatenating?)
I would take a look at every line where you reference oldVModel and verify you are using it consistently/correctly.
One thing I notice is you have it defined as new oldVModel[128][32] yet you are using the first index for the player id? If this is the case, it should be oldVModel[ MAXPLAYERS + 1 ][ MAXCHARS + 1 ] and then any time you set data to it, pass charsmax( oldVModel[] ) for max chars. These two else's are not needed since the function terminates with a PLUGIN_HANDLED anyway. PHP Code:
PHP Code:
PHP Code:
Add some lines to troubleshoot to confirm your code is working as expected. PHP Code:
|
Re: Loading incorrect model. (string is concatenating?)
You defined oldModel like this
Code:
new oldVModel[128][32];Code:
set_pev(id, pev_viewmodel, engfunc(EngFunc_AllocString, oldVModel[id])); |
Re: Loading incorrect model. (string is concatenating?)
Quote:
I'll keep testing for a while before marking this thread as "Solved". Thank you. |
| All times are GMT -4. The time now is 18:03. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.