Quote:
Originally Posted by SAMURAI16
if you want a function like OnDayExecute( ) (a forward actually), you need to create your own forward wich requires a custom .inc
I made a stock wich returns current day
<!-- Code Here --!>
How to use it:
<!-- More code here --!>
Or example 2, to check if is your required day:
<!-- Moar code here --!>
|
Or I could simply put the bits that I need at the bottom of the code, rather than making it an .INC.
so what you're telling me is I could do..
Code:
#include <sourcemod>
#include <sdktools>
#define MY_PLUGIN_NAME "Sunday Plugin"
#define MY_PLUGIN_VERSION "1.0.0"
#define MY_PLUGIN_AUTHOR "DDRKhat"
public Plugin:myinfo =
{
name = "Sunday Plugin",
author = "DDRKhat",
description = "A plugin that only executes stuff on Sunday!",
version = "1.0",
url = ""
}
public OnPluginStart()
{
return PLUGIN_CONTINUE
}
public example_2()
{
new String:today[16];
fn_GetDay(today);
if(StrEqual(today,"Sunday"))
{
server_print("[SM] Today is Sunday!")
}
}
stock fn_GetDay(String:output[])
{
new String:day[16];
FormatTime(day,sizeof(day),"%A",GetTime());
strcopy(output,sizeof(day),day);
}
__________________