Raised This Month: $51 Target: $400
 12% 

Day Function


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CeDeee
Member
Join Date: Dec 2011
Old 05-31-2012 , 10:01   Day Function
Reply With Quote #1

get_day function is not?

PHP Code:
new day
get_day 
(%dday32)

client_print (idprint_chat"Day:%d"day
CeDeee is offline
GordonFreeman (RU)
Veteran Member
Join Date: Jan 2010
Location: Uzbekistan
Old 05-31-2012 , 10:04   Re: Day Function
Reply With Quote #2

Code:
new day,sday[5] get_time("%d",sday,4) day = str_to_num(sday)
__________________
The functional way is the right way
GordonFreeman (RU) is offline
CeDeee
Member
Join Date: Dec 2011
Old 05-31-2012 , 10:09   Re: Day Function
Reply With Quote #3

Day : 51 ? what?
example:
Day: Monday
CeDeee is offline
GordonFreeman (RU)
Veteran Member
Join Date: Jan 2010
Location: Uzbekistan
Old 05-31-2012 , 10:27   Re: Day Function
Reply With Quote #4

51? LOL
i dont know how to get current day name, only current day number
__________________
The functional way is the right way
GordonFreeman (RU) is offline
CeDeee
Member
Join Date: Dec 2011
Old 05-31-2012 , 12:20   Re: Day Function
Reply With Quote #5

CeDeee is offline
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 05-31-2012 , 12:24   Re: Day Function
Reply With Quote #6

Try this:
Code:
new CurrentTime[9] get_time("%A",CurrentTime,8) client_print(0,3,"Day: %s",CurrentTime)
__________________
kiki33hun is offline
CeDeee
Member
Join Date: Dec 2011
Old 05-31-2012 , 13:18   Re: Day Function
Reply With Quote #7

Köszi Kiki ez lesz! És ezt h lehet magyarositani?ezt valami lang. fájlból olvassa ki vagy honnan?
CeDeee is offline
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 05-31-2012 , 13:36   Re: Day Function
Reply With Quote #8

Nem sajnos, vagyis talán külön függvényként meglehet írni!
Indoklás:
Code:
static cell AMX_NATIVE_CALL get_time(AMX *amx, cell *params) 
{
	int ilen;
	char* sptemp = get_amxstring(amx, params[1], 0, ilen);
	time_t td = time(NULL);
	tm* lt = localtime(&td);
	
	char szDate[512];
	strftime(szDate, 511, sptemp, lt);
	
	return set_amxstring(amx, params[2], szDate, params[3]);
}
Ittis strftime c++ funkcióval kéri le, csak átvan írva pawn függvényre. Amúgy ha nagyon érdekel:http://www.cplusplus.com/reference/c...time/strftime/, hogy ezt átlehet e írni magyarra jó kérdés, biztos átlehet de sok munka kell hozzá, mert még a time függvényekhez is megvannak hívva függvények mégpedig így néz ki:
Code:
#ifndef _TIME_H
#define _TIME_H

#include <sys/cdefs.h>
#include <sys/time.h>

__BEGIN_DECLS

extern int __isleap(int year);

int nanosleep(const struct timespec *req, struct timespec *rem) __THROW;

time_t mktime(struct tm *timeptr) __THROW __pure;

char *asctime(const struct tm *timeptr) __THROW;
char *asctime_r(const struct tm *timeptr, char *buf) __THROW;

char *ctime(const time_t *timep) __THROW;

size_t strftime(char *s, size_t max, const char *format, const struct tm *tm) __THROW __attribute__((format(strftime,3,0)));
time_t time(time_t *t) __THROW;

int stime(time_t *t) __THROW;

double difftime(time_t time1, time_t time0) __THROW __attribute__((const));

#define CLOCKS_PER_SEC 1000000l

extern long int timezone;
extern int daylight;
extern char* tzname[2];

void tzset (void) __THROW;

struct tm* localtime(const time_t* t) __THROW;
struct tm* gmtime(const time_t* t) __THROW;
struct tm* localtime_r(const time_t* t, struct tm* r) __THROW;
struct tm* gmtime_r(const time_t* t, struct tm* r) __THROW;

clock_t clock(void);

char *strptime(const char *s, const char *format, struct tm *tm);

#ifdef _GNU_SOURCE
time_t timegm(struct tm *timeptr) __THROW __attribute_dontuse__ __pure ;
time_t timelocal(struct tm *timeptr) __THROW __attribute_dontuse__ __pure;
#endif

__END_DECLS

#endif
De a konstans napokhoz még méllyebre kellene ásni, és külön modulként megírni, egyszerűbb pawn stockként létrehozni
__________________
kiki33hun is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 05-31-2012 , 13:55   Re: Day Function
Reply With Quote #9

English Only please
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
CeDeee
Member
Join Date: Dec 2011
Old 05-31-2012 , 14:00   Re: Day Function
Reply With Quote #10

sorry

Last edited by CeDeee; 11-18-2013 at 15:07. Reason: reply only english
CeDeee is offline
Reply



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 02:48.


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