Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:asellhouse(playerid, params[])
- {
- new house;
- if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You need to login first.");
- if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_ERROR, "Nu ai gradul necesar ca sa folosesti aceasta comanda!");
- if(sscanf(params,"i",house)) return SendClientMessage(playerid, COLOR_SYN, "Sintaxa:{FFFFFF} /asellhouse <houseid>");
- {
- if(strlen(HouseInfo[house][hOwner]) < 2) return SendClientMessage(playerid, COLOR_ERROR, "Invalid house id.");
- if(GetPlayerID(HouseInfo[house][hOwner]) != INVALID_PLAYER_ID)
- {
- PlayerInfo[GetPlayerID(HouseInfo[house][hOwner])][pHouseKey] = 0;
- Update(GetPlayerID(HouseInfo[house][hOwner]), pHouseKeyx);
- }
- else
- {
- gQuery[0] = (EOS);
- mysql_format(handle, gQuery, sizeof(gQuery), "UPDATE `players` SET `HouseKey`='0' WHERE `HouseKey`=%d", house);
- mysql_tquery(handle, gQuery, "", "");
- }
- format(gString,sizeof(gString),"You sold the house %d, owned by %s.",house,HouseInfo[house][hOwner]);
- format(gString, sizeof(gString), "%s sold house %d, owned by %s",GetName(playerid), house,HouseInfo[house][hOwner]);
- CMDRaport(gString, 5, 0);
- HouseInfo[house][hLock] = 1;
- hUpdate(house, hLockx);
- HouseInfo[house][hOwned] = 0;
- hUpdate(house, hOwnedx);
- HouseInfo[house][hSafe] = 0;
- hUpdate(house, hSafex);
- strmid(HouseInfo[house][hOwner], "The State", 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);
- hUpdate(house, hOwnerx);
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- GameTextForPlayer(playerid, gString, 5000, 3);
- for(new i = 1; i <= TotalClans; i++)
- {
- if(ClanInfo[i][clHouseHQ] == house)
- {
- ClanInfo[i][clHQType] = 0;
- cUpdate(i, clHQTypex);
- ClanInfo[i][clHouseHQ] = 0;
- cUpdate(i, clHouseHQx);
- }
- }
- HouseUpdate(house);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement