aboutsummaryrefslogtreecommitdiff
path: root/sp/src/game/server/client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sp/src/game/server/client.cpp')
-rw-r--r--sp/src/game/server/client.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/sp/src/game/server/client.cpp b/sp/src/game/server/client.cpp
index 2fd87cfe..39905046 100644
--- a/sp/src/game/server/client.cpp
+++ b/sp/src/game/server/client.cpp
@@ -798,6 +798,24 @@ CON_COMMAND( give, "Give item to player.\n\tArguments: <item_name>" )
Q_strncpy( item_to_give, args[1], sizeof( item_to_give ) );
Q_strlower( item_to_give );
+ // Don't allow regular users to create point_servercommand entities for the same reason as blocking ent_fire
+ if ( !Q_stricmp( item_to_give, "point_servercommand" ) )
+ {
+ if ( engine->IsDedicatedServer() )
+ {
+ // We allow people with disabled autokick to do it, because they already have rcon.
+ if ( pPlayer->IsAutoKickDisabled() == false )
+ return;
+ }
+ else if ( gpGlobals->maxClients > 1 )
+ {
+ // On listen servers with more than 1 player, only allow the host to create point_servercommand.
+ CBasePlayer *pHostPlayer = UTIL_GetListenServerHost();
+ if ( pPlayer != pHostPlayer )
+ return;
+ }
+ }
+
// Dirty hack to avoid suit playing it's pickup sound
if ( !Q_stricmp( item_to_give, "item_suit" ) )
{