Raised This Month: $ Target: $400
 0% 

Solved Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server ♰


Post New Thread Reply   
 
Thread Tools Display Modes
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-14-2021 , 14:13   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #11

Quote:
Originally Posted by McTavish View Post
if you have a good plugin you can share it mate.
I'm talking about Supremache's plugin. I haven't checked it out but the point it uses a config file instantly makes it 100 times better.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-14-2021 , 14:27   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #12

@Supremache some quick notes:

1. i < ArraySize( g_aModels ) should be cached since the condition gets called each loop cycle.
------------
2.

Code:
if( iFlags & eModel[ Model_Flag ] && iTeam == eModel[ Model_Team ] ) {     cs_set_user_model( id, eModel[ Model_Name ] ) } else cs_reset_user_model( id )

This will constantly reset the model if any of the skins' flags don't match. Meaning it will only work for the last skin in the array.
You need to break the loop once a skin has been set and the reset part should be done before the loop.
------------
3. ArrayClear( g_aModels ); -- this is not needed; the array was just created.
------------
4.

Code:
remove_quotes( szModel ); remove_quotes( szTeam ); remove_quotes( szFlag );

This is not needed as parsing the data does not keep the quotes.
------------
5. precache_model( szModel )

The server will crash if the model has its own T.mdl file. Consider using this stock (note that only the model name is required):

