Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. ЗА МЕСТО КОМАНДЫ /giverub
  2. CMD:giverub(playerid, params[])
  3. {
  4. if(!IsPlayerAdmin(playerid)) return true;
  5. new name[24], count_rub, string[100];
  6. if(sscanf(params, "s[24]d",name, count_rub)) return SendClientMessage(playerid, COLOR_WHITE, "• {FFC800}[Подсказка] {ffffff} /giverub [НИК] [КОЛ-ВО РУБЛЕЙ]");
  7. new player_id = INVALID_PLAYER_ID;
  8. sscanf(name, "i", player_id);
  9. mysql_format(connects, string, sizeof(string), "SELECT * FROM `accounts` WHERE `Name`= '%s'", name);
  10. mysql_tquery(connects, string, "GiveOffDonate", "dsdd",playerid,name,count_rub, player_id);
  11. return true;
  12. }
  13. В КОНЕЦ МОДА
  14. publics: GiveOffDonate(playerid,name[], rub, tmpid)
  15. {
  16. new string[384];
  17. new rows,fields;
  18. cache_get_data(rows, fields);
  19. if(!rows)
  20. {
  21. SCMF(playerid, COLOR_BLUE, "Аккаунт %s не существует", name);
  22. }
  23. else
  24. {
  25. SCMF(playerid, COLOR_BLUE, "Выданы рубли игроку %s", name);
  26. if(tmpid != -1)
  27. {
  28. SCM(tmpid, COLOR_BLUE, "Вам выданы рубли. Перезайдите на сервер для их получения.");
  29. }
  30. mysql_format(connects, string, MAX_SQL, "UPDATE `accounts` SET `pRub`= `pRub` + '%d' WHERE `Name`='%s'",rub, name);
  31. mysql_empty(connects, string);
  32. return false;
  33. }
  34. return true;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement