AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Command, start loop (https://forums.alliedmods.net/showthread.php?t=22797)

Obbin 01-04-2006 04:58

Command, start loop
 
I'm reposting this, i thought i fixed it but i didn't.
here is what it should do:


Admin uses a command like amx_test to choose a player. ex amx_test obbin (the admin can't choose himself)

then a loop starts that makes everybody say teir #id (the id that appear when you type status in console) like "say my id is: #1".

The one that executed the command (the admin) and the one that was choosen by the command (The choosen) should not say anything.



Hope you understood this mess :wink:

PM 01-04-2006 06:48

Try:
Code:
public command_handler(id) {    // I don't do any access checking because I don't know whether you want it    new arg[32]    read_argv(1,arg,31)    new player = cmd_target(id,arg,1)  // 1 = obey immunity, no idea whether you want that though    if (!player)       return PLUGIN_HANDLED    for (new i = 1; i <= 32; ++i)    {       if (is_user_connected(i) && i != id && i != player)          client_cmd(i, "say my id is %d", get_user_userid(i));    } }

Or something like that

Obbin 01-04-2006 07:10

Thx PM that worked :)


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

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