28.09.2011, 22:49
With what?
Here's the code of the command:
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)
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...
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;
}
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;
}
Thanks guys for your help...


