PDA

View Full Version : Dealership problem


Lunixx
22/10/2013, 02:28 PM
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:
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_STY LE_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;
}

Threshold
22/10/2013, 02:55 PM
Give this a shot:

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_STY LE_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;
}

Lunixx
22/10/2013, 06:05 PM
It doesnt work.