/BuyProds Error. Help
#1

Hi guys. Few days ago i start with a GM (Raven's Roleplay's UnknowGamers' Edition) but i have a problem with the Trucker Job.

Here's the code:

PHP код:
YCMD:buyprods(playeridparams[], help)
{
    if(
help) return SCM(playeridCOLOR_GREY"Not supported");
    if(
IsPlayerConnected(playerid))
    {
        new 
string[256], amounttmpcar GetPlayerVehicleID(playerid), compcost 20;
        if(
IsPlayerInRangeOfPoint(playerid702468.4919,-2092.9902,13.5469))
        {
            if(
IsATruck(tmpcar))
            {
                if(
PlayerHaul[tmpcar][pLoad] < PlayerHaul[tmpcar][pCapasity])
                {
                     if(
sscanf(params"d"amount))
                    {
                        
SCM(playeridCOLOR_GRAD1"USAGE: /buyprods [amount]");
                        return 
1;
                    }
                    if(
amount || amount 500) { SCM(playeridCOLOR_GREY"   Can't buy less then 1 Product or more then 500!"); return 1; }
                    new 
checkPlayerHaul[tmpcar][pLoad] + amount;
                    if(
check PlayerHaul[tmpcar][pCapasity])
                    {
                        
format(stringsizeof(string), "   You went over the Truck Products Carry Limit of %d, you currently carry %d.",PlayerHaul[tmpcar][pCapasity],PlayerHaul[tmpcar][pLoad]);
                        
SCM(playeridCOLOR_GREYstring);
                        return 
1;
                    }
                    new 
cost amount*compcost;
                    if(
GetPlayerMoney(playerid) >= cost)
                    {
                        
PlayerHaul[tmpcar][pLoad] += amount;
                        
format(stringsizeof(string), "Products: %d/%d."PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
                        
SCM(playeridTEAM_GROVE_COLORstring);
                        
format(stringsizeof(string), "You bought %d Products for $%d."amount,cost);
                        
SCM(playeridTEAM_GROVE_COLORstring);
                        
SafeGivePlayerMoney(playerid,-cost);
                        
PlayerPlaySound(playerid10520.00.00.0);
                        return 
1;
                    }
                    else
                    {
                        
format(stringsizeof(string), "You cant afford %d Products at $%d!"amount,cost);
                        
SCM(playeridTEAM_GROVE_COLORstring);
                        return 
1;
                    }
                }
                else
                {
                        
format(stringsizeof(string), "Products: %d/%d."PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
                        
SCM(playeridTEAM_GROVE_COLORstring);
                        return 
1;
                }
            }
            else
            {
                
SCM(playeridTEAM_GROVE_COLOR"This Vehicle does not deliver Products.");
                return 
1;
            }
        }
        else
        {
            
SCM(playeridCOLOR_GREY"You are not in trucker place.");
            return 
1;
        }
    }
    return 
1;

In the game, when you are on those RangePoint and you are on a Truck; and you use the /buyprods cmd, nothing happens Something is wrong but i dont know what.

I hope your answers. Thanks a lots guys
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)