Monthly Target: $400 Donations: $295
 73% 

[stock] model size


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Backup
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, 81 views)
__________________

Sorry for my english.
Backup is offline
Send a message via ICQ to Backup Send a message via MSN to Backup
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 17:46.


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