AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   placing a model on a map (https://forums.alliedmods.net/showthread.php?t=57550)

flyeni6 07-06-2007 20:04

placing a model on a map
 
how can i place a model on the middle of a map no matter what map it is?

AlMod 07-07-2007 00:02

Re: placing a model on a map
 
Try something like that:
PHP Code:

public place_entity_on_map()
{
            new 
ent create_entity("info_target")
            new 
origin[3] = {0,0,0// Change zeros to needed coords
            
entity_set_model(ent,"models/model.mdl")


engine module is required

flyeni6 07-07-2007 16:08

Re: placing a model on a map
 
thx. :)

hlstriker 07-08-2007 01:15

Re: placing a model on a map
 
Quote:

Originally Posted by AlMod (Post 499810)
PHP Code:

public place_entity_on_map()
{
            new 
ent create_entity("info_target")
            new 
origin[3] = {0,0,0// Change zeros to needed coords
            
entity_set_model(ent,"models/model.mdl")



In that code replace...
new origin[3] = {0,0,0}

With...
entity_set_origin(ent, Float:{0.0, 0.0, 0.0});

AlMod 07-08-2007 03:34

Re: placing a model on a map
 
Oops, sorry, forgot to set the entity origin in game :)

ConnorMcLeod 07-08-2007 06:40

Re: placing a model on a map
 
http://forums.alliedmods.net/showthread.php?p=162695

Rolnaaba 07-09-2007 22:02

Re: placing a model on a map
 
uh,how about engine sux my nuts?
Code:
//fakemeta pwns n00bs new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target")); set_pev(shot, pev_classname, "custom_class_name"); new origin[3] = {0,0,0}; //also you left out a bunch of stuff... new Float:maxs[3] = {0.2,0.2,0.5}; new Float:mins[3] = {-0.2,-0.2,-0.5}; set_pev(ent, pev_origin, origin); engfunc(EngFunc_SetSize, ent, mins, maxs); //set size set_pev(ent, pev_solid, SOLID_BBOX); //make solid set_pev(ent, pev_movetype, MOVETYPE_FLYMISSILE); //set movetype set_pev(ent, pev_framerate, 1.0); set_pev(ent, pev_rendermode, 5); set_pev(ent, pev_renderamt, 255.0); set_pev(ent, pev_scale, 1.20); engfunc(EngFunc_SetModel, ent, "models/model.mdl");
there might be some more stuff, I just typed that up from memory

flyeni6 07-09-2007 23:40

Re: placing a model on a map
 
ty :)

Rolnaaba 07-10-2007 10:34

Re: placing a model on a map
 
um I just took some o that stuff from my AVP mod so you might have to change like the movetype and stuff, as of right now its is movetype flymissle with is used for like, well missles and stuff not an entity not moving so you might wanna change that lol.


All times are GMT -4. The time now is 21:26.

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