Gettime saving in y_ini... - 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)
+--- Thread: Gettime saving in y_ini... (
/showthread.php?tid=472879)
Gettime saving in y_ini... -
Scrillex - 31.10.2013
Hello I need a help with saving get time..
I'm using y_ini saving system.
Write in like this:
pawn Код:
PlayerInfo[playerid][VET] = Gettime();
Or how.. so basically that's my question.
Oh and another question I want to set gettime to 2 days how can I do it...
I have made something like this:
pawn Код:
YCMD:vipstats(playerid, params[],help)
{
new TVT, Days, Hours, Minutes, Msg[200];
TVT = PlayerInfo[playerid][VET] - gettime();//here it will get the time stamp saved in the player variable
if (TVT>= 86400)
{
Days = TotalVipTime / 86400;
TVT= TVT- (Days * 86400);//here it calculates the days
}
if (TVT>= 3600)
{
Hours = TotalVipTime / 3600;
TVT = TVT- (Hours * 3600);//calculates the seconds
}
if (TVT >= 60)
{
Minutes = TVT / 60;
TVT = TVT - (Minutes * 60);//calculates the minutes
}
format(Msg, 200, "{00CED1}Remaining Vip: {FFFFFF}Days: {00A400}%i{FFFFFF}, Hours: {00A400}%i{FFFFFF}, Minutes: {00A400}%i{FFFFFF}\n", Days, Hours, Minutes);
SendClientMessage(playerid,-1,Msg);
return 1;
)