Unknown Command..
#1

Well - When I Type this CMD IG..]

PHP код:
    if(strcmp(cmd"/buyprods"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            new 
tmpcar GetPlayerVehicleID(playerid);
            new 
compcost 20;
            if(
IsPlayerInRangeOfPoint(playerid702468.4919,-2092.9902,13.5469))
            {
                if(
IsATruck(tmpcar))
                {
                    if(
PlayerHaul[tmpcar][pLoad] < PlayerHaul[tmpcar][pCapasity])
                    {
                        new 
amount;
                        
tmp strtok(cmdtextidx);
                        if(!
strlen(tmp))
                        {
                            
SendClientMessage(playeridCOLOR_GRAD1"USAGE: /buyprods [amount]");
                            return 
1;
                        }
                        
amount strval(tmp);
                        if(
amount || amount 500) { SendClientMessage(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]);
                            
SendClientMessage(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]);
                            
SendClientMessage(playeridTEAM_GROVE_COLORstring);
                            
format(stringsizeof(string), "You bought %d Products for $%d."amount,cost);
                            
SendClientMessage(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);
                            
SendClientMessage(playeridTEAM_GROVE_COLORstring);
                            return 
1;
                        }
                    }
                    else
                    {
                            
format(stringsizeof(string), "Products: %d/%d."PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
                            
SendClientMessage(playeridTEAM_GROVE_COLORstring);
                            return 
1;
                    }
                }
                else
                {
                    
SendClientMessage(playeridTEAM_GROVE_COLOR"This Vehicle does not deliver Products.");
                    return 
1;
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GREY"You are not in trucker place.");
                return 
1;
            }
        }
        return 
1;
    } 
It shows me : Unknown Command.
Reply
#2

Other commands work?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)