Advertisement
gkkahjfhaf

Untitled

Jun 10th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. enum E_PLAYER_DATA {
  2. p_xp
  3. }
  4.  
  5. public OnGameModeInit()
  6. {
  7. SetTimer("XP", 60000, true);
  8. }
  9.  
  10. public OnPlayerConnect(playerid)
  11. {
  12. new ORM: ormid = P[playerid][_p_ormid] = orm_create("accounts");
  13. orm_addvar_int(ormid, P[playerid][p_xp], "Xp");
  14. orm_setkey(ormid, "Name");
  15. orm_select(ormid, "OnMySQL_SelectAccount", "d", playerid);
  16. return 1;
  17. }
  18.  
  19. public OnPlayerSpawn(playerid)
  20. {
  21. SetPlayerScore(playerid, P[playerid][p_xp]);
  22. }
  23.  
  24. forward XP();
  25. public XP()
  26.  
  27. {
  28. for ( new i = 0; i <= GetPlayerPoolSize(); i ++ )
  29. {
  30. if ( !IsPlayerConnected( i ) )
  31. continue;
  32. SetPlayerScore( i, GetPlayerScore( i ) + 1);
  33. }
  34.  
  35. return true;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement