Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. function onPlayerDisconnect(playerid, reason)
  2. {
  3. if (Logged[playerid] == 1)
  4. {
  5. local Date = date();
  6. if((Date["min"] - tCMin[playerid]) < 0)
  7. {
  8. local rMin2;
  9. /*tCMin = 58
  10. Data["min"] = 10
  11. rmin1 = 60+(Data["min"] - tCMin)-(60-tCMin) = -49;
  12. rmin1 = 60-48-2=10
  13. rmin2 = 60 - tCMin = 60 - 59 = 1
  14. rminf = 60+rmin1-rmin2 = 60-49-1 = 11-1 = 10
  15.  
  16. tCMin = 55;
  17. Data["min"] = 10;
  18. fmin = 60+(-45) = 15
  19.  
  20.  
  21. 5-59 = -54
  22. 60 - tCMin = 1
  23. rminf = 60+rmi
  24. rMin2 = (60 - tCMin[i]*/
  25. rMin2 = 60+(Data["min"]-tCMin[playerid]);
  26. tMins[playerid] = (tMins[playerid]+rMin2);
  27.  
  28. }else tMins[playerid] = (tMins[playerid]+(Date["min"]-tCMin[playerid]));
  29. if(tMins[playerid] >= 60)
  30. {
  31. tHours[playerid] = (tHours[playerid]+1);
  32. tMins[playerid] = (tMins[playerid]-60);
  33. }
  34. sql.query("UPDATE `ivmp` SET `skin` ="+ pSkin[playerid] +", `money`="+getPlayerMoney(playerid)+", `tMins`="+tMins[playerid]+", `tHours`="+tHours[playerid]+" WHERE `username` = '"+getPlayerName(playerid)+"' LIMIT 1");
  35. }
  36. Admin[playerid] = 0;
  37. Logged[playerid] = 0;
  38. Mute[playerid] = 0;
  39. goto[playerid] = 1;
  40. pSkin[playerid] = 0;
  41. tVerificat[playerid] = 0;
  42. tHours[playerid] = 0;
  43. tMins[playerid] = 0;
  44. return 1;
  45. }
  46. addEvent("playerDisconnect", onPlayerDisconnect);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement