CMD:Bizwithdraw aint working .
#1

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
PHP код:
BIZTIL 40253
 
USAGE bizwithdraw (amount) , 
but i cant withdraw any of the money from my store

PHP код:
YCMD:bizwithdraw(playeridparams[], help)
{
    if(
help) return SCM(playeridCOLOR_GREY"Not supported");
    if(
IsPlayerConnected(playerid))
    {
        new 
string[256], cashdepositbouse PlayerInfo[playerid][pPbiskey];
        if (
bouse == 9999)
        {
            
SCM(playeridCOLOR_GRAD2"   You don't own a business");
            return 
1;
        }
        if(
sscanf(params"d"cashdeposit))
        {
            
format(stringsizeof(string), "  You Have $%d in your till."BizzInfo[bouse][bTill]);
            
SCM(playeridCOLOR_GRAD3string);
            
SCM(playeridCOLOR_GRAD2"USAGE: /bizwithdraw [amount]");
            return 
1;
        }
        if (
cashdeposit BizzInfo[bouse][bTill] || cashdeposit 1)
        {
            
SCM(playeridCOLOR_GRAD2"   You dont have that much");
            return 
1;
        }
        if (
bouse >= 100)
        {
            if (!
IsPlayerInRangeOfPoint(playerid100,BizzInfo[bouse][bExitX],BizzInfo[bouse][bExitY],BizzInfo[bouse][bExitZ]))
            {
                
SCM(playeridCOLOR_GRAD2"   You are to far from your business");
                return 
1;
            }
            else
            {
                
SafeGivePlayerMoney(playerid,cashdeposit);
                
BizzInfo[bouse][bTill] -= cashdeposit;
                
format(stringsizeof(string), "  You Have Withdrawn $%d from your till Total: $%d "cashdeposit,BizzInfo[bouse][bTill]);
                
OnPropUpdate(2,bouse);
                
OnPropTextdrawUpdate(2bouse);
                
SCM(playeridCOLOR_YELLOWstring);
                return 
1;
            }
        }
    }
    return 
1;

Reply
#2

Try this:
pawn Код:
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;
}
Can't guarantee it will work, but give it a try.
Reply
#3

Where did you create cashdeposit?
Код:
YCMD:bizwithdraw(playerid, params[], help)
{
    new cashdeposit;
    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;
        } 
....
Reply
#4

Solved it Thank you guys it was in
PHP код:
SafeGivePlayerMoney(playerid,-cashdeposit); 
thank you Capua and ty dominik523 , REP both of you (y)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)