- 0
Problema PayDay
-
Similar Content
-
Recently Browsing 0 members
- No registered users viewing this page.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.
Question
NuamNume
Salut, o problema in care mereu cand ma loghez, imi da payday-ul.
COD:
task SecondTimer[1000]() / asta nu stiu daca conteaza dar mna
{
new string[64];
new hour, minute, second, year, month, day;
gettime(hour, minute, second);
getdate(year, month, day);
format(string, sizeof string, "%02d.%02d.%d~N~%02d:%02d:%02d", day, month, year, hour, minute, second);
TextDrawSetString(ServerTimeTD, string);
format(string, sizeof string, "T: ~Y~%d~W~~H~ Q: ~B~%d", GetServerTickRate(), mysql_unprocessed_queries());
TextDrawSetString(ServerInfoTD, string);
return true;
}
ptask SecondPlayerTimer[1000](playerid)
{
if(IsPlayerPaused(playerid) || IsPlayerInRangeOfPoint(playerid, 1.0, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]))
{
PlayerInfo[playerid][pAFKSeconds] ++;
}
else
{
PlayerInfo[playerid][pAFKSeconds] = 0;
}
if(PlayerInfo[playerid][pAFKSeconds] < 10)
{
PlayerInfo[playerid][pSeconds] ++;
}
if(PlayerInfo[playerid][pPayday] <= gettime())
{
SendClientMessage(playerid, 0x00b3b3FF, "---------------------------------------------------------");
SendFormatMessage(playerid, COLOR_WHITE, "Paycheck: $%s, Hours Played: %.2f (%.0f minutes).", FormatNumber(PlayerInfo[playerid][pLevel] * 125), (PlayerInfo[playerid][pSeconds] / 3600), (PlayerInfo[playerid][pSeconds] / 60));
SendClientMessage(playerid, 0x00b3b3FF, "---------------------------------------------------------");
PlayerInfo[playerid][pHours] += (PlayerInfo[playerid][pSeconds] / 3600);
PlayerInfo[playerid][pSeconds] = 0;
PlayerInfo[playerid][pPayday] = (gettime() + 3600);
PlayerInfo[playerid][pRespectPoints] ++;
if(PlayerInfo[playerid][pDrivingLic] > 0)
PlayerInfo[playerid][pDrivingLic] --;
if(PlayerInfo[playerid][pWeaponLic] > 0)
PlayerInfo[playerid][pWeaponLic] --;
if(PlayerInfo[playerid][pBoatLic] > 0)
PlayerInfo[playerid][pBoatLic] --;
if(PlayerInfo[playerid][pFlyLic] > 0)
PlayerInfo[playerid][pFlyLic] --;
if(PlayerInfo[playerid][pDrivingLicS] > 0)
PlayerInfo[playerid][pDrivingLicS] --;
if(PlayerInfo[playerid][pWeaponLicS] > 0)
PlayerInfo[playerid][pWeaponLicS] --;
if(PlayerInfo[playerid][pBoatLicS] > 0)
PlayerInfo[playerid][pBoatLicS] --;
if(PlayerInfo[playerid][pFlyLicS] > 0)
PlayerInfo[playerid][pFlyLicS] --;
GivePlayerMoneyEx(playerid, (PlayerInfo[playerid][pLevel] * 125));
UpdateLevelBar(playerid);
mysqlQuery("UPDATE `users` SET `Hours` = '%f', `Seconds` = '0', `Payday` = '3600', `RespectPoints` = '%d' `Licenses` = '%d|%d|%d|%d|%d|%d|%d|%d' WHERE `ID` = '%d'", PlayerInfo[playerid][pHours], PlayerInfo[playerid][pRespectPoints], PlayerInfo[playerid][pSQLID]);
}
new string[64];
format(string, sizeof string, "Next payday in ~Y~%s", Calculate(PlayerInfo[playerid][pPayday] - gettime()));
PlayerTextDrawSetString(playerid, PaydayPTD[playerid], string);
GetPlayerPos(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]);
return true;
}
9 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now