AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [CS:S] Grenade Smoke Color 1.3.4 (https://forums.alliedmods.net/showthread.php?t=174122)

Cyril Tuto 09-13-2012 13:11

Re: [CS:S & DOD:S] Grenade Smoke Color
 
Hello,
Thank you for this plugin!
That should be removed or added to only the players with the flag "o" can be colored smoke? Thank you!

ahmedamin 10-22-2012 15:39

Re: [CS:S & DOD:S] Grenade Smoke Color
 
Thank you m8

RedSword 01-02-2013 17:23

Re: [CS:S & DOD:S] Grenade Smoke Color
 
Hi there,

I'm unapproving your plugin, as past errors (like TnTSCS ones, as well as DoD:S still being announced as compatible) weren't corrected.

Red

HSFighter 01-29-2013 16:18

Re: [CS:S & DOD:S] Grenade Smoke Color
 
Quote:

Originally Posted by RedSword (Post 1865666)
Hi there,

I'm unapproving your plugin, as past errors (like TnTSCS ones, as well as DoD:S still being announced as compatible) weren't corrected.

Red

Hi RedSword,
  • Test on 10 CS:S Server's!
  • No errors until jet!
  • Announce for DoD:S removet.

Please Aprove again.

RedSword 01-29-2013 17:51

Re: [CS:S] Grenade Smoke Color
 
When creating an entity, you should ensure that it is well created (!= -1) before using functions on it. L112

Also, please, please, please don't do that :

Code:

public bool:IsClientOK(client)
{
        if (client != 0)
        {
                // Get all clients on the server
                for (new i = 1; i <= MaxClients; i++)
                {
                        // Check if player ok
                        if (IsClientConnected(i) && IsClientInGame(i) && !IsFakeClient(client))
                        {
                                // Check if client is a player on the server
                                if (i == client) return true;                       
                        }
                }       
        }       
        return false;
}

Use something simpler like :
Code:

public bool:IsValidClient(client)
{
        if ( !( 1 <= client <= MaxClients ) || !IsClientInGame(client) || IsFakeClient(client) )
        {
                return false
        }
        return true
}

You really don't need to loop through all players to validate if a player is present.

That might not be; all pass more conciously latter.

RedSword 01-29-2013 22:33

Re: [CS:S] Grenade Smoke Color
 
Hi again,

There is still something that should be adressed before approving :

If near round end, a player throw and detonate a smoke, than a round restart and another player get to have the same index for his smoke grenade, his smoke will be killed earlier.

To prevent that, use EntIndexToEntRef when calling the timer and retrieve the entity index with EntRefToEntIndex and make sure it is != -1.

Also, the rest below doesn't prevent approval, but it should be considered :
  • If you're unlucky, a player could throw a smoke grenade, go spectate, than it would detonate and a random input would be given as color. This can't crash, but I don't think it is a wanted behaviour (gray, possibly random). To prevent that simply handle team 1, or make it so you remember last team.
  • Don't implement OnMapStart if you're not going to use it. You're wasting ~9 lines.
  • L123 to 127. You don't need to do that. "smokegrenade_detonate" is already hooked; and it only exist in CS:S/GO. Currently, you're only locking yourself to CS:S. You also don't have to make sure your plugin doesn't produce errors on other unannounced mods. If you really feel repulsion towards CS:GO players, then you can let it as it is lol.
  • You better let it free to all mods (I mean by this, last point; but still write this plugin as CSS only) and if you're lucky someone will come report it working under CS:GO.

Red

minimoney1 01-30-2013 15:48

Re: [CS:S] Grenade Smoke Color
 
Quote:

Originally Posted by RedSword (Post 1883286)
Hi again,

There is still something that should be adressed before approving :

If near round end, a player throw and detonate a smoke, than a round restart and another player get to have the same index for his smoke grenade, his smoke will be killed earlier.

To prevent that, use EntIndexToEntRef when calling the timer and retrieve the entity index with EntRefToEntIndex and make sure it is != -1.

Yeah, I actually fixed this locally when I was using it but forgot to post it here.
I had players reporting that their weapons just randomly disappeared and got this fixed with the help of TheTwistedPanda.

Pialx 04-17-2013 09:30

Re: [CS:S] Grenade Smoke Color
 
Could-you confirm the bug with weapons when sometimes the primary weapon disappears was fixed?
And what about the logs flooded in sm_grenadesmokecolor_mode "2" ?

I want to use this funny plugin! :)

Bacardi 04-17-2013 14:53

Re: [CS:S] Grenade Smoke Color
 
*this should prevent players weapons from disappear.
...

thetwistedpanda 04-17-2013 17:49

Re: [CS:S] Grenade Smoke Color
 
Bacardi - That won't correctly resolve the issue, if at all. The issue is CreateTimer is being passed an entity index, which is always subject to change (much like a client index). The correct way to resolve that bug is as RedSword suggested above. Although it looks like they overlooked a memory leak with Checktime only being killed once regardless of how many smoke grenades are passed.


All times are GMT -4. The time now is 01:29.

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