28.06.2013, 10:45
Hi,
1. I want to make with sscanf command, you can input 10 time intervals like: HH:MM, HH:MM ...
But how to get is player wrote right format? not like: qwe, lasds, trt, asdas, sdasd, but hours and minutes: HH:MM .
2.
And for player don't need to write exatly 10 intervals.. he can input just 5 HH:MM, HH:MM,HH:MM, HH:MM,HH:MM . Or how much he want, but no more than 10. In my sscanf, i do it right? because if i check TIMEINTERVALS string if it will be empty (with strcmp), then player don't write more intervals right?
1. I want to make with sscanf command, you can input 10 time intervals like: HH:MM, HH:MM ...
But how to get is player wrote right format? not like: qwe, lasds, trt, asdas, sdasd, but hours and minutes: HH:MM .
2.
Код:
new TIMEINTERVALS[ 10 ][ 10 ]; if(sscanf(params, "S[empty]S[empty]S[empty]S[empty]S[empty]S[empty]S[empty]S[empty]S[empty]S[empty]", TIMEINTERVALS[ 0 ],TIMEINTERVALS[ 1 ],TIMEINTERVALS[ 2 ],TIMEINTERVALS[ 3 ],TIMEINTERVALS[ 4 ],TIMEINTERVALS[ 5 ],TIMEINTERVALS[ 6 ], TIMEINTERVALS[ 7 ],TIMEINTERVALS[ 8 ],TIMEINTERVALS[ 9 ] );