PDA

View Full Version : ClientCommand When Somebody Knifed.


shavit
02-03-2012, 15:19
i Wanna make everybody do a command when somebody knifed and killed.

how i can do it?

Dr. Greg House
02-03-2012, 17:08
How about googling?
http://docs.sourcemod.net/api/index.php?fastload=file&id=27&type=&

Keep in mind that there are certain restrictions affected by how the netcode is designed and security.

Jasonbourne
02-04-2012, 07:42
i Wanna make everybody do a command when somebody knifed and killed.

how i can do it?

i lol @ your threads

shavit
02-04-2012, 11:06
why you are spamming?

Bacardi
02-04-2012, 11:39
i Wanna make everybody do a command when somebody knifed and killed.

how i can do it?
What kind client commands... ?

TheAvengers2
02-04-2012, 12:19
Hmmm.. I think this is what you're looking for: http://wiki.amxmodx.org/Events_%28SourceMod_Scripting%29#Post_Hooks. All you need to do is add a check on the weapon and fake command, something like:


if (StrEqual(weapon, "weapon_knife"))
{
for (new i = 1; i <= MaxClients; i++)
{
if (!IsClientInGame(i))
continue;

FakeClientCommandEx(i, "say \"lol you got knifed, boy!\"");
}
}

shavit
02-04-2012, 13:22
Hmmm.. I think this is what you're looking for: http://wiki.amxmodx.org/Events_%28SourceMod_Scripting%29#Post_Hooks. All you need to do is add a check on the weapon, something like:


if (StrEqual(weapon, "weapon_knife"))
{
// do something
}


how can i do it?