about time and pickup icon. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: about time and pickup icon. (
/showthread.php?tid=113149)
about time and pickup icon. -
arachimi - 12.12.2009
I want to get pickup icon show every 6 o'clock and disappear 8 o'clock for every day.
what it's possible.
Re: about time and pickup icon. -
miokie - 12.12.2009
Top of Script:
pawn Код:
new PickupShown;
new thepickup;
OnGameModeInit
pawn Код:
SetTimer("CheckTime",1000,1);
Anywhere:
pawn Код:
public CheckTime()
{
new h,m,s;
gettime(h,m,s);
if(h == 6 && m = 0 && s = 0)
{
if(PickupShown == 0)
{
thepickup=CreatePickup(...);
PickupShown = 1;
}
}
if(h == 8 && m = 0 && s = 0)
{
if(PickupShown == 1)
{
DestroyPickup(thepickup);
PickupShown = 0;
}
}
return 1;
}
It's untested but in theory, It will work.
Re: about time and pickup icon. -
DJDhan - 12.12.2009
Well yes it is possible.
If you have world time set,you can use GetPlayerTime(playerid,&hours,&minutes)
and when hours=6 and min=00 you can use "Pickupname"= CreatePickUp(modelid,type,X,Y,Z,virtualworld) and then check on hour=8 and min=00
DestroyPickUp("Pickupname")
You are at liberty to choose the pickup name!
Hope i helped
Re: about time and pickup icon. -
arachimi - 12.12.2009
if now 23 o'clock adn I want to disappear icon at 1(am)o'clock
how I set Hour.
Thank's sir.
Re: about time and pickup icon. -
miokie - 12.12.2009
Quote:
Originally Posted by arachimi
if now 23 o'clock adn I want to disappear icon at 1(am)o'clock
how I set Hour.
Thank's sir.
|
Top of script
pawn Код:
#define APPEAR_TIME 6 //This is the time it will appear, Change this number to what time you want it to appear at
#define DISAPPEAR_TIME 8 //Change this to what time you want it to dissapear.
So you want it to be:
pawn Код:
#define APPEAR_TIME 23
#define DISAPPEAR_TIME 1
pawn Код:
public CheckTime()
{
new h,m,s;
gettime(h,m,s);
if(h == APPEAR_TIME && m = 0 && s = 0)
{
if(PickupShown == 0)
{
thepickup=CreatePickup(...);
PickupShown = 1;
}
}
if(h == DISAPPEAR_TIME && m = 0 && s = 0)
{
if(PickupShown == 1)
{
DestroyPickup(thepickup);
PickupShown = 0;
}
}
return 1;
}
Re: about time and pickup icon. -
arachimi - 12.12.2009
when i use /time it's late for 1 hour. how can i fix it?