Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:house(playerid, params[], help) {
- new option[9],
- k = PlayerInfo[playerid][pKuca];
- if(sscanf(params, "s[9]", option))
- {
- SCM(playerid, COLOR_GREY, "Koriscenje: /house [Opcija]");
- SendClientMessage(playerid, -1, "Opcije: sefinfo, lock, sell");
- SendClientMessage(playerid, -1, "Opcije: locate, sellto, accept");
- SendClientMessage(playerid, -1, "Opcije: putgun, takegun, putmats, takemats");
- SendClientMessage(playerid, -1, "Opcije: putdrugs, takedrugs, putmoney, takemoney");
- return 1;
- }
- if(strcmp(option, "putmoney", true) == 0) {
- if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY,"Niste prijavljeni ili ste mrtvi!");
- new i, iznos,string[256];
- if(PlayerInfo[playerid][pKuca] == 0) return SCM(playerid, COLOR_GREY, "Ne posedujete kucu!");
- 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.");
- if(sscanf(params, "id", i, iznos)) return SCM(playerid,COLOR_GREY,"Koriscenje: /house putmoney [kolicina]");
- if(iznos > GetPlayerCash(playerid)) return SCM(playerid,COLOR_GREY,"Nemate toliko novca!");
- if(iznos < 1 || iznos > 50000) return SCM(playerid,COLOR_GREY,"Ne mozete staviti manje od 1 ili vise od 50000$ u kucu.");
- KucaInfo[k][kNovac] += iznos; GivePlayerCash(playerid, -iznos); SacuvajKucu(k);
- format(string, sizeof(string), "INFO: Ostavili ste $%d u vasu kucu.", iznos);
- SendClientMessage(playerid,-1, string);
- }
- else if(strcmp(option, "takemoney", true) == 0) {
- if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY,"Niste prijavljeni ili ste mrtvi!");
- new iznos,string[256];
- if(PlayerInfo[playerid][pKuca] == 0) return SCM(playerid, COLOR_GREY, "Ne posedujete kucu!");
- 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.");
- if(sscanf(params, "d", iznos)) return SCM(playerid,COLOR_GREY,"Koriscenje: /house takemoney [kolicina]");
- if(iznos > KucaInfo[k][kNovac]) return SendClientMessage(playerid, COLOR_GREY, "Nemate toliko novca u kuci!");
- if(iznos < 1 || iznos > 50000) return SCM(playerid,COLOR_GREY,"Ne mozete uzeti manje od 1 ili vise od 50000$ iz kuce.");
- KucaInfo[k][kNovac] -= iznos; GivePlayerCash(playerid, iznos); SacuvajKucu(k);
- format(string, sizeof(string), "INFO: Uzeli ste $%d iz vase kuce.", iznos);
- SendClientMessage(playerid,0xFFFF00AA, string);
- }
- return (true);
- }
Advertisement
Add Comment
Please, Sign In to add comment