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

Solved precaching models 100% cpu


Post New Thread Reply   
 
Thread Tools Display Modes
lexzor
Veteran Member
Join Date: Nov 2020
Old 07-20-2023 , 18:03   Re: precaching models 100% cpu
Reply With Quote #11

Quote:
Originally Posted by Natsheh View Post
On set_fail_state why don't you do a return after it, to stop initiating commands within the plugin.

i thought it was supposed to stop automatically
lexzor is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 07-20-2023 , 18:15   Re: precaching models 100% cpu
Reply With Quote #12

Quote:
Originally Posted by lexzor View Post
i thought it was supposed to stop automatically
Correct

Quote:
Originally Posted by https://www.amxmodx.org/api/amxmodx/set_fail_state
Note
Calling this will cause the calling plugin to completely cease
operation. It is not possible to recover.
__________________

Last edited by Black Rose; 07-20-2023 at 18:16.
Black Rose is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 07-21-2023 , 10:18   Re: precaching models 100% cpu
Reply With Quote #13

Code:
if(containi(weaponmodel, ".mdl") == -1) {     log_to_file("DUMBLOG.log", "The model that you tried to precache doesn't have a .mdl extension. This error occurs when a section from csgoclassy.ini doesn't exists.") } server_print("You have a missing model ^"%s^" in the [DEFAULT] section of csgoclassy.ini", weaponmodel); set_fail_state("");

to

PHP Code:
if(containi(weaponmodel".mdl") == strlen(weaponmodel) - 4)
{
    
log_to_file("DUMBLOG.log""The model that you tried to precache doesn't have a .mdl extension. This error occurs when a section from csgoclassy.ini doesn't exists.")
}

formatex(buffcharsmax(buff), "You have a missing model ^"%s^" in the [DEFAULT] section of csgoclassy.ini"weaponmodel);

set_fail_state(buff); 
and

Code:
if (!file_exists(weaponmodel)) {         server_print("[CSGO Classy] You have a missing model ^"%s^" in the [SKINS] section of csgoclassy.ini", weaponmodel);         set_fail_state(""); }

to

PHP Code:
if (!file_exists(weaponmodel))
{
    
formatex(buffcharsmax(buff), "[CSGO Classy] You have a missing model ^"%s^" in the [SKINS] section of csgoclassy.ini"weaponmodel);

    
set_fail_state(buff);

__________________
mlibre is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 07-21-2023 , 12:25   Re: precaching models 100% cpu
Reply With Quote #14

Quote:
Originally Posted by mlibre View Post
...
My code was just to show what I ran. It is not supposed to be used in any serious way.
__________________

Last edited by Black Rose; 07-21-2023 at 12:25.
Black Rose is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 07-21-2023 , 13:34   Re: precaching models 100% cpu
Reply With Quote #15

i think there is nothing i can do, linux things (maybe)

i will mark this as solved

thx u all
lexzor is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 07-21-2023 , 17:29   Re: precaching models 100% cpu
Reply With Quote #16

Well, maybe there is something that can help you. It shouldn’t be the problem but who knows..
You are using equali and containi. Try to use equal and contain. It’s the right way for your needs and costs less cpu.
__________________
Jhob94 is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 07-21-2023 , 17:36   Re: precaching models 100% cpu
Reply With Quote #17

Quote:
Originally Posted by Jhob94 View Post
Well, maybe there is something that can help you. It shouldn’t be the problem but who knows..
You are using equali and containi. Try to use equal and contain. It’s the right way for your needs and costs less cpu.
That might make 1% difference, if any at all.
__________________
Black Rose is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 07-21-2023 , 17:40   Re: precaching models 100% cpu
Reply With Quote #18

Quote:
Originally Posted by Black Rose View Post
That might make 1% difference, if any at all.
Yup but we don’t know how many files there are and their size. Even if it doesn’t fix the problem it is the proper way so it’s worth to try it.
__________________

Last edited by Jhob94; 07-21-2023 at 17:41.
Jhob94 is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 07-21-2023 , 18:23   Re: precaching models 100% cpu
Reply With Quote #19

Quote:
Originally Posted by lexzor View Post
precaching them: https://imgur.com/GyVPgkj
how is it possible to exceed the limit 118/100 wtf!? this is too much for your vps
__________________
mlibre 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 01:15.


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