Dialog response bug (-1) -
OwlIT - 07.09.2016
Hi, actually i'm using the library easydialogs, i'm using like a lot of dialogs and no one of them has caused me problems. All, except one, this one gives me whatever button i click the response -1, but just in the callback where it's called up because I checked in the OnDialogResponse and it gives to me the right number.
Код:
Dialog:FuelDialog(playerid, dialogid, response, listitem, inputtext[])
{
printf("%d", response);
if(response)
{
new
vehicleid = GetPlayerVehicleID(playerid), Float: X, Float: Y, Float: Z;
GetVehiclePos(vehicleid, X, Y, Z);
RefuelCounter[playerid] = 0;
new
bizid = g_FuelBiz[playerid], str[64] = "Rifornimento\n((---------------))", modelid = GetVehicleModel(vehicleid),
price = (!IsValidVehicle(VehicleInfo[vehicleid][vID])) ? (floatround(((g_VehicleStatsInfo[modelid - 400][vehicleCapacity] - CarInfo[vehicleid][benzina])*10)+1)) : (floatround(((g_VehicleStatsInfo[modelid - 400][vehicleCapacity] - VehicleInfo[vehicleid][vFuel]) *10)+1)),
Float: amount = (IsValidVehicle(VehicleInfo[vehicleid][vID])) ? (floatsub(g_VehicleStatsInfo[GetVehicleModel(vehicleid) - 400][vehicleCapacity], VehicleInfo[vehicleid][vFuel])) : (floatsub(g_VehicleStatsInfo[GetVehicleModel(vehicleid) - 400][vehicleCapacity], CarInfo[vehicleid][benzina]));
if(PlayerInfo[playerid][Soldi] < price) return SendError(playerid,"Non hai abbastanza soldi."), g_FuelBiz[playerid] = -1;
textFuel[playerid] = CreateDynamic3DTextLabel(str, COLOR_GREEN, X, Y, Z, 5.0, INVALID_PLAYER_ID, vehicleid, 1, GetPlayerVirtualWorld(playerid), -1, playerid);
KillTimerEx(g_RefuelTimer[playerid]);
g_RefuelTimer[playerid] = SetTimerEx("RefuelTimer", 1000, true, "dfdfffd", playerid, amount, price, BusinessInfo[bizid][bEnterX], BusinessInfo[bizid][bEnterY], BusinessInfo[bizid][bEnterZ], g_FuelBiz[playerid]);
SendClientMessage(playerid, COLOR_GREEN, "SERVER: Quest'operazione richiede 15 secondi.");
g_FuelBiz[playerid] = -1;
}
return 1;
}
As u can see I put a debug inside of it and.. yeah it gives everytime -1. I checked inside the easydialogs and I didn't find anything wrong.
Re: Dialog response bug (-1) -
PrO.GameR - 07.09.2016
Are you sure it's not listitem, response in the dialog header? because when the dialog is a message box listitem is -1, I feel like either you have them missplaced or somehow easydialogs is bugging and switching those up.
Because response is never -1 (at least to my knowledge)
Re: Dialog response bug (-1) -
OwlIT - 07.09.2016
Yeah I though it too.. it's strange cause the others dialogs works fine...
Re: Dialog response bug (-1) -
OwlIT - 07.09.2016
I've printed listitem and it gives to me this number: 11271820, i've tested however the output from the response and from the listitem in another msgbox dialog and it works normally, only this is bugged.
EDIT: I've tested again and every time on listitem it gives to me random numbers.