Code:
precache_player_model(const szModel[], &id = 0) {     new model[128]     formatex(model, charsmax(model), "models/player/%s/%sT.mdl", szModel, szModel)     if(file_exists(model))         id = precache_generic(model)     static const extension[] = "T.mdl"     #pragma unused extension     copy(model[strlen(model) - charsmax(extension)], charsmax(model), ".mdl")     return precache_generic(model) }
------------
6.

Code:
if( !file_exists( szModel ) ) {     log_amx( "ERROR: model ^"%s^" not found!", szModel ) } ... ArrayPushArray(g_aModels, eModel)

If the file doesn't exist, stop the code, don't put it in the array.
------------
7. You should clear szFlag and szTeam for each valid line of the file (case default). If you don't you allow for data to be transfered from previous lines.

Code:
"model name" "2" "b" "another model" "2"

In this case "another model" will have the "b" flag because parse() didn't detect a third argument so the previous one is still stored in szFlag. Do this before parsing:

Code:
szFlag[0] = EOS szTeam[0] = EOS
__________________

Last edited by OciXCrom; 12-15-2021 at 06:16.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
McTavish
Senior Member
Join Date: May 2021
Old 12-14-2021 , 14:44   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #13

Quote:
Originally Posted by Supremache View Post
The file name is : CsModels

Edit: i forget to set a location for the file, try it #3
the plugin crashing cs 1.6 xD
McTavish is offline
McTavish
Senior Member
Join Date: May 2021
Old 12-14-2021 , 14:48   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #14

Quote:
Originally Posted by OciXCrom View Post
@Supremache some quick notes:

1. i < ArraySize( g_aModels ) should be cached since the condition gets called each loop cycle.
------------
2.

Code:
if( iFlags & eModel[ Model_Flag ] && iTeam == eModel[ Model_Team ] ) {     cs_set_user_model( id, eModel[ Model_Name ] ) } else cs_reset_user_model( id )

This will constantly reset the model if any of the skins' flags don't match. Meaning it will only work for the last skin in the array.
You need to break the loop once a skin has been set and the reset part should be done before the loop.
------------
3. ArrayClear( g_aModels ); -- this is not needed; the array was just created.
------------
4.

Code:
remove_quotes( szModel ); remove_quotes( szTeam ); remove_quotes( szFlag );

This is not needed as parsing the data does not keep the quotes.
------------
5. precache_model( szModel )

The server will crash if the model has its own T.mdl file. Consider using this stock (note that only the model name is required):

Code:
precache_player_model(const szModel[], &id = 0) {     new model[128]     formatex(model, charsmax(model), "models/player/%s/%sT.mdl", szModel, szModel)     if(file_exists(model))         id = precache_generic(model)     static const extension[] = "T.mdl"     #pragma unused extension     copy(model[strlen(model) - charsmax(extension)], charsmax(model), ".mdl")     return precache_generic(model) }
------------
6.

Code:
eModel[ Model_Team ] = clamp( str_to_num( szTeam ), 0, 2 ) // Dont need to add 3, who want to put model for spectator's xD

Spectator makes much more sense than an unassigned player (0).
------------
7.

Code:
if( !file_exists( szModel ) ) {     log_amx( "ERROR: model ^"%s^" not found!", szModel ) } ... ArrayPushArray(g_aModels, eModel)

If the file doesn't exist, stop the code, don't put it in the array.
------------
8. You should clear szFlag and szTeam for each valid line of the file (case default). If you don't you allow for data to be transfered from previous lines.

Code:
"model name" "2" "b" "another model" "2"

In this case "another model" will have the "b" flag because parse() didn't detect a third argument so the previous one is still stored in szFlag. Do this before parsing:

Code:
szFlag[0] = EOS szTeam[0] = EOS
you write all of this , so you can make a code for model ze xD go make it and i got what are you want to say.
McTavish is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-14-2021 , 14:50   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #15

I write all of that so the plugin's author can see what's wrong and fix it.
The crash is probably caused because of #5.

If your model doesn't have a T.mdl, then the crash is caused by you configuring the plugin incorrectly. Show what you've done.
__________________

Last edited by OciXCrom; 12-14-2021 at 14:51.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
McTavish
Senior Member
Join Date: May 2021
Old 12-14-2021 , 14:55   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #16

Quote:
Originally Posted by OciXCrom View Post
I write all of that so the plugin's author can see what's wrong and fix it.
The crash is probably caused because of #5.

If your model doesn't have a T.mdl, then the crash is caused by you configuring the plugin incorrectly. Show what you've done.
i copy the plugin and paste it in amx (Studio) when it's done , i copy the plugin and put it in plugin folders and write it in plugin.ini , when i join 5s and the game crashed. and i create Csmodels.ini as he was saying
Attached Thumbnails
Click image for larger version

Name:	Capture.PNG
Views:	57
Size:	4.6 KB
ID:	192655  

Last edited by McTavish; 12-14-2021 at 14:56. Reason: add pic
McTavish is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-14-2021 , 14:58   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #17

A player model crash can only occur on server start, so the problem is not caused by this plugin.

Quote:
i copy the plugin and put it in plugin folders and write it in plugin.ini , when i join 5s and the game crashed. and i create Csmodels.ini as he was saying
McTavish is online now Report Post
Please just copy the contents of the file here so we can actually see what you've done. Him writing something is one, you reading it properly is another thing, as we can clearly tell from other recent threads.

For starters, the file name is "CsModels.ini", not "Csmodels.ini".
__________________

Last edited by OciXCrom; 12-14-2021 at 15:02.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
McTavish
Senior Member
Join Date: May 2021
Old 12-14-2021 , 15:02   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #18

Quote:
Originally Posted by OciXCrom View Post
A player model crash can only occur on server start, so the problem is not caused by this plugin.



Please just copy the contents of the file here so we can actually see what you've done. Him saying something is one, you reading it properly is another thing.

For starters, the file name is "CsModels.ini", not "Csmodels.ini".
when i change "Csmodels.ini" to "CsModels.ini" the game not crashing now and the plugin is running but the skin not working.

"Cs Models 1.0.0 Supremache Ze_Skin.amxx running"

Last edited by McTavish; 12-14-2021 at 15:03.
McTavish is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-14-2021 , 15:03   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #19

For the third time in 13 minutes - show the file's contents.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
McTavish
Senior Member
Join Date: May 2021
Old 12-14-2021 , 15:22   Re: Zombie Escape , Models... By : Aditya Ambre - Developer & Owner - Xavier's Server
Reply With Quote #20

Quote:
Originally Posted by OciXCrom View Post
For the third time in 13 minutes - show the file's contents.
sorry mate , but i didn't understand "show the file's contents."
McTavish 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 15:38.


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