Raised This Month: $51 Target: $400
 12% 

CMDLCache:: Out of memory error while setting model?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
verideth
Junior Member
Join Date: Jun 2016
Old 07-02-2016 , 12:27   CMDLCache:: Out of memory error while setting model?
Reply With Quote #1

Hey guys, I'm quite new to sourcemod and have been trying to replicate a gamemode known as zombie escape. Right now I'm trying to set the model of the T's. by doing this

PHP Code:
public void Terrorist(Event event, const char[] namebool dontBroadcast)
{
    for (
int i 1GetMaxClients(); i++)
    {
        if (
IsClientInGame(i) && GetClientTeam(i) == CS_TEAM_T)
        {
            
SetEntityModel(i"models/player/zombieescape/zm_undertaker.mdl")
        }
    }

then I call it like this

PHP Code:
// Called when map starts
public void OnMapStart()
{
    
// Undertaker
    
AddFileToDownloadsTable("models/player/zombieescape/zm_undertaker.mdl");
    
PrecacheModel("models/player/zombieescape/zm_undertaker.mdl"false);
    
    
HookEvent("round_start"Terrorist);

It's not setting the model, nothing is happening besides after about 5 - 8 seconds of being in game the server console gets this error: CMDLCache:: Out of memory
then the server crashes

Anyone here know why this is happening? Thanks!
__________________
Love programming!
Add me if you need any help http://steamcommunity.com/id/desslian/

Last edited by verideth; 07-02-2016 at 12:27.
verideth is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 07-03-2016 , 07:34   Re: CMDLCache:: Out of memory error while setting model?
Reply With Quote #2

Remove the "models/" prefix from the calls to SetEntityModel and PrecacheModel.
__________________
asherkin is offline
Reply



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 20:10.


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