Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- YCMD:asellhouse(playerid, params[], help) {
- new house, string[180], query[180];
- if(sscanf(params, "d", house)) return SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/asellhouse <House ID>");
- if(PlayerInfo[playerid][pAdmin] < 5) return SCM(playerid, COLOR_GREY, "Nu ai nivelul necesar de admin pentru a face asta.");
- foreach(Player, i) {
- if(IsPlayerConnected(i) && PlayerInfo[i][pHouse] == house) {
- PlayerInfo[i][pHouse] = 999;
- PlayerInfo[i][pRented] = -1;
- Update(i, pHousex);
- }
- }
- HouseInfo[house][hHel] = 0;
- HouseInfo[house][hArm] = 0;
- HouseInfo[house][hLock] = 0;
- HouseInfo[house][hOwned] = 1;
- HouseInfo[house][hValue] = 0;
- format(query,sizeof(query),"UPDATE `houses` SET `Hel`='0',`Arm`='0',`Lockk`='0',`Owned`='1',`Owner`='The State',`Value`='0' WHERE `ID`='%d'",house);
- mysql_query(SQL,query);
- format(query,sizeof(query),"UPDATE users SET `House`='999' WHERE `name`='%s'",HouseInfo[house][hOwner]);
- mysql_query(SQL,query);
- strmid(HouseInfo[house][hOwner], "The State", 0, strlen("The State"), 255);
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "* Casa %d a fost vandut cu succes la stat!", house);
- SCM(playerid, COLOR_YELLOW, string);
- UpdateLabel(1, house);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment