Raised This Month: $ Target: $400
 0% 

Entity Resources Replacement[ V 1.4 ]


Post New Thread Reply   
 
Thread Tools Display Modes
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-22-2014 , 09:59   Re: Entity Resources Replacement[ OKAPI ]
Reply With Quote #51

What about thinking a bit before doing stupid things ? ALL YOU HAVE TO DO IS TO REPLACE THE DEFAULT CHECK WITH MY ONE. No other checks needed.

Code:
if(model[7] == 'w' && model[8] == '_') //here i guess we get the index of 7, which is models/W, followed by index 8, which is _, so w_     { become if(equal(model, g_szNewModel)) {     //do your stuffs }

You may need to adapt:
Code:
 switch(model[9])             {                 case 'h': { type = NT_HEGRENADE; csw = CSW_HEGRENADE; }                 case 'f': { type = NT_FLASHBANG; csw = CSW_FLASHBANG; }                 case 's': { type = NT_SMOKEGRENADE; csw = CSW_SMOKEGRENADE; }             }

For the new model name.
__________________

Last edited by HamletEagle; 11-22-2014 at 10:00.
HamletEagle is offline
bLacK-bLooD
AlliedModders Donor
Join Date: Jun 2008
Old 11-23-2014 , 05:41   Re: Entity Resources Replacement[ OKAPI ]
Reply With Quote #52

Please consider the fact that nobody was born taught and you yourself had doubt in what you have done in the past. I respect you for what you know, but respect us, the ones who show they want to learn.

With your help now everything works as it should. The only problem is that I keep getting error logs with a string being larger than the original string, although I have checked all of them and they are == or < .

My entities_resources_replacement.ini
Code:
models/v_m4a1.mdl models/x/m4a1.mdl
models/v_ak47.mdl models/x/ak47.mdl
models/v_awp.mdl models/x/awp.mdl
models/v_knife.mdl models/x/knife.mdl
models/v_galil.mdl models/x/guita.mdl
models/v_mp5.mdl models/x/mp5.mdl
models/v_glock18.mdl models/x/glock18.mdl
models/v_usp.mdl models/x/usp.mdl
models/v_m249.mdl models/x/mg3.mdl
models/v_deagle.mdl models/x/deagle.mdl
models/v_famas.mdl models/x/famas.mdl
models/v_m3.mdl models/x/m3.mdl

models/w_flashbang.mdl models/x/w_sball.mdl
models/w_hegrenade.mdl models/x/w_sball.mdl
models/w_smokegrenade.mdl models/x/w_sball.mdl

models/v_flashbang.mdl models/x/flash.mdl
models/v_hegrenade.mdl models/x/he.mdl
models/v_smokegrenade.mdl models/x/smoke.mdl

