07.11.2014, 19:49
hello ..
im confused with this command , when im buying a gun it from my store .. it give the player the gun and it saves the money in bizbank , but if i want to withdraw the money as im the owner of the busnisse , i cant , im doing /bizwithdraw he's giving me the
but i cant withdraw any of the money from my store
im confused with this command , when im buying a gun it from my store .. it give the player the gun and it saves the money in bizbank , but if i want to withdraw the money as im the owner of the busnisse , i cant , im doing /bizwithdraw he's giving me the
PHP код:
BIZTIL : 40253$
USAGE : bizwithdraw (amount) ,
PHP код:
YCMD:bizwithdraw(playerid, params[], help)
{
if(help) return SCM(playerid, COLOR_GREY, "Not supported");
if(IsPlayerConnected(playerid))
{
new string[256], cashdeposit, bouse = PlayerInfo[playerid][pPbiskey];
if (bouse == 9999)
{
SCM(playerid, COLOR_GRAD2, " You don't own a business");
return 1;
}
if(sscanf(params, "d", cashdeposit))
{
format(string, sizeof(string), " You Have $%d in your till.", BizzInfo[bouse][bTill]);
SCM(playerid, COLOR_GRAD3, string);
SCM(playerid, COLOR_GRAD2, "USAGE: /bizwithdraw [amount]");
return 1;
}
if (cashdeposit > BizzInfo[bouse][bTill] || cashdeposit < 1)
{
SCM(playerid, COLOR_GRAD2, " You dont have that much");
return 1;
}
if (bouse >= 100)
{
if (!IsPlayerInRangeOfPoint(playerid, 100,BizzInfo[bouse][bExitX],BizzInfo[bouse][bExitY],BizzInfo[bouse][bExitZ]))
{
SCM(playerid, COLOR_GRAD2, " You are to far from your business");
return 1;
}
else
{
SafeGivePlayerMoney(playerid,cashdeposit);
BizzInfo[bouse][bTill] -= cashdeposit;
format(string, sizeof(string), " You Have Withdrawn $%d from your till Total: $%d ", cashdeposit,BizzInfo[bouse][bTill]);
OnPropUpdate(2,bouse);
OnPropTextdrawUpdate(2, bouse);
SCM(playerid, COLOR_YELLOW, string);
return 1;
}
}
}
return 1;
}