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

[stock] model size


Post New Thread Reply   
 
Thread Tools Display Modes
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, 339 views)
__________________
Sorry for my english.
Backup is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 02-19-2012 , 10:56   Re: [stock] model size
Reply With Quote #2

Very useful. Thanks
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Reply


Thread Tools
Display Modes

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 11:11.


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