models/v_c4.mdl models/v_v4.mdl
models/p_c4.mdl models/p_p4.mdl
The error log:
PHP Code:
L 11/23/2014 04:12:33Info (map "fy_snow") (file "addons/amxmodx/logs/error_20141123.log")
L 11/23/2014 04:12:33: [OKAPIreplacement string must be of length equal or smaller than the length of the original string
L 11
/23/2014 04:12:33: [AMXXRun time error 10 (plugin "entities_resources_replacement.amxx") (native "okapi_mod_replace_string") - debug not enabled!
L 11/23/2014 04:12:33: [AMXXTo enable debug modeadd "debug" after the plugin name in plugins.ini (without quotes).
L 11/23/2014 04:43:43Start of error session.

L 11/23/2014 12:28:05Info (map "de_dust2") (file "addons/amxmodx/logs/error_20141123.log")
L 11/23/2014 12:28:05: [OKAPIreplacement string must be of length equal or smaller than the length of the original string
L 11
/23/2014 12:28:05: [AMXXDisplaying debug trace (plugin "entities_resources_replacement.amxx")
L 11/23/2014 12:28:05: [AMXXRun time error 10native error (native "okapi_mod_replace_string")
L 11/23/2014 12:28:05: [AMXX]    [0entities_resources_replacement.sma::unpatchMemory (line 250)
L 11/23/2014 12:28:05: [AMXX]    [1entities_resources_replacement.sma::plugin_end (line 172
I haven't changed anything in the .sma . Another weird thing is that you have set a message for when the string is too long and it's skipped, so it's not that. Any ideas?

Last edited by bLacK-bLooD; 11-23-2014 at 05:45.
bLacK-bLooD is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-23-2014 , 06:13   Re: Entity Resources Replacement[ OKAPI ]
Reply With Quote #53

I respect everyone, but understand that all of us can have a bad day from time to time. The errors comes from okapi and not from my plugin, but I think it's a problem related to the file format. I somehow "fixed" this in the next version. Try saving it with diferent encoding and report here the one that works. Anyway, I have to check why the log message wasn't triggered and why okapi says that it's longer than the original one.
__________________

Last edited by HamletEagle; 11-23-2014 at 07:36.
HamletEagle is offline
bLacK-bLooD
AlliedModders Donor
Join Date: Jun 2008
Old 11-23-2014 , 12:33   Re: Entity Resources Replacement[ OKAPI ]
Reply With Quote #54

I have converted it from UTF-8 w/o BOM to UTF-8, ANSI, UCS-2, but nothing. I guess I am doing again something stupid.

The file I tried to edit is the .ini file because you said it's not from your plugin.

L.E. Ok, I have read now the edited post and I am waiting for your reply.

Last edited by bLacK-bLooD; 11-23-2014 at 12:36.
bLacK-bLooD is offline
Old 11-26-2014, 06:40
Jhob94
This message has been deleted by Jhob94. Reason: Nvm
_GamerX
AlliedModders Donor
Join Date: Jun 2011
Location: Fun Server
Old 11-28-2014 , 10:05   Re: Entity Resources Replacement[ OKAPI ]
Reply With Quote #55

I can change with plugin players models?
_GamerX is offline
Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-01-2014 , 11:04   Re: Entity Resources Replacement[ OKAPI ]
Reply With Quote #56

Guys, this is what I done for now:
1. You can set new weapon models for a specific steam id, specific team or for all player.
2. You can have custom player models for a specific steam id, specific team or for all player.

What should I add next for dynamic replacement ?

@_GamerX, just tested right now. It seems that the new model is replaced into the game, it precache the new model, but you have the same old model in game. Anyway, when I finish the dynamic replacement way you will be able to replace them.
__________________

Last edited by HamletEagle; 12-01-2014 at 12:57.
HamletEagle is offline
bLacK-bLooD
AlliedModders Donor
Join Date: Jun 2008
Old 12-01-2014 , 15:55   Re: Entity Resources Replacement[ OKAPI ]
Reply With Quote #57

Maybe fix the encoding problem?
bLacK-bLooD is offline
Old 12-02-2014, 12:54
HamletEagle
This message has been deleted by HamletEagle.
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-04-2014 , 15:31   Re: Entity Resources Replacement[ BIG UPDATE ]
Reply With Quote #58

Updated - now added dynamic replacement.
__________________

Last edited by HamletEagle; 12-04-2014 at 15:32.
HamletEagle is offline
bLacK-bLooD
AlliedModders Donor
Join Date: Jun 2008
Old 12-05-2014 , 06:38   Re: Entity Resources Replacement[ BIG UPDATE ]
Reply With Quote #59

Just tested it.

Code:
L 12/05/2014 - 12:32:56: Info (map "de_inferno_winter") (file "addons/amxmodx/logs/error_20141205.log")
L 12/05/2014 - 12:32:56: [ORPHEU] Invalid memory structure "ResString"
L 12/05/2014 - 12:32:56: [AMXX] Run time error 10 (plugin "entities_resources_replacement.amxx") (native "OrpheuMemoryReplace") - debug not enabled!
L 12/05/2014 - 12:32:56: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 12/05/2014 - 12:33:33: [ORPHEU] Invalid memory structure "ResString"
L 12/05/2014 - 12:33:33: [AMXX] Run time error 10 (plugin "entities_resources_replacement.amxx") (native "OrpheuMemoryReplace") - debug not enabled!
L 12/05/2014 - 12:33:33: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
And it fails to replace a lot of models with the error: "x string could not be replaced by y. They don't have the same size. Skipped"

I am using the entities_resources_comp_replace.ini
bLacK-bLooD is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-05-2014 , 09:13   Re: Entity Resources Replacement[ BIG UPDATE ]
Reply With Quote #60

Lol, I'm so..... Will fix it when I reach my pc.

Edit: Please show me your configuration file or some examples of resources where the plugin fails.
Edit2: Fixed files uploaded.
__________________

Last edited by HamletEagle; 12-05-2014 at 12:51.
HamletEagle 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 22:15.


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