Raised This Month: $ Target: $400
 0% 

Detect if a model change


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BoBzY
AlliedModders Donor
Join Date: Aug 2010
Location: Bruxelles
Old 09-19-2011 , 01:08   Detect if a model change
Reply With Quote #1

Hello,

is there anyway to detect when a client change his model?
(For example, plugin A change the model to any player, plugin B say "X change his model")
BoBzY is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 09-19-2011 , 09:00   Re: Detect if a model change
Reply With Quote #2

GetClientModel

Syntax:
native GetClientModel(client, String:model[], maxlen);

Usage:
client Player's index. model Buffer to store the client's model name. maxlen Maximum length of string buffer (includes NULL terminator).Notes:
Returns the client's model name.

Return:
No return.

Version Added:
1.0.0.1946
On error / Errors:
Invalid client index, client not in game, or no mod support
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<
andi67 is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 09-19-2011 , 09:27   Re: Detect if a model change
Reply With Quote #3

That's not what he asked.
__________________
hleV is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 09-19-2011 , 10:03   Re: Detect if a model change
Reply With Quote #4

Not........?
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<
andi67 is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 09-19-2011 , 10:24   Re: Detect if a model change
Reply With Quote #5

He wants to hook an event when model changed.
__________________
hleV is offline
miniman
Senior Member
Join Date: Aug 2009
Location: Israel
Old 09-19-2011 , 12:30   Re: Detect if a model change
Reply With Quote #6

theres a console command like jointeam that selects the player's skin so you can hook it but I forgot what is it
miniman is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 09-19-2011 , 13:57   Re: Detect if a model change
Reply With Quote #7

Quote:
Originally Posted by miniman View Post
theres a console command like jointeam that selects the player's skin so you can hook it but I forgot what is it
That not help when plugin change player model.

But if @BoBzY need that only, then nevermind

*edit
There is player event

PHP Code:
    "player_class"                // a player changed his class
    
{
        
"userid"    "short"        // user ID on server
        
"class"        "string"    // new player class / model
    

__________________
Do not Private Message @me

Last edited by Bacardi; 09-19-2011 at 14:01.
Bacardi is offline
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 09-19-2011 , 14:25   Re: Detect if a model change
Reply With Quote #8

detour/hook setentitymodel in the engine and create a forward for that, i was looking forward to write a hooks extension for things like that, maybe it would be the best to ask the author of sdkhooks (psychonic?) to merge these hooks/forwards into sdkhooks so ppl wouldnt have to upload a new extension for some forwards
__________________
Taking private C++/PHP/SourcePawn requests, PM me.
Zephyrus is offline
psychonic

BAFFLED
Join Date: May 2008
Old 09-19-2011 , 18:05   Re: Detect if a model change
Reply With Quote #9

Quote:
Originally Posted by Zephyrus View Post
detour/hook setentitymodel in the engine and create a forward for that, i was looking forward to write a hooks extension for things like that, maybe it would be the best to ask the author of sdkhooks (psychonic?) to merge these hooks/forwards into sdkhooks so ppl wouldnt have to upload a new extension for some forwards
That's been requested in sdkhooks before, but I declined to add it to avoid confusion as hooking SetModel still won't catch all model changes.
psychonic is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 09-19-2011 , 18:58   Re: Detect if a model change
Reply With Quote #10

check which think the model changes in using sdkhooks. create a static array that stores each players model index in that think and check it each think against its previous value similar to checking when players press/release buttons.
blodia 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:23.


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