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

Solved ES_ModelIndex not works


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wilian159
Member
Join Date: Dec 2013
Old 02-15-2023 , 17:37   ES_ModelIndex not works
Reply With Quote #1

hello, I'm trying to change the model of the player according to the distance, but without results.

the message is issued but the template is not changed.

has anyone used this?

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <engine>

new hostage

public plugin_precache()
{
    
hostage precache_model("models/hostage.mdl")
}

public 
plugin_init()
{
    
register_forward(FM_AddToFullPack"AddToFullPackPost"true)
}

public 
AddToFullPackPost(es_handleeenthosthostflagsplayerpSet)
{
    if(
player && is_user_alive(ent) && host != ent)
    {
        static 
xDist
        xDist 
get_entity_distance(hostent)

        if(
xDist <= 200)
        {
            
set_es(es_handleES_ModelIndexhostage)
            
server_print("changed")
        }
    }
    
    return 
FMRES_IGNORED


Last edited by wilian159; 02-16-2023 at 16:48.
wilian159 is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 02-15-2023 , 22:50   Re: ES_ModelIndex not works
Reply With Quote #2

ModelIndex is not the model itself but it hitbox and other information so you can’t change it like that
__________________
My plugin:

Last edited by Celena Luna; 02-15-2023 at 22:50.
Celena Luna is offline
wilian159
Member
Join Date: Dec 2013
Old 02-15-2023 , 22:59   Re: ES_ModelIndex not works
Reply With Quote #3

Quote:
Originally Posted by Celena Luna View Post
ModelIndex is not the model itself but it hitbox and other information so you can’t change it like that
Do you have any idea how I can make this work?
wilian159 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-16-2023 , 01:29   Re: ES_ModelIndex not works
Reply With Quote #4

set_user_info(id, "model", "modelname")
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
wilian159
Member
Join Date: Dec 2013
Old 02-16-2023 , 01:50   Re: ES_ModelIndex not works
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
set_user_info(id, "model", "modelname")
I didn't understand, the model should be changed only in my view, not for everyone
wilian159 is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 02-16-2023 , 10:09   Re: ES_ModelIndex not works
Reply With Quote #6

Try it with this way. You would need to hook it as pre&post:

https://forums.alliedmods.net/showpo...17&postcount=3
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
wilian159
Member
Join Date: Dec 2013
Old 02-16-2023 , 16:48   Re: ES_ModelIndex not works
Reply With Quote #7

Quote:
Originally Posted by bibu View Post
Try it with this way. You would need to hook it as pre&post:

https://forums.alliedmods.net/showpo...17&postcount=3
worked, thank you.
wilian159 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 20:59.


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