Jump to content
  • 0

pPcarkey2 /v sellto


shean

Question

Poi am scriptat comanda /v sellto si nu merge la slot 2 /v sellto zice ca nus in masina. Nu stiu cred ca am scriptat ceva gresit

[pawn]         else if(strcmp(x_nr,"sellto",true) == 0)

        {

if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey])

{

    GetPlayerName(playerid, sendername, sizeof(sendername));

    new ownvehkey;

                if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { ownvehkey = PlayerInfo[playerid][pPcarkey]; }

                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { ownvehkey = PlayerInfo[playerid][pPcarkey2]; }

                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { ownvehkey = PlayerInfo[playerid][pPcarkey3]; }

        else { return 1; }

    if(strcmp(sendername, CarInfo[ownvehkey][cOwner], true) == 0)

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

    SCM(playerid, COLOR_WHITE, "HINT: /v sellto [playerid/PartOfName] [price]");

    return 1;

}

giveplayerid = ReturnUser(tmp);

if(IsPlayerConnected(giveplayerid))

{

if(giveplayerid != INVALID_PLAYER_ID)

{

    if(ProxDetectorS(8.0, playerid, giveplayerid))

      {

    if(PlayerInfo[giveplayerid][pPcarkey] == 999)

    {

            tmp = strtok(cmdtext, idx);

            if(!strlen(tmp))

            {

                SCM(playerid, COLOR_WHITE, "HINT: /v sellto [playerid/PartOfName] [price]");

                return 1;

            }

            new price;

            price = strval(tmp);

            if(price < 1 || price > 1500000)

            {

                SCM(playerid, COLOR_GREY, "  Price not lower then 1 and not higher then 1500000. ");

                return 1;

            }

            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

      format(string, sizeof(string), "* You offerd %s to buy your car for $%d .", giveplayer, price);

        SCM(playerid, COLOR_WHITE, string);

        format(string, sizeof(string), "* Car Owner %s offered you to buy his/her car for $%d (type /accept ownablecar) to buy.", playername, price);

        SCM(giveplayerid, COLOR_WHITE, string);

        OwnableCarOffer[giveplayerid] = playerid;

        OwnableCarID[giveplayerid] = ownvehkey;

        OwnableCarPrice[giveplayerid] = price;

        return 1;

        }

        else

        {

            SCM(playerid, COLOR_GREY, "That player already have a car! ");

            return 1;

        }

    }

    else

    {

        SCM(playerid, COLOR_GREY, "  Player is not near you ! ");

        return 1;

    }

}

}

    }

    else

    {

        SCM(playerid, COLOR_GREY, "  This is not your car");

        return 1;

    }

} [/pawn]

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.