CMD:guns(playerid,params[])
{
GivePlayerWeapon(playerid, 30, 200);
GivePlayerWeapon(playerid, 26, 200);
GivePlayerWeapon(playerid, 24, 200);
}
CMD:guns(playerid,params[])
{
//if it's the week-end
GivePlayerWeapon(playerid, 30, 400);
GivePlayerWeapon(playerid, 26, 400);
GivePlayerWeapon(playerid, 24, 400);
}
new day, month, year; getdate(day, month year);
if(day == (saturday etc...)
you can make something like this
pawn Код:
|
CMD:guns(playerid,params[])
{
new day, month, year; getdate(day, month year);
if(day == (saturday)
{
GivePlayerWeapon(playerid, 30, 400);
GivePlayerWeapon(playerid, 26, 400);
GivePlayerWeapon(playerid, 24, 400);
return 1;
}
if(day == (sunday)
{
GivePlayerWeapon(playerid, 30, 400);
GivePlayerWeapon(playerid, 26, 400);
GivePlayerWeapon(playerid, 24, 400);
return 1;
}
else
{
GivePlayerWeapon(playerid, 30, 200);
GivePlayerWeapon(playerid, 26, 200);
GivePlayerWeapon(playerid, 24, 200);
return 1;
}
}
error 017: undefined symbol "saturday" error 017: undefined symbol "sunday"
new days = getdate(); new day, year, month; getdate(year, month, day);
if(day == days/7) // If day is tuesday since 1 jan 2013 was a tuesday
GetDayName(name[])
{
new tmp,day,name[10];
getdate(day,tmp,tmp);
if(day==1)format(name,sizeof(name),"Monday");
if(day==2)format(name,sizeof(name),"Tuesday");
if(day==3)format(name,sizeof(name),"Wednesday");
if(day==4)format(name,sizeof(name),"Thursday");
if(day==5)format(name,sizeof(name),"Friday");
if(day==6)format(name,sizeof(name),"Saturday");
if(day==7)format(name,sizeof(name),"Sunday");
}
CMD:guns(playerid,params[])
{
new day;
day = GetDayToday();
if(day == SATURDAY || day == SUNDAY)
{
GivePlayerWeapon(playerid, 30, 400);
GivePlayerWeapon(playerid, 26, 400);
GivePlayerWeapon(playerid, 24, 400);
}
else
{
GivePlayerWeapon(playerid, 30, 200);
GivePlayerWeapon(playerid, 26, 200);
GivePlayerWeapon(playerid, 24, 200);
}
return 1;
}
I'm not really sure, that i know how to use it, can you explain mroe or show me a helpful topic?
|
new day, month year;
getdate(day, month, year);
if(day == 18) //today that is saturday - 18 - may
{
//code
}