AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   In-game Model Viewer (Great for testing models!) (https://forums.alliedmods.net/showthread.php?t=8144)

doomy 12-02-2004 22:41

In-game Model Viewer (Great for testing models!)
 
1 Attachment(s)
This plugin allows you to specify various models which you would like to import. Once imported you can use in-game amx commands to display the models in counter-strike!

Here is how it works:
- A file named "amx_model_viewer.ini" must be placed in the parent cstrike folder
- In that file you may specify which files you would like to import (Super directory is cstrike)
- To specify a file all you have to do is type the file path and put it in quotes (I.E.: "models/pacman.mdl" ) NOTE: Name lengths must not exceed 50 characters excluding the quotes. You will recieve an exception error if this happens.

- All you have to do then is enable the mod (Put the .amxx file in your plugins directory and add a pointer in the plugins.ini file in the configs folder)

DEBUGGING:
- If the plugin does not work what is probably wrong is that your array module is probably not being loaded. To change that remove the ' ; ' in modules.ini in front of the array_amxx.dll.

- It may also be a good idea to remove all of the ;'s so that every plugin will work. Not just this one.

- If there is an error loading and you have checked modules.ini scroll up in the console to see if my plugin gave an exception. It can be identified by the "<model_viewer>" tag. It will give you the cause. It should be self-explanatory how to fix it as well.

SYNTAX:

- The syntax is very simple. To show a model type amx_showmodel <model index>

- The model index is a number which you can view by typing amx_modellist. It will show all of the models you have loaded and also there indexes.

- NOTE: Default the plugin can be accessed by the public. To change this, if you are an admin, use the command amx_model_access 1. To change it back use amx_model_access 0. The one stands for a boolean meaning that only admins can access the commands.

If you have any other questions you can reach me at [email protected].

LynX 12-05-2004 12:52

This will come in handy.
I work alot with models ingame, it should help me on my research. Great job! :D

BigBaller 12-05-2004 15:51

A few suggestions

Code:
public plugin_modules() {     require_module("array") }

That will place errors in amxx log files if people dont enable that module, kinda nice feature they added. It will also help you from saying "you have to enable the array module" a lot more.

Also

Code:
#include <file> #include <float> #include <string>

Those 3 inlcudes are automatically in amxmodx.inc ... soo you could remove them from the entire plugin source because they already included with

Code:
#include <amxmodx>

Just to help you improve the code a lil :)

Soo changing

Code:
#include <amxmodx> #include <amxmisc> #include <array> #include <file> #include <float> #include <string>

To

Code:
#include <amxmodx> #include <amxmisc> #include <array> public plugin_modules() {     require_module("array") }

doomy 12-05-2004 15:57

thx. ill append it to the source.

Izze 12-10-2004 05:52

how do u use this plugin for TFC ?

i followed your instructions and used tfc folder instead of cstrike but there are several error messages.

first i have no access as superuser to the command even when i authorized.

when i set amx_model_access 0 in amxx.cfg and i type amx_modellist in console, nothing happens.

when i try to use amx_showmodel 1, because i have one entry in the amx_model_viewer.ini, i also get an error message.

for better understanding, i did the following:

- compiled it with amxmodx 1.0 linux and copied it into amxmodx/plugins folder
- enabled array_amxx_i386.so in modules.ini
- crated a amx_model_viewer.ini in tfc directory with the following entry: "models/player/santa/santa.mdl" (path and file exits!)
- added amx_model_access 0 to amxx.cfg
- restarted server

during compilation i get 2 errors:

model_viewer.sma(111) : warning 213: tag mismatch
model_viewer.sma(134) : warning 219: local variable "access" shadows a variable at a preceding level

console command amx_plugins shows the plugin running:
Model Viewer .1.0.0. doomy model_viewer.am debug

whats going wrong ?

doomy 12-10-2004 23:22

First of all when you compiled it those warnings are warnings, not errors. I decided to ignore them since they are not impeding the effeciency of the plugin.

Secondly, you have to have files inside the initialization file for the plugin to work properly. amx_modellist does nothing when there is nothing in the initialization file. Also amx_showmodel 1 would do nothing because that index hasn't been assigned.

If in your intialization file there are files there im going to need to see the file and also your models folder's structure.

PS: the index 1 is reserved for the entire map's model. My plugin also ignores indexes not assigned to its own models.

Izze 12-11-2004 04:52

Quote:

First of all when you compiled it those warnings are warnings, not errors. I decided to ignore them since they are not impeding the effeciency of the plugin.
ok, agree with this. i ignore them. that was just to tell you what happens.

Quote:

Secondly, you have to have files inside the initialization file for the plugin to work properly. amx_modellist does nothing when there is nothing in the initialization file. Also amx_showmodel 1 would do nothing because that index hasn't been assigned.
i think you mean as initialization file the amx_model_viewer.ini.

the content of this file is one line:

"models/player/santa/santa.mdl"

the path and the file exists.

Quote:

If in your intialization file there are files there im going to need to see the file and also your models folder's structure.
the folders structure is:

hlds_l/tfc/models/player/santa/santa.mdl

the amx_model_viewer.ini is placed at hlds_l/tfc/amx_model_viewer.ini

i hope i understood you right and this is what you wanted to know.

Thx !

doomy 12-11-2004 12:32

ok, im convinced the error is caused when the plugin is precaching. Wat i need u to do is scroll up through ur console and look for the tag <model_viewer> and give me the message it is giving. The errors ur getting are fail-safes i built in. It is possible i screwed one of them up. If u could do that i should be able to solve it asap. Ill keep looking rit now tho.


All times are GMT -4. The time now is 06:50.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.