[HELP]HouseCar -
[Aka]Dragonu - 30.08.2011
Hello, I made this housecar dialog, everything works just fine except the fact that in game doesn't appear how much the car costs I mean the "Bike(1234$)" in game it only appears "Bike" and the (1234$) doesn't appear. Here is my code:
pawn Код:
if(listitem == 1)
{
if(playermoney >= 20000)
{
if(PlayerInfo[playerid][pLevel] >= 0 && (strcmp(housecar, "Bike(1234$)", true, strlen(housecar)) == 0))
{
SendClientMessage(playerid, COLOR_YELLOW, "You have successfully bought an bike.");
HouseInfo[houseid][hVec] = 509;
GivePlayerMoney(playerid, -1234);
}
}
else
{
SendClientMessage(playerid, COLOR_RED,"You need $1234 dollars in cash to buy an housecar.");
TogglePlayerControllable(playerid, 1);
}
}
Re: [HELP]HouseCar -
TTJJ - 30.08.2011
Hi Dragonu,
Where is the price supposed to appear? In the dialog? If so can I see the code for the dialog box?
Also in relation to the following:
Код:
strcmp(housecar, "Bike(1234$)", true, strlen(housecar)
Where does the variable "housecar" get defined, and what exactly is that supposed to do?
Cheers,
TJ
Re: [HELP]HouseCar -
[Aka]Dragonu - 30.08.2011
Look man I want in this picture instead of Bike to show Bike(1234$) :
Understand ?
Re: [HELP]HouseCar -
TTJJ - 30.08.2011
Hi again Dragonu,
Indeed, I do understand. The only thing I can recommend is that you make sure the option in the list has the text (1234$) in it. If you could show me the code that is used to to display the dialog, eg. the command or whatever it may be. I may be able to help you further with this.
Cheers,
TJ
Re: [HELP]HouseCar -
[Aka]Dragonu - 30.08.2011
Here is my first part of the dialog :
pawn Код:
if(strcmp(cmd, "/housecar", true) == 0 || strcmp(cmd, "/hc", true) == 0)
{
if(PlayerInfo[playerid][pHouseKey] != INVALID_HOUSE_ID && PlayerInfo[playerid][pHouseOwner] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, HOUSECAR_SPAWN[PlayerInfo[playerid][pHouseKey]]))
{
SendClientMessage(playerid, COLOR_RED, "You cannot do this command because your housecar is being used.");
return 1;
}
}
ShowPlayerDialog(playerid, 25, DIALOG_STYLE_LIST, "Vehicle Types :", "Bikes\nConvertibles\nIndustrial\nLowriders\nOff Road\nSallons\nSport Vehicles\nStation Wagons\nUnique Vehicles\nPolice Cars", "Accept", "Cancel");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You cannot do this command because you don't have a house.");
}
return 1;
}
Re: [HELP]HouseCar -
TTJJ - 30.08.2011
Ok, Excellent.
So thats the directory, do you have the vehicle listing dialog for bikes? So the dialog that is displayed when they click the bikes item in that dialog.
Cheers,
TJ
Re: [HELP]HouseCar -
[Aka]Dragonu - 30.08.2011
I solved the problem myself, thanks anyway I will give you 1 rep point.
Re: [HELP]HouseCar -
TTJJ - 30.08.2011
Thanks Dragonu.
Glad you solved the problem.
Cheers,
TJ
Re: [HELP]HouseCar -
[Aka]Dragonu - 30.08.2011
Hey I have a problem now, I get an error that the pawno line is too long how can I transform it into a shorter line or 2 lines ?
Code:
pawn Код:
if(listitem == 5)
{
ShowPlayerDialog(playerid, 6, DIALOG_STYLE_LIST, "Saloons", "Admiral(16000$)\nBloodring Banger(24000$)\nBravura(15300$)\nBuccaneer(16800$)\nCadrona(15300$)\nClover(13700$)\nElegant(17900$)\nElegy(21000$)\nEmperor(18000$)\nEsperantoEsperanto(16700$)\nFortune(14600$)\nGlendale Shit(13800$)\nGlendale(16300$)\nGreenwood(17200$)\nHermes(18340$)\nIntruder(12334$)\nMajestic(15600$)\nManana(13000$)\nMerit(16600$)\nNebula(13800$)\nOceanic(12100$)\nPicador(13200$)\nPremier(18990$)\nPrevion(17650$)\nPrimo(13220$)\nSentinel(20000$)\nStafford(31200$\nSultan(23890$)\nSunrise(17830$)\nTampa(12850$)\nVincent(11530$)\nVirgo(14300$)\nWillard(12000$)\nWashington(17400$)", "Select", "Back"); //Remove carname to a gta car
}
Re: [HELP]HouseCar -
[Aka]Dragonu - 30.08.2011
Any1 can help me please?