ShowPlayerDialog problem -
rt-2 - 28.09.2011
Hi,
I'll do it the short way,
I've been developing today a system of car selling with dialogs, i have two errors(not at compiling but at testing) where dialogs just dont show up...
here's the code that I copy pasted and gives me the 2 errors
Quote:
format(message,sizeof(message),"Are you sure you want to buy this car for %i $?",Vehicle[GetPlayerVehicleID(playerid)][ForSell]);
ShowPlayerDialog(playerid,2053,DIALOG_STYLE_MSGBOX ,"Vehicle Dealership",message,"Yes","Back");
|
Dialog ID is correct, and the code before and after this part is repeated often in the code and works...
I've try to find the problem but with no solution....
Thanks...
Re: ShowPlayerDialog problem -
Cypress - 28.09.2011
Show us the errors you get.
Re: ShowPlayerDialog problem -
Jack_Leslie - 28.09.2011
I've had this problem, sometimes it's the string, so try changing the "message" from a string to just "Test" and see if it works, so have:
pawn Код:
ShowPlayerDialog(playerid,2053,DIALOG_STYLE_MSGBOX ,"Vehicle Dealership","Test","Yes","Back");
If that works, then it's your string.
Re: ShowPlayerDialog problem -
Dragony92 - 28.09.2011
Show us your dialog, and check is there any dialog with same id...
Re: ShowPlayerDialog problem -
[MWR]Blood - 28.09.2011
Make sure you have put a destination size for your string.
It might be the enum too.
Re: ShowPlayerDialog problem -
Tigerkiller - 28.09.2011
vehicle stats
you must get the vid first before checkiing
new vID = GetPlayerVehicleID(playerid);
and Vehicle[vID][...]
Re: ShowPlayerDialog problem -
[MWR]Blood - 28.09.2011
Quote:
Originally Posted by Tigerkiller
vehicle stats
you must get the vid first before checkiing
new vID = GetPlayerVehicleID(playerid);
and Vehicle[vID][...]
|
No.
pawn Код:
Vehicle[GetPlayerVehicleID(playerid)][ForSell]
does exactly the same.
Re: ShowPlayerDialog problem -
Dragony92 - 28.09.2011
Quote:
Originally Posted by Tigerkiller
vehicle stats
you must get the vid first before checkiing
new vID = GetPlayerVehicleID(playerid);
and Vehicle[vID][...]
|
What are the differences? LoL
Re: ShowPlayerDialog problem -
Tigerkiller - 28.09.2011
i had the problem too but i solved it with this
Re: ShowPlayerDialog problem -
rt-2 - 28.09.2011
Quote:
Originally Posted by Tigerkiller
i had the problem too but i solved it with this
|
With what?
Here's the code of the command:
Код:
if(strcmp(cmd, "/sellcar", true) == 0) {
GetField(2,playerid,"owner");
if(strcmp(result[playerid],pname,true) == 0)
{
if(IsInBusiness(1,playerid))
{
if(strcmp(Business[playerid][bowner],pname, true) == 0)
{
ShowPlayerDialog(playerid,2041,DIALOG_STYLE_INPUT,"Vehicle Ownership","To sell this vehicle,\nplease enter the amount of money you want to sell it for.","Ok","Cancel");
return 1;
}
}
ShowPlayerDialog(playerid,2099,DIALOG_STYLE_MSGBOX,"Vehicle Ownership","To sell a vehicle,\nyou need to be in a vehicle dealership that you own.","Ok","");
}
else
{
ShowPlayerDialog(playerid,2099,DIALOG_STYLE_MSGBOX,"Vehicle Ownership","This is not your vehicle.","Ok","");
}
return 1;
}
This part works perfectly, and the function GetField is mine and return the result in the variable "result" (works fine in all the rest of my script)
So when i use this script i do have the page asking me for the amount
here's the code with dialog id 2041, (dialog id 2099 does not exist and it's ok)
Код:
//car dealership
if(dialogid == 2041)//receive money amount
{
if(!response)//if cancel, cancel
{
return 1;
}
if(strval(inputtext)<1000 || strval(inputtext)>10000000)
{
//not valid number
ShowPlayerDialog(playerid,2041,DIALOG_STYLE_INPUT,"Vehicle Ownership","To sell this vehicle,\nplease enter a valid amount of money(1000-10000000)","Ok","Cancel");
}
//give confirm
format(message,sizeof(message),"Vehicle informations.\n\n\tLicense plate: %i\n\tModel: %s\n\tPrice: %i\n\nAre you sure you want to sell this vehicle?",GetPlayerVehicleID(playerid)+1000,VehiclesName[GetVehicleModel(GetPlayerVehicleID(playerid))+400],strval(inputtext));
ShowPlayerDialog(playerid,2042,DIALOG_STYLE_MSGBOX,"Vehicle Dealership",message,"Yes","Back");
return 1;
}
And finally i want to say that if i enter a bad number, the dialog saying to put it again works, but when i enter a valid number, it just do nothing
Thanks guys for your help...