AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Reading different precached Models (https://forums.alliedmods.net/showthread.php?t=25403)

Stephen 03-13-2006 09:59

Reading different precached Models
 
Hi.

I have an Question ^^ again.. :D

HOW would it be done to make something like this.

command: function [PATHNAME/MODEL.MDL] etc....

So i can choose different Sprites when its precached.

Code:
register_clcmd("Funtion","func",ADMIN_ALL, [value], [Modelpath/modelname]")

Code:
public func(id, the commands, MODELPATH/MODELNAME.MDL) //Creating the Stuff     lopes[id] = create_entity("env_model");     entity_set_string(lopes[id], EV_SZ_classname, "env_model")     entity_set_edict(lopes[id], EV_ENT_owner, id );         entity_set_int(lopes[id], EV_INT_rendermode, rendermo )         entity_set_model(lopes[id], "PATH/MODELNAME.MDL");//Precached Model

Code:
public plugin_precache() { precache_model("pathname/modelname.mdl") precache_model("pathname/modelname1.mdl") precache_model("pathname/modelname2.mdl") etc...     return PLUGIN_HANDLED }

So HOW would that be done, so i can use 1 Code Function with different precached Models ?
Where i have to write the exact pathname and modelname in the console field when i wanna create that Model ?

Stephen 03-13-2006 11:25

Code:
new model[64]     new filepath[64]     format(model,63,"models/%s.mdl", filepath)     entity_set_model(avatar[id],model)


this is what i use now.
I compiles without erros BUT, when i wanna create the entity an make in console

Function [Modelpath/modelname.mdl]

It crashes an says HOST error: No preache: models/.mdl

How can i fix that ??


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

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