SA-MP Forums Archive
Textdraw Arrow question - 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: Textdraw Arrow question (/showthread.php?tid=526133)



Textdraw Arrow question - sammp - 15.07.2014

Hi. I have a textdraw where you can click an arrow to go to a different town. (it's a spawn selection)

How do I do it so the town changes each time you click the arrow? My head is in the stars ATM.

Thanks.


Re: Textdraw Arrow question - Smileys - 15.07.2014

um, I don't quite understand what you mean, could you explain abit more please?


Re: Textdraw Arrow question - sammp - 15.07.2014

Does this help?




Does that help?? So if i keep clicking the right arrow it'll go to a different town each time.


Re: Textdraw Arrow question - sammp - 16.07.2014

help


Re: Textdraw Arrow question - nmader - 16.07.2014

Use:
pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
to make something happen. Use an if statement for if the clickedid is equal to whatever textdraw and if it is than to do something.


Re: Textdraw Arrow question - amirab - 16.07.2014

first make a arrow as a textdraw
second make it selectable
third use SelectTextDraw when it shows
forth in callback OnPlayerClickTextDraw set what you want


SrY FoR My BaD EnGlIsH


Re: Textdraw Arrow question - sammp - 16.07.2014

Yes I know that. Though I am puzzled as to how I would make it like pages.


Re: Textdraw Arrow question - nmader - 16.07.2014

Quote:
Originally Posted by sammp
Посмотреть сообщение
Yes I know that. Though I am puzzled as to how I would make it like pages.
Just use a variable. Like:
pawn Код:
new SpawnSelected[MAX_PLAYERS];
And have it assign a specific value each time you click the arrow. So if they click the right arrow:
pawn Код:
SpawnSelected[playerid]++;
and for the left arrow:
pawn Код:
SpawnSelected[playerid]--;
And then create a function to spawn the player based on a key or command and use:
pawn Код:
switch(SpawnSelected[playerid])
{
    case 0: //Your first selection
    case 1: //Your second selection
    case 2: //Your third selection
}
Be sure you make it to where if SpawnSelected[playerid] is equal to three (or your max value) then if the right arrow is clicked (to make the variable increase) then subtract it by the amount of possible spawns, three for my example.