Select age with textdraws? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Select age with textdraws? (
/showthread.php?tid=544091)
Select age with textdraws? -
Inuro - 31.10.2014
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.
Re: Select age with textdraws? -
Threshold - 31.10.2014
At the top of your script:
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.
Re : Select age with textdraws? -
Inuro - 31.10.2014
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?
Re: Re : Select age with textdraws? -
DanishHaq - 31.10.2014
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.
Re: Select age with textdraws? -
Beckett - 31.10.2014
Threshold already explained it for you.
All you need is define.
Re : Select age with textdraws? -
Inuro - 31.10.2014
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?