AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Target (https://forums.alliedmods.net/showthread.php?t=22117)

DarlD 12-19-2005 01:52

Target
 
How would one target someone threw chat commands.

Code:
public checktext(id) {     if (!access(id,ADMIN_KICK)         return PLUGIN_HANDLED     new text[2]     read_argv(1, text, 1)         while (text[0] != '!')         return PLUGIN_HANDLED         new name[63],Target[32]
i wanted to use authid but that would return the player activating this script.

teame06 12-19-2005 03:42

I'm confused.. You mean the person who ran that command threw say chat?

DarlD 12-19-2005 23:30

yes like so: say:! Meta
and meta would be the player that is targeted
dont know if you see what i mean....

teame06 12-19-2005 23:35

Code:
 public checktext(id) { // <--id is the person id.

XxAvalanchexX 12-20-2005 02:08

Assuming it is like this:
say ! player command

Code:
 public checktext(id) {     if (!access(id,ADMIN_KICK)         return PLUGIN_HANDLED     // get what they said     new text[64]     read_args(text, 63)     // ignore if it doesn't start with !     if (text[0] != '!')         return PLUGIN_HANDLED     // clear the !     replace(text, 63, "!", "")     // trim it of extra spaces     trim(text)     // get name and data     new name[32], command[32]     strbreak(text, name, 31, command, 31)     // tada     new player = cmd_target(id, name);  }

Assuming it is just:
say ! player

Code:
 public checktext(id) {     if (!access(id,ADMIN_KICK)         return PLUGIN_HANDLED     // get what they said     new text[64]     read_args(text, 63)     // ignore if it doesn't start with !     if (text[0] != '!')         return PLUGIN_HANDLED     // clear the !     replace(text, 63, "!", "")     // trim it of extra spaces     trim(text)     // tada     new player = cmd_target(id, text);  }


All times are GMT -4. The time now is 16:02.

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