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

[L4D2] Explosive Cars v1.0.4


Post New Thread Reply   
 
Thread Tools Display Modes
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 09-21-2010 , 06:10   Re: [L4D2] Explosive Cars
Reply With Quote #11

PHP Code:
SetFailState("Advanced Deathmatch supports Left 4 dead 2 only!"); 
PHP Code:
    else if(StrEqual(class1"prop_physics") || StrEqual(class1"prop_physics_override"))
    {
        
decl String:model[256];
        
GetEntPropString(victimProp_Data"m_ModelName"modelsizeof(model))
        if(
StrContains(model"vehicle"false) >= 0)
        {
            
g_iEntityDamage[victim]+= RoundToFloor(damage);
        }
    } 
Putting this part into the OnEntityCreated Hook would save so much computing


PHP Code:
    if(tdamage >= MaxDamageHandle && tdamage MaxDamageHandle*&& !g_bLowWreck[victim])
    {
        
AttachParticle(victimDAMAGE_WHITE_SMOKE);
        
g_bLowWreck true;
    }
    if(
tdamage >= MaxDamageHandle*&& tdamage MaxDamageHandle*&& !g_bMidWreck[victim])
    {
        
AttachParticle(victimDAMAGE_BLACK_SMOKE);
        
g_bMidWreck true;
    }
    if(
tdamage >= MaxDamageHandle*&& tdamage MaxDamageHandle*&& !g_bHighWreck[victim])
    {
        
AttachParticle(victimDAMAGE_FIRE_SMALL);
        
g_bHighWreck true;
    }
    if(
tdamage >= MaxDamageHandle*&& tdamage MaxDamageHandle*&& !g_bCritWreck[victim])
    {
        
AttachParticle(victimDAMAGE_FIRE_HUGE);
        
g_bCritWreck true;
    }
    if(
tdamage MaxDamageHandle*&& !g_bExploded[victim] && g_iTimesExploded[victim] <= 0)
    {
        
g_bExploded[victim] = true;
        
g_iTimesExploded[victim]++;
        
decl Float:pos[3];
        
GetEntPropVector(victimProp_Data"m_vecOrigin"pos);
        
CreateExplosion(pos);
        
LaunchCar(victim);
        
g_bExploded[victim] = true;
    } 
How about using case or 'else if' so it doesnt have to check everything at all times


PHP Code:
    if(vel[2] == 0.0)
    {
        
vel[2] = 2500.0;
    }
    else
    {
        
vel[2]+= 2500.0;
    } 
The latter case includes the first. How about randomizing it a bit?


PHP Code:
        decl Float:vel[3];
        
vel[0] = 0.0;
        
vel[1] = 0.0;
        
vel[2] = 0.0;
        
SetEntPropVector(carProp_Data"m_vecVelocity"vel); 
Just using new Floatxx[3] would result in a 0,0,0 vector. Maybe NULL_VECTOR too. Why are you stopping the car anyways?


PHP Code:
new Float:realdistance SquareRoot(FloatMul(distance[0],distance[0])+FloatMul(distance[1],distance[1])); 
GetVectorDistance


EDIT:


Im scrubbing your code just now because i think the idea is awesome, and i keep finding stuff like this

