Raised This Month: $32 Target: $400
 8% 

[PROBLEMA] Cache_alloc: already allocated


  
 
 
Thread Tools Display Modes
Author Message
Movie City
Senior Member
Join Date: Sep 2012
Location: hns_floppytown
Old 04-28-2013 , 20:28   [PROBLEMA] Cache_alloc: already allocated
#1

Hola, tengo un problema, me salta el error que esta ^.... mi idea era poner sombreritos , y el code lo saque de Hats_fixed(fakameta) de SgtBane y de admin_mark (engine)....
PHP Code:
Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>


#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "Author"

new MODEL_MARK[]     = "models/admin_head.mdl"
new g_adminmarkEnt[33]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
plugin_precache()
{
    
precache_model(MODEL_MARK)    
        
}

public 
client_PreThink(id)
{
    if(!
is_user_connected(id))
        return 
PLUGIN_CONTINUE
    
    
    
if(!is_user_alive(id))
        return 
PLUGIN_CONTINUE
        
    g_adminmarkEnt
[id] = engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))
    
            
            
engfunc(EngFunc_SetModelg_adminmarkEnt[id], MODEL_MARK)
            
set_pev(g_adminmarkEnt[id], pev_movetypeMOVETYPE_FOLLOW)
            
set_pev(g_adminmarkEnt[id], pev_aimentid)
            
        
    
    

EDIT: por ahora quiero setear sombreros,luego le dare la condicion para que lo use los admines nomas


Gracias c:

Last edited by Movie City; 04-28-2013 at 20:29.
Movie City is offline
Matians
Veteran Member
Join Date: Nov 2010
Location: ME QUIEREN ROBAR
Old 04-28-2013 , 20:33   Re: [PROBLEMA] Cache_alloc: already allocated
#2

Solo tengo una duda, si usas engine, porque no pones el include? Va no se, tal vez sea así.
Matians is offline
chetah
Senior Member
Join Date: Jan 2013
Location: BangBros
Old 04-28-2013 , 21:38   Re: [PROBLEMA] Cache_alloc: already allocated
#3

No revise si compila pero que no anda?
__________________
Minecraft Mod: | %15
"Tomorrowland <3"
chetah is offline
MexPower
Veteran Member
Join Date: Nov 2012
Old 04-28-2013 , 21:44   Re: [PROBLEMA] Cache_alloc: already allocated
#4

* Plugin generated by AMXX -Studio */
->
/*Plugin generated by AMXX -Studio */
__________________
Allied Modders En Español
MexPower is offline
BlackFur
BANNED
Join Date: Apr 2012
Location: RCL
Old 04-28-2013 , 21:47   Re: [PROBLEMA] Cache_alloc: already allocated
#5

Quote:
Originally Posted by MexPower View Post
* Plugin generated by AMXX -Studio */
->
/*Plugin generated by AMXX -Studio */
sabia que alguien tenia que publicar esa estupides , pense que era matias.

On : crear una entidad en prethink no es bueno o si ? porque segun yo se , tienen un limite de entidades , parece que era 512 , y prethink se llama rapidisimo .
BlackFur is offline
YakumoHiratsuhi
Veteran Member
Join Date: Dec 2010
Location: Dreαmlαnd.
Old 04-28-2013 , 21:55   Re: [PROBLEMA] Cache_alloc: already allocated
#6

Quote:
Originally Posted by Matians View Post
Solo tengo una duda, si usas engine, porque no pones el include? Va no se, tal vez sea así.
Donde vez engine? .

No es bueno hacer operaciones pesadas (en este caso manejar entidades) en funciones virtuales recursivas, aquí esta un ejemplo no se si correcto o incorrecto, fue rapido.

PHP Code:
#include <amxmodx>
#include <engine>
#include <hamsandwich>

new const model_mark[]     = "models/admin_head.mdl" 
new g_hat_entity[33]

public 
plugin_precache()
    
precache_model(model_mark)

public 
plugin_init()
{
    
register_plugin("Hat""0.0""SveN'")
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled_Post"1)
}

public 
fw_PlayerSpawn_Post(id)
{
    if(!
is_user_alive(id))
        return;
    
    
// Derp :goofy:
    
hatme(id1)
}

public 
fw_PlayerKilled_Post(victimattackershouldgib)
{
    
// Derp :goofy:
    
hatme(victim0)
}

