Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:asellbiz(playerid, params[])
- {
- CheckCommandStatus(playerid, "asellbiz");
- if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
- if(IsPlayerConnected(playerid))
- {
- new house;
- if(sscanf(params, "d", house)) return SendClientMessage(playerid, 0xFFFFFFFF, "{c5d8f7}Syntax: /asellbiz <Biz ID>");
- if (PlayerInfo[playerid][pAdmin] >= 5)
- {
- new ownerh[64],
- field[128],
- str2[256];
- format(field,128,"SELECT `Owner` FROM `bizz` WHERE `ID`='%d'",house);
- mysql_query(SQL,field);
- mysql_store_result();
- if(mysql_retrieve_row())
- {
- mysql_fetch_field_row(ownerh, "Owner");
- }
- mysql_free_result();
- BizzInfo[house][bLocked] = 0;
- BizzInfo[house][bOwned] = 0;
- strmid(BizzInfo[house][bOwner], "The State", 0, strlen("The State"), 255);
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- GameTextForPlayer(playerid, "~w~You have sold this property", 10000, 3);
- mysql_format(SQL,str2,sizeof(str2),"UPDATE `bizz` SET `Locked`='0',`Owned`='0',`Owner`='The State' WHERE `ID`='%d'",house);
- mysql_tquery(SQL,str2,"","");
- mysql_format(SQL,str2,sizeof(str2),"UPDATE users SET `Bizz`='255' WHERE `name`='%s'",ownerh);
- mysql_tquery(SQL,str2,"","");
- OnPropTextdrawUpdate(2, house);
- return 1;
- }
- else return SendClientMessage(playerid, COLOR_WHITE, "{5CAD5C}Error: Your admin level isn't high enough to use this command.");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement