if(dialogid == 4){
if(inputtext > DOF2_GetInt(pFile(playerid),"Money")){SendClientMessage(playerid,COLOR_DENIED,"[ERROR] {FF6969}You don't have this ammount of money"); return 1;}
DOF2_SetString(pFile(playerid),"Bank",inputtext); DOF2_SetString(pFile(playerid),"Money",-inputtext);}
return 1;}
if(inputtext > DOF2_GetInt(pFile(playerid),"Money")){SendClientMessage(playerid,COLOR_DENIED,"[ERROR] {FF6969}You don't have this ammount of money"); return 1;}
inputtext is a string.
Use isnumeric(string) to check if it's a number. If it was, use strval(inputtext) > ... instead of inputtext. |
if(IsNumeric(inputtext) > DOF2_GetInt(pFile(playerid),"Money")) return SendClientMessage(playerid,COLOR_DENIED,"[ERROR] {FF6969}You don't have this ammount of money");
stock IsNumeric(string[])
{
for (new i = 0, j = strlen(string); i < j; i++)
{
if (string[i] > '9' || string[i] < '0') return 0;
}
return 1;
}
if(strval(inputtext) > DOF2_GetInt(pFile(playerid),"Money")) return SendClientMessage(playerid,COLOR_DENIED,"[ERROR] {FF6969}You don't have this ammount of money");
if(IsNumeric(inputtext)
{
if(strval(inputtext) > DOF2_GetInt(pFile(playerid),"Money")) return SendClientMessage(playerid,COLOR_DENIED,"[ERROR] {FF6969}You don't have this ammount of money");
}
else
{
SendClientMessage(playerid, YOURCOLOR, MESSAGE THAT HE HAS TO ENTER A NUMBER);
}