Dealership [car ownership] problem.
#1

Alright the problem is. You can have 3 slots of vehicles, but from the dealership you can buy only 2, but here is the problem. If you got already 2 cars and go to delership and use /buycar it changes the slot 2 of vehicle owned with the new one that you used last and so on. I want to set it afer you bought 2 cars already and try using /buycar to say: You cant buy anymore or something like that, the idea is to make the dealership wont let you buy card after you got already 2.
Reply
#2

Can you show us the code?
Reply
#3

CMD:buycar(playerid, params[])
{
new string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsPlayerInRangeOfPoint(playerid, 2, 545.6661,-1292.2437,17.2422)) return SendClientMessage(playerid, COLOR_GREY, "You are not near the vehicles dealership.");
if(PlayerInfo[playerid][pVIP] >= 2)
{
if(PlayerInfo[playerid][vModel] && PlayerInfo[playerid][vVModel] && PlayerInfo[playerid][vBModel])
{
format(string, sizeof(string), "You already own vehicles ID %d and %d.", PlayerInfo[playerid][pVeh], PlayerInfo[playerid][pVVeh]);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
else ShowDialog(playerid, 10);
return 1;
}
if(PlayerInfo[playerid][vModel])
{
format(string, sizeof(string), "You already own vehicle ID %d.", PlayerInfo[playerid][pVeh]);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
ShowDialog(playerid, 10);
return 1;
}
Reply
#4

Up. Please i really need a solution for this. Anyone?
Reply
#5

Please give us the codes with this parametres: "ShowDialog(playerid, 10);". Show your Dialogid 10
Reply
#6

The codes with parameters for ShowDialog(playerid, 10) are the only 2 from the "buycar" command.

}
else if(dialogid == 10) // Dealership main
{
if(response)
{
switch(listitem)
{
case 0: ShowDialog(playerid, 11); // Bikes
case 1: ShowDialog(playerid, 12); // Normal Vehicles
case 2: ShowDialog(playerid, 21); // Lowriders
case 3: ShowDialog(playerid, 13); // Off-Road Vehicles
case 4: ShowDialog(playerid, 14); // Sport Vehicles
}
}
}
else if(dialogid == 11) // Bikes
Reply
#7

SOLVED
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)