Fox_Man
Новичок
Покупаю бизнес всё норм, хочу продать пишет unknown command. Вот код команды /sellbiz
PHP:
else if(strcmp(cmd, "/sellbiz", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pPbiskey] == 255 && PlayerInfo[playerid][pPsbiskey] == 255) return SendClientMessage(playerid, COLOR_GREY, "Ó âàñ íåò áèçåíñà!");
if(strcmp(playername, SBizzInfo[PlayerInfo[playerid][pPsbiskey]][sbOwner], true) == 0)
{
new bouse = PlayerInfo[playerid][pPsbiskey];
if (!PlayerToPoint(3, playerid,SBizzInfo[bouse][sbEntranceX], SBizzInfo[bouse][sbEntranceY], SBizzInfo[bouse][sbEntranceZ])) return SendClientMessage(playerid, COLOR_GREY, "Âû íå ó ñâîåãî áèçíåñà!");
PlayerInfo[playerid][pBank] +=SBizzInfo[bouse][sbTill];
SBizzInfo[bouse][sbLocked] = 1;
SBizzInfo[bouse][sbOwned] = 0;
SBizzInfo[bouse][sbPriceProd] = 0;
SBizzInfo[bouse][sbProducts] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(SBizzInfo[bouse][sbOwner], "The State", 0, strlen("The State"), 255);
// PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_YELLOW2, "::: Áèçíåñ óñïåøíî ïðîäàí :::");
format(string, sizeof(string), "- Ïðèáûëü ñ ïðîäàæè áèçíåñà: %d âèðò", SBizzInfo[bouse][sbTill]);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "- Íîâûé ñ÷¸ò â áàíêå: %d âèðò", PlayerInfo[playerid][pBank]);
SendClientMessage(playerid, COLOR_WHITE, string);
SendClientMessage(playerid, COLOR_YELLOW2, "::: Áèçíåñ óñïåøíî ïðîäàí :::");
SBizzInfo[bouse][sbTill] = 0;
PlayerInfo[playerid][pPsbiskey] = 255;
format(string, sizeof(string), "{00FF32}Öåíà:{FEFEFE} %d\n{F5FF00}Áèçíåñ ïðîäà¸òñÿ",SBizzInfo[bouse][sbBuyPrice]);
Update3DTextLabelText(SBizzInfo[bouse][sbLabel], COLOR_YELLOW, string);
OnPropUpdate();
OnPlayerUpdateRL(playerid);
return true;
}
if(strcmp(playername, BizzInfo[PlayerInfo[playerid][pPbiskey]][bOwner], true) == 0)
{
new bouse = PlayerInfo[playerid][pPbiskey];
if (!PlayerToPoint(3, playerid,BizzInfo[bouse][bEntranceX], BizzInfo[bouse][bEntranceY], BizzInfo[bouse][bEntranceZ])) return SendClientMessage(playerid, COLOR_GREY, "Âû íå ó ñâîåãî áèçíåñà!");
BizzInfo[bouse][bLocked] = 1;
BizzInfo[bouse][bOwned] = 0;
BizzInfo[bouse][bProducts] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(BizzInfo[bouse][bOwner], "The State", 0, strlen("The State"), 255);
strmid(BizzInfo[bouse][bExtortion], "No-one", 0, strlen("No-one"), 255);
PlayerInfo[playerid][pBank] +=BizzInfo[bouse][bTill] / 2;
PlayerInfo[playerid][pBank] +=BizzInfo[bouse][b2Till];
//PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_YELLOW2, "::: Áèçíåñ óñïåøíî ïðîäàí :::");
format(string, sizeof(string), "- Ïðèáûëü ñ ïðîäàæè áèçíåñà: %d âèðò", BizzInfo[bouse][bTill]);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "- Íîâûé ñ÷¸ò â áàíêå: %d âèðò", PlayerInfo[playerid][pBank]);
SendClientMessage(playerid, COLOR_WHITE, string);
SendClientMessage(playerid, COLOR_YELLOW2, "::: Áèçíåñ óñïåøíî ïðîäàí :::");
BizzInfo[bouse][bTill] = 0;
BizzInfo[bouse][b2Till] = 0;
PlayerInfo[playerid][pPbiskey] = 255;
format(string, sizeof(string), "Öåíà: %d\nÁèçíåñ ïðîäà¸òñÿ",BizzInfo[bouse][bBuyPrice]);
Update3DTextLabelText(BizzInfo[bouse][bLabel], COLOR_YELLOW, string);
OnPropUpdate();
OnPlayerUpdateRL(playerid);
return true;
}
else { SendClientMessage(playerid, COLOR_GREY, "Ó âàñ íåò áèçíåñà!");
}
}
else { return true; }
}
