Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Sa-Mp Include Days
- *
- * (c) by Kaliber, 2012
- *
- */
- #include <a_samp>
- static ERROR_MSG[16] = "ERROR";
- enum d_day {
- day_s[16]
- };
- new DayInfo[8][d_day] = {
- {"\0"},{"Montag"},{"Dienstag"},{"Mittwoch"},{"Donnerstag"},{"Freitag"},{"Samstag"},{"Sonntag"}
- };
- stock GetDay()
- {
- new y, m, d, var, i=1;
- getdate(y,m,d);
- var = Get_Var(y,m);
- for(; i!=31; i++) {
- if(i != d) var++;
- if(var == 8) var = 1;
- if(i == d) return DayInfo[var];
- }
- return ERROR_MSG;
- }
- stock Get_Var(y,m)
- {
- new x;
- if(y == 2012) {
- switch(m) {
- case 1: x=7; case 2: x=3; case 3: x=4; case 4: x=7; case 5: x=2; case 6: x=5; case 7: x=6;
- case 8: x=3; case 9: x=6; case 10: x=1; case 11: x=4; case 12: x=6;
- }
- }
- else if(y == 2013){
- switch(m) {
- case 1: x=2; case 2: x=5; case 3: x=5; case 4: x=1; case 5: x=3; case 6: x=6; case 7: x=1;
- case 8: x=4; case 9: x=7; case 10: x=2; case 11: x=4; case 12: x=7;
- }
- }
- return x;
- }
Advertisement
Add Comment
Please, Sign In to add comment