Added a cvar to either reset the burn time when naded, or to use the original burn-time.
This commit is contained in:
		| @@ -137,6 +137,7 @@ enum CvarsList | ||||
|     Handle:CVAR_RESPAWN_TEAM_ZOMBIE, | ||||
|     Handle:CVAR_RESPAWN_TEAM_ZOMBIE_WORLD, | ||||
|     Handle:CVAR_NAPALM_IGNITE, | ||||
|     Handle:CVAR_NAPALM_TIME_RESET, | ||||
|     Handle:CVAR_NAPALM_DOUSE, | ||||
|     Handle:CVAR_JUMPBOOST_BHOP_PROTECT, | ||||
|     Handle:CVAR_JUMPBOOST_BHOP_MAX, | ||||
| @@ -416,6 +417,7 @@ CvarsCreate() | ||||
|     // Napalm (module) | ||||
|     // =========================== | ||||
|     g_hCvarsList[CVAR_NAPALM_IGNITE]                    =    CreateConVar("zr_napalm_ignite",       "1",    "Ignite grenade in mid-air after player throws it. [Dependency: Human Attribute 'has_napalm']"); | ||||
|     g_hCvarsList[CVAR_NAPALM_TIME_RESET]                =    CreateConVar("zr_napalm_time_reset",   "1",    "The burn-time is reset when being naded multiple times. [0: Original burn-time is used.]"); | ||||
|     g_hCvarsList[CVAR_NAPALM_DOUSE]                     =    CreateConVar("zr_napalm_douse",        "0",    "Minimum water-saturation before flame is extinguished. ['0' = Disabled | '1' = Feet | '2' = Waist | '3' = Full submersion]"); | ||||
|      | ||||
|      | ||||
|   | ||||
| @@ -132,11 +132,17 @@ NapalmOnClientHurt(client, attacker, const String:weapon[]) | ||||
|     // If weapon is a grenade, then ignite player. | ||||
|     if (StrEqual(weapon, "hegrenade", false)) | ||||
|     { | ||||
|         // Put any existing fire out. | ||||
|         ExtinguishEntity(client); | ||||
|         new bool:reset = GetConVarBool(g_hCvarsList[CVAR_NAPALM_TIME_RESET]); | ||||
|         new flags = GetEntityFlags(client); | ||||
|          | ||||
|         // Re-ignite to start burn-time over. | ||||
|         IgniteEntity(client, napalm_time); | ||||
|         if (reset || !(flags & FL_ONFIRE)) | ||||
|         { | ||||
|             // This stops the fire before re-ignition. | ||||
|             ExtinguishEntity(client); | ||||
|              | ||||
|             // Ignite client. | ||||
|             IgniteEntity(client, napalm_time); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user