Commands Error
#1

Removed
Reply
#2

It means that you don't have enough money to buy that buisness.
Reply
#3

Removed
Reply
#4

Make it:

PHP код:
if(GetPlayerMoney(playerid) < BusinessInfo[id][bPrice]) 
Since you gotta update your pCash for it to store your current money.
Reply
#5

Removed
Reply
#6

Код:
CMD:buybiz(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return 1;

	new id = IsPlayerNearBizEnt(playerid);
	if(id == -1 || id == 0) return SendClientMessage(playerid, COLOR_GREY, "You are not near a biz");

	if(BusinessInfo[id][bOwned] != 0 || BusinessInfo[id][bPrice] == 0) return SendClientMessage(playerid, COLOR_GREY, "This biz is not for sale.");

	if(PlayerInfo[playerid][BizID] != 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You already own a biz.");

	if(PlayerInfo[playerid][pCash] < BusinessInfo[id][bPrice]) return SendClientMessage(playerid, COLOR_LIGHTRED, "Sorry, you can not afford this biz.");

    if(GetPlayerMoney(playerid) > BusinessInfo[id][bPrice])
	PlayerInfo[playerid][BizID] = id;
    PlayerInfo[playerid][pCash] -= BusinessInfo[id][bPrice];
	GivePlayerMoney(playerid, -BusinessInfo[id][bPrice]);

	BusinessInfo[id][bLocked] = 0;
	BusinessInfo[id][bOwned] = 1;
	BusinessInfo[id][bOwner] = RemoveUnderScore(playerid);

	SendClientMessage(playerid, COLOR_YELLOW, "Congratulations on your new biz! Use /bizhelp to get help, or /ask!");
	return 1;
}
Reply
#7

Here.

PHP код:
CMD:buybiz(playeridparams[])
{
    if(
gPlayerLogged[playerid] == 0) return 1;
    new 
id IsPlayerNearBizEnt(playerid);
    if(
id == -|| id == 0) return SendClientMessage(playeridCOLOR_GREY"You are not near a biz");
    if(
BusinessInfo[id][bOwned] != || BusinessInfo[id][bPrice] == 0) return SendClientMessage(playeridCOLOR_GREY"This biz is not for sale.");
    if(
PlayerInfo[playerid][BizID] != 0) return SendClientMessage(playeridCOLOR_LIGHTRED"You already own a biz.");
    if(
GetPlayerMoney(playerid) < BusinessInfo[id][bPrice]) return SendClientMessage(playeridCOLOR_LIGHTRED"Sorry, you can not afford this biz.");
      
PlayerInfo[playerid][BizID] = id;
    
PlayerInfo[playerid][pCash] -= BusinessInfo[id][bPrice];
    
GivePlayerMoney(playerid, -BusinessInfo[id][bPrice]);
    
BusinessInfo[id][bLocked] = 0;
    
BusinessInfo[id][bOwned] = 1;
    
BusinessInfo[id][bOwner] = RemoveUnderScore(playerid);
    
SendClientMessage(playeridCOLOR_YELLOW"Congratulations on your new biz! Use /bizhelp to get help, or /ask!");
    return 
1;

Reply
#8

Removed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)