Inputtext (OnDialogResponse) returns something way off - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Inputtext (OnDialogResponse) returns something way off (
/showthread.php?tid=393399)
Inputtext (OnDialogResponse) returns something way off -
SKAzini - 18.11.2012
pawn Код:
case DIALOG_SET_FUELTAX: {
if(response) {
new stringb[80];
Settings[0][FuelTax] = inputtext[0];
format(stringb, sizeof(stringb), "{2F8AB1}** %s %s sat the fuel tax to $%d.", Factions[UserStats[playerid][Faction]][FRank6], GetName(playerid), 60*Settings[0][FuelTax]/2);
SendClientMessageToAll(-1, stringb);
}
}
Now, when I enter "1" in the dialog the output (60*Settings[0][FuelTax]/2) becomes 1500 when it should be 30. How come?
Re: Inputtext (OnDialogResponse) returns something way off -
SKAzini - 18.11.2012
Works now ;], thanks.
pawn Код:
case DIALOG_SET_FUELTAX: {
if(response) {
new stringb[80];
sscanf(inputtext, "d", Settings[0][FuelTax]);
format(stringb, sizeof(stringb), "{2F8AB1}** %s %s sat the fuel tax to $%d.", Factions[UserStats[playerid][Faction]][FRank6], GetName(playerid), 60*Settings[0][FuelTax]/2);
SendClientMessageToAll(-1, stringb);
}
}