PHP Code:
    for(new i=1i<=MaxClientsi++)
    {
        if(
== 
PHP Code:
g_bLowWreck 
And some others .. you name and use them as bools but declare them integers.


You also have the completely useless g_iTimesExploded along the g_bExploded


PHP Code:
    for(new i=1i<=MaxClientsi++)
    {
        ...
        
        new 
Float:realdistance SquareRoot(FloatMul(distance[0],distance[0])+FloatMul(distance[1],distance[1])); 
Do not.



Edit #2:

Im done customizing a version for my server, if you want to see what i would have done differently. Cool Plugin still, cant wait to see it in action.

Last edited by AtomicStryker; 09-21-2010 at 06:46.
AtomicStryker is offline
blitzzz
Member
Join Date: Mar 2010
Old 09-21-2010 , 10:40   Re: [L4D2] Explosive Cars
Reply With Quote #12

Okay after some testing, i think i know why corsi say it doesnt work. When we first connect to the server, the plugin (although its loaded as shown in hlsw) doesnt seem to be working on the 1st map (e.g., dark carnival map 2 alarm car at the pool). I had to restart the map once to make it work. Same thing on parish map 1.
blitzzz is offline
corsi
Member
Join Date: Mar 2010
Old 09-21-2010 , 10:55   Re: [L4D2] Explosive Cars
Reply With Quote #13

L 09/21/2010 - 17:50:29: [SM] Plugin encountered error 15: Array index is out of bounds
L 09/21/2010 - 17:50:29: [SM] Displaying call stack trace for plugin "l4d2_explosive_cars.smx":
L 09/21/2010 - 17:50:29: [SM] [0] Line 109, l4d2_explosive_cars.sp::Event_RoundStart()
[TANK] GameMode = 1, MapState = 1 [0 Wave] [F=0] (10 x 12000)
i got this error; i think we need a better version of this pluggin!!!
corsi is offline
Cthulhu
Member
Join Date: Apr 2010
Old 09-21-2010 , 12:10   Re: [L4D2] Explosive Cars
Reply With Quote #14

Quote:
Originally Posted by honorcode23 View Post
I calculated how long would it explode by shoving. Took 5 mins to do so, i dont think survivors will be 5 mins shoving lol. Yes, tanks will explode cars so they gotta be carefull. (Anyway, if the car explodes near survivors, they are completely wiped ).
Well, imagine a car with 1 HP after take some damage from survivors weapons, you try to push an infected shoving him but you hit the car...

Only survivors firearms weapons should damage car. With this plugin the tactic of use cars with tanks trying to incapacitate survivors is gone :-(
Cthulhu is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 09-21-2010 , 12:18   Re: [L4D2] Explosive Cars
Reply With Quote #15

The plugin as posted cant work because of an Array error. So honorcode made this, but not once tested it (LOL).

While i was fixing it up i also noticed OnEntityCreated doesnt work for mapside cars (that arent alarm cars), so ive added a OnMapStart Loop to do it.

That being said, the car code itself is working fine and creating explosions.

Also, his vector/fling computing is complete bogus.



EDIT:

Here, this is working as intended.

http://code.google.com/p/atomicstrykers-codedump/source/browse/customized/l4d2_explosive_cars.sp

EDIT #2: Right Link is right
Attached Files
File Type: smx l4d2_explosive_cars.smx (11.3 KB, 455 views)

Last edited by AtomicStryker; 09-21-2010 at 15:37.
AtomicStryker is offline
Skorpion1976
Veteran Member
Join Date: Jun 2009
Location: Austria
Old 09-21-2010 , 13:24   Re: [L4D2] Explosive Cars
Reply With Quote #16

I guess, you meant this url:
http://code.google.com/p/atomicstryk...losive_cars.sp
Skorpion1976 is offline
marvel
BANNED
Join Date: Dec 2009
Old 09-21-2010 , 13:49   Re: [L4D2] Explosive Cars
Reply With Quote #17

Quote:
Originally Posted by AtomicStryker View Post
The plugin as posted cant work because of an Array error. So honorcode made this, but not once tested it (LOL).

While i was fixing it up i also noticed OnEntityCreated doesnt work for mapside cars (that arent alarm cars), so ive added a OnMapStart Loop to do it.

That being said, the car code itself is working fine and creating explosions.

Also, his vector/fling computing is complete bogus.



EDIT:

Here, this is working as intended.

http://code.google.com/p/atomicstryk..._refuelling.sp
Although your code might be better you're really an asshole by leaving that reply. I've been testing the plugin and it worked fine for me although I admit it gave some high cpu usage.

Anyway you have a history yourself posting plugins without testing them first and now blame other people doing the same. And what's even worse, you steal his idea and code, built your own plugin from it and then start breaking his balls.

You are so full of yourself but in fact you should be really ashamed
marvel is offline
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 09-21-2010 , 13:58   Re: [L4D2] Explosive Cars
Reply With Quote #18

Marvel, this is a perk of an open source community. Everyone is free to improve on other people's ideas, and comparing the two plugins your code definitely needed improving / optimizing. Now he could have simply gave you pointers and suggestions on how to fix the code, but such a process would be quite slow if he wanted to use it on his own server and knew how to fix it himself. It's better to learn from the experience and see what areas you made mistakes in to improve your plugins in the future, rather than getting upset.
__________________
thetwistedpanda is offline
marvel
BANNED
Join Date: Dec 2009
Old 09-21-2010 , 14:08   Re: [L4D2] Explosive Cars
Reply With Quote #19

@thetwistedpanda,

I didn't make the plugin and I think it's great Atomic or anybody else improves it, it's just the cocky way he's acting to other developers I have a problem with. It might stop them from developing anything new since Atomic knows how to do it better anyway and even laughs at other people's code.
marvel is offline
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 09-21-2010 , 14:37   Re: [L4D2] Explosive Cars
Reply With Quote #20

Ooh, I suppose I should pay more attention next time :-o. *inserts foot into mouth*
__________________
thetwistedpanda 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 14:56.


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