Commands Error - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Commands Error (
/showthread.php?tid=384770)
Commands Error -
RenovanZ - 13.10.2012
Removed
Re: Commands Error -
Lordzy - 13.10.2012
It means that you don't have enough money to buy that buisness.
Re: Commands Error -
RenovanZ - 13.10.2012
Removed
Re: Commands Error -
gtakillerIV - 13.10.2012
Make it:
PHP код:
if(GetPlayerMoney(playerid) < BusinessInfo[id][bPrice])
Since you gotta update your pCash for it to store your current money.
Re: Commands Error -
RenovanZ - 13.10.2012
Removed
Re: Commands Error -
Windrush - 13.10.2012
Код:
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;
}
Re: Commands Error -
gtakillerIV - 13.10.2012
Here.
PHP код:
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(GetPlayerMoney(playerid) < BusinessInfo[id][bPrice]) return SendClientMessage(playerid, COLOR_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(playerid, COLOR_YELLOW, "Congratulations on your new biz! Use /bizhelp to get help, or /ask!");
return 1;
}
Re: Commands Error -
RenovanZ - 13.10.2012
Removed