SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 12/12/2009, 02:47 PM   #1
arachimi
Big Clucker
 
Join Date: Jul 2007
Posts: 63
Reputation: 3
Default about time and pickup icon.

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


what it's possible.
arachimi is offline  
Old 12/12/2009, 03:11 PM   #2
miokie
High-roller
 
miokie's Avatar
 
Join Date: Jan 2007
Location: Bedfordshire, England
Posts: 1,148
Reputation: 13
Default Re: about time and pickup icon.

Top of Script:
pawn Code:
new PickupShown;
new thepickup;

OnGameModeInit
pawn Code:
SetTimer("CheckTime",1000,1);

Anywhere:
pawn Code:
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.
__________________
miokie is offline  
Old 12/12/2009, 03:12 PM   #3
DJDhan
High-roller
 
DJDhan's Avatar
 
Join Date: Oct 2009
Location: Canada
Posts: 1,150
Reputation: 6
Default Re: about time and pickup icon.

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
__________________
DJDhan is offline  
Old 12/12/2009, 05:09 PM   #4
arachimi
Big Clucker
 
Join Date: Jul 2007
Posts: 63
Reputation: 3
Default Re: about time and pickup icon.

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


how I set Hour.

Thank's sir.
arachimi is offline  
Old 12/12/2009, 05:32 PM   #5
miokie
High-roller
 
miokie's Avatar
 
Join Date: Jan 2007
Location: Bedfordshire, England
Posts: 1,148
Reputation: 13
Default Re: about time and pickup icon.

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 Code:
#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 Code:
#define APPEAR_TIME 23
#define DISAPPEAR_TIME 1

pawn Code:
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;
}
__________________
miokie is offline  
Old 12/12/2009, 06:48 PM   #6
arachimi
Big Clucker
 
Join Date: Jul 2007
Posts: 63
Reputation: 3
Default Re: about time and pickup icon.

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make a pickup show a text only 1 time sobolanux Help Archive 0 05/04/2010 01:15 AM
there is no pickup icon Medzmara Help Archive 3 24/10/2009 10:07 AM
[HELP] How can I get a pickup icon ingame? FreddeN Help Archive 6 05/06/2009 11:41 PM
Place Map Icon On Top Of Pickup ??? Alec24 Help Archive 8 23/03/2009 07:59 PM
Unknown Pickup Icon? ReV. Help Archive 3 20/03/2009 11:29 PM


All times are GMT. The time now is 06:29 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.