Help On this CMD
#8

Try This:
PHP код:
CMD:bizwithdraw(playeridparams[])
{
    for(new 
biz 0biz MAX_BIZbiz++)
    {
        if(
IsPlayerInRangeOfPoint(playerid100BizInfo[biz][IXCoord], BizInfo[biz][IYCoord], BizInfo[biz][IZCoord]))
        {
            if(
GetPlayerVirtualWorld(playerid) == BizInfo[biz][VW])
            {
                if(!
strcmp(BizInfo[biz][Owner], GetPlayerNameEx(playerid), true))
                {
                    new 
money;
                    if(
sscanf(params,"d"money)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /bizwithdraw [amount]");
                    if(
money BizInfo[biz][Till]) return SendClientMessage(playeridCOLOR_GRAD2"You don't have that much money in your Till!");
                    new 
string[150];
                    
format(string,sizeof(string),"You've taken $%d out of your Business Till."money);
                    
SendClientMessage(playeridCOLOR_GREYstring);
                     
GivePlayerCash(playeridmoney);
                     
BizInfo[biz][Till] -= money;
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"You're not in your bussiness.");
                }
            }
        }
    }
    return 
1;

Also, Make sure your Owner's name is getting saved correctly inside files.
Reply


Messages In This Thread
Help On this CMD - by Bojaa - 15.05.2017, 09:06
Re: Help On this CMD - by XtremeRz - 15.05.2017, 09:26
Re: Help On this CMD - by Bolex_ - 15.05.2017, 09:37
Re: Help On this CMD - by Bojaa - 15.05.2017, 09:53
Re: Help On this CMD - by Tord - 15.05.2017, 10:00
Re: Help On this CMD - by Bojaa - 15.05.2017, 14:27
Re: Help On this CMD - by Tord - 15.05.2017, 15:40
Re: Help On this CMD - by GTLS - 15.05.2017, 16:18
Re: Help On this CMD - by DRIFT_HUNTER - 15.05.2017, 16:57

Forum Jump:


Users browsing this thread: 5 Guest(s)