Advertisement
VanGans

FS Voucher

Jul 18th, 2020
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. CMD:setcode(playerid, params[])
  2. {
  3. new code;
  4. new money, score;
  5.  
  6. if(sscanf(params, "ddd", code, money, score))
  7. {
  8. return SendClientMessage(playerid, COLOR_GREY, "USAGE: /setcode (code) (money) (score) ");
  9. }
  10.  
  11. if(IsPlayerAdmin(playerid))
  12. {
  13. format(fstring, sizeof(fstring), VOUCHER_FILE, code);
  14. if(dini_Exists(fstring)) return SendClientMessage(playerid, COLOR_GREY, "ERROR: Voucher Code ini sudah ada, dan tidak bisa di buat kembali dengan code yang sama.");
  15. dini_Create(fstring);
  16. dini_IntSet(fstring, "Uang", money);
  17. dini_IntSet(fstring, "Scoree", score);
  18. format(nstring, sizeof(nstring), "SUCCES: Code '%d' Berhasil di buat.", code);
  19. SendClientMessage(playerid, COLOR_GREY, nstring);
  20. }
  21. else SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
  22. return 1;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement