Raised This Month: $ Target: $400
 0% 

model precaching


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
allenwr
Veteran Member
Join Date: Jan 2006
Location: The place where the karm
Old 09-06-2008 , 05:39   model precaching
Reply With Quote #1

Well, i have messed up again.

My plugin is not precaching the models. The bool is working, another part of the plugin has shown me that already.

The game is dod and the models' directories are correct, even uploaded to the right places. But the models are not being downloaded from the fastdownload site or the game server site.

PHP Code:
public plugin_precache() {
    if(
forest) {
        
precache_model("models/player/axis/axis.mdl")
        
precache_model("models/player/axis/axisT.mdl")
        
precache_model("models/player/allies/allies.mdl")
        
precache_model("models/player/allies/alliesT.mdl")
    }
}

public 
hudmodelset(id) {
    new 
team get_user_team(id)
    
    if(
forest) {
        switch(
team) {
            case 
1dod_set_model(id"allies")
            case 
2dod_set_model(id"axis")
        }
    }

__________________
Don't ever place an order with Vee Servers. This is why.
allenwr is offline
Send a message via ICQ to allenwr Send a message via Yahoo to allenwr
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-06-2008 , 05:47   Re: model precaching
Reply With Quote #2

1.Where do you set the boolean true?
2.Make shure the precache limit has not be reached.
Alka is offline
allenwr
Veteran Member
Join Date: Jan 2006
Location: The place where the karm
Old 09-06-2008 , 05:52   Re: model precaching
Reply With Quote #3

bool is set true in the plugin_init

and this is the only custom plugin that precaches anything.
__________________
Don't ever place an order with Vee Servers. This is why.
allenwr is offline
Send a message via ICQ to allenwr Send a message via Yahoo to allenwr
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-06-2008 , 06:45   Re: model precaching
Reply With Quote #4

plugin_init() is called after plugin_precache() that explains why is not working.
Alka is offline
allenwr
Veteran Member
Join Date: Jan 2006
Location: The place where the karm
Old 09-06-2008 , 13:24   Re: model precaching
Reply With Quote #5

Ok, well I guess I could make a plugin that only loads on the map for the precache, but is there another way for me to make the downloads happen only when the map is forest?

I think I have seen some plugins where they do this using:

PHP Code:
#if
    //something
#endif 
__________________
Don't ever place an order with Vee Servers. This is why.

Last edited by allenwr; 09-06-2008 at 13:26.
allenwr is offline
Send a message via ICQ to allenwr Send a message via Yahoo to allenwr
Prajch
Senior Member
Join Date: Dec 2007
Location: anger++
Old 09-06-2008 , 13:33   Re: model precaching
Reply With Quote #6

One less elegant way is specifically enabling that plugin only for that map, in your maps configs.

You'd create something like
Code:
amxmodx/configs/maps/plugins-de_forest.ini
and add the line
Code:
myplugin.amxx
to it.
Prajch is offline
allenwr
Veteran Member
Join Date: Jan 2006
Location: The place where the karm
Old 09-06-2008 , 13:44   Re: model precaching
Reply With Quote #7

I thought about that, but that cant work for me, you see, this plugin is actually my DoD Class Menu that I am modifying, and I really do not want to disable the plugin for the rest of the server and this is also a good learning area for me so I can understand something I have not done before.

But if the above does not work, how can I disable a plugin for a certain map as well?
__________________
Don't ever place an order with Vee Servers. This is why.
allenwr is offline
Send a message via ICQ to allenwr Send a message via Yahoo to allenwr
allenwr
Veteran Member
Join Date: Jan 2006
Location: The place where the karm
Old 09-06-2008 , 13:49   Re: model precaching
Reply With Quote #8

Why didn't someone just tell me to do this:
PHP Code:
public plugin_precache() {
    
get_mapname(g_map,31)
    if(
equali(g_map,"dod_forest")) {
        
forest true
    
}
    if(
forest) {
         
//stuff
    
}

__________________
Don't ever place an order with Vee Servers. This is why.
allenwr is offline
Send a message via ICQ to allenwr Send a message via Yahoo to allenwr
Prajch
Senior Member
Join Date: Dec 2007
Location: anger++
Old 09-06-2008 , 15:25   Re: model precaching
Reply With Quote #9

Good question. Guess it slipped my mind.

Anyway if you wanna disable a plugin by that method I mentioned, put "disable" next to its name.
Prajch is offline
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 09-07-2008 , 22:52   Re: model precaching
Reply With Quote #10

Quote:
Originally Posted by allenwr View Post
Why didn't someone just tell me to do this:
Because I just read the thread. lol
Just remember, plugin_precache gets executed before plugin_init
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
Old 09-08-2008, 09:41
atomen
This message has been deleted by atomen.
Reply


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 03:09.


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