View Full Version : Question in scripting
spelworm
08-08-2007, 20:11
Is there a way to only select non-admins
so u could get a command to work for players but not admins
yeah, ill code a quick example how to do it using a console command
#include <sourcemod>
#pragma semicolon 1
public Plugin:myinfo =
{
name = "No Admins Command",
author = "dubbeh",
description = "Fake command will only run for clients with no admin",
version = "1.0.0.0",
url = "http://www.sourcemod.net/"
};
public OnPluginStart ()
{
/* register the console command */
RegConsoleCmd ("sm_cmd", Command);
}
public Action:Command (client, args)
{
if (client == 0)
return;
new AdminId:AdminID = GetUserAdmin (client);
if (AdminID != INVALID_ADMIN_ID)
{
ReplyToCommand(client, "This command will work on no admin users only");
return;
}
/* else allow the command for the none admin client */
ReplyToCommand(client, "Welcome none admin user");
}
hope that helps :)
spelworm
08-08-2007, 22:10
gonna try it out thanks :)
edit: just edited the script works great so far havent fully tested it but i edited basechat so people could see wat there typing to admins and made it to work into normal chat with a @ to so far so good but server kinda empty now xD so thats havent fully tested it
thanks man :)
vBulletin® v3.8.7, Copyright ©2000-2024, vBulletin Solutions, Inc.