Raised This Month: $ Target: $400
 0% 

[HL2DM] RP problem with "freezing money"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
grypho
Junior Member
Join Date: Oct 2012
Old 10-11-2012 , 11:52   [HL2DM] RP problem with "freezing money"
Reply With Quote #1

Hello, some of you might know HL2DM RP plugin. (It requires source mod to work)

I have a small problem with it and I can't seem to solve myself. This problem is about money freezing on the air, instead of dropping on the ground when a player dies. When I tested killing myself when I had a a large amount of cash with me, it didn't drop on the ground.

RP script is supposed to drop my money on the ground when I die, well it didn't. Money just floats and is frozen on the air. (It was supposed to drop gold bar props on the ground and some coins.) I remember when I last time played someone else's server, it dropped on the ground.

I was playing in LAN server, if this helps at all.
If anyone knows how to solve this, I would appreciate your help.
grypho is offline
NatalyaAF
Senior Member
Join Date: Dec 2008
Old 10-12-2012 , 09:21   Re: [HL2DM] RP problem with "freezing money"
Reply With Quote #2

Try:

ActivateEntity(ent);

Where ent is the model of the money.


If that doesn't work, you might be spawning it as the wrong entity type. It should be spawned as either prop_physics_multiplayer or prop_physics_override so if you're spawning it as a prop_physics then switch it to one of those two.
__________________
Talk to me on Steam: natalyaaf
See my website for downloads: www.lady-natalya.info

Natalya: killing someone while they make a plugin
Natalya: perfect analogy
Natalya: for the mayan apocalypse

Last edited by NatalyaAF; 10-12-2012 at 09:29.
NatalyaAF is offline
grypho
Junior Member
Join Date: Oct 2012
Old 10-12-2012 , 10:22   Re: [HL2DM] RP problem with "freezing money"
Reply With Quote #3

I did what you suggested, I put "ActivateEntity(Ent)" thing in to code, but nothing is still happening, it still freezes on the air. Is there something wrong that I should fix? Here is the code related to it + picture:

Code:
//Initialize:
        new Ent = rp_createent("prop_physics_override");
        if(Amount > 1000) //goldbar
        {
            DroppedMoneyValue[Ent] = 1000;
            rp_dispatchkeyvalue(Ent, "model", "models/money/goldbar.mdl");
            Amount -= 1000;
            ActivateEntity(models/money/goldbar.mdl);
        }
        else if(Amount > 200) //note
        {
            DroppedMoneyValue[Ent] = 200;
            rp_dispatchkeyvalue(Ent, "model", "models/money/note2.mdl");
            Amount -= 200;
            ActivateEntity(models/money/note2.mdl);
        }
        else if(Amount > 100) //note
        {
            DroppedMoneyValue[Ent] = 100;
            rp_dispatchkeyvalue(Ent, "model", "models/money/note.mdl");
            Amount -= 100;
            ActivateEntity(models/money/note.mdl);
        }
        else if(Amount > 50) //note 3
        {
            DroppedMoneyValue[Ent] = 50;
            rp_dispatchkeyvalue(Ent, "model", "models/money/note3.mdl");
            Amount -= 50;
            ActivateEntity(models/money/note3.mdl);
        }
        else if(Amount > 20) //golcoin
        {
            DroppedMoneyValue[Ent] = 20;
            rp_dispatchkeyvalue(Ent, "model", "models/money/goldcoin.mdl");
            Amount -= 20;
            ActivateEntity(models/money/goldcoin.mdl);
        }
        else if(Amount > 10) //silvcoin
        {
            DroppedMoneyValue[Ent] = 10;
            rp_dispatchkeyvalue(Ent, "model", "models/money/goldcoin.mdl");
            Amount -= 10;
            ActivateEntity(models/money/goldcoin.mdl);
        }
        else if(Amount > 5) //silvcoin
        {
            DroppedMoneyValue[Ent] = 5;
            rp_dispatchkeyvalue(Ent, "model", "models/money/silvcoin.mdl");
            Amount -= 5;
            ActivateEntity(models/money/silvcoin.mdl);
        }
        
        else if(Amount > 2) //silvcoin
        {
            DroppedMoneyValue[Ent] = 2;
            rp_dispatchkeyvalue(Ent, "model", "models/money/silvcoin.mdl");
            Amount -= 2;
            ActivateEntity(models/money/silvcoin.mdl);
        }
        else //broncoin
        {
            DroppedMoneyValue[Ent] = 1;
            rp_dispatchkeyvalue(Ent, "model", "models/money/broncoin.mdl");
            Amount -= 1;
            ActivateEntity(models/money/broncoin.mdl);
        }
        
        
        //Spawn:
        rp_dispatchspawn(Ent);
        
        //Angles:
        Angles[1] = GetRandomFloat(0.0, 360.0);
        Position[0] = OrgPos[0] + GetRandomFloat(-50.0, 50.0);
        Position[1] = OrgPos[1] + GetRandomFloat(-50.0, 50.0);
        
        
        //Debris:
        Collision = GetEntSendPropOffs(Ent, "m_CollisionGroup");
        if(IsValidEntity(Ent)) SetEntData(Ent, Collision, 1, 1, true);
        
        //Send:
        rp_teleportent(Ent, Position, Angles, NULL_VECTOR);
    }
    return true;
}

http://i.cubeupload.com/O5iobH.jpg

