The first of many nub questions...
OK, So I decided i'd write a simple script that would tell me (in console) who is playing on my server... This is what I wrote:
Code:
//Include Files
#include <amxmodx>
//Initializing Function (main)
public plugin_init()
{
register_plugin("FindPlayer", "1.00", "Steve0")
register_concmd("17_Players", "show_players", ADMIN_CHAT, "{NO ARGS}")
}
public show_players()
{
new Players[32]
new playerCount, i, player
new strPlayer[32]
get_players(Players, playerCount)
for (i=0; i<playerCount; i++)
{
player = Players[i]
num_to_str(player, strPlayer[31], 31)
client_print (0, print_console, "The following 1337 players are playing now:")
client_print (0, print_console, strPlayer)
}
PLUGIN_HANDLED
}
And the results are really weird. In console it says:
] 17_Players
The following 1337 players are playing now:
The following 1337 players are playing now:
The following 1337 players are playing now:
The following 1337 players are playing now:
Unknown command: 17_Players
So, can someone give me a hand? I know there is a function for this already, but I want to write my own to learn the language... thought this would be nice and easy to start with, but apparently not. I want the output to look like this:
The following 1337 players are playing now:
id name steam_id
id name steam_id
id name steam_id
id name steam_id
id name steam_id
(The following 1337 players are playing now: inside the loop was put in for debug purposes, i know it shouldn't be there)
Also, I was wondering how anyone could call this command, i tried removing ADMIN_CHAT but i got errors. Thanx
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.
-Friedrich Nietzsche