Advertisement
Sem_Loreann

Untitled

Mar 16th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. stock bool:GivePlayerExp(playerid)
  2. {
  3. if(PlayerInfo[playerid][pExp] >= PlayerInfo[playerid][pLevel]*4)
  4. {
  5. SendClientMessage(playerid, c_ARGON, "Поздравляем, вы повысили свой уровень.");
  6. PlayerInfo[playerid][pLevel]++;
  7. PlayerInfo[playerid][pExp] = 0;
  8. SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
  9. if(PlayerInfo[playerid][pExp] == 24)
  10. {
  11. int PIN[24];
  12. mysql_format(MySQL, mquery, 144, "SELECT * FROM "TABLE_ACCOUNT" WHERE ID = '%i' LIMIT 1", PlayerInfo[playerid][pInvited]);
  13. int Cache:result = mysql_query(MySQL, mquery, true);
  14. if(cache_num_rows() > 0) cache_get_value_index(0, 1, PIN, 24);
  15. cache_delete(result);
  16. int Player = GetPlayerOnline(PIN);
  17. if(Player != INVALID_PLAYER_ID) GiveMoney(Player, 50000);
  18. else
  19. {
  20. mysql_format(MySQL, mquery, sizeof(mquery), "UPDATE "TABLE_ACCOUNT" SET `Cash` = `Cash` + '50000' WHERE `ID` = '%e'", PlayerInfo[playerid][pInvited]);
  21. mysql_tquery(MySQL, mquery, "", "");
  22. }
  23. SetTax(playerid, -50000, 0);
  24. }
  25. }
  26. return true;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement