Select age with textdraws?
#1

Good evening anglophone community.
Sorry for my English I am French, I would like to select the age of my character by clicking on the arrows.

Insights:



< : Descends age
> : Age is increased

And when I click "ok", how to retrieve the age wanted by the player?

I would like your help please, thank you.
Reply
#2

At the top of your script:
pawn Код:
new age[MAX_PLAYERS];
When they click the right arrow:
pawn Код:
if(age[playerid] < MAX_AGE) age[playerid]++;
When they click the left arrow:
pawn Код:
if(age[playerid] > 1) age[playerid]--;
When they click 'ok', their age is stored in the 'age[playerid]' variable.
Reply
#3

Okay, I'll try tomorrow and I answer, for me it is 2:43 in the morning.
Thank you!

EDIT: But how to put a minimum age and a maximum age?
Reply
#4

Quote:
Originally Posted by Inuro
Посмотреть сообщение
Okay, I'll try tomorrow and I answer, for me it is 2:43 in the morning.
Thank you!

EDIT: But how to put a minimum age and a maximum age?
Use the #define like you would do with colours or other stuff at the top of your script.

pawn Код:
#define objective value
Reply
#5

Threshold already explained it for you.

All you need is define.

pawn Код:
#define MAX_AGE value
Reply
#6

I therefore need

pawn Код:
#define age 18 // min age, or MIN_AGE 18 ?
#define MAX_AGE 90 // max age
But how is it that the middle number will change when the player will click on the arrows?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)