Hi all.
How can I allow players who have a gag to use commands !top !toptime !rank etc..
I'm using a plugin SourceBans++ 1.7.0
I tried to do something like this but it doesn't work.
This is the code in the file levels_ranks/commands.sp'
Regards! ;)
@refresh
How can I allow players who have a gag to use commands !top !toptime !rank etc..
I'm using a plugin SourceBans++ 1.7.0
sourcebans-pp/game/addons/sourcemod/scripting/include/sourcecomms.inc at v1.x · sbpp/sourcebans-pp
Admin, ban, and comms management system for the Source engine - sbpp/sourcebans-pp
github.com
I tried to do something like this but it doesn't work.
This is the code in the file levels_ranks/commands.sp'
C++:
#include <sourcecomms>
public void OnClientSayCommand_Post(int iClient, const char[] sCommand, const char[] sArgs)
{
if(CheckStatus(iClient) && SourceComms_GetClientGagType(iClient) != bNot || SourceComms_GetClientGagType(iClient) == bNot)
{
if(!strcmp(sArgs, "top", false) || !strcmp(sArgs, "!top", false))
{
OverAllTopPlayers(iClient, false);
}
else if(!strcmp(sArgs, "toptime", false) || !strcmp(sArgs, "!toptime", false))
{
OverAllTopPlayers(iClient);
}
else if(!strcmp(sArgs, "session", false) || !strcmp(sArgs, "!session", false))
{
MyStatsSession(iClient);
}
else if(!strcmp(sArgs, "rank", false) || !strcmp(sArgs, "!rank", false))
{
int iKills = g_iPlayerInfo[iClient].iStats[ST_KILLS],
iDeaths = g_iPlayerInfo[iClient].iStats[ST_DEATHS];
float fKDR = iKills / (iDeaths ? float(iDeaths) : 1.0);
if(g_Settings[LR_ShowRankMessage])
{
int iPlaceInTop = g_iPlayerInfo[iClient].iStats[ST_PLACEINTOP],
iExp = g_iPlayerInfo[iClient].iStats[ST_EXP];
for(int i = GetMaxPlayers(); --i;)
{
if(CheckStatus(i))
{
LR_PrintMessage(i, true, false, "%T", "RankPlayer", i, iClient, iPlaceInTop, g_iDBCountPlayers, iExp, iKills, iDeaths, fKDR);
}
}
}
else
{
LR_PrintMessage(iClient, true, false, "%T", "RankPlayer", iClient, iClient, g_iPlayerInfo[iClient].iStats[ST_PLACEINTOP], g_iDBCountPlayers, g_iPlayerInfo[iClient].iStats[ST_EXP], iKills, iDeaths, fKDR);
}
}
}
}
Regards! ;)
@refresh
Последнее редактирование модератором: