Half-Life и Adrenaline Gamer форум
http://aghl.ru/forum/

spawn (players /entities) in some classname ?
http://aghl.ru/forum/viewtopic.php?f=12&t=2845
Страница 3 из 3

Автор:  Lev [ 21 дек 2017, 05:38 ]
Заголовок сообщения:  Re: spawn (players /entities) in some classname ?

Because info_taget does not implement KeyValue method:
Код:
   virtual void   KeyValue( KeyValueData* pkvd) { pkvd->fHandled = FALSE; }
You can check after DispatchKeyValue that value is not processed.
So, no one use such a method I think.
Just
Код:
   new Ent = create_entity("info_target") 
   if (!Ent) return PLUGIN_HANDLED;
   engfunc(EngFunc_SetOrigin,Ent,Origin)
   engfunc(EngFunc_SetSize,Ent,Mins,Maxs)
   engfunc(EngFunc_SetModel,Ent,"models/rpgrocket.mdl")

Автор:  abdobiskra [ 21 дек 2017, 12:37 ]
Заголовок сообщения:  Re: spawn (players /entities) in some classname ?

Lev писал(а):
Just
Код:
   new Ent = create_entity("info_target") 
   if (!Ent) return PLUGIN_HANDLED;
   engfunc(EngFunc_SetOrigin,Ent,Origin)
   engfunc(EngFunc_SetSize,Ent,Mins,Maxs)
   engfunc(EngFunc_SetModel,Ent,"models/rpgrocket.mdl")

inside pfn_keyvalue ?

Here is also another try but I get only one flag (The whole model) can spawn in "item_flag_team2" ( the flag model has 2 skins so I want to Put each skin in its coordinates)
 

Perhaps there is another way (I'm not sure about this) is creating an entitys in pfn_keyvalue and then perhaps they can be searched for (using find_ent_by_*) and the new entity placed in those coordinates we found ?

Автор:  Lev [ 21 дек 2017, 17:07 ]
Заголовок сообщения:  Re: spawn (players /entities) in some classname ?

Because you are using one variable to store 2 values.
Код:
new ent

Автор:  abdobiskra [ 22 дек 2017, 13:04 ]
Заголовок сообщения:  Re: spawn (players /entities) in some classname ?

How should I have no idea ?

Автор:  Lev [ 22 дек 2017, 15:52 ]
Заголовок сообщения:  Re: spawn (players /entities) in some classname ?

Hey, you are storing one ent id into variable, then, overwrite it with another value, and then using in twice.
Calls way:
Код:
public pfn_keyvalue(entid1) // sets ent to entid1
public pfn_keyvalue(entid2) // sets ent to entid2

public plugin_init()

    flag_spawn(TEAM_BLUE);
public flag_spawn(iFlagTeam)
    entity_set_model(ent, FLAG_MODEL) // uses ent - it contains entid2

    flag_spawn(TEAM_RED);
public flag_spawn(iFlagTeam)
    entity_set_model(ent, FLAG_MODEL) // uses ent - it contains entid2

Автор:  abdobiskra [ 29 дек 2017, 21:11 ]
Заголовок сообщения:  Re: spawn (players /entities) in some classname ?

In fact I wanted to make only one entity simulates because it contains two skins as well i have array remember
Код:
g_iFlagEntity[iFlagTeam] = ent

Can be used in the last example (Your)

Код:
public flag_spawn(iFlagTeam)
    entity_set_model(ent, FLAG_MODEL) // uses ent - it contains entid2
    g_iFlagEntity[iFlagTeam] = ent

    flag_spawn(TEAM_RED);
public flag_spawn(iFlagTeam)
    entity_set_model(ent, FLAG_MODEL) // uses ent - it contains entid2
     g_iFlagEntity[iFlagTeam] = ent

Страница 3 из 3 Часовой пояс: UTC + 5 часов [ Летнее время ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/