Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. CMD:asellhouse(playerid, params[])
  2. {
  3. new house;
  4. if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You need to login first.");
  5. if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_ERROR, "Nu ai gradul necesar ca sa folosesti aceasta comanda!");
  6. if(sscanf(params,"i",house)) return SendClientMessage(playerid, COLOR_SYN, "Sintaxa:{FFFFFF} /asellhouse <houseid>");
  7. {
  8. if(strlen(HouseInfo[house][hOwner]) < 2) return SendClientMessage(playerid, COLOR_ERROR, "Invalid house id.");
  9. if(GetPlayerID(HouseInfo[house][hOwner]) != INVALID_PLAYER_ID)
  10. {
  11. PlayerInfo[GetPlayerID(HouseInfo[house][hOwner])][pHouseKey] = 0;
  12. Update(GetPlayerID(HouseInfo[house][hOwner]), pHouseKeyx);
  13. }
  14. else
  15. {
  16. gQuery[0] = (EOS);
  17. mysql_format(handle, gQuery, sizeof(gQuery), "UPDATE `players` SET `HouseKey`='0' WHERE `HouseKey`=%d", house);
  18. mysql_tquery(handle, gQuery, "", "");
  19. }
  20.  
  21. format(gString,sizeof(gString),"You sold the house %d, owned by %s.",house,HouseInfo[house][hOwner]);
  22. format(gString, sizeof(gString), "%s sold house %d, owned by %s",GetName(playerid), house,HouseInfo[house][hOwner]);
  23. CMDRaport(gString, 5, 0);
  24.  
  25. HouseInfo[house][hLock] = 1;
  26. hUpdate(house, hLockx);
  27. HouseInfo[house][hOwned] = 0;
  28. hUpdate(house, hOwnedx);
  29. HouseInfo[house][hSafe] = 0;
  30. hUpdate(house, hSafex);
  31. strmid(HouseInfo[house][hOwner], "The State", 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);
  32. hUpdate(house, hOwnerx);
  33. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  34. GameTextForPlayer(playerid, gString, 5000, 3);
  35.  
  36. for(new i = 1; i <= TotalClans; i++)
  37. {
  38. if(ClanInfo[i][clHouseHQ] == house)
  39. {
  40. ClanInfo[i][clHQType] = 0;
  41. cUpdate(i, clHQTypex);
  42. ClanInfo[i][clHouseHQ] = 0;
  43. cUpdate(i, clHouseHQx);
  44. }
  45. }
  46. HouseUpdate(house);
  47. }
  48. return 1;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement