Jump to content
  • 0

pomoc Iba cisla


E1r2i3k4

Dotaz

Čaute. Robím vip systém a mám tam dialog input aby do neho hráč napísal na koľko cní chce mať vip, ale neviem podmienku aby hráč nemohol napísať žiadné písmená iba čísla. Pomôžete mi ? Dík za každú odpoveď :)

Link to comment
Share on other sites

2 odpovědí na tuto otázku

Recommended Posts

  • 0

Stock

stock IsNumeric(const string[])
{
new length=strlen(string);
if (length==0) return false;
for (new i = 0; i < length; i++)
{
if ((string[i] > '9' || string[i] < '0' && string[i]!='-' && string[i]!='+')|| (string[i]=='-' && i!=0)|| (string[i]=='+' && i!=0)) return false;
}
if (length==1 && (string[0]=='-' || string[0]=='+')) return false;
return true;
}

Podmienka:

if(!IsNumeric(inputtext)) return SendClientMessage(playerid,-1,"Nezadal cislo..");
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...