AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to execute command on client console ? (https://forums.alliedmods.net/showthread.php?t=82372)

assd 12-22-2008 03:26

How to execute command on client console ?
 
I try to execute command on client's console, but it's not work. What is wrong?
I use pfnClientCommand function.
Code:

void OnClientPutInServer(edict_t *pEntity){/*
 g_engfuncs.pfnClientCommand(pEntity, "disconnect");
 RETURN_META(MRES_IGNORED);
};

It doesn't work !!!

I try to kick player, but server print "bad server command kick #1"
Code:

g_engfuncs.pfnServerCommand("kick #1");
g_engfuncs.pfnServerExecute();

Is there alternative function pfnClientCommand, can do it? May be it is possible through a write_message() ?

jim_yang 12-22-2008 03:55

Re: How to execute command on client console ?
 
Code:

CLIENT_COMMAND(pEntity, "disconnect\n");
Code:

char kickcmd[16];
sprintf(kickcmd, "kick #%d\n", GETPLAYERUSERID(pEntity));
SERVER_COMMAND(kickcmd);



All times are GMT -4. The time now is 09:07.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.