Why this CMD dont work ?
#4

Not sure why it doesn't work, otherwise you can just use mine:
PHP код:
CMD:sellmycar(playeridparams[])
{
    for(new 
MAX_PLAYERVEHICLESd++)
    {
        if(
IsPlayerInVehicle(playeridPlayerVehicleInfo[playerid][d][pvId]))
         {
            new 
Float:health;
            
GetVehicleHealth(PlayerVehicleInfo[playerid][d][pvId], health);
            if(
PlayerInfo[playerid][pLevel] == 1)
            {
                
SendClientMessageEx(playeridCOLOR_GREY"You have to be level 2 or higher to be able to sell vehicles.");
                return 
1;
            }
            if(
health 500) return SendClientMessageEx(playeridCOLOR_GREY" Your vehicle is too damaged to sell it.");
            new 
string[128], giveplayeridprice;
            if(
sscanf(params"ud"giveplayeridprice)) return SendClientMessageEx(playeridCOLOR_WHITE"USAGE: /sellmycar [playerid] [price]");
            if(
price 1) return SendClientMessageEx(playeridCOLOR_GREY"Price must be higher than 0.");
            if(
PlayerInfo[giveplayerid][pLevel] == 1)
            {
                
SendClientMessageEx(playeridCOLOR_GREY"The player has to be Level 2 or higher to be able to sell vehicles to them.");
                return 
1;
            }
            if(
playerid == giveplayerid)
            {
                
SendClientMessageEx(playeridCOLOR_GREY"You can not use this command on yourself.");
                return 
1;
            }
            if(!
IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playeridCOLOR_GREY"Player is currently not connected to the server.");
            if (
ProxDetectorS(8.0playeridgiveplayerid))
             {
                
VehicleOffer[giveplayerid] = playerid;
                
VehicleId[giveplayerid] = d;
                
VehiclePrice[giveplayerid] = price;
                
format(stringsizeof(string), "* You offered %s to buy this %s for $%d."GetPlayerNameEx(giveplayerid), GetVehicleName(PlayerVehicleInfo[playerid][d][pvId]), price);
                
SendClientMessageEx(playeridCOLOR_LIGHTBLUEstring);
                
format(stringsizeof(string), "* %s has offered you their %s for $%d, (type /accept car) to buy."GetPlayerNameEx(playerid), GetVehicleName(PlayerVehicleInfo[playerid][d][pvId]), price);
                
SendClientMessageEx(giveplayeridCOLOR_LIGHTBLUEstring);
                return 
1;
            }
            else
            {
                
SendClientMessageEx(playeridCOLOR_GREY"That player is not near you.");
                return 
1;
            }
        }
    }
    
SendClientMessageEx(playeridCOLOR_GREY" You need to be inside a vehicle that you own.");
    return 
1;

Reply


Messages In This Thread
Why this CMD dont work ? - by barts - 31.01.2014, 12:56
Re: Why this CMD dont work ? - by PowerPC603 - 31.01.2014, 15:24
Re: Why this CMD dont work ? - by barts - 01.02.2014, 07:53
Re: Why this CMD dont work ? - by Ryan McDuff - 01.02.2014, 07:59

Forum Jump:


Users browsing this thread: 1 Guest(s)