Guest User

Untitled

a guest
Jun 24th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. CMD:house(playerid, params[], help) {
  2. new option[9],
  3. k = PlayerInfo[playerid][pKuca];
  4. if(sscanf(params, "s[9]", option))
  5. {
  6. SCM(playerid, COLOR_GREY, "Koriscenje: /house [Opcija]");
  7. SendClientMessage(playerid, -1, "Opcije: sefinfo, lock, sell");
  8. SendClientMessage(playerid, -1, "Opcije: locate, sellto, accept");
  9. SendClientMessage(playerid, -1, "Opcije: putgun, takegun, putmats, takemats");
  10. SendClientMessage(playerid, -1, "Opcije: putdrugs, takedrugs, putmoney, takemoney");
  11. return 1;
  12. }
  13. if(strcmp(option, "putmoney", true) == 0) {
  14. if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY,"Niste prijavljeni ili ste mrtvi!");
  15. new i, iznos,string[256];
  16. if(PlayerInfo[playerid][pKuca] == 0) return SCM(playerid, COLOR_GREY, "Ne posedujete kucu!");
  17. if(!IsPlayerInRangeOfPoint(playerid, 15.0, KucaInfo[k][kIzlazX], KucaInfo[k][kIzlazY], KucaInfo[k][kIzlazZ])) return SCM(playerid,COLOR_GREY, "Ne mozete koristiti ovu komandu jer niste u svojoj kuci.");
  18. if(sscanf(params, "id", i, iznos)) return SCM(playerid,COLOR_GREY,"Koriscenje: /house putmoney [kolicina]");
  19. if(iznos > GetPlayerCash(playerid)) return SCM(playerid,COLOR_GREY,"Nemate toliko novca!");
  20. if(iznos < 1 || iznos > 50000) return SCM(playerid,COLOR_GREY,"Ne mozete staviti manje od 1 ili vise od 50000$ u kucu.");
  21. KucaInfo[k][kNovac] += iznos; GivePlayerCash(playerid, -iznos); SacuvajKucu(k);
  22. format(string, sizeof(string), "INFO: Ostavili ste $%d u vasu kucu.", iznos);
  23. SendClientMessage(playerid,-1, string);
  24. }
  25. else if(strcmp(option, "takemoney", true) == 0) {
  26. if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY,"Niste prijavljeni ili ste mrtvi!");
  27. new iznos,string[256];
  28. if(PlayerInfo[playerid][pKuca] == 0) return SCM(playerid, COLOR_GREY, "Ne posedujete kucu!");
  29. if(!IsPlayerInRangeOfPoint(playerid, 15.0, KucaInfo[k][kIzlazX], KucaInfo[k][kIzlazY], KucaInfo[k][kIzlazZ])) return SCM(playerid,COLOR_GREY, "Ne mozete koristiti ovu komandu jer niste u svojoj kuci.");
  30. if(sscanf(params, "d", iznos)) return SCM(playerid,COLOR_GREY,"Koriscenje: /house takemoney [kolicina]");
  31. if(iznos > KucaInfo[k][kNovac]) return SendClientMessage(playerid, COLOR_GREY, "Nemate toliko novca u kuci!");
  32. if(iznos < 1 || iznos > 50000) return SCM(playerid,COLOR_GREY,"Ne mozete uzeti manje od 1 ili vise od 50000$ iz kuce.");
  33. KucaInfo[k][kNovac] -= iznos; GivePlayerCash(playerid, iznos); SacuvajKucu(k);
  34. format(string, sizeof(string), "INFO: Uzeli ste $%d iz vase kuce.", iznos);
  35. SendClientMessage(playerid,0xFFFF00AA, string);
  36. }
  37. return (true);
  38. }
Advertisement
Add Comment
Please, Sign In to add comment