Module commit
Module commit.
This commit is contained in:
33
_module/nss/temps_on_load.nss
Normal file
33
_module/nss/temps_on_load.nss
Normal file
@@ -0,0 +1,33 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Temps persistant
|
||||
//:: Par Zyzko
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
// A mettre sur le On Module Load
|
||||
// Paste it on your module load event
|
||||
|
||||
void main()
|
||||
{
|
||||
object oMod=GetModule();
|
||||
int nHour, nDay, nMonth, nYear;
|
||||
if(GetCampaignInt("Dates","TIMEYEAR",oMod))
|
||||
{
|
||||
nHour=GetCampaignInt("Dates","TIMEHOUR",oMod);
|
||||
nDay=GetCampaignInt("Dates","TIMEDAY",oMod);
|
||||
nMonth=GetCampaignInt("Dates","TIMEMONTH",oMod);
|
||||
nYear=GetCampaignInt("Dates","TIMEYEAR",oMod);
|
||||
SetLocalInt(oMod,"HourStart", nHour);
|
||||
SetLocalInt(oMod,"DayStart", nDay);
|
||||
SetLocalInt(oMod,"MonthStart", nMonth);
|
||||
SetLocalInt(oMod,"YearStart", nYear);
|
||||
SetCalendar(nYear, nMonth, nDay);
|
||||
SetTime(nHour, 0, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLocalInt(oMod,"HourStart", GetTimeHour());
|
||||
SetLocalInt(oMod,"DayStart", GetCalendarDay());
|
||||
SetLocalInt(oMod,"MonthStart", GetCalendarMonth());
|
||||
SetLocalInt(oMod,"YearStart", GetCalendarYear());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user