why 'g_MyCamera[id]' is the first argument? set_pev have as first argument 'entity' (or Id as you want to understand ).
Code:
public Create_Camera(id)
{
if(pev_valid(g_MyCamera[id]))
return
static Float:vAngle[3], Float:Angles[3]
pev(id, pev_origin, g_CameraOrigin[id])
pev(id, pev_v_angle, vAngle)
pev(id, pev_angles, Angles)
static Ent; Ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
if(!pev_valid(Ent)) return
set_pev(Ent, pev_classname, CAMERA_CLASSNAME)
set_pev(Ent, pev_solid, 0)
set_pev(Ent, pev_movetype, MOVETYPE_NOCLIP)
set_pev(Ent, pev_owner, id)
engfunc(EngFunc_SetModel, Ent, CAMERA_MODEL)
static Float:Mins[3], Float:Maxs[3]
Mins[0] = -1.0
Mins[1] = -1.0
Mins[2] = -1.0
Maxs[0] = 1.0
Maxs[1] = 1.0
Maxs[2] = 1.0
entity_set_size(Ent, Mins, Maxs)
set_pev(Ent, pev_origin, g_CameraOrigin[id])
set_pev(Ent, pev_v_angle, vAngle)
set_pev(Ent, pev_angles, Angles)
fm_set_rendering(Ent, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 0)
g_MyCamera[id] = Ent;
}
You do not use enough well g_MyCamera array, what is the purpose of him, please explain.