SA-MP Forums Archive
Dealership problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dealership problem (/showthread.php?tid=471328)



Dealership problem - Lunixx - 22.10.2013

lets say:
I made 2 Dealerships
Dealership 1 owner - can use /editcardealership
Dealership 2 owner - says "You do not own a car dealership
And the command is:
pawn Код:
CMD:editcardealership(playerid, params[])
{
    for(new d = 0 ; d < MAX_CARDEALERSHIPS; d++)
 {
        if(IsPlayerInRangeOfPoint(playerid, CarDealershipInfo[d][cdRadius], CarDealershipInfo[d][cdEntranceX], CarDealershipInfo[d][cdEntranceY], CarDealershipInfo[d][cdEntranceZ])) {
            if(IsPlayerOwnerOfCDEx(playerid, d))
   {
                SetPVarInt(playerid, "editingcd", d);
                SetPVarInt(playerid, "editingcdveh", -1);
                SetPVarInt(playerid, "editingcdvehpos", 0);
                SetPVarInt(playerid, "editingcdvehnew", 0);
                new listitems[] = "1 New Vehicle\n2 My Vehicles\n3 Upgrade\n4 Till";
                ShowPlayerDialog(playerid,DIALOG_CDEDIT,DIALOG_STYLE_LIST,"Choose an item to continue", listitems,"Select","Cancel");
                return 1;
            }
            else
   {
                SendClientMessageEx(playerid, COLOR_GREY, "You do not own that Car Dealership.");
                return 1;
            }
        }
    }
    SendClientMessageEx(playerid, COLOR_GREY, "ERROR: You must be standing inside the radius of the Car Dealership.");
    return 1;
}



Re: Dealership problem - Threshold - 22.10.2013

Give this a shot:

pawn Код:
CMD:editcardealership(playerid, params[])
{
    for(new d = 0 ; d < MAX_CARDEALERSHIPS; d++)
    {
        if(IsPlayerInRangeOfPoint(playerid, CarDealershipInfo[d][cdRadius], CarDealershipInfo[d][cdEntranceX], CarDealershipInfo[d][cdEntranceY], CarDealershipInfo[d][cdEntranceZ]))
        {
            if(IsPlayerOwnerOfCDEx(playerid, d))
            {
                SetPVarInt(playerid, "editingcd", d);
                SetPVarInt(playerid, "editingcdveh", -1);
                SetPVarInt(playerid, "editingcdvehpos", 0);
                SetPVarInt(playerid, "editingcdvehnew", 0);
                new listitems[] = "1 New Vehicle\n2 My Vehicles\n3 Upgrade\n4 Till";
                ShowPlayerDialog(playerid,DIALOG_CDEDIT,DIALOG_STYLE_LIST,"Choose an item to continue", listitems,"Select","Cancel");
                return 1;
            }
            else return SendClientMessageEx(playerid, COLOR_GREY, "You do not own that Car Dealership.");
        }
    }
    SendClientMessageEx(playerid, COLOR_GREY, "ERROR: You must be standing inside the radius of the Car Dealership.");
    return 1;
}



Re: Dealership problem - Lunixx - 22.10.2013

It doesnt work.