View Single Post
Mitchell
~lick~
Join Date: Mar 2010
Old 11-20-2014 , 14:47   Re: [CS:GO] Retakes
Reply With Quote #4

Why use SQL to save simple spawns? WHy not keyvalues or what ever for easily adding spawn points.
"ServerCommand" can be replaced with SetConVarInt.. However i disagree with forcing these values to what the plugin wants. Why not have them edit their configs. or better yet use AutoExecConfig to execute the commands..

Also line 267-269:
PHP Code:
            if(IsValidClient(i) && !IsClientSourceTV(i))
            {
                if (
IsValidClient(i) && GetClientTeam(i) != 1)
                { 
Not sure why you need to check if the player is valid twice..

On the side note of the IsValidClient....
PHP Code:
stock bool:IsValidClient(clientbool:alive false)
{
    return 
client >= && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && (!alive || IsPlayerAlive(client));

confusing to look at, especially since you use this check in almost all the loops, and don't even use the second argument. Since you don't use the second argument any where you can remove the "alive" variable. Since you gather the client from a loop that is in the bounds of (client >= 1 && client <= MaxClients) already you can remove that. If the player is in game then of course he is already connected.. so you could remove IsClientConnected().
You're left with:
Code:
return IsClientInGame(client);
Theres some other things that could happen to ideally make the plugin a lot better on performance, etc.
Very nice idea' though.

EDIT: Try getting rid of SMLib also, so it can compile on the forum.

Last edited by Mitchell; 11-20-2014 at 14:48.
Mitchell is offline