How can ?
#1

How can i make a system , when you have a driving license , license expire in 21 days (3week)
i try
create at pInfo pCarLicTime , when player take a driving license i set PlayerInfo[playerid][pCarLicTime] = 1814400; and at /licenses i try
Код:
if(PlayerInfo[playerid][pCarLicTime] == 0)
		        {
		            SendClientMessage(playerid, COLOR_GREY, "Drivers License: Not passed");
		        }
		        else
		        {
		        new timelicd = PlayerInfo[playerid][pCarLicTime] /60/60/24 ;
		        new timelico = PlayerInfo[playerid][pCarLicTime] /60/60 ;
		        new timelicm = PlayerInfo[playerid][pCarLicTime] /60 ;
		            format(string, sizeof(string), "Drivers License Passed for: %d days or %d hours or %d minutes!.", timelicd,timelico,timelicm);
              		SendClientMessage(playerid, COLOR_GREY, string);
		        }
This is ok but how can i create timer for this? but driving license is on 21 days ( 1814400 seconds)
Please help me
Reply
#2

Hello,
Timmers are useless here, because they will deduct value of your var only when player is online.

If player stats saves in *.ini, you can do sth like this.

When player buys licence, do something like this:
pawn Код:
...
new Date[3];
GetDate(Date[2], Date[1], Date[0]);
..
Date[2] - Year
Date[1] - Month
Date[0] - Day

Okay, so now you know, when player bought this licence.
For eg, 2012.06.21

Good. If you have enum, add there variable:
pawn Код:
enum something
{
...
eDateD,
eDateM,
eDateY
..
}
Player[MAX_PLAYERS][something];
And
pawn Код:
Player[playerid][eDateD] = Date[0];
Player[playerid][eDateM] = Date[1];
Player[playerid][eDateY] = Date[2];
So variables from enumelator will assign values of Month, Year and Day when player bought licence.
All you need to do now, is to somehow save these values, and make scrpit which will calculate an exact
date which will be after 21 days. You need to think a bit, cuz if you simply add this 21 days to current day,
server will have such info:
Код:
Server: Ohh, damn, I've to remove his licence in 42.06.2012?? Oh ma god.. -,-
Such day doesnt exists, does it?

I had script which calculates such things on my old PC (cuz I did same thing like you on my own, W/O any support ^^).

If you do this script, you can make in same way as eDate's xDate's, which will be assigned with values of date, when server must remove player license.

Understand anything? xD

Good luck!
Greetz,
Lets

Reply
#3

GetDate undefine symbol why?
Reply
#4

pawn Код:
getdate(year,month,day)
Small letters, sorry

Gretz,
LetsOWN
Reply
#5

you can help me with team viewer ?I have skype : zyghy.mu , yahoo i`m: cubase.samp
Reply
#6

Up!I urgently needed please help
Reply
#7

Up!I urgently needed please help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)