Raised This Month: $ Target: $400
 0% 

Remove origins data from file


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 09-03-2009 , 09:35   Remove origins data from file
Reply With Quote #1

Example in dust2.cfg file is written this information:
Quote:
1037 2233 65
1272 2234 76
1453 2211 72
1603 2184 80
PHP Code:
new const mod_dir_name[] = "itemorigin";
// In menu
case 2:
{
    new 
entbody
    get_user_aiming
(identbody300)
    
RemoveItemAim(ent)

PHP Code:
public RemoveItemAim(ent)
{
    new 
classname[32]
    
pev(entpev_classnameclassname31)
    if( !
equal(classname"MedItem") )
        return;
    
    new 
Floatorigin[3];
    
pev(entpev_originorigin)
    new 
eorigin[128]
    
    new 
x[8], y[8], z[8]
    if( 
equal(classname"MedItem") ) 
    {
        new 
configsdir[128]
        
get_configsdir(configsdir127)
        
        new 
file[256], CurMap[51]
        
get_mapname(CurMap50)
        
format(file255"%s/%s/%s.cfg"configsdir,mod_dir_nameCurMap)
        
format(eorigin127"%i %i %i"floatround(origin[0]), floatround(origin[1]), floatround(origin[2]))
        new 
fh fopen(file"rt")
        
        if(
fh
        {
            new 
buffer[128]
            new 
counter
        
            
while(!feof(fh)) 
            {
                
fgets(fhbuffer127)
            
                
parse(bufferx7y7z7)
                
format(buffer127"%i %i %i"str_to_num(x), str_to_num(y), str_to_num(z))
            
                if(
equal(buffereorigin)) 
                {
                    
format(buffer127"")
                
                    
write_file(filebuffercounter)
                }
                
                
counter++
            }
            
fclose(fh)
        }
    }
    
    
remove_entity(ent)

Why it won't remove the origins data from file, when aiming, it removes only the entity :/
?
__________________

Last edited by xbatista; 09-03-2009 at 09:38.
xbatista is offline
Send a message via Skype™ to xbatista
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 09-03-2009 , 10:05   Re: Remove origins data from file
Reply With Quote #2

Just because it doesnt equal ?xD
__________________
xPaw is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 09-03-2009 , 10:07   Re: Remove origins data from file
Reply With Quote #3

what?
I don't understand ,show me correct example :{}
__________________

Last edited by xbatista; 09-03-2009 at 10:11.
xbatista is offline
Send a message via Skype™ to xbatista
Jon
Veteran Member
Join Date: Dec 2007
Old 09-03-2009 , 10:15   Re: Remove origins data from file
Reply With Quote #4

What are you trying to do? Remove entities and saved which ones are removed to a file?
Jon is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 09-03-2009 , 10:20   Re: Remove origins data from file
Reply With Quote #5

Quote:
Remove entities and saved which ones are removed to a file?
Yes , removing aimed entity and aimed entitie's origins from file, which was saved.
And it won't delete aimed entitie's origins data from file.

xPaw: Yes it doesn't ,but I don't understand why ? :/
__________________

Last edited by xbatista; 09-03-2009 at 12:55.
xbatista is offline
Send a message via Skype™ to xbatista
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 09-03-2009 , 14:15   Re: Remove origins data from file
Reply With Quote #6

Problem was when I'm creating entity :/
PHP Code:
entity_set_int(item_entEV_INT_movetypeMOVETYPE_TOSS)
drop_to_floor(item_ent
That was a problem, cuz it drops to floor and entity is in unknown place, how to fix that MOVETYPE_TOSS problem?

I need to set it somehow, without gravity + it must be on the floor
__________________

Last edited by xbatista; 09-03-2009 at 14:26.
xbatista is offline
Send a message via Skype™ to xbatista
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-03-2009 , 15:02   Re: Remove origins data from file
Reply With Quote #7

Try using drop_to_floor( ) without setting the movetype.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 09-04-2009 , 02:40   Re: Remove origins data from file
Reply With Quote #8

It won't drop to floor without MOVETYPE_TOSS
__________________
xbatista is offline
Send a message via Skype™ to xbatista
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 09-04-2009 , 07:35   Re: Remove origins data from file
Reply With Quote #9

Because your dropping it to floor and after that you set origin... move drop_to_floor to end
__________________
xPaw is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 09-04-2009 , 07:39   Re: Remove origins data from file
Reply With Quote #10

it just stuck on me(player origin).
BTW bugs bugs bugs, look at the first code what I've posted,if I will drop to floor doesn't equal and I can't delete item by aim...
__________________
xbatista is offline
Send a message via Skype™ to xbatista
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 15:13.


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