AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Reporting blank in logs? (https://forums.alliedmods.net/showthread.php?t=63593)

BigBaller 11-25-2007 04:29

Reporting blank in logs?
 
Code:
    set_task(30.0, "currPlayCount") } public currPlayCount() {     new currentCSPlayers = get_playersnum(1)     log_amx("Amount of players or conecting players on the server currently is %s", currentCSPlayers) // Logs the current amount of players or connecting players on the server now. }

I know im doing this wrong somewhere, I am having a huge brain fart. I think it needs to be in a array but im lost.

get_playersnum(1) is suppose to return a native ? 1 i know returns players that are connecting also.

I figured out that I had to convert it into a string. so I added the following things into that snippet above and the log_amx function finally logged a number instead of a blank!

new currPlayerCount[3]

num_to_str(currentCSPlayers, currPlayerCount, 2)

Arkshine 11-25-2007 04:40

Re: Reporting blank in logs?
 
I don't understand well what you ask but 'get_playersnum()' return an integer.

So it should be ' %i ', not ' %s '.


All times are GMT -4. The time now is 01:18.

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