get a specif number value.
#1

Hi,

I show player dialog, and i need that player input numbers. Ok i check IsNumeric there, but + i need to check is the 3 first numbers, for ex: player input:

58987412354

And i need to check is this three numbers in start:

589

5 i need that player write here a 7.
8 i need that player write here a 5.
9 i need that player write here a 1.
Reply
#2

Limit the numbers to 3 so player can only input 3 numbers, not more or less.
Then you can easily detect those 3 numbers because inputtext will equal the 3 numbers.

if(strlen(inputtext) > 3 || strlen(inputtext) < 3) return SendClientMessage(playerid, 0xFF0000AA, "You need to input 3 numbers.");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)