07.09.2016, 10:01
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.
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.
Код:
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; }