01.05.2010, 14:29
Код:
if(strcmp(cmd, "/buybiz", true) == 0) { for(new h = 0; h < sizeof(BizzInfo); h++) { if(IsPlayerInRangeOfPoint(playerid, 2.0, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]) && BizzInfo[h][bForSell] == 1) { if(GetPlayerScore(playerid) < BizzInfo[h][bLevelNeeded]) { SendClientMessage(playerid, LIGHTRED, "You need to be level 4+ to buy this."); } else if(GetPlayerMoneyEx(playerid) > BizzInfo[h][bBuyPrice]) { format(string,sizeof(string),"D-RP/Accounts/%s.ini", BizzInfo[h][bOwner]); BizPrice[playerid] = dini_Int(string, "Money"); BizPrice[playerid] += BizzInfo[h][bBuyPrice]; dini_IntSet(string,"Money",BizPrice[playerid]); BizPrice[playerid] = 0; GivePlayerMoneyEx(playerid, -BizzInfo[h][bBuyPrice]); strmid(BizzInfo[h][bOwner], PlayerName(playerid), 0, strlen(PlayerName(playerid)), 255); BizzInfo[h][bOwned] = 1; SendClientMessageEx(playerid, YELLOW_GREEN, "You bought a business. Name: %s, Price: %d. (/businesshelp)",BizzInfo[h][bMessage],BizzInfo[h][bBuyPrice]); Update3DLabels(); PropUpdate(); AccountUpdate(playerid); } } return 1; } }