AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Why it doesn't show timeleft? (https://forums.alliedmods.net/showthread.php?t=170887)

Evaldas.Grigas 10-30-2011 03:51

Why it doesn't show timeleft?
 
Read title. It shows name not timeleft. And shows a letter befor name.
PHP Code:

public print(id)
{
    new 
date[32]
    new 
map[33]
    new 
szName[33]
    new 
MyInt get_timeleft()
    
    
get_user_name(idszNamecharsmax(szName)) 
    
get_mapname (map32
    
get_time("%d.%m.%Y"date31)
    
    
client_print(idprint_chat"Your name: %s. Map: %s. Date: %s. Timeleft: %s"szNamemapdateMyInt)



Backstabnoob 10-30-2011 06:23

Re: Why it doesn't show timeleft?
 
It's an integer, not a string.

%s - string
%d - integer
%f - floats
...

You cannot use strings for everything.

Evaldas.Grigas 10-30-2011 06:32

Re: Why it doesn't show timeleft?
 
What I must use to display time? And it would be increasing? It still doesn't work.

Backstabnoob 10-30-2011 07:40

Re: Why it doesn't show timeleft?
 
Timeleft: %d

Evaldas.Grigas 10-30-2011 08:03

Re: Why it doesn't show timeleft?
 
Time?
P.S. Timeleft not working: [IMG]http://img402.**************/img402/8134/unledejh.png[/IMG]

It shows timeleft in seconds, how to make it show example: 6:26?

EDIT: Done it:
PHP Code:

new get_timeleft()
show_hudmessage(id"Timeleft: %d:%02d", (60), (60)) 

[IMG]http://**************/photo/my-images/402/unledejh.png/[/IMG]


All times are GMT -4. The time now is 14:23.

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