error 001: expected token: "-identifier-", but found "-integer value-"
#6

Hi Mecent, thanks it's fixed already, how about this? can you make work this also?

PHP код:
CMD:accept(playeridparams[])
{
       if(
Player[playerid][Admin] >= 1)
     {
          
SendClientMessage(playerid,COLOR_WHITE"Administrators can't use this command.");
        return 
1;
    }
    new 
string[145];
    
//new sendername[MAX_PLAYER_NAME];
    //new giveplayer[MAX_PLAYER_NAME];
    
new material[2];

    if(
IsPlayerConnected(playerid))
    {
        if(
isnull(params))
        {
            
SendClientMessage(playeridCOLOR_WHITE"USAGE: /accept [name]");
            
SendClientMessage(playeridCOLOR_GREY"Available Names: Mats");
            return 
1;
        }
           else if(
strcmp(params,"mats",true) == 0)
        {
            if(
MatsOffer[playerid] < 999)
            {
                if(
GetPlayerMoney(playerid) >= MatsPrice[playerid])
                {
                    if(
IsPlayerConnected(MatsOffer[playerid]))
                    {
                        if(
GetPVarInt(playerid"SellMatsTimer") > 0)
                        {
                            
format(stringsizeof(string), "You must wait %d seconds before accepting materials."GetPVarInt(playerid"SellMatsTimer"));
                            
SendClientMessage(playerid,COLOR_GREY,string);
                            return 
1;
                        }
                        
                        if (
Player[MatsOffer[playerid]][MatsA] < MatsAmount[playerid])
                        {
                            
SendClientMessage(playerid,COLOR_GREY"That player does not have that amount of materials anymore!");
                            return 
1;
                        }
                        else if (
Player[MatsOffer[playerid]][MatsB] < MatsAmount[playerid])
                        {
                            
SendClientMessage(playerid,COLOR_GREY"That player does not have that amount of materials anymore!");
                            return 
1;
                        }
                        else if (
Player[MatsOffer[playerid]][MatsC] < MatsAmount[playerid])
                        {
                            
SendClientMessage(playerid,COLOR_GREY"That player does not have that amount of materials anymore!");
                            return 
1;
                        }

                         
format(stringsizeof(string), "* You bought %d class %s materials for $%d from %s."MatsAmount[playerid], materialMatsPrice[playerid], GetName(MatsOffer[playerid]));
                        
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                          
format(stringsizeof(string), "* %s has bought your %d class %s materials, the $%d was added to your money."GetName(playerid), MatsAmount[playerid], materialMatsPrice[playerid]);
                        
SendClientMessage(MatsOffer[playerid], COLOR_LIGHTBLUEstring);

                          
GivePlayerMoney(MatsOffer[playerid], MatsPrice[playerid]);
                        
GivePlayerMoney(playerid, -MatsPrice[playerid]);
                        
                        if (
strcmp(material"A"true))
                        {
                            
Player[playerid][MatsA] += MatsAmount[playerid];
                            
Player[MatsOffer[playerid]][MatsA] -= MatsAmount[playerid];
                        }
                        else if (
strcmp(material"B"true))
                        {
                            
Player[playerid][MatsB] += MatsAmount[playerid];
                            
Player[MatsOffer[playerid]][MatsB] -= MatsAmount[playerid];
                        }
                        else if (
strcmp(material"C"true))
                        {
                            
Player[playerid][MatsC] += MatsAmount[playerid];
                            
Player[MatsOffer[playerid]][MatsC] -= MatsAmount[playerid];
                        }

                        
MatsOffer[playerid] = 999;
                        
MatsPrice[playerid] = 0;
                         
MatsType[playerid] = 0;
                        
MatsAmount[playerid] = 0;
                    }
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GREY"You can't afford those materials!");
                    return 
1;
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GREY"No-one offered you any materials!");
                return 
1;
            }
        }
    }
    return 
1;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)