You need to parse the date string manually (break it down until you get "12", "25" and "2011") then you can use those to get numbers with str_to_num().
Also, make sure that if you have a single digit month or day that you prepend it with a zero so that the number is always two characters wide.
Here is one I just came up with for parsing the date string:
test "12252011"
PHP Code:
#include <amxmodx>
public plugin_init()
{
register_plugin("Plugin", "0.1", "Author")
register_concmd("test", "cmdTest")
}
public cmdTest(id)
{
new szDate[32], szNum[6]
read_argv(1, szDate, charsmax(szDate))
formatex(szNum, 2, "%c%c", szDate[0], szDate[1])
new month = str_to_num(szNum)
formatex(szNum, 2, "%c%c", szDate[2], szDate[3])
new day = str_to_num(szNum)
formatex(szNum, 4, "%c%c%c%c", szDate[4], szDate[5], szDate[6], szDate[7])
new year = str_to_num(szNum)
server_print("Date: %d/%d/%d", month, day, year)
}
__________________