[STOCK] NumberToMonth

For scripting examples for learning how to use AMXX.
User avatar
Archive-Poster
Posts: 1327
Gender:
United States of America

[STOCK] NumberToMonth

Post by Archive-Poster »

NumberToMonth(number)
Return number to month!

Code: Select all

stock NumberToMonth(number)
{
        new ertek[11]
        switch(number)
        {
            case 1: ertek = "January";
            case 2: ertek = "February";
            case 3: ertek = "March";
            case 4: ertek = "April";
            case 5: ertek = "May";
            case 6: ertek = "June";
            case 7: ertek = "July";
            case 8: ertek = "August";
            case 9: ertek = "September";
            case 10: ertek = "October";
            case 11: ertek = "November";
            case 12: ertek = "December";
            default: ertek = "Invalid";
        }
        return ertek
} 
Example plugin:

Code: Select all

#include <amxmodx>
#include <numbertomonth>

#define PLUGIN    "Test"
#define AUTHOR    "Kiki33"
#define VERSION    "1.0"

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("say /test", "testfgv")
}

public testfgv(id)
{    
    if(is_user_connected(id))
    {
        new year, month, day;
        date(year, month, day);
        client_print(id, print_chat, "Current year:%d, Current month:%s, Current Day:%d", year, NumberToMonth(month), day)
    }
} 
Attachments
numbertomonth.inc.zip
(410 Bytes) Downloaded 4 times

Who is online

Users browsing this forum: No registered users and 1 guest