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

[stock] model size


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Backup
Senior Member
Join Date: Jul 2010
Location: Česká Republika
Old 02-19-2012 , 10:46   [stock] model size
Reply With Quote #1

Hi, i've made a stock for getting model size. Model doesn't have to be precached.
Code:
stock mdlsize(filename[],Float:vec[3]){
    new file = fopen(filename,"rb")
    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]
}
Attached Files
File Type: inc mdlsize.inc (326 Bytes, 346 views)
__________________
Sorry for my english.
Backup 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 19:02.


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