Raised This Month: $ Target: $400
 0% 

[DoD:S] Change flags model and icon flags on hud.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
micmacx
Member
Join Date: May 2021
Old 10-07-2023 , 22:09   [DoD:S] Change flags model and icon flags on hud.
Reply With Quote #1

Hi,
I try to change standard flags models by another model for halloween. And icon for hud by other icon with pumpkin.

I try this :

PHP Code:
public Action:OnRound(Handle:event, const String:name[], bool:dontBroadcast)
{
        new 
entity;
        while ((
entity FindEntityByClassname(entity"dod_control_point")) != -1)
        {
            if(
IsValidEntity(entity))
            {
                
DispatchKeyValue(entity"point_allies_model""models/models_kit/hallo_scarecrow.mdl"); // Work ok.
                
DispatchKeyValue(entity"point_axis_model""models/models_kit/hallo_scarecrow_noir.mdl"); // Work ok.
                
DispatchKeyValue(entity"point_reset_model""models/models_kit/hallo_scarecrow_blanc.mdl"); // Not working.
                
                
if(h_icon_enable)
                {
                    
DispatchKeyValue(entity"point_hud_icon_allies""sprites/obj_icons/icon_hall_allies"); // Not working.
                    
DispatchKeyValue(entity"point_hud_icon_axis""sprites/obj_icons/icon_hall_axis"); // Not working.
                    
DispatchKeyValue(entity"point_hud_icon_neutral""sprites/obj_icons/icon_hall_neutral"); // Not working.
                    
PrintToChatAll("Icons Envoyés..................................."); // To check and it work
                

                new 
Float:Origin[3]
                
GetEntPropVector(entityProp_Send"m_vecOrigin"Origin)
                new 
Floath_buffer2 Origin[2]-30.0
                Origin
[2] = h_buffer2
                SetEntPropVector
(entityProp_Send"m_vecOrigin"Origin)
                
SetEntPropFloat(entityProp_Send"m_flModelScale"1.4);
            }
        }

I commented in the script what doesn't work.

I found all the keyvalues ​​in hammer see the picture.

I Try with this at the end and it not working :
PHP Code:
AcceptEntityInput(entity"RoundInit"); // Not working 
PHP Code:
AcceptEntityInput(entity"RoundStart"); // Not working 
Dod_control_point#Flags

If anyone has an idea, I'm all ears.
Thanks in advance. :-)
Attached Thumbnails
Click image for larger version

Name:	dod_control_point.jpg
Views:	38
Size:	89.6 KB
ID:	201810  
__________________

Last edited by micmacx; 10-07-2023 at 22:37.
micmacx is offline
micmacx
Member
Join Date: May 2021
Old 10-11-2023 , 09:41   Re: [DoD:S] Change flags model and icon flags on hud.
Reply With Quote #2

Hi,
I see that I haven't necessarily approached the problem in the right way.

I dumped the netprops and propdata which allowed me to realize certain things.
I looked at how some plugins work and I didn't necessarily understand everything.

It's great to have these dumps but I can't use everything yet.
Do you have any guides to recommend to me?

This is mainly to know how to interpret the data:
How do I know if it's text? (like file path)
How do I know if it's an integer, a floating point number...

Table type entities, such as:
PHP Code:
 Tablem_iAlliesIcons (offset 980) (type m_iAlliesIcons)
  
Member000 (offset 0) (type integer) (bits 8) (Unsigned)
  
Member001 (offset 4) (type integer) (bits 8) (Unsigned)
  
Member002 (offset 8) (type integer) (bits 8) (Unsigned)
  
Member003 (offset 12) (type integer) (bits 8) (Unsigned)
  
Member004 (offset 16) (type integer) (bits 8) (Unsigned)
  
Member005 (offset 20) (type integer) (bits 8) (Unsigned)
  
Member006 (offset 24) (type integer) (bits 8) (Unsigned)
  
Member007 (offset 28) (type integer) (bits 8) (Unsigned
Is there another way to exploit them other than with GetEntData?

This is not necessarily the right example because we can see directly that it is an integer, for example in my case I think I need to modify this data:
PHP Code:
m_iszAlliesModel (Offset 1172) (Save|Key)(4 Bytes) - point_allies_model
m_iszAxisModel (Offset 1176) (Save|Key)(4 Bytes) - point_axis_model
m_iszResetModel (Offset 1180) (Save|Key)(4 Bytes) - point_reset_model 
How to know the type of data to use to use the correct function:
GetEntProp
GetEntPropFloat
GetEntPropString
GetEntPropVector

Thank you in advance and see you soon. :-)
__________________

Last edited by micmacx; 10-11-2023 at 10:06.
micmacx is offline
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 10-12-2023 , 11:26   Re: [DoD:S] Change flags model and icon flags on hud.
Reply With Quote #3

For the flag model you could use this function:
https://sm.alliedmods.net/new-api/sd...SetEntityModel
You should pay attention to the name prefixes
"isz" are strings. Most likely it is string_t type. For fixed size char array "sz" is used. So, you could try getting the value with GetEntPropString
It shows 4 byte integer and has the "i"as it is only a pointer to actual string data.
m_iAlliesIcons is an array of integers. The "i" indicates so and the size of a single component. It is not clear what is kept in the variables. Probably some sort if icon indexes which are predefined somewhere. You have to read them and check.

Last edited by kadet.89; 10-12-2023 at 11:53.
kadet.89 is offline
Send a message via Skype™ to kadet.89
micmacx
Member
Join Date: May 2021
Old 10-12-2023 , 12:48   Re: [DoD:S] Change flags model and icon flags on hud.
Reply With Quote #4

Hi,
Thank you very much for your response, it will help me a lot to finish the script.

+++. :-) :-) :-)
__________________
micmacx 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 03:39.


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