AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Napalm Grenades! (https://forums.alliedmods.net/showthread.php?t=59642)

Peoples Army 08-17-2007 19:31

Napalm Grenades!
 
1 Attachment(s)
Napalm Grenades:

HE grenades turn into napalm , and when damaged by a HE grenade , the damaged player gets set on fire , the time the player gets set on fire , is greater with the amount of damage the nade does , the more damage done , the longer your on fire .


Instalation:
  • Install Like Any Other sourcemod plugin .
CVARS:
  • napalm_nades_on 1/0 1 is on 0 is off
Change Logs:
  • 8-10-07 - 0.1 - Originol Release
  • 8-10-07 - 0.2- Added Extinguish Enitity On Player Death
  • 8-11-07 - 0.3 - Added Extinguish Entity On Player Disconnect
  • 8-21-07 -0.4- Fixed Bug In Ignite Switch
  • 8-22-07 -0.5 - Fixed Time Bug
Any Ideas And Feed Back Are Welcome :up:

Nican 08-18-2007 00:34

Re: Napalm Grenades!
 
So I repeat:
This buring choosing lines does not make sense...
Lets say the person takes 75 damage from the granade... The plugin would react:

if(DmgDone <= 30) = False
else if(DmgDone > 31) = True
and it would stop right here, and never go to 12.0 seconds...

and wouldn't it make more sense if you made a formula for the time of the fire
something like:

( Damage / MaxHealth ) * MaxFireTime
IgniteEntity(client, ( float(DmgDone) / 100.0 ) * 12.0);

Peoples Army 08-18-2007 15:46

Re: Napalm Grenades!
 
as far as i know and the approvers my coding makes sence other wise they would have pointed it out .

dalto 08-19-2007 22:12

Re: Napalm Grenades!
 
I think what he is saying is not that there is something wrong with your code, but that it might not be doing what you intended it to do.


Code:

        if(DmgDone <= 30)
        {
            IgniteEntity(client,3.0);
        }else if(DmgDone > 31)
        {
            IgniteEntity(client,6.0);
        }else if(DmgDone > 51)
        {
            IgniteEntity(client,9.0);
        }else if (DmgDone > 71)
        {
            IgniteEntity(client,12.0);
        }

With this code, it is not possible to ever get to the if(DmgDone > 51) or if (DmgDone > 71).

Because once it gets to if(DmgDone > 31), it finds a match and stops.

You might, instead consider doing something like this:
Code:

        if(DmgDone <= 30)
        {
            IgniteEntity(client,3.0);
        }else if(DmgDone > 31 && DmgDone <= 51)
        {
            IgniteEntity(client,6.0);
        }else if(DmgDone > 51 && DmgDone <= 71)
        {
            IgniteEntity(client,9.0);
        }else if (DmgDone > 71)
        {
            IgniteEntity(client,12.0);
        }

It will work either way, it is just a question of what you are trying to accomplish.

cybermind 08-19-2007 22:17

Re: Napalm Grenades!
 
Just move the greater numbers to the top of the else-if tree:

Code:

        if(DmgDone <= 30)
        {
            IgniteEntity(client,3.0);
        }else if (DmgDone > 71)
        {
            IgniteEntity(client,12.0);
        }else if(DmgDone > 51)
        {
            IgniteEntity(client,9.0);
        }else if(DmgDone > 31)
        {
            IgniteEntity(client,6.0);
        }


BAILOPAN 08-19-2007 22:20

Re: Napalm Grenades!
 
The checklist for approving a plugin is somewhat generic -- moderators won't personally test and read every line of your plugin. If it contains a semantic error that's syntactically correct, it's up to you to fix it (and if it's a "show-stopping" problem that gets reported, it may mean unapproval later).

edit: hi cybermind

Peoples Army 08-19-2007 23:53

Re: Napalm Grenades!
 
ooooppsss . i never noticed that . sorry guys . it makes sence now . i gotta go to sleep (work tommaorw) but ill fix it tommarow . thanks for the help . :up:

Nican 08-20-2007 00:10

Re: Napalm Grenades!
 
I still think you should make a nice little formula for it :O

Anyway, sorry for my bad communication skills D:

Peoples Army 08-21-2007 19:46

Re: Napalm Grenades!
 
ok fixed teh cases i had and uploaded new version should be all fixed. thx for pointing it out . :wink:

Nican 08-21-2007 22:03

Re: Napalm Grenades!
 
Ok... two new bugs:
1.Have you noticed the less damage the player takes, the longer he stays on fire...
-- if he takes > 71, he stays lit for 6 seconds
-- if he takes > 51, he stays lit for 9 seconds
-- if he takes > 31, he stays lit for 12 seconds

2. If the player takes exactly 31 damage, nothing happens...


All times are GMT -4. The time now is 04:31.

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