hatme(idspawn)
{
    if(
spawn)
    {
        if(!
is_valid_ent(g_hat_entity[id]))
        {
            
g_hat_entity[id] = create_entity("info_target")
            
            if(
is_valid_ent(g_hat_entity[id]))
            {
                
entity_set_model(g_hat_entity[id], model_mark)
                
entity_set_int(g_hat_entity[id], EV_INT_movetypeMOVETYPE_FOLLOW)
                
entity_set_edict(g_hat_entity[id], EV_ENT_aimentid)
            }
        }
        else
        {
            
set_rendering(g_hat_entity[id])
            
entity_set_edict(g_hat_entity[id], EV_ENT_aimentid// resetear movimiento en caso de que cambie de cliente
        
}
    }
    else
        
set_rendering(g_hat_entity[id], .render kRenderTransTexture, .amount 0)

4 you.
__________________
"Podra parecer ridiculo o imposible, pero este es el camino que seguimos los verdaderos hombres, si hay un muro en el camino, lo derribamos, si no hay camino, haremos uno, con nuestras propias manos, porque el magma de nuestro corazón arde en llamas."
YakumoHiratsuhi is offline
Send a message via MSN to YakumoHiratsuhi
Movie City
Senior Member
Join Date: Sep 2012
Location: hns_floppytown
Old 04-28-2013 , 22:41  
#7

Quote:
Originally Posted by YakumoHiratsuhi View Post
Donde vez engine? .

No es bueno hacer operaciones pesadas (en este caso manejar entidades) en funciones virtuales recursivas, aquí esta un ejemplo no se si correcto o incorrecto, fue rapido.

PHP Code:
#include <amxmodx>
#include <engine>
#include <hamsandwich>

new const model_mark[]     = "models/admin_head.mdl" 
new g_hat_entity[33]

public 
plugin_precache()
    
precache_model(model_mark)

public 
plugin_init()
{
    
register_plugin("Hat""0.0""SveN'")
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled_Post"1)
}

public 
fw_PlayerSpawn_Post(id)
{
    if(!
is_user_alive(id))
        return;
    
    
// Derp :goofy:
    
hatme(id1)
}

public 
fw_PlayerKilled_Post(victimattackershouldgib)
{
    
// Derp :goofy:
    
hatme(victim0)
}

hatme(idspawn)
{
    if(
spawn)
    {
        if(!
is_valid_ent(g_hat_entity[id]))
        {
            
g_hat_entity[id] = create_entity("info_target")
            
            if(
is_valid_ent(g_hat_entity[id]))
            {
                
entity_set_model(g_hat_entity[id], model_mark)
                
entity_set_int(g_hat_entity[id], EV_INT_movetypeMOVETYPE_FOLLOW)
                
entity_set_edict(g_hat_entity[id], EV_ENT_aimentid)
            }
        }
        else
        {
            
set_rendering(g_hat_entity[id])
            
entity_set_edict(g_hat_entity[id], EV_ENT_aimentid// resetear movimiento en caso de que cambie de cliente
        
}
    }
    else
        
set_rendering(g_hat_entity[id], .render kRenderTransTexture, .amount 0)

4 you.

Me salta el mismo error, igual gracias c:

Quote:
Originally Posted by Matians View Post
Solo tengo una duda, si usas engine, porque no pones el include? Va no se, tal vez sea así.
para engine:

PHP Code:
entity_set_int(g_adminmarkEnt[id], EV_INT_movetypeMOVETYPE_FOLLOW)
            
//entity_set_edict(g_adminmarkEnt[id], EV_ENT_aiment, id)
            //entity_set_model(g_adminmarkEnt[id], MODEL_MARK) 
para fakameta

PHP Code:
engfunc(EngFunc_SetModelg_adminmarkEnt[id], MODEL_MARK)
            
set_pev(g_adminmarkEnt[id], pev_movetypeMOVETYPE_FOLLOW)
            
set_pev(g_adminmarkEnt[id], pev_aimentid
Quote:
Originally Posted by chetah View Post
No revise si compila pero que no anda?
Compila,cdo ingreso al cs me tira ese error, no me deja entrar al mapa, se me cierra el juego

Last edited by lucas_7_94; 04-29-2013 at 14:33. Reason: Triple post ! Cuidado!
Movie City is offline
YakumoHiratsuhi
Veteran Member
Join Date: Dec 2010
Location: Dreαmlαnd.
Old 04-28-2013 , 22:52   Re: [PROBLEMA] Cache_alloc: already allocated
#8

Hm, que raro lo probé y funciona correctamente, te fijaste que no sea otro plugin el que este causando interferencias? te fijaste que tu modelo este bien y que no este dañado?
__________________
"Podra parecer ridiculo o imposible, pero este es el camino que seguimos los verdaderos hombres, si hay un muro en el camino, lo derribamos, si no hay camino, haremos uno, con nuestras propias manos, porque el magma de nuestro corazón arde en llamas."
YakumoHiratsuhi is offline
Send a message via MSN to YakumoHiratsuhi
TimooCS
Veteran Member
Join Date: Dec 2012
Location: Argentina
Old 04-29-2013 , 13:27   Re: [PROBLEMA] Cache_alloc: already allocated
#9

no hagas 3ple post...
__________________
TimooCS is offline
Send a message via MSN to TimooCS Send a message via Skype™ to TimooCS
Movie City
Senior Member
Join Date: Sep 2012
Location: hns_floppytown
Old 04-29-2013 , 19:34   Re: [PROBLEMA] Cache_alloc: already allocated
#10

Quote:
Originally Posted by YakumoHiratsuhi View Post
Hm, que raro lo probé y funciona correctamente, te fijaste que no sea otro plugin el que este causando interferencias? te fijaste que tu modelo este bien y que no este dañado?
Me funciono, era problema de otro plugin jaja.... en fin cual me recomiendas engine o fakameta? c: gracias
Movie City is offline
 


Thread Tools
Display Modes

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 19:40.


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