Change Knife Model With Player Model
Hey everyone. I need help with this plugin I'm making. Here's what I have so far.
Code:
#include <amxmodx>I tried changing containi to equali but it doesnt work. All help accepted! And the code doesnt need to be converted because I'm not releasing this... but you can convert if you want. |
Re: Change Knife Model With Player Model
Hey, "containi()" definition says: function returns -1 value on failure, not 0.
Look at the first "if" block: "if(containi(usermodel, "zombi_host"))" equals to "if(-1)" so "if" body will be executed, and all further "else if" will be skipped. You have to compare "containi()" return value to -1 explicitly. Why not to define an array, with "usermodels" as indexes, and "model_weapon_view(2)" as values? ("zombi_host", "zombi_origin" are constants, I guess) In this case, it is possible to switch to 1-2 commands(check array index is present and fetch that value) instead of annoying "if-else" blocks. Array values can be loaded from file(s) also, so you don't need to modify source code when you want new model(s) :oops: "containti()" is case insensitive, you don't need to "strtolower(usermodel)", until "contain()" is preferred. Cheers. |
| All times are GMT -4. The time now is 01:26. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.