Raised This Month: $51 Target: $400
 12% 

In-game Model Viewer (Great for testing models!)


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:          Approver:   BAILOPAN (72)
doomy
Member
Join Date: Jul 2004
Location: Plano, Texas
Old 12-02-2004 , 22:41   In-game Model Viewer (Great for testing models!)
Reply With Quote #1

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].
Attached Files
File Type: sma Get Plugin or Get Source (model_viewer.sma - 2755 views - 6.2 KB)
doomy is offline
LynX
Veteran Member
Join Date: Oct 2004
Old 12-05-2004 , 12:52  
Reply With Quote #2

This will come in handy.
I work alot with models ingame, it should help me on my research. Great job!
__________________
Current plugin : SoulPunisher anti-cheat
Percentage done : {||--------} 20%

If you think v3x is a PIMP, paste this into your sig!

If you think Bailopan is DA BOMB, paste this into your sig
LynX is offline
Send a message via ICQ to LynX
BigBaller
Veteran Member
Join Date: Mar 2004
Location: Everett, WA
Old 12-05-2004 , 15:51  
Reply With Quote #3

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") }
__________________

BigBaller is offline
doomy
Member
Join Date: Jul 2004
Location: Plano, Texas
Old 12-05-2004 , 15:57  
Reply With Quote #4

thx. ill append it to the source.
__________________
Life is a twisted irony filled with things we can not explain. That's why we are here--to define your world!
doomy is offline
Izze
Junior Member
Join Date: Aug 2004
Location: Germany, NRW
Old 12-10-2004 , 05:52  
Reply With Quote #5

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 ?
Izze is offline
doomy
Member
Join Date: Jul 2004
Location: Plano, Texas
Old 12-10-2004 , 23:22  
Reply With Quote #6

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.
doomy is offline
Izze
Junior Member
Join Date: Aug 2004
Location: Germany, NRW
Old 12-11-2004 , 04:52  
Reply With Quote #7

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 !
Izze is offline
doomy
Member
Join Date: Jul 2004
Location: Plano, Texas
Old 12-11-2004 , 12:32  
Reply With Quote #8

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.
doomy is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:56.


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