about time and pickup icon.
#1

I want to get pickup icon show every 6 o'clock and disappear 8 o'clock for every day.


what it's possible.
Reply
#2

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.
Reply
#3

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
Reply
#4

if now 23 o'clock adn I want to disappear icon at 1(am)o'clock


how I set Hour.

Thank's sir.
Reply
#5

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;
}
Reply
#6

when i use /time it's late for 1 hour. how can i fix it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)