01.09.2011, 13:25
pawn Код:
if(strcmp(cmd, "/sellbusiness", true) == 0 || strcmp(cmd, "/sellbiz", true) == 0)
{
if(PlayerInfo[playerid][pBusinessKey] == INVALID_BUSINESS_ID)
{
SendClientMessage(playerid, COLOR_RED, "You cannot sell your business because you don't have one.");
return 1;
}
else
{
new businessid = PlayerInfo[playerid][pBusinessKey];
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_YELLOW, "You have successfully sold your business.");
PlayerInfo[playerid][pBusinessKey] = INVALID_BUSINESS_ID;
new bizzname[32];
strmid(bizzname, BusinessInfo[businessid][bDescription], 3, strlen(BusinessInfo[businessid][bDescription]), 32);
format(string, sizeof(string), "%s has sold business %s.", PlayerName[playerid], BusinessInfo[businessid][bDescription]);
SendClientMessageToAll(COLOR_YELLOW, string);
GivePlayerMoney(playerid, BusinessInfo[businessid][bPrice]/2);
SellBusiness(businessid);
OnBusinessUpdate();
}
return 1;
}