Last edited by grypho; 10-12-2012 at 10:24.
grypho is offline
miniman
Senior Member
Join Date: Aug 2009
Location: Israel
Old 10-12-2012 , 10:47   Re: [HL2DM] RP problem with "freezing money"
Reply With Quote #4

ActivateEntity(Ent);
as is
also do it after you spawn it (rp_dispatchspawn(Ent))
miniman is offline
grypho
Junior Member
Join Date: Oct 2012
Old 10-12-2012 , 12:41   Re: [HL2DM] RP problem with "freezing money"
Reply With Quote #5

Still doesn't work. :/
grypho is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 10-12-2012 , 21:14   Re: [HL2DM] RP problem with "freezing money"
Reply With Quote #6

Manualy claculated the position of your leg.

Position[1] -= 100.0; // or where ever your leg located.

Other stuff.. Try "SetEntityMoveType()". Apply the gravity to the money.
GsiX is offline
miniman
Senior Member
Join Date: Aug 2009
Location: Israel
Old 10-13-2012 , 01:51   Re: [HL2DM] RP problem with "freezing money"
Reply With Quote #7

Quote:
Originally Posted by GsiX View Post
Manualy claculated the position of your leg.

Position[1] -= 100.0; // or where ever your leg located.

Other stuff.. Try "SetEntityMoveType()". Apply the gravity to the money.
I think it would be better to trace to the ground ,since if you jump it will be still floating.
miniman is offline
grypho
Junior Member
Join Date: Oct 2012
Old 10-13-2012 , 11:04   Re: [HL2DM] RP problem with "freezing money"
Reply With Quote #8

I tried that aswell but didn't work, HOWEVER! I found out that this came to my server's console when money was about to freeze.

Late precache of models/money/goldbar.mdl
ERROR!: Can't create physics object for models/money/goldbar.mdl
Late precache of models/money/note2.mdl
ERROR!: Can't create physics object for models/money/note2.mdl
ERROR!: Can't create physics object for models/money/note2.mdl
ERROR!: Can't create physics object for models/money/note2.mdl
Late precache of models/money/note.mdl
ERROR!: Can't create physics object for models/money/note.mdl
Late precache of models/money/note3.mdl
ERROR!: Can't create physics object for models/money/note3.mdl
Late precache of models/money/goldcoin.mdl
ERROR!: Can't create physics object for models/money/goldcoin.mdl
ERROR!: Can't create physics object for models/money/goldcoin.mdl
Late precache of models/money/silvcoin.mdl
ERROR!: Can't create physics object for models/money/silvcoin.mdl
ERROR!: Can't create physics object for models/money/silvcoin.mdl
ERROR!: Can't create physics object for models/money/silvcoin.mdl
Late precache of models/money/broncoin.mdl
ERROR!: Can't create physics object for models/money/broncoin.mdl
A
grypho is offline
miniman
Senior Member
Join Date: Aug 2009
Location: Israel
Old 10-13-2012 , 11:30   Re: [HL2DM] RP problem with "freezing money"
Reply With Quote #9

Quote:
Originally Posted by grypho View Post
I tried that aswell but didn't work, HOWEVER! I found out that this came to my server's console when money was about to freeze.

Late precache of models/money/goldbar.mdl
ERROR!: Can't create physics object for models/money/goldbar.mdl
Late precache of models/money/note2.mdl
ERROR!: Can't create physics object for models/money/note2.mdl
ERROR!: Can't create physics object for models/money/note2.mdl
ERROR!: Can't create physics object for models/money/note2.mdl
Late precache of models/money/note.mdl
ERROR!: Can't create physics object for models/money/note.mdl
Late precache of models/money/note3.mdl
ERROR!: Can't create physics object for models/money/note3.mdl
Late precache of models/money/goldcoin.mdl
ERROR!: Can't create physics object for models/money/goldcoin.mdl
ERROR!: Can't create physics object for models/money/goldcoin.mdl
Late precache of models/money/silvcoin.mdl
ERROR!: Can't create physics object for models/money/silvcoin.mdl
ERROR!: Can't create physics object for models/money/silvcoin.mdl
ERROR!: Can't create physics object for models/money/silvcoin.mdl
Late precache of models/money/broncoin.mdl
ERROR!: Can't create physics object for models/money/broncoin.mdl
A
Interesting,
Try precaching every model for ex:
PHP Code:
PrecacheModel("models/money/broncoin.mdl",true); 
put it in the OnMapStart block
and get rid of the code that you added
miniman is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 10-13-2012 , 13:41   Re: [HL2DM] RP problem with "freezing money"
Reply With Quote #10

Quote:
Originally Posted by miniman View Post
Interesting,
Try precaching every model for ex:
PHP Code:
PrecacheModel("models/money/broncoin.mdl",true); 
put it in the OnMapStart block
and get rid of the code that you added
I think that still give console error because of the model.

How i fix mine is OnMapStart (after you precache the model) create a timer 2 or 3 sec. In your timer create prop_physic or prop_dynamic, then change the model to your money, dispatch it, then "kill" (or remove edict). The next time your spawn the money you wont get the error nor the freeze about 0.1 sec or something.

EDIT:
PHP Code:
stock PrecacheObject( const String:ModelNameHere[] )
{
    new 
prop;
    
prop CreateEntityByName"prop_physic" );
    if ( 
prop != -)
    {
        
DispatchKeyValueprop"model"ModelNameHere );
        
DispatchSpawnprop );
        
AcceptEntityInputprop"kill" );
    }


Last edited by GsiX; 10-13-2012 at 15:01.
GsiX is offline
Reply



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 23:41.


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