Raised This Month: $32 Target: $400
 8% 

Reporting blank in logs?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BigBaller
Veteran Member
Join Date: Mar 2004
Location: Everett, WA
Old 11-25-2007 , 04:29   Reporting blank in logs?
Reply With Quote #1

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)
__________________


Last edited by BigBaller; 11-25-2007 at 04:41. Reason: woot figured it out. Sorry this could be locked if need be!
BigBaller is offline
Old 11-25-2007, 04:37
[ --<-@ ] Black Rose
This message has been deleted by [ --<-@ ] Black Rose. Reason: Yes, of course.
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-25-2007 , 04:40   Re: Reporting blank in logs?
Reply With Quote #2

I don't understand well what you ask but 'get_playersnum()' return an integer.

So it should be ' %i ', not ' %s '.
__________________
Arkshine is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:43.


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