Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onPlayerDisconnect(playerid, reason)
- {
- if (Logged[playerid] == 1)
- {
- local Date = date();
- if((Date["min"] - tCMin[playerid]) < 0)
- {
- local rMin2;
- /*tCMin = 58
- Data["min"] = 10
- rmin1 = 60+(Data["min"] - tCMin)-(60-tCMin) = -49;
- rmin1 = 60-48-2=10
- rmin2 = 60 - tCMin = 60 - 59 = 1
- rminf = 60+rmin1-rmin2 = 60-49-1 = 11-1 = 10
- tCMin = 55;
- Data["min"] = 10;
- fmin = 60+(-45) = 15
- 5-59 = -54
- 60 - tCMin = 1
- rminf = 60+rmi
- rMin2 = (60 - tCMin[i]*/
- rMin2 = 60+(Data["min"]-tCMin[playerid]);
- tMins[playerid] = (tMins[playerid]+rMin2);
- }else tMins[playerid] = (tMins[playerid]+(Date["min"]-tCMin[playerid]));
- if(tMins[playerid] >= 60)
- {
- tHours[playerid] = (tHours[playerid]+1);
- tMins[playerid] = (tMins[playerid]-60);
- }
- sql.query("UPDATE `ivmp` SET `skin` ="+ pSkin[playerid] +", `money`="+getPlayerMoney(playerid)+", `tMins`="+tMins[playerid]+", `tHours`="+tHours[playerid]+" WHERE `username` = '"+getPlayerName(playerid)+"' LIMIT 1");
- }
- Admin[playerid] = 0;
- Logged[playerid] = 0;
- Mute[playerid] = 0;
- goto[playerid] = 1;
- pSkin[playerid] = 0;
- tVerificat[playerid] = 0;
- tHours[playerid] = 0;
- tMins[playerid] = 0;
- return 1;
- }
- addEvent("playerDisconnect", onPlayerDisconnect);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement