22.10.2011, 21:16
I am getting this error on the line
the IsNumeric function i use is
pawn Код:
if(IsNumeric(fare))
the IsNumeric function i use is
pawn Код:
stock IsNumeric(const string[])
{
for (new i = 0, j = strlen(string); i < j; i++)
{
if (string[i] > '9' || string[i] < '0') return 0;
}
return 1;
}
pawn Код:
if(AccountGetInt(PName,"Job") == 2)
{
new fare;
fare = strval(inputtext);
if(IsNumeric(fare))
{
new string[50];
if(fare < 0) return ShowPlayerDialog(playerid,8000,DIALOG_STYLE_INPUT,"SET FARE","Fare cannot be lower than $0\n\nSet your fare(0 - 1000):","Set Fare","Cancel");
if(fare < 1000) return ShowPlayerDialog(playerid,8000,DIALOG_STYLE_INPUT,"SET FARE","Fare cannot be higher than $1000\n\nSet your fare(0 - 1000):","Set Fare","Cancel");
if(fare >= 0 && fare <= 1000)
{
AccountSetInt(PName,"DFare",fare);
format(string, sizeof(string), "You have set your fare rate at $%d", fare);
SendClientMessage(playerid, COLOR_TAXI, string);
TogglePlayerControllable(playerid,1);
}
} else return ShowPlayerDialog(playerid,8000,DIALOG_STYLE_INPUT,"SET FARE","Set your fare(0 - 1000):","Set Fare","Cancel");
}