start some and finish after few days..
#1

hello, i want to do a prizes system of the player can to win a Anti Bike Fall for 3 days, there is any way to do this without timer? leave the anti fall, i will do this. but i want it to end after 3 days.

PHP код:
dini_IntSet(File(playerid),"AntiFall",1)// i want it will automatically set to 0 after 3 days 
// i want it will automatically set to 0 after 3 days, can someone give me an example how to do this?
Reply
#2

u need a msql system :/
Reply
#3

its easy if you will not use Days.
Reply
#4

it is a whole looping with server info thing, he cannot use regular methods of saving 2 do this
Reply
#5

You need to use UNIX (POSIX) Timestamps, check more information about it here https://sampforum.blast.hk/showthread.php?tid=254915
Reply
#6

1.Use a timer,not recomanded.
2.If you have a 'time system' on server,like weather change every hour..make +1 at every hour and when you got 72,you got 3 days,it`s just an ideea..
Reply
#7

i found this:

PHP код:
stock DaysBetweenDates(DateStart[], DateEnd[]) // by SharkyKH
{
    new 
datetmp[256], idx1idx2;
    
    
datetmp strtok(DateStartidx1'.');
    new 
Start_Day strval(datetmp);
    
datetmp strtok(DateStartidx1'.');
    new 
Start_Month strval(datetmp);
    
datetmp strtok(DateStartidx1'.');
    new 
Start_Year strval(datetmp);
    
    
datetmp strtok(DateEndidx2'.');
    new 
End_Day strval(datetmp);
    
datetmp strtok(DateEndidx2'.');
    new 
End_Month strval(datetmp);
    
datetmp strtok(DateEndidx2'.');
    new 
End_Year strval(datetmp);
    
    new 
init_date mktime(12,0,0,Start_Day,Start_Month,Start_Year);
    new 
dest_date mktime(12,0,0,End_Day,End_Month,End_Year);
    
    new 
offset dest_date-init_date;
    
    new 
days floatround(offset/60/60/24floatround_floor);
    return 
days;

with this i can do this too? because i don't understand the unix timestamp.. if i can do it with this function, can you give me an example how to do this?
Reply
#8

someone??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)