View Single Post
ofir753
Senior Member
Join Date: Aug 2012
Old 11-20-2014 , 20:10   Re: [CS:GO] Retakes
Reply With Quote #8

Quote:
Originally Posted by Mitchell View Post
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.
Thanks for the notices, i fixed some of them
Sorry i didnt mentioned this plugin is currently on beta i need this kind of feedback.
Edit:The only reason i made it in sql its beacuse i am planting to make a stats and rankings in the sql and it will use sql anyways so why should i use keyvalues when you got sql that loads only in the start of the map

Last edited by ofir753; 11-20-2014 at 20:17.
ofir753 is offline