04.05.2018, 17:34
You're passing the i variable to the VehiculeRent function but i isn't defined anywhere.
I assume you want to pass i from a loop.
I split up the format because you don't want to add Vehicle\tIn Stock every second line, you only want it at the top.
Also, you add everything to the dialog string but you don't pass it to the dialog, so nothing will show up.
Also, you didn't even add anything to string2 and you're passing it but it's empty, so nothing will show up again.
You don't need string2[256] and dialog[500] as you don't use them. And the line with strcat isn't used as well.
And somewhere, outside of the functions, define how many is the max.
I assume you want to pass i from a loop.
PHP код:
format(string, sizeof(string), "Vehicle\tIn Stock\n");
for(new i=0;i<MAX_RENTABLE_CARS;i++)
{
format(string, sizeof(string), "%s\t30\n", VehiculeRent(i));
}
Also, you add everything to the dialog string but you don't pass it to the dialog, so nothing will show up.
Also, you didn't even add anything to string2 and you're passing it but it's empty, so nothing will show up again.
PHP код:
ShowPlayerDialog(playerid, DIALOG_RENTCAR, DIALOG_STYLE_TABLIST_HEADERS, "RentCar", string, "Select", "Cancel");
And somewhere, outside of the functions, define how many is the max.
PHP код:
#define MAX_RENTABLE_CARS 4