Firstly, on a global declared variable static is silly. This is the purpose of a global variable, it won't ever be destroyed during run-time.
AFAIK, the path for player models should be:
Code:
models/player/some_model_name/some_model_name.mdl
Yours is not like that. When I worked on some models setting plugins I had problems using different paths structure.
Also, your gPlayerModel is never filled with a value.
Please debug your code, this mean to put some debug messages in the key parts of your code and output variable values in order to know where it fails. You can add them inside if conditions to know if they pass or not, inside loops, when you want to see if your variables are correctly filled or where it is needed. If you did that before, you would see that gPlayerModel is empty and the code from if condition won't be executed.
I see. I've seen some plugins working with models (weapon models, but I figured it's the same) and the path was stored in a static. Also, I followed a tutorial on setting models, so I don't really get what did I do so that variable stays empty. I'll edit the path as you mentioned and I'll review the code hoping that I'll find the issue.
You can remove that new gPlayerModel[33][32]; , make only one constant where you put all models, and when the player select one store his choice in a variable like PlayerChoice. After that, to know what model he has use: constant_name[PlayerChoice], this will point you to the right model.
new PLUG[] = "Player model menu"; new VERS[] = "1.0"; new AUTH[] = "EpicKiller";
// MODELS new DAVID_BLACK[] = "models/player/vip_models_menu/david_black/david_black.mdl"; new DEATH[] = "models/player/vip_models_menu/death/death.mdl"; new JOKER[] = "models/player/vip_models_menu/joker/joker.mdl"; new BATMAN[] = "models/player/vip_models_menu/batman/batman.mdl"; new DAVID_WHITE[] = "models/player/vip_models_menu/david_white/david_white.mdl"; new REDOR[] = "models/player/vip_models_menu/redor/redor.mdl";
new bool:HasCustomModel[33]; new PlayerChoice[33][64];
public plugin_init() { register_plugin(PLUG, VERS, AUTH);
No. If you still want to stick to your way(with more constants and not with just one) save his current model(when you assign it) inside gPlayerModel, this is what you are missing. You can use copy native for that purpose.