PDA

View Full Version : need some help :|


snc
10-02-2007, 14:35
Hi im a newbie (as you might see) please help!
what is wrong with this?

public Action:Command_rtime(cilent, args)
{
new String:name[255];
GetClientName(client, name, sizeof(name));
PrintToChatAll(" %s changed roundtime", name);
decl String:rtime[255];
GetCmdArgString(rtime, sizeof(rtime));
ServerCommand("mp_roundtime %s", rtime);
}
as long as I got your attension how can Find out how many players are online (not sourcetv) ?

Thanks!
snc

Nican
10-02-2007, 15:56
I can nothing wrong with that...

It may be giving you warnings because you are using different spaces before each expression, try:

public Action:Command_rtime(cilent, args)
{
//Player names can not be longer than 64 chars
decl String:name[64], String:rtime[255];
GetClientName(client, name, sizeof(name));
GetCmdArgString(rtime, sizeof(rtime));

PrintToChatAll("%s changed roundtime", name);
ServerCommand("mp_roundtime %s", rtime);
}



There is a function called GetClientCount (http://sm.nican132.com/index.php?fastload=show&id=357&), but i am not sure if it detects sourcetv people


I am not sure if this works, but according to http://wiki.alliedmods.net/Format_Class_Functions_%28SourceMod_Scripting %29 you can try using %N to get player name, exemple:
PrintToChatAll("%N changed roundtime", client);

snc
10-03-2007, 09:34
thx, but when i try to complie it says error: 017 undefined symbol "client"
seems to be connected to this
GetClientName(client, name, sizeof(name));

ferret
10-03-2007, 10:45
Typo:

public Action:Command_rtime(cilent, args)

cilent?

bl4nk
10-04-2007, 02:41
He copied the code from the OP and didn't double check for spelling errors. :P

snc
10-04-2007, 08:32
haha, thx!