CMD:rentvehicle(playerid, params[]) { new vehicleid, string[256], string2[256], id; if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first."); if(PlayerInfo[playerid][pCash] < 30000) return SendClientMessage(playerid, COLOR_WHITE, "Nu ai suma necesara de bani. (30.000$)"); if(IsPlayerInVehicle(playerid, vehicleid)) return SendClientMessage(playerid, COLOR_WHITE, "Nu poti inchiria un vehicul atat timp cat tu te afli intr-o masina."); if(!IsPlayerInRangeOfPoint(playerid, 10.0, -2240.7644,539.0970,35.1488)) return SendClientMessage(playerid, COLOR_WHITE, "Nu te afli in locatia corecta."); strcat(string2, "Vehicle\tIn Stock\n"); format(string, sizeof(string), "%s\t30\n", VehiculeRent(id); strcat(string, string2); ShowPlayerDialog(playerid, DIALOG_RENTCAR, DIALOG_STYLE_TABLIST_HEADERS, "RentCar", string2, "Select", "Cancel"); return 1; }
stock VehiculeRent(id){ new string[256]; switch(id){ case 0: string = "Infernus"; case 1: string = "Sultan"; case 2: string = "Bravura"; case 3: string = "Perenial"; } return string; }
CMD:rentvehicle(playerid, params[]) { new vehicleid, string[256], string2[256], dialog[500], id; if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first."); if(PlayerInfo[playerid][pCash] < 30000) return SendClientMessage(playerid, COLOR_WHITE, "Nu ai suma necesara de bani. (30.000$)"); if(IsPlayerInVehicle(playerid, vehicleid)) return SendClientMessage(playerid, COLOR_WHITE, "Nu poti inchiria un vehicul atat timp cat tu te afli intr-o masina."); if(!IsPlayerInRangeOfPoint(playerid, 10.0, -2240.7644,539.0970,35.1488)) return SendClientMessage(playerid, COLOR_WHITE, "Nu te afli in locatia corecta."); format(string, sizeof(string), "Vehicle\tIn Stock\n\n%s\t30\n", VehiculeRent(id); strcat(string, dialog); ShowPlayerDialog(playerid, DIALOG_RENTCAR, DIALOG_STYLE_TABLIST_HEADERS, "RentCar", string2, "Select", "Cancel"); return 1; }
make it like this-
new dialog[500]; strcat(string2, "Vehicle\tIn Stock\n"); // delete this rmat(string, sizeof(string), "Vehicle\tIn Stock\n\n%s\t30\n", VehiculeRent(id); strcat(string, dialog); ShowPlayerDialog(playerid, DIALOG_RENTCAR, DIALOG_STYLE_TABLIST_HEADERS, "RentCar", dialog, "Select", "Cancel"); Hope it works, rep++ if it will help you. |
CMD:rentvehicle(playerid, params[])
{
new vehicleid, string[256], string2[256], id;
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
if(PlayerInfo[playerid][pCash] < 30000) return SendClientMessage(playerid, COLOR_WHITE, "Nu ai suma necesara de bani. (30.000$)");
if(IsPlayerInVehicle(playerid, vehicleid)) return SendClientMessage(playerid, COLOR_WHITE, "Nu poti inchiria un vehicul atat timp cat tu te afli intr-o masina.");
if(!IsPlayerInRangeOfPoint(playerid, 10.0, -2240.7644,539.0970,35.1488)) return SendClientMessage(playerid, COLOR_WHITE, "Nu te afli in locatia corecta.");
strcat(string2, "Vehicle\tIn Stock\n");
format(string, sizeof(string), "%s\t30\n", VehiculeRent(id);
//strcat(string, string2);
strcat(string2, string);
ShowPlayerDialog(playerid, DIALOG_RENTCAR, DIALOG_STYLE_TABLIST_HEADERS, "RentCar", string2, "Select", "Cancel");
return 1;
}
new arrVehiculeRent[] =
{
{"Infernus", 411},
{"Sultan", 560},
{"Bravura", x}, //replace x with its vehicle id
{"Perenial", y} //replace y with vehicle id
};
CMD:rentvehicle(playerid, params[])
{
new vehicleid, string[256], string2[256], id;
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
if(PlayerInfo[playerid][pCash] < 30000) return SendClientMessage(playerid, COLOR_WHITE, "Nu ai suma necesara de bani. (30.000$)");
if(IsPlayerInVehicle(playerid, vehicleid)) return SendClientMessage(playerid, COLOR_WHITE, "Nu poti inchiria un vehicul atat timp cat tu te afli intr-o masina.");
if(!IsPlayerInRangeOfPoint(playerid, 10.0, -2240.7644,539.0970,35.1488)) return SendClientMessage(playerid, COLOR_WHITE, "Nu te afli in locatia corecta.");
strcat(string2, "Vehicle\tIn Stock\n");
for(new i = 0; i < sizeof arrVehiculeRent; i++)
{
format(string, sizeof(string), "%s\t30\n", VehiculeRent[i][0];
strcat(string2, string);
}
ShowPlayerDialog(playerid, DIALOG_RENTCAR, DIALOG_STYLE_TABLIST_HEADERS, "RentCar", string2, "Select", "Cancel");
return 1;
}
if(dialogid == DIALOG_RENTCAR)
{
if(response)
{
//You can spawn a new vehicle here by simply getting the listitem such as
//CreateVehicle(VehiculeRent[listitem][1], ......);
}
}
new dialog[1000], str[128];
format(str,128,"Vehicle\t In Stick\n");
strcat(dialog,str);
format(str,128,"%s\t 30\n",VehicleRent(id));
strcat(dialog,str);
ShowPlayerDialog(playerid,DIALOG_RENTCAR,DIALOG_STYLE_TABLIST_HEADERS,"RentCar",dialog,"Select","Cancel");