Raised This Month: $ Target: $400
 0% 

Determine a model size


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 08-13-2021 , 17:40   Determine a model size
Reply With Quote #1

Hello,
How could I determine the size of a model. I need to create an entity and set it's size as big as the model.
So far I found this stock:
PHP Code:
stock mdlsize(filename[],Float:vec[3]){
    new 
file fopen(filename,"rb")
    
    if (!
file)
    
server_print("CANT OPEN %s"filename)
    
    
fseek(file,160,SEEK_SET)
    new 
bboff
    fread
(file,bboff,BLOCK_INT)
    
fseek(file,bboff+8,SEEK_SET)
    new 
Float:size[6]
    
fread_blocks(file,_:size,6,BLOCK_INT)
    
fclose(file)
    
vec[0]=size[3]-size[0]
    
vec[1]=size[4]-size[1]
    
vec[2]=size[5]-size[2]

As results, I get the mins + maxs vectors but it doesn't work.
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]

Last edited by Shadows Adi; 08-13-2021 at 18:15.
Shadows Adi is offline
 



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 02:34.


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