Advertisement
xt3z0ne

comenzi

Aug 18th, 2018
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. CMD:asellbiz(playerid, params[])
  2. {
  3. if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
  4. if(IsPlayerConnected(playerid))
  5. {
  6. new house;
  7. if(sscanf(params, "d", house)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF9900}Scrie: {33CCFF}/asellbiz <Biz ID>");
  8. if (PlayerInfo[playerid][pAdmin] >= 5)
  9. {
  10. new ownerh[64],
  11. field[128],
  12. str2[256];
  13. format(field,128,"SELECT `Owner` FROM `bizz` WHERE `ID`='%d'",house);
  14. mysql_query(SQL,field);
  15. mysql_store_result();
  16. if(mysql_retrieve_row())
  17. {
  18. mysql_fetch_field_row(ownerh, "Owner");
  19. }
  20. mysql_free_result();
  21. BizzInfo[house][bLocked] = 0;
  22. BizzInfo[house][bOwned] = 0;
  23. strmid(BizzInfo[house][bOwner], "The State", 0, strlen("The State"), 255);
  24. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  25. GameTextForPlayer(playerid, "~w~You have sold this property", 10000, 3);
  26. mysql_format(SQL,str2,sizeof(str2),"UPDATE `bizz` SET `Locked`='0',`Owned`='0',`Owner`='The State' WHERE `ID`='%d'",house);
  27. mysql_tquery(SQL,str2,"","");
  28. mysql_format(SQL,str2,sizeof(str2),"UPDATE users SET `Bizz`='255' WHERE `name`='%s'",ownerh);
  29. mysql_tquery(SQL,str2,"","");
  30. OnPropTextdrawUpdate(2, house);
  31. return 1;
  32. }
  33. else return SendClientMessage(playerid, COLOR_WHITE, "{5CAD5C}Error: Your admin level isn't high enough to use this command.");
  34. }
  35. return 1;
  36. }
  37. CMD:asellhouse(playerid, params[])
  38. {
  39. if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
  40. if(IsPlayerConnected(playerid))
  41. {
  42. new house;
  43. if(sscanf(params, "d", house)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF9900}Scrie: {33CCFF}/asellhouse <House ID>");
  44. if (PlayerInfo[playerid][pAdmin] >= 5)
  45. {
  46. new ownerh[64],
  47. field[128],
  48. str2[256];
  49. format(field,128,"SELECT `Owner` FROM `houses` WHERE `ID`='%d'",house);
  50. mysql_query(SQL,field);
  51. mysql_store_result();
  52. if(mysql_retrieve_row())
  53. {
  54. mysql_fetch_field_row(ownerh, "Owner");
  55. }
  56. mysql_free_result();
  57. HouseInfo[house][hHel] = 0;
  58. //HouseInfo[house][hArm] = 0;
  59. HouseInfo[house][hLock] = 0;
  60. HouseInfo[house][hOwned] = 0;
  61. strmid(HouseInfo[house][hOwner], "The State", 0, strlen("The State"), 255);
  62. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  63. mysql_format(SQL,str2,sizeof(str2),"UPDATE `houses` SET `Hel`='0',`Arm`='0',`Lockk`='0',`Owned`='0',`Owner`='The State' WHERE `ID`='%d'",house);
  64. mysql_tquery(SQL,str2,"","");
  65. mysql_format(SQL,str2,sizeof(str2),"UPDATE users SET `House`='999' WHERE `name`='%s'",ownerh);
  66. mysql_tquery(SQL,str2,"","");
  67. OnPropTextdrawUpdate(1, house);
  68. return 1;
  69. }
  70. else
  71. {
  72. SendClientMessage(playerid, COLOR_WHITE, "{5CAD5C}Error: Your admin level isn't high enough to use this command.");
  73. }
  74. }
  75. return 1;
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement