Advertisement
Marlborox

Untitled

Jun 6th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. CMD:asellbiz(playerid, params[])
  2. {
  3. CheckCommandStatus(playerid, "asellbiz");
  4. if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
  5. if(IsPlayerConnected(playerid))
  6. {
  7. new house;
  8. if(sscanf(params, "d", house)) return SendClientMessage(playerid, 0xFFFFFFFF, "{c5d8f7}Syntax: /asellbiz <Biz ID>");
  9. if (PlayerInfo[playerid][pAdmin] >= 5)
  10. {
  11. new ownerh[64],
  12. field[128],
  13. str2[256];
  14. format(field,128,"SELECT `Owner` FROM `bizz` WHERE `ID`='%d'",house);
  15. mysql_query(SQL,field);
  16. mysql_store_result();
  17. if(mysql_retrieve_row())
  18. {
  19. mysql_fetch_field_row(ownerh, "Owner");
  20. }
  21. mysql_free_result();
  22. BizzInfo[house][bLocked] = 0;
  23. BizzInfo[house][bOwned] = 0;
  24. strmid(BizzInfo[house][bOwner], "The State", 0, strlen("The State"), 255);
  25. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  26. GameTextForPlayer(playerid, "~w~You have sold this property", 10000, 3);
  27. mysql_format(SQL,str2,sizeof(str2),"UPDATE `bizz` SET `Locked`='0',`Owned`='0',`Owner`='The State' WHERE `ID`='%d'",house);
  28. mysql_tquery(SQL,str2,"","");
  29. mysql_format(SQL,str2,sizeof(str2),"UPDATE users SET `Bizz`='255' WHERE `name`='%s'",ownerh);
  30. mysql_tquery(SQL,str2,"","");
  31. OnPropTextdrawUpdate(2, house);
  32. return 1;
  33. }
  34. else return SendClientMessage(playerid, COLOR_WHITE, "{5CAD5C}Error: Your admin level isn't high enough to use this command.");
  35. }
  36. return